Message ID | 20240216184153.2714504-8-oliver.upton@linux.dev |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-69188-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp713634dyb; Fri, 16 Feb 2024 10:45:13 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVb+4bBasO0jzzNQGbLYvPIi8CHY0A4oAlpKighnTl0t3zBXi9fwKPJU4akZHx/QIC43CR38bsSDYLb+QeCzr+/mr6OTA== X-Google-Smtp-Source: AGHT+IHNZA8YOEu8G/ILV/tUzxIwslvnofkHOeOWsbnvufrFaDkVJmZm5ESW7PrjS5rNQCYfv2cD X-Received: by 2002:a05:6a00:2283:b0:6de:5e6:8ade with SMTP id f3-20020a056a00228300b006de05e68ademr7524042pfe.24.1708109113791; Fri, 16 Feb 2024 10:45:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708109113; cv=pass; d=google.com; s=arc-20160816; b=hNzxNB9qI83X1mg/XMFtrhoomWVrfm+l4sd9LdFHmhSmH0fq1PmMm3+a028q8veb0V 1HZxPt32EvdXko61S/cGk0U+6JjWbLsMiPPBr8ts2Oe+6d32lxcjgSkv7Hku0/3WTcyy vPlpzsr3j8SDezo7duUupuHB6a/coQgsACK6vgdQL8nKpSeruuycWqQAAPQDe7YnpuZn V69OzChZuyShG3JVk1LGukPn0FykYKcu1GHrn79qH+Xe185rcpHh7xNjOtgUxHUFYdMS xYF+M5zslDVcR+GOtHpIN+/O6ZnphToD8Kp+v4kD4NsDpnr3zIE/pJNtao1WB40aGuos PuyA== 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=z9GN6WeBnSe+DXw8hn3rK0c8U+qc433lF4ad1LOLZiY=; fh=OGIcGdyoke6ohfCedcQQ3UJr3JDRxZcQDHVG7x10Yg0=; b=U8fHfFM2JmcYuqFMgTOadjtVaTytZhGs0VRr9lDue85nR+efc3nZfWpIy3xgqr1jK6 9Y7bFg/FVMdcLb4gGSeww9rDgRUwJDUhIWqME2yH3gAZOgEN2pMFzrDi0PUouzzrMNyR L7b37Ql6Xs9SVlJ2aj+LEuEZY/Lb/JytqT06BiDuPEt1KBugaw/zE+o1KNF6gUHD+u+i rfC6LtEcp+P/C+laocgPeRT+zM5AfBYchmVNdgLmY3aPYKtNIELIxOi1wTPS+o9t2yfZ ynvYYllIb/I1MHnC//Q1YJGIDZXVIT48Tt45fcMZcYTVQe/MrfVqVPlQNaxWUKQr/Kh+ HFjA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=B8h55U4v; 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-69188-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69188-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id ll9-20020a056a00728900b006de1e26adb5si291908pfb.275.2024.02.16.10.45.13 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 10:45:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-69188-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=B8h55U4v; 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-69188-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69188-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 17C4B282CD4 for <ouuuleilei@gmail.com>; Fri, 16 Feb 2024 18:44:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 357D51474DB; Fri, 16 Feb 2024 18:42:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="B8h55U4v" Received: from out-185.mta0.migadu.com (out-185.mta0.migadu.com [91.218.175.185]) (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 C9428146015 for <linux-kernel@vger.kernel.org>; Fri, 16 Feb 2024 18:42:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.185 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708108942; cv=none; b=uVRkIAMez9VJKV0qIcqsQRTnoQmkHSdIzn45pVDakPy7+3gsBftWcs2/nAUnIFjJzP/48CvUffDNK2WoOtm3tDuAOnzEgWpBX+rszpmH51lAayIR8MLRDU0ea9EY22pa/o2ZthJleh4rY4ZgPe/7JU48wB7EbR8j1x8HvnIfii0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708108942; c=relaxed/simple; bh=vtekqhGgtjmqisr8NulSQvgtjNS1TOilwFJMKeBnMg4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=j0y10LBZNc4Zyz2hhFJzJiB3nfzz/HX7IbRYI3+RC2DUfvjIyEtYu5MrZRxpqzpbjl9vZcFvE3LZyBvdifl60l83Z+vDDlnl5phPfe52EtzvEJArUOzhsBzApJxp60ni1FINx9W/AYIumyOmn+PUgQd5vuDmiKpqmd9SEAMtxlU= 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=B8h55U4v; arc=none smtp.client-ip=91.218.175.185 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=1708108939; 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=z9GN6WeBnSe+DXw8hn3rK0c8U+qc433lF4ad1LOLZiY=; b=B8h55U4vyFlSMWnLw3WokyuHHqf8SDrZYLk+F5/4/VmqI7gxyrbjsPcP5qiY84KN4ccDQL F+qnE61n5c9PbbeXv8H0A5xjvpRrfV9ItrPXnR+conGlKE00t8cEPfgeS7GGbp9ME7If5Q 8kpOuHuA8ql4HXQg4tlW5W9asI4smsE= 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 v3 07/10] KVM: arm64: vgic: Free LPI vgic_irq structs in an RCU-safe manner Date: Fri, 16 Feb 2024 18:41:50 +0000 Message-ID: <20240216184153.2714504-8-oliver.upton@linux.dev> In-Reply-To: <20240216184153.2714504-1-oliver.upton@linux.dev> References: <20240216184153.2714504-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: 1791082221786093855 X-GMAIL-MSGID: 1791082221786093855 |
Series |
KVM: arm64: Avoid serializing LPI get() / put()
|
|
Commit Message
Oliver Upton
Feb. 16, 2024, 6:41 p.m. UTC
Free the vgic_irq structs in an RCU-safe manner to allow reads of the
LPI configuration data to happen in parallel with the release of LPIs.
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
---
arch/arm64/kvm/vgic/vgic.c | 2 +-
include/kvm/arm_vgic.h | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/kvm/vgic/vgic.c b/arch/arm64/kvm/vgic/vgic.c index 5988d162b765..be3ed4c5e1fa 100644 --- a/arch/arm64/kvm/vgic/vgic.c +++ b/arch/arm64/kvm/vgic/vgic.c @@ -124,7 +124,7 @@ void __vgic_put_lpi_locked(struct kvm *kvm, struct vgic_irq *irq) xa_erase(&dist->lpi_xa, irq->intid); atomic_dec(&dist->lpi_count); - kfree(irq); + kfree_rcu(irq, rcu); } void vgic_put_irq(struct kvm *kvm, struct vgic_irq *irq) diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h index 71e9d719533b..47035946648e 100644 --- a/include/kvm/arm_vgic.h +++ b/include/kvm/arm_vgic.h @@ -117,6 +117,7 @@ struct irq_ops { struct vgic_irq { raw_spinlock_t irq_lock; /* Protects the content of the struct */ + struct rcu_head rcu; struct list_head ap_list; struct kvm_vcpu *vcpu; /* SGIs and PPIs: The VCPU