From patchwork Mon Nov 27 18:49:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongjiu Geng X-Patchwork-Id: 841601 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ylk3Y5XnWz9sRm for ; Mon, 27 Nov 2017 21:45:44 +1100 (AEDT) Received: from localhost ([::1]:60085 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eJGuy-0002LG-Sc for incoming@patchwork.ozlabs.org; Mon, 27 Nov 2017 05:45:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58575) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eJGtz-000269-Q6 for qemu-devel@nongnu.org; Mon, 27 Nov 2017 05:44:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eJGtz-0007gB-39 for qemu-devel@nongnu.org; Mon, 27 Nov 2017 05:44:39 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:2111 helo=huawei.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eJGtt-0007cr-GU; Mon, 27 Nov 2017 05:44:33 -0500 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 3E29B700FE97; Mon, 27 Nov 2017 18:44:25 +0800 (CST) Received: from localhost.localdomain (10.143.28.90) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.361.1; Mon, 27 Nov 2017 18:44:20 +0800 From: Dongjiu Geng To: , , , , , , , , , , , , , , , , , , , , Date: Tue, 28 Nov 2017 02:49:49 +0800 Message-ID: <1511808595-24158-7-git-send-email-gengdongjiu@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1511808595-24158-1-git-send-email-gengdongjiu@huawei.com> References: <1511808595-24158-1-git-send-email-gengdongjiu@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.143.28.90] X-CFilter-Loop: Reflected X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 45.249.212.190 Subject: [Qemu-devel] [PATCH v13 06/12] target-arm: kvm64: detect whether can set vsesr_el2 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Check if kvm can support to set vsesr_el2 value for vcpu. When guest takes a virtual SError interrupt exception, this value will provides syndrome value reported into ESR_EL1 ISS filed. Signed-off-by: Dongjiu Geng Signed-off-by: Quanming Wu --- Address James's(james.morse@arm.com) comments to detect whether KVM has the capability to set ESR instead of detecting CPU RAS capability in [1] [1] https://www.spinics.net/lists/kvm-arm/msg27150.html https://www.spinics.net/lists/arm-kernel/msg604440.html --- target/arm/kvm64.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c index a16abc8..af8ebc9 100644 --- a/target/arm/kvm64.c +++ b/target/arm/kvm64.c @@ -980,3 +980,9 @@ bool kvm_arm_handle_debug(CPUState *cs, struct kvm_debug_exit_arch *debug_exit) return false; } + +static bool kvm_can_set_vcpu_esr(struct KVMState *state) +{ + int ret = kvm_check_extension(state, KVM_CAP_ARM_INJECT_SERROR_ESR); + return (ret) ? true : false; +}