Received: by 10.223.185.116 with SMTP id b49csp463584wrg; Sat, 3 Mar 2018 00:05:34 -0800 (PST) X-Google-Smtp-Source: AG47ELseBlqUosXojl04tYXV+S62JSO0OlWP8uyu0BWzQjJT//OJWXFSTjx+B6hiB6z8ueIVIZBz X-Received: by 10.98.61.133 with SMTP id x5mr8294614pfj.181.1520064334167; Sat, 03 Mar 2018 00:05:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520064334; cv=none; d=google.com; s=arc-20160816; b=RS57bf/l3C91wd78u/t3YmPQescKcaBmkSJzfDRTBIt5sArBuidHLToDnUV8uJcJIc 3jLnHJy6KpdlZCZZApAUbNkw8Bz4/r16jpMIqUu1I/Ln7GXPjlxU8uh4PV8lrFi9MSwH iJicfcNid6hvzE3coBi4BXjRjCydGyZasKpzbpDOy8jW9bHo4dteheNRZZ+HUGdd5bvt TGUyqaiB7V/HRP3l6ILGh7fym8qUPWuve7koOh08vPawI+LvxKUmuwxJ8fHCDCKXPMqG UWSsKbP6BoMlalH6iEBmI0UVMa7wWObeoYH1Qhr/NebmCfVCoPJMW8hiDlX+NWiUeD4a o2yw== 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=qKhnxer+N0QpUO1wD441crw5biQ+N2+pzVgMqhgTYSo=; b=BENq8Zmk36Sd3n5DWU9Ut6jZCYspBylw51UQeu2SRRrPxLBzSJYvA+1rzr5StZQ19/ R+Ftr4TfOWJsXYYr4upsvPQTgEEqSZFJCdCTaOcYHvir4mlAYNxmMUlrFXO6DNcW64X8 rfHW/BVaRvygZ+K8P3NEkgaIoEPAXiluw/SEWbztSAfKQPgj9LBVdtReP0EdDoPXyZSJ 5Ys1FGytOF5oqdOhUQkKPNxkiCztgNjgmFY5fGzSfZT4MeE+Zu9hvcLL5P0ia1PH2NVS c51kMuEzRYsRzubZnXozM21LmAv0pA3FpNeiefQtLYhOiJm4i1PSA4jlT1cqO+g3Q6HN MvuA== 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 q11si5213185pgf.90.2018.03.03.00.05.15; Sat, 03 Mar 2018 00:05:34 -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 S932090AbeCCIEF (ORCPT + 99 others); Sat, 3 Mar 2018 03:04:05 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:5702 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751811AbeCCID7 (ORCPT ); Sat, 3 Mar 2018 03:03:59 -0500 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id DBA3E8E41A79B; Sat, 3 Mar 2018 16:03:41 +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:37 +0800 From: Dongjiu Geng To: , , , , , , , , , , , , , , , , CC: , Subject: [PATCH v10 1/5] arm64: KVM: Prepare set virtual SEI syndrome value Date: Sun, 4 Mar 2018 00:09:36 +0800 Message-ID: <1520093380-42577-2-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 Export one API to specify virtual SEI syndrome value for guest, and add a helper to get the VSESR_EL2 value. Signed-off-by: Dongjiu Geng --- arch/arm64/include/asm/kvm_emulate.h | 5 +++++ arch/arm64/include/asm/kvm_host.h | 2 ++ arch/arm64/kvm/inject_fault.c | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/arch/arm64/include/asm/kvm_emulate.h b/arch/arm64/include/asm/kvm_emulate.h index 413dc82..3294885 100644 --- a/arch/arm64/include/asm/kvm_emulate.h +++ b/arch/arm64/include/asm/kvm_emulate.h @@ -71,6 +71,11 @@ static inline void vcpu_set_hcr(struct kvm_vcpu *vcpu, unsigned long hcr) vcpu->arch.hcr_el2 = hcr; } +static inline unsigned long vcpu_get_vsesr(struct kvm_vcpu *vcpu) +{ + return vcpu->arch.vsesr_el2; +} + static inline void vcpu_set_vsesr(struct kvm_vcpu *vcpu, u64 vsesr) { vcpu->arch.vsesr_el2 = vsesr; diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h index a73f63a..3dc49b7 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h @@ -354,6 +354,8 @@ void handle_exit_early(struct kvm_vcpu *vcpu, struct kvm_run *run, int kvm_perf_init(void); int kvm_perf_teardown(void); +void kvm_set_sei_esr(struct kvm_vcpu *vcpu, u64 syndrome); + struct kvm_vcpu *kvm_mpidr_to_vcpu(struct kvm *kvm, unsigned long mpidr); static inline void __cpu_init_hyp_mode(phys_addr_t pgd_ptr, diff --git a/arch/arm64/kvm/inject_fault.c b/arch/arm64/kvm/inject_fault.c index 60666a0..78ecb28 100644 --- a/arch/arm64/kvm/inject_fault.c +++ b/arch/arm64/kvm/inject_fault.c @@ -186,3 +186,8 @@ void kvm_inject_vabt(struct kvm_vcpu *vcpu) { pend_guest_serror(vcpu, ESR_ELx_ISV); } + +void kvm_set_sei_esr(struct kvm_vcpu *vcpu, u64 syndrome) +{ + pend_guest_serror(vcpu, syndrome & ESR_ELx_ISS_MASK); +} -- 1.9.1