Received: by 10.223.185.116 with SMTP id b49csp463857wrg; Sat, 3 Mar 2018 00:05:59 -0800 (PST) X-Google-Smtp-Source: AG47ELvIOd31d7zhawXSKTCEqUeMI0np4mjqQz+gPp5Hnz69h+f8MYZDlXSxCtIU2S145wBkMvcr X-Received: by 10.99.119.5 with SMTP id s5mr6522567pgc.71.1520064359151; Sat, 03 Mar 2018 00:05:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520064359; cv=none; d=google.com; s=arc-20160816; b=YAuxhdAPn2AU4bytjgg1xKr/jqZUQEweM2Zt27e5VIIO23ld7ENzQkUsMehzt7VANg nQMnTy/ImGnAXjq+Oae6BHRP8723k9IcingoRbYdXQfzHkcpe+3jUpUqJV/cnJGLMs04 iF2I80ccDuO9ZARFwnymYa7BF9RO3WEe4YhEgi7C7Oxc69aV7dT9E4kKZDszJ8wXmFfR OfkOapGPosu94HvlqD6ao09jFDkS1jUGWkfKcGzGRRqVYLvIUQCLu2n19b4w+MWd97qq I/moVVb6hf6pJrP91YRS0BYGXznT7e2Bl0oLKdgZ3MXmJSD2AvD1XYwR1kNDbqH+5wKT Dd9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=QnQBODS37sWaDFH9XNKHQG10/+syvXCFDYiDoHnfM1A=; b=yk238I+nYs6gYIj3hOMQ1PirYyo79eVW04/wWxS3xnXTyxDlxHE9PQMkyV1hT8gVIQ 64PO/Qya4CI0dUXByNrH9Sf6MCHG6R7eks7+vVmd2uGcKaidpGtzw9sQNV+Nlu58AT92 dEce4C6638m1xUH8ygFp0+2+XdzXUPnSJaBP0BteN48SX7FDuR/EZPVGVpFfjyotX5bl G/ccVsQ9FKf5kPSBYEqRSdeQJc/x2CUNuCWGhf6vloP7+X46Aj3pAX2idZRrKZ3alKMM Fn+jSGANjkZIq7AXstmIhcUy5PJiJc6MX89dJH3IKLORn6Y+v3eSQcnY22njMNI0xUzJ y2nQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m39-v6si6141631plg.151.2018.03.03.00.05.44; Sat, 03 Mar 2018 00:05:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932142AbeCCIEl (ORCPT + 99 others); Sat, 3 Mar 2018 03:04:41 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:57749 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751937AbeCCIEA (ORCPT ); Sat, 3 Mar 2018 03:04:00 -0500 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 03F98B8412843; Sat, 3 Mar 2018 16:03:47 +0800 (CST) Received: from localhost.localdomain (10.143.28.90) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.361.1; Sat, 3 Mar 2018 16:03:38 +0800 From: Dongjiu Geng To: , , , , , , , , , , , , , , , , CC: , Subject: [PATCH v10 2/5] arm64: KVM: export the capability to set guest SError syndrome Date: Sun, 4 Mar 2018 00:09:37 +0800 Message-ID: <1520093380-42577-3-git-send-email-gengdongjiu@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1520093380-42577-1-git-send-email-gengdongjiu@huawei.com> References: <1520093380-42577-1-git-send-email-gengdongjiu@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.143.28.90] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Before user space injects a SError, it needs to know whether it can specify the guest Exception Syndrome, so KVM should tell user space whether it has such capability. Signed-off-by: Dongjiu Geng --- Documentation/virtual/kvm/api.txt | 11 +++++++++++ arch/arm64/kvm/reset.c | 3 +++ include/uapi/linux/kvm.h | 1 + 3 files changed, 15 insertions(+) diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index fc3ae95..8a3d708 100644 --- a/Documentation/virtual/kvm/api.txt +++ b/Documentation/virtual/kvm/api.txt @@ -4415,3 +4415,14 @@ Parameters: none This capability indicates if the flic device will be able to get/set the AIS states for migration via the KVM_DEV_FLIC_AISM_ALL attribute and allows to discover this without having to create a flic device. + +8.14 KVM_CAP_ARM_SET_SERROR_ESR + +Architectures: arm, arm64 + +This capability indicates that userspace can specify syndrome value reported to +guest OS when guest takes a virtual SError interrupt exception. +If KVM has this capability, userspace can only specify the ISS field for the ESR +syndrome, can not specify the EC field which is not under control by KVM. +If this virtual SError is taken to EL1 using AArch64, this value will be reported +into ISS filed of ESR_EL1. diff --git a/arch/arm64/kvm/reset.c b/arch/arm64/kvm/reset.c index 3256b92..38c8a64 100644 --- a/arch/arm64/kvm/reset.c +++ b/arch/arm64/kvm/reset.c @@ -77,6 +77,9 @@ int kvm_arch_dev_ioctl_check_extension(struct kvm *kvm, long ext) case KVM_CAP_ARM_PMU_V3: r = kvm_arm_support_pmu_v3(); break; + case KVM_CAP_ARM_INJECT_SERROR_ESR: + r = cpus_have_const_cap(ARM64_HAS_RAS_EXTN); + break; case KVM_CAP_SET_GUEST_DEBUG: case KVM_CAP_VCPU_ATTRIBUTES: r = 1; diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index 8fb90a0..3587b33 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h @@ -934,6 +934,7 @@ struct kvm_ppc_resize_hpt { #define KVM_CAP_S390_AIS_MIGRATION 150 #define KVM_CAP_PPC_GET_CPU_CHAR 151 #define KVM_CAP_S390_BPB 152 +#define KVM_CAP_ARM_INJECT_SERROR_ESR 153 #ifdef KVM_CAP_IRQ_ROUTING -- 1.9.1