Message ID | 20240221054253.3848076-4-oliver.upton@linux.dev |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-74101-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp850246dyc; Tue, 20 Feb 2024 21:46:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVSp8B95W7/7n4KB/D2wPLWLx8vAqVc1A/PMXBznyO2vWW8+6e0b47IalNayyldIKJgJrezwkYS9dnO8b1/HQYOolo5lQ== X-Google-Smtp-Source: AGHT+IFy865+gQf0LuVlVlH/OwZsPGaY8lgcKAYpmkMA9PD+wTMOjFHrBeuQu+8lliTOr9+MmLUB X-Received: by 2002:a05:6358:5719:b0:17b:56f6:ab32 with SMTP id a25-20020a056358571900b0017b56f6ab32mr1888140rwf.4.1708494403648; Tue, 20 Feb 2024 21:46:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708494403; cv=pass; d=google.com; s=arc-20160816; b=NXrdrc/yVNdmiHR5TlbIn+z3Nk1jf+feNvrRUxE1F6Z2MTkKuqXCIeSnDPkdFwYJDH hropihzQRpsURRbYy3EdCVCO4stasr+k9FNRQ7jTvtV3WspU83VIpcyGvUFdBpjt103Y K5ejM8JzgrfsD8Qnt+d1XsaZUufl9BzA8FMjUIEdXnkKLq8JvP9Xi0JscA3W4BW6Ta6Z GXihs5p4VXb5MiMa15nkuQ0friXCUSW6VdiTUMmLek2kOhsr33i2r12xL3O9P0DHcwzg Y+ah3w4oHN1pmERm77+bfzPg0o0/nHs0puRiMkV0eP+zr0GzGxHiWfpiWC3C8YORePQR NYKg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=p7/gBwWxFbIZwFC+F2czZFaZoLMKZvcePyaMRonjua4=; fh=kCIhDCwfhVa+1moYcBlLNuY7yX/BfELZCoRk1wSf3jY=; b=p31mSahdbp62qPyb2LWcp64M7c1SxXVwj45HsdbeTL7ffPcut3H48ri9tkLvcbYhjL Cae/8PxFT9dtVlFWNbbZ3RzwzckcJgOg3b/wK2J3CXBsIHAQQyRWTnFaTLjP1hOj00MC xL0ZZoQsJcUorq1KgYsu9eoQafuVXko0+hJARLgwQ/451hIZSORaOW14CLaF5DfTbMj+ FCEc3Ykk5tE8CiOcrT+6FGAv9TldlwuaE0WZxr4prfEKb/5BZnh9/jKwHpnJGwDuTQ5A pnoqthfdXf36N63yb/WTDzj7gvc59eC11cpl/RCUQQHhw1aO3oFnOIjXXautc01V2JEX ZmAA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=GL2D5v0S; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-74101-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74101-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id fj36-20020a056a003a2400b006d3c35096dcsi7486996pfb.320.2024.02.20.21.46.43 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 21:46:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-74101-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=GL2D5v0S; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-74101-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74101-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 7D8FFB24220 for <ouuuleilei@gmail.com>; Wed, 21 Feb 2024 05:45:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C33C43C068; Wed, 21 Feb 2024 05:43:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="GL2D5v0S" Received: from out-182.mta0.migadu.com (out-182.mta0.migadu.com [91.218.175.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2882E3B193 for <linux-kernel@vger.kernel.org>; Wed, 21 Feb 2024 05:43:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708494208; cv=none; b=EOXS9Ctp/1boTXuUXevKyKHaCiJGS/XEVqz7gRAyAxTCopRvYeijz/ZIqXJc56S2GRFxFq1E1RTjRiXaLhAT5rGPOD828BQkowkzWHDYtaWrH+FsKHVxVozM43ftjx3Ey95zizCKXzQI1Hncau6Lb831HTdd497awuvMKRL5NfI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708494208; c=relaxed/simple; bh=RxF9w33LgnXLTuXV5O9RLdzK9dXUqE5MSbsOmdxxwVA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LCtyuJ9AtPEq0qAr2LfMpcymzPEBhIb8DTh11NsRtvGBErFjvtc0LLrOwikdEdJEcr5pYOZIH8AIMDWh/87g2K6hL3Lsl+fwo02TWh7PlL6UI0ozWHMTF8ZeJY9SvJTICvfDey8912UdZLwLlukhiFhkK2SYw5U2sWV2iTNBVPE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=GL2D5v0S; arc=none smtp.client-ip=91.218.175.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1708494204; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=p7/gBwWxFbIZwFC+F2czZFaZoLMKZvcePyaMRonjua4=; b=GL2D5v0SC8vLCvny+w0lysq1H7+eVYaJPjgBXHDAX31SpwfBHeusS509F4eACvmVOuX2oW YZQOwMa3/zFkcg+V/vPyOoDP+9UuhCmyIp2XJVxwtXOjQ3Cs4Ip3o/VYERU1asvwz4SbZF cnqOWEIcewTFCBKCM25xdIFUmrmg9AE= From: Oliver Upton <oliver.upton@linux.dev> To: kvmarm@lists.linux.dev Cc: kvm@vger.kernel.org, Marc Zyngier <maz@kernel.org>, James Morse <james.morse@arm.com>, Suzuki K Poulose <suzuki.poulose@arm.com>, Zenghui Yu <yuzenghui@huawei.com>, linux-kernel@vger.kernel.org, Eric Auger <eric.auger@redhat.com>, Oliver Upton <oliver.upton@linux.dev> Subject: [PATCH v4 03/10] KVM: arm64: vgic-v3: Iterate the xarray to find pending LPIs Date: Wed, 21 Feb 2024 05:42:46 +0000 Message-ID: <20240221054253.3848076-4-oliver.upton@linux.dev> In-Reply-To: <20240221054253.3848076-1-oliver.upton@linux.dev> References: <20240221054253.3848076-1-oliver.upton@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791486228254562381 X-GMAIL-MSGID: 1791486228254562381 |
Series |
KVM: arm64: Avoid serializing LPI get() / put()
|
|
Commit Message
Oliver Upton
Feb. 21, 2024, 5:42 a.m. UTC
Start walking the LPI xarray to find pending LPIs in preparation for
the removal of the LPI linked-list. Note that the 'basic' iterator
is chosen here as each iteration needs to drop the xarray read lock
(RCU) as reads/writes to guest memory can potentially block.
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
---
arch/arm64/kvm/vgic/vgic-v3.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/kvm/vgic/vgic-v3.c b/arch/arm64/kvm/vgic/vgic-v3.c index 9465d3706ab9..4ea3340786b9 100644 --- a/arch/arm64/kvm/vgic/vgic-v3.c +++ b/arch/arm64/kvm/vgic/vgic-v3.c @@ -380,6 +380,7 @@ int vgic_v3_save_pending_tables(struct kvm *kvm) struct vgic_irq *irq; gpa_t last_ptr = ~(gpa_t)0; bool vlpi_avail = false; + unsigned long index; int ret = 0; u8 val; @@ -396,7 +397,7 @@ int vgic_v3_save_pending_tables(struct kvm *kvm) vlpi_avail = true; } - list_for_each_entry(irq, &dist->lpi_list_head, lpi_list) { + xa_for_each(&dist->lpi_xa, index, irq) { int byte_offset, bit_nr; struct kvm_vcpu *vcpu; gpa_t pendbase, ptr;