Message ID | 20240213093250.3960069-9-oliver.upton@linux.dev |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-63213-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp424462dyb; Tue, 13 Feb 2024 01:36:45 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWUWiW3x3CI8mlpjZwL694RxAOnv5g43KySdq9FKXuTj6oTwVeiGoIB8RCHt281X7RbxVJ0AnJnzGVoWpPuL/jnWLS+bg== X-Google-Smtp-Source: AGHT+IF/zEkTKznxSG0R3YU1oCgvI9SNUt9STNqWv2Q/KEXC6n6qM/fbu0mAbbp2pivEpzeoaILj X-Received: by 2002:a17:906:5798:b0:a3d:1fc:c5f7 with SMTP id k24-20020a170906579800b00a3d01fcc5f7mr687167ejq.52.1707817005672; Tue, 13 Feb 2024 01:36:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707817005; cv=pass; d=google.com; s=arc-20160816; b=znLRWJOPzLjgEihautYA9IQy6iMVA9Hnf3MkZ+GEL9QDNR0d2LQg9+zpjzQfzBCJh6 YK2slpw4Kn4gdfhttuw6GzM5Dna7aVAJ2EXk01LTZRfI3m7qXd3/yHKsRdffssYmyY7/ 5aq/aNuy6OPUWnG4MQl7TKqHfS3kXgkZnYBn/a2koKKBzkuBd/5Qmln6wCasaFmC/TeM Kq9SpQxAAu8ejF88z18XahAQQEjKZCfeR41F2UEfBpgvpzTUeRPKdDOpswzZxFZv+MhB xfd9K7lIjXNFRrE2SkmNc1+MngT1aZr6eTFRf9jKqmKZTSflAuMLaW1mBupyGgb/uXY7 tvnA== 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=TtUC9LwCBXa/InKHa3MSglqgjCcySjFJ8GApzq67bXk=; fh=bxDVlu76AACwTGl/BZc5HrEL3eHjK/J0aSXRc/93tWs=; b=XRYUVDIflleAnXB3J8eQ+lAApdtbbVCU6ht1Tlu+t91m6kK8rvilT7YTuP0Y4S0XWu e9Q989iRqKlG8XbvICgUVk+3cZ+w4F0dlK42eTZ6CiOxeWGOXPXoG0x7vL/UE4skiLUQ ZE91m0rqp/Pug3BHApFy8tc0WxqzIjdWKS8IVKHWVKJF76bbr19En2KOHWZwSrav7iXF yPgZhB+XgjNuGuKKFfH5zQS8InQtU8u7FFk4/WnDRdzSmixmcx3wTK87XBpajonJqRX7 5JnJ1K5PxM50gVwfNxjJYYxwAnB4gSvoA4NCGpx0OJgt6bcH1YGFwTyhRliOJoLzjGhA Mv0w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=JxeGbdEa; 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-63213-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63213-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev X-Forwarded-Encrypted: i=2; AJvYcCUzo0/G9So4EyIt87vxOYdBXfuIcKgLbWIeLdzZWrkiB460/SNf7W9mDwEY0iAK0TJuU4+9b5ciNHmKz76K98XG1PUJTw== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id o11-20020a1709062e8b00b00a3c2bfc9086si1025493eji.624.2024.02.13.01.36.45 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 01:36:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63213-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=JxeGbdEa; 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-63213-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63213-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 478CB1F2177C for <ouuuleilei@gmail.com>; Tue, 13 Feb 2024 09:36:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1710F43154; Tue, 13 Feb 2024 09:33:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="JxeGbdEa" Received: from out-189.mta1.migadu.com (out-189.mta1.migadu.com [95.215.58.189]) (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 A6C1737715 for <linux-kernel@vger.kernel.org>; Tue, 13 Feb 2024 09:33:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.189 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707816810; cv=none; b=CVXiAfzSM3tX2AOElAR8Z5fO4u2RDx0NwroRswkgkd/b4CCkRNzCqHCpDmwgnBfwJyfSVzxvMY0NmBSDNB4cSCQvFdZXEv+lGMB0l2PzYjsAoNlNmJQCPTOPIkTbH8PcUacTJx/9GyCse4CGrOOov9wEUAInqO8U9joXfeHVRXo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707816810; c=relaxed/simple; bh=Xl8MN8nPeESY7C6rMo2OigN0MetDVjtmFaMrPpaUx6g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CrTjiOhLiP2Btp+WzDlYKDVuOucDWdkKafEqDbPJs5rP5jTYVMM6zzg6LpoO99GDwOLvKu5GkQjCS1p0fCKMdTz1QiK3XklNKA0FPrwBr6CqvI4bj0z5q1Rhu9kPmER3gnSrPaOCEGCwzYkgs56K25/99JKrmH4QyQVJ432r398= 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=JxeGbdEa; arc=none smtp.client-ip=95.215.58.189 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=1707816807; 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=TtUC9LwCBXa/InKHa3MSglqgjCcySjFJ8GApzq67bXk=; b=JxeGbdEawMgFP4lolaW83sT6rOVtn3Jr5awIE+IJufW0O6N7HRGIYnCCAdSYU1n3+2eSFJ 4Lal0qXRYPH/zdJ9lHg+ZsUA6r4ZMDf3+VNDIH4rnpGq1vpnwRkOQFCGELItFtMp80Tt9B QEiMbQvQ+M6qEBCO8OHFpR4xtsc+py4= 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 08/23] KVM: arm64: vgic: Free LPI vgic_irq structs in an RCU-safe manner Date: Tue, 13 Feb 2024 09:32:45 +0000 Message-ID: <20240213093250.3960069-9-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: 1790775924873374519 X-GMAIL-MSGID: 1790775924873374519 |
Series |
KVM: arm64: Improvements to LPI injection
|
|
Commit Message
Oliver Upton
Feb. 13, 2024, 9:32 a.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