From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8D96FC54FB9 for ; Thu, 16 Nov 2023 14:11:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=R9+MfewglEAKOMoKv/ZT99+ohHGwNWTTJRZLPG3tpCU=; b=mhmYxOUdasjVyi 4bVTJ2e7g5P9PKZ8liFCLjSwLBMhqTtGRFwyFr1Las8mNZMUylRm8aF7+GhwRxDofbIiOoxuTR2ge AMddhLH4Ku3SrOYwPWJFMDGWMRxKCm4pm0Foo59O5Hh1kudQGpMT5G+dKRzY1iW63N8v3k1kwzYFK JaQ/N/dsM13/fnj0uPj90+QlXlXcoQvU2jCd95X1Am7KkL5yggCbQ1rdx3mjX4G3YEOg3Q/m3g5kI R6BtAFmVmv86WOe5E1kFF23lHhZ6APwX1lyHxvt1xYNR0vUmMPLbGvnfR9j50HomxI3D1pM0IIqWz SjToSscy1EgjcGTAChTg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r3d4k-003ewC-2m; Thu, 16 Nov 2023 14:10:34 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r3d4i-003evl-27 for linux-arm-kernel@lists.infradead.org; Thu, 16 Nov 2023 14:10:33 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 6279CB81D8F; Thu, 16 Nov 2023 14:10:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AFBD5C433C8; Thu, 16 Nov 2023 14:10:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700143829; bh=8MTym2s+U2AEVbQmC20//YcIVeykER0de05Mk9/ujrQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=hoZwkJlTpK2I3yuUAUPzpx/QPdxI3IkN6m60bhtHBnpiHBqSqSsYl0MzMFSDdmAFC hzVk1zeEhfZ+tx53cnLtrPZ82lmyls5yTy2wPHwCJk6SzWcIWVbgDMN000US0lE6kN Rg8MDYS4WjmZXfJEa1uJF4R1pVuY38aW8I4io0Rt8XTvLFvfVWduJ21fIILIY0gwzb 4Y387JYYKj4AxcEqwhtYxQlmUDf8xlUvgwPIBce2081tZzZm5hAzvD4OHmES2TTyKO l9My0tpiQDSvieQN0SjEkFDZ/UPaPz1S8FrqLrJMDO01NvrfHrfnqq0PQmjGdKSysj uPe5SxjwxSDeg== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1r3d4c-00DgrT-Vn; Thu, 16 Nov 2023 14:10:27 +0000 Date: Thu, 16 Nov 2023 14:10:26 +0000 Message-ID: <864jhl23hp.wl-maz@kernel.org> From: Marc Zyngier To: Kunkun Jiang Cc: Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , Will Deacon , Jean-Philippe Brucker , , , , Subject: Re: [PATCH] KVM: arm/arm64: GICv4: Do not perform an map to a mapped vLPI In-Reply-To: <20231116125215.1812-1-jiangkunkun@huawei.com> References: <20231116125215.1812-1-jiangkunkun@huawei.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: jiangkunkun@huawei.com, oliver.upton@linux.dev, james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, jean-philippe@linaro.org, eric.auger@redhat.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, wanghaibin.wang@huawei.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231116_061032_845514_E7F710FD X-CRM114-Status: GOOD ( 21.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 16 Nov 2023 12:52:15 +0000, Kunkun Jiang wrote: > > Before performing an unmap, let's check whether the vLPI has been > mapped. This corresponds to checking whether a vLPI is valid before > unmap it. > > Signed-off-by: Kunkun Jiang > --- > arch/arm64/kvm/vgic/vgic-v4.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/arch/arm64/kvm/vgic/vgic-v4.c b/arch/arm64/kvm/vgic/vgic-v4.c > index 339a55194b2c..824f4baf50ee 100644 > --- a/arch/arm64/kvm/vgic/vgic-v4.c > +++ b/arch/arm64/kvm/vgic/vgic-v4.c > @@ -436,6 +436,11 @@ int kvm_vgic_v4_set_forwarding(struct kvm *kvm, int virq, > if (ret) > goto out; > > + if (irq->hw) { > + ret = -EBUSY; > + goto out; > + } > + So this code affects the mapping side, not the unmapping. Even more confusingly, the subject of the patch doesn't match the commit message. Furthermore, I'm not sure we want to return an error here. Userspace has no knowledge of GICv4, and there are numerous other cases where we don't return any error. This is certainly a userspace visible change. Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel