Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp631600pxu; Sun, 22 Nov 2020 22:58:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJyu2xcpI90LMWFqEBAtJg9XCt2DEPHMetQlkvBdDfok9Q3Lv1VWyMyEsKxtHSeWWjP3ehJR X-Received: by 2002:a17:906:7016:: with SMTP id n22mr45128485ejj.402.1606114734920; Sun, 22 Nov 2020 22:58:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606114734; cv=none; d=google.com; s=arc-20160816; b=xBjvwMBCYDA5qvM81tNI5rOTkQgigSXgUFeTI3S/BfVbgo78a+9EU/vqt9P0/piHYP N1AF+cyABM/8iVmOZ0RoyH+yVLTFzXxL9akfplCKmiCtlM4ePpVNhjxEkoBVmrrUrEAe NQ5HhNNl/dMfdJgErExpx3TD7C1UWh5RyJ99PY5oB0QAO/396QqZX71t741u0VLuZtWE 2U0JrSPAl8KrbFeQpnUlFroyxJqSxw3f7L/NO1BM+fK1kVKRx5ZKUS8CcvuCWJUhRjob sc5cVKJORoCpa7+/wwmUVLNkq1SU0xFSeWGMRufjoivJqGIjhdKc8874yyq3Gaf6T23u Nf0w== 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=I3JTJWoI2EI5vX9F+b0XfOJ2SLnZ89uhgX7jQ26UNSc=; b=TJWmsc1AErCoisUA9w+3t1DKgi4MgG8Mg7+WnwV0+c16Lvp+s6U0S/rVSAFaUHfnJN mQlEbfZO3MD3A7DrL3g3G6yB5d0JKeMDE/FrMP/PQMo9HpIbp+FP1mdITsn1PcV88psf gtHauF3SRaYxkQTtBvnxnn6vFs11tZBdh0M6FU4NBsXw3BtP6/Y5CV/A0neqWNY320vw ef+K9dtThVt7o/PiOzEYk1ZH1CD944AJe2/it9PZPRBCkYgIdmMUGcuNVWpmMA7KWTQS kAWw/0uZNIEeLWVbuqUv22A/iRjsP4njfaJU/G0yGxOHrWCtWHzmmxG0cfgvhBZ90jHB 8RVg== 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 v25si6307530edy.175.2020.11.22.22.58.32; Sun, 22 Nov 2020 22:58:54 -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 S1727880AbgKWGy7 (ORCPT + 99 others); Mon, 23 Nov 2020 01:54:59 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:8013 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727855AbgKWGy7 (ORCPT ); Mon, 23 Nov 2020 01:54:59 -0500 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4CfdDt1V1Kzhg2q; Mon, 23 Nov 2020 14:54:38 +0800 (CST) Received: from DESKTOP-7FEPK9S.china.huawei.com (10.174.187.74) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.487.0; Mon, 23 Nov 2020 14:54:49 +0800 From: Shenming Lu To: Marc Zyngier , James Morse , "Julien Thierry" , Suzuki K Poulose , Eric Auger , , , , , Christoffer Dall CC: Alex Williamson , Kirti Wankhede , Cornelia Huck , Neo Jia , , , Subject: [RFC PATCH v1 4/4] KVM: arm64: GICv4.1: Give a chance to save VLPI's pending state Date: Mon, 23 Nov 2020 14:54:10 +0800 Message-ID: <20201123065410.1915-5-lushenming@huawei.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20201123065410.1915-1-lushenming@huawei.com> References: <20201123065410.1915-1-lushenming@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.187.74] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Before GICv4.1, we do not have direct access to the VLPI's pending state. So we simply let it fail early when encountering any VLPI. But now we don't have to return -EACCES directly if on GICv4.1. So let’s change the hard code and give a chance to save the VLPI's pending state (and preserve the interfaces). 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.23.0