Message ID | 20240221054253.3848076-8-oliver.upton@linux.dev |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-74105-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp850182dyc; Tue, 20 Feb 2024 21:46:33 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV8Z6EQgkb7sTuamLsGhvAcxQnSq53UngWifmjXsqOV+ACblpHrDwFmbgAaZHwmv/SWn9RxKes9GEj5kuc6gIMg4N9V2w== X-Google-Smtp-Source: AGHT+IH3KUfUDZVJPDffafGVp2O3gfMtTIo1PuXOlBFTJLCsAD4GWDEiN17lUMVXMuNowBlw4hSR X-Received: by 2002:a05:6a20:d38f:b0:19e:9a97:cb12 with SMTP id iq15-20020a056a20d38f00b0019e9a97cb12mr22078770pzb.54.1708494393010; Tue, 20 Feb 2024 21:46:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708494392; cv=pass; d=google.com; s=arc-20160816; b=m+vmv3CjYapAKDI8IkZ70C0XHyXbGlwrF3JYSBJmkR94fQcjtC9eNCBz63Zi5+jRhU wT3/+sVFlU34fgtI4icZXKEGzue+nkpQi59C90PjkSUFJo+OlmguyA3tswISteoVhwuy 7LX7L9DQWjBMcmbgtGHKGoMnE/XUVQnZ8pzOU1WVMJYOFU1A8kQEIBhTk+HjjK3Mpak9 0slA5yjL6PDXv+j3T1WHZUpE8WtXp3r4nFym70aPEU/9Njta7NALLGsQz18TPf/MSM4E Yrs/8nVXWSqdpe0SKGGFb5H+LxNdASOJIdFrkEKZAH+zuQoOkQBGuKDNPdJOcMDOdi7P f/Wg== 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=w2vP8fjlFG48ofYu0phwr6P5tTp39+9IxC+FJcXQ4f8=; fh=kCIhDCwfhVa+1moYcBlLNuY7yX/BfELZCoRk1wSf3jY=; b=oAGqvpUnfY1GrHaU9QwFKI0o0WWhhb4ds3PZls22EYrNgLpn5QCLiCu0PY3M0/7uMN 7CrJbVXRERk7MiEbgqNhvMbcOq859dT7Kp0H/gJQ7tdVW8T/yIDb6aoyORAcutmLdUMW H+alVfjFRQd0WI+K2UFgYZeQf1HvaF7UatisHzWgZFNtQin2u554vR24D+qcipL0wtnm 2AJvBjlkTmK3MD2gVroBrF1HJEIPVh+cyXWjqhSxdGKM+4KSK8tuhTYktjS2TJEdqrCT 6bjePH7HslzTrsuXaDiwbqx6iTRCLr24/s6++TBMbnWPNHxEK2D6E980NgqwF8K+d7M0 tCAg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=sdaejefD; 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-74105-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74105-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id sn15-20020a17090b2e8f00b002992db5a4f6si7519604pjb.101.2024.02.20.21.46.32 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 21:46:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-74105-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=sdaejefD; 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-74105-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74105-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 DA82D285EF4 for <ouuuleilei@gmail.com>; Wed, 21 Feb 2024 05:45:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7642A3D0C9; Wed, 21 Feb 2024 05:43:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="sdaejefD" Received: from out-189.mta0.migadu.com (out-189.mta0.migadu.com [91.218.175.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 670C63A1C7; Wed, 21 Feb 2024 05:43:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.189 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708494215; cv=none; b=Pu56ponqHgCc/vwDKL68Pc6nfyyNN+6UpJzCgahjr2CEs9A4VmkUgUa8D2u5PTcIHZl75RLPY1p2qMD8JAXSvBdqVBs8GsFw8N4ZilsBvFFv1YrjeXBWqcJ7r2wH14QHdg06ta9iUq8BsKO5L1BWSYq7lTKRmEc5NbB4hiaDa74= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708494215; c=relaxed/simple; bh=iPMx6to6nitv27V003CljDT9TCjGzeZ9T5PREHKTqXY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=u1nNYgTX7iawtHklM1McCvSnuuRPf7V4kCinMjdCbinlHOTybJ+3VINq6ryu0xLK7uTNbxsRStm+9TCiFfo2ucq5Iangpw9TA0YtU0/jpDgPimcXfSskyTg6ZLXHbJELK6TVqu2sbCwv8NKWoqqkMxmQ+9uhlYsYUSXqNHiGMuo= 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=sdaejefD; arc=none smtp.client-ip=91.218.175.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=1708494212; 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=w2vP8fjlFG48ofYu0phwr6P5tTp39+9IxC+FJcXQ4f8=; b=sdaejefD5Jik4CTUWmfbhv0AYU/Q05Y8Op4W9bykUArkL/dz+jcAyW8mywmef8uZMcnfDU UIRvZ/bQ86t1OfXpl0cxcOBySejSehv3d6tkIZpwMvuPSuTYx748F88BSGe7BdJWFS/uzi AIMGLQHhX8DNtbIksD7DZa4YvK5oWhs= 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 07/10] KVM: arm64: vgic: Free LPI vgic_irq structs in an RCU-safe manner Date: Wed, 21 Feb 2024 05:42:50 +0000 Message-ID: <20240221054253.3848076-8-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: 1791486216822888142 X-GMAIL-MSGID: 1791486216822888142 |
Series |
KVM: arm64: Avoid serializing LPI get() / put()
|
|
Commit Message
Oliver Upton
Feb. 21, 2024, 5:42 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 15dbd17b3a9e..3fedc58e663a 100644 --- a/arch/arm64/kvm/vgic/vgic.c +++ b/arch/arm64/kvm/vgic/vgic.c @@ -125,7 +125,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