Message ID | 20240213093250.3960069-5-oliver.upton@linux.dev |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-63209-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp423903dyb; Tue, 13 Feb 2024 01:35:17 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV++upSMmuSmwa9E/EQROQobNx2IfXHICFsTpQVhoGlycWdENOjEsIhOX+/5scMnWxB/MWwm8KdObyoCG6Eade4yL6uqA== X-Google-Smtp-Source: AGHT+IFG8OJL33i3CZMyYil9iEuJ/DpFnAgnacmgwsNvEonSfmYfC6TsMAQlYeVuUmZAcn9Lotpp X-Received: by 2002:a17:906:7fd7:b0:a38:916e:a4fb with SMTP id r23-20020a1709067fd700b00a38916ea4fbmr7390648ejs.69.1707816917592; Tue, 13 Feb 2024 01:35:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707816917; cv=pass; d=google.com; s=arc-20160816; b=Ks7+3skO22y0E9t7ovnZosGOGugCDPjg8B8TQlNZfgH7j5xvQsquSnoFYj1TV2F8il xQFUC6courgu57QCYRfz6AnpMjUJvUpC2JqVwk46DGBxi2Z/ttffHuNXmEsCCEFiv9Ok 7tzw6Sg+TrhbQEWAaqAUrHSPElbH8rYw+mHsmZE7JS/LAlqVzlruOIERDcYUFR/M8d+Z dxLFXTvOKL/KrCDJNvu+yydU0VOyTzjAkgslCw/xOG68vMRXyx1n6EuwJSS8W0u8eOCA Ue3RR5DHhta63t5dKgB+0XO7tlVteSZrSp2PbIShzusnyyOWAFUqPfZicaSqP1a6M8qW a+qQ== 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=vHotxBfo61Yf7VQTBp6voheJpujlHBDNO8X85Tkwjh0=; fh=wFACL8wzc6lWd12BgWZoLxWpvtllGvFLJCbEcf8Etq4=; b=sXGp8IrKADQDbn48WNegBwoeV0n3fH2BnFrEbSZiPzq0bwXC5vQt81Ry5JSBuxKLID 30yVCZQNsh3XvZ9TJN7pgxgcnbzP/kSPQbpLT3zXh+Y41B3Nuf3qEmNWYYqmgOXfcGGP jR1ZTv3NG/0A3CHPZGRiwdoUqKJgm+G2RUUXwyj8H9t0f5yTONt2gCtJsKBMIgs3Gx6S VHi8s5VrOD2iuYIwAB97dwWSfD/zFFuEpNScg1y0iSKAzPO8JOupXzTwBTBKnFV1aSHX WB0vgk6sD1+ipKDVXjzZ2ouc9zSla0oAu8Uzc+F3zGNSfIQ3Ei/ogpU3uYkenmDhhoLl +ONA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Ycl6rikb; 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-63209-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63209-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev X-Forwarded-Encrypted: i=2; AJvYcCUexo03VdrCiVJnCO52IzVHf2NgWMh94A0v4cLvALn/ofcvTn66pZuwBaddv/HPDfdSmzhXfufGLZhmcBbYLRcXeGk6hQ== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id g25-20020a170906199900b00a3c476d7d61si1023808ejd.528.2024.02.13.01.35.17 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 01:35:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63209-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Ycl6rikb; 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-63209-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63209-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 360901F254CB for <ouuuleilei@gmail.com>; Tue, 13 Feb 2024 09:35:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B22A9364B3; Tue, 13 Feb 2024 09:33:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Ycl6rikb" Received: from out-174.mta1.migadu.com (out-174.mta1.migadu.com [95.215.58.174]) (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 9841123774 for <linux-kernel@vger.kernel.org>; Tue, 13 Feb 2024 09:33:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707816803; cv=none; b=clduAflXqjQFB7ljz0PKZxONJZYRkds6xdMNsUsFnMPfsK98aHxCbXbdMoV2gTBRs5jUYmX18n2nbdUkHInfjr6U2bpT7pktdtcubTEeHCKkTji4C4o84gM8S87ldY9Bj5+u+iPsnEDtYni2PJ5/wT07tLNh9+RiMjcqavs8qtI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707816803; c=relaxed/simple; bh=42EjqTJnQjPHCRZ1CTq/hh9Jo/BrHMISVzmWYzrxSIE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dUI4K+v8ZyLXLoshpiJoRTiKhp9lth6+Isu5ISxRcG5i7PfOwXSx1hJYLmlPurOBiZdjbdv6aQ54iYxNrRqHwS123Tn8nwV1tu7QhlXuGBNOx35DFtVtgY0yxFkvvc6gHvE8ef/4WPuUMy/Pp+tPQGYXcU0ybi5pfPIIRt7JBrw= 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=Ycl6rikb; arc=none smtp.client-ip=95.215.58.174 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=1707816800; 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=vHotxBfo61Yf7VQTBp6voheJpujlHBDNO8X85Tkwjh0=; b=Ycl6rikbVAanKCNVreZMOwzDdQAIGD1dS+LPBIe7vQ1Sq5OcJDWhFjgF6M0OGCEBYC8Y7K ur7EsSz3WhyVCtrbPd2w9FWmNVdhshL4P9hcDsTwqyO5b4Che0EBVeFD9PRcxND2ZPnec+ cRTQI5/mj2t502UjVNydFjb1qWzhh50= 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, Oliver Upton <oliver.upton@linux.dev> Subject: [PATCH v2 04/23] KVM: arm64: vgic-v3: Iterate the xarray to find pending LPIs Date: Tue, 13 Feb 2024 09:32:41 +0000 Message-ID: <20240213093250.3960069-5-oliver.upton@linux.dev> In-Reply-To: <20240213093250.3960069-1-oliver.upton@linux.dev> References: <20240213093250.3960069-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: 1790775832134204168 X-GMAIL-MSGID: 1790775832134204168 |
Series |
KVM: arm64: Improvements to LPI injection
|
|
Commit Message
Oliver Upton
Feb. 13, 2024, 9:32 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;