Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1894615pxf; Sat, 13 Mar 2021 00:48:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJwXC5Jh4S9YacBk1aLPBPq5gB6szJGxH4tkDkpBwzq4aypn/LXYdxmrO2t/mVDNtcVYr9Wh X-Received: by 2002:a17:907:9862:: with SMTP id ko2mr12673532ejc.222.1615625299749; Sat, 13 Mar 2021 00:48:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615625299; cv=none; d=google.com; s=arc-20160816; b=hbUbiOpaoEn8Fco6/xGEmFo7kemPGSxCUDiIhaWp/94wrkhdJIjrnhUMpArzBgKxB2 RHwS26zgvVR4Ck4ANxZDaGojv/aMgZ9UkdHgF2V4WvD+Rst0kAVF2x701p1FUl4xC4BH rCd4Kp/nsHtv8AW0RWvIWw4Fut/idrIr4O1B2p1G7e55cVYKcFNLLaydeNnrEnXct8jj IQhaeW502s43mM+E8pBUj0J5yrrQavXnP/7j7aht0HPWiBP4Bt4Rf4vnZ/4KznRcmvqZ 3EiPohFyc8zk+F5ddh/XUlybMBV9PIekjMSu7oqw7PHl77SjXiE7Si31AKTVPjymfqaX Hbhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=M9JJGPc44sDWRrY53TugcEI7OB8NHLtCidQae6WKYN0=; b=GcFbCgOrwDMRpr+iiDGkW1/odd2XokaIVcPWAR1mim2E3IO/AhMVGG4Qu+GKKvSNEr dyGvl3YEku8dB9kw1xxEUSx4dwljACl0D8r3WeLSO6jgntrchq+t4ekMl+lfl9vtKFnF iNuaKvg/PY6Izvioc0WeJyoZZ5zCkX0sABvk0rFnwt19810LFUkF8GtJhBjoR5/ZU/IV bkFlcpP0YN0LPV1v1jXPeWNwhlJmQ3YaMxXvPVCzT23mMc+rpN59MpiCGzt7PcYJHa1+ rYPb/H0eojL1XyvKMNox0rwgLHKy+Y3cfo4l6JeYsV5BhvefZQbSBroVExX//CXEMMpH ljBg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a23si6279247ejx.146.2021.03.13.00.47.57; Sat, 13 Mar 2021 00:48:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233468AbhCMIkE (ORCPT + 99 others); Sat, 13 Mar 2021 03:40:04 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:14328 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233114AbhCMIj4 (ORCPT ); Sat, 13 Mar 2021 03:39:56 -0500 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4DyGKT1s8bz8x02; Sat, 13 Mar 2021 16:38:05 +0800 (CST) Received: from DESKTOP-7FEPK9S.china.huawei.com (10.174.184.135) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.498.0; Sat, 13 Mar 2021 16:39:47 +0800 From: Shenming Lu To: Marc Zyngier , Eric Auger , "Will Deacon" , , , , CC: Alex Williamson , Cornelia Huck , Lorenzo Pieralisi , , , Subject: [PATCH v4 6/6] KVM: arm64: GICv4.1: Give a chance to save VLPI state Date: Sat, 13 Mar 2021 16:39:00 +0800 Message-ID: <20210313083900.234-7-lushenming@huawei.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20210313083900.234-1-lushenming@huawei.com> References: <20210313083900.234-1-lushenming@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.184.135] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Before GICv4.1, we don't have direct access to the VLPI state. So we simply let it fail early when encountering any VLPI in saving. But now we don't have to return -EACCES directly if on GICv4.1. Let’s change the hard code and give a chance to save the VLPI state (and preserve the UAPI). Signed-off-by: Shenming Lu --- Documentation/virt/kvm/devices/arm-vgic-its.rst | 2 +- arch/arm64/kvm/vgic/vgic-its.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/virt/kvm/devices/arm-vgic-its.rst b/Documentation/virt/kvm/devices/arm-vgic-its.rst index 6c304fd2b1b4..d257eddbae29 100644 --- a/Documentation/virt/kvm/devices/arm-vgic-its.rst +++ b/Documentation/virt/kvm/devices/arm-vgic-its.rst @@ -80,7 +80,7 @@ KVM_DEV_ARM_VGIC_GRP_CTRL -EFAULT Invalid guest ram access -EBUSY One or more VCPUS are running -EACCES The virtual ITS is backed by a physical GICv4 ITS, and the - state is not available + state is not available without GICv4.1 ======= ========================================================== KVM_DEV_ARM_VGIC_GRP_ITS_REGS diff --git a/arch/arm64/kvm/vgic/vgic-its.c b/arch/arm64/kvm/vgic/vgic-its.c index 40cbaca81333..ec7543a9617c 100644 --- a/arch/arm64/kvm/vgic/vgic-its.c +++ b/arch/arm64/kvm/vgic/vgic-its.c @@ -2218,10 +2218,10 @@ static int vgic_its_save_itt(struct vgic_its *its, struct its_device *device) /* * If an LPI carries the HW bit, this means that this * interrupt is controlled by GICv4, and we do not - * have direct access to that state. Let's simply fail - * the save operation... + * have direct access to that state without GICv4.1. + * Let's simply fail the save operation... */ - if (ite->irq->hw) + if (ite->irq->hw && !kvm_vgic_global_state.has_gicv4_1) return -EACCES; ret = vgic_its_save_ite(its, device, ite, gpa, ite_esz); -- 2.19.1