Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3184903pxf; Sun, 21 Mar 2021 23:04:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwu5ZJmbsE4OCQSZuU2nmKxyX/BGLYSSb8rIl76lIB1gB/NJ1YbYq7bG/lHwtZFx8eflt2a X-Received: by 2002:aa7:c804:: with SMTP id a4mr23315873edt.251.1616393093918; Sun, 21 Mar 2021 23:04:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616393093; cv=none; d=google.com; s=arc-20160816; b=c4xhbj8PfRgwSj/DHmrhmx+fyQll36/Uf+QOzeSI6t2byjEBcM6cy3kH4GmxUIU8vY jh/Ued2tkT0iegYkonowYUzoZrHqBdhP1XKjC61HX+/YIW5ySiCH8GVWXGXTtom/TLcd 7EB/pRfCYQ+v6cKFHawl1VA/5bS0J7JIdcNvKnAinTy4al54+R8agx/E/vPPZmYJoImB tyz3AGpU5g19BLjza0mwxYFQpfIKcbtCI+W/0kFByP3idbYQI5Gdjy6OKm3nm/aHwP34 B1N6Sx3aFuLn5+Z3pFmkItVbp0GDwNmxFIEiUrSJAe/CuBtPMq7/Eai3F0d9Kthbl8+o Gjug== 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=05O7cEQbXnCKVtCJ2bCcPlj/MogyVVJe9FswxSQ2vW7heGg+BUIFD149bzmPvyH6+X /xHeRojb0/DnnV6jPdummZ6eKtQI5fm2JIJkoGJ2z+PLkAucIrLoYfsweNd3JqzxncCk O3VR6EV5c1IX+C16087yXqBuWvO9SjcrqHHUOjgAOZUA8NDFmjvbN0z+RCPnw/xM6V91 euQvSlmfEWw/Qkbvz0JWIPWnvlQQH5Nq+MsI1PEre539ZucIUiEvCoa7bDD/uHsVeue7 MElplxhHYs5EEEuOXqL+m33c8jJg4GMQN72QXp0FQobE/oqtSWZdNx+FG4XBMkt6mxZ5 M6Pg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u26si3267197ejg.555.2021.03.21.23.04.31; Sun, 21 Mar 2021 23:04:53 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230182AbhCVGD2 (ORCPT + 99 others); Mon, 22 Mar 2021 02:03:28 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:14122 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229875AbhCVGCo (ORCPT ); Mon, 22 Mar 2021 02:02:44 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4F3kPn19bLz19GH0; Mon, 22 Mar 2021 14:00:45 +0800 (CST) Received: from DESKTOP-7FEPK9S.china.huawei.com (10.174.184.135) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.498.0; Mon, 22 Mar 2021 14:02:33 +0800 From: Shenming Lu To: Marc Zyngier , Eric Auger , "Will Deacon" , , , , CC: Alex Williamson , Cornelia Huck , Lorenzo Pieralisi , , , Subject: [PATCH v5 6/6] KVM: arm64: GICv4.1: Give a chance to save VLPI state Date: Mon, 22 Mar 2021 14:01:58 +0800 Message-ID: <20210322060158.1584-7-lushenming@huawei.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20210322060158.1584-1-lushenming@huawei.com> References: <20210322060158.1584-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