Received: by 10.213.65.68 with SMTP id h4csp705363imn; Sat, 17 Mar 2018 22:21:47 -0700 (PDT) X-Google-Smtp-Source: AG47ELuFjBHz1nE/sXwjYk37jzWkwwAVLHWmx1fJbhIb7Jp8bhhvZRZFWfakO0uB2DaDMs11Jatc X-Received: by 10.98.103.69 with SMTP id b66mr6418157pfc.151.1521350507166; Sat, 17 Mar 2018 22:21:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521350507; cv=none; d=google.com; s=arc-20160816; b=QNDgUmwLeJoVd9jhX15QLmOc6UNVoP2vFEIRBS4RF7hN5kx8hAjeLxBu7SIY+7foDv 1ryUDWjJfxZCcUfZbSZBADrXfs4Ne4lXKsNG17JOkOtuBhiZarJdTnl97enOfmJQaIqZ TNtO+jdtnCaMHLmf/frRK0MeOozg7VFQNTsgy2mJ2Du04iQlMQALizNYTqz8/xRQptM3 hte++M5Ctn4W2zOA+coAF5gk//ZvCvhv0N1ppNk3L/8pn38WPspJxCNZKP8tnS4q5apY 88l/7uSxVlmZjlOKrgMhCAtdY9lcu85VQcG/tY3YAS2ms76IjYF50okdaezVBn/TY1Ta RzLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:message-id:date:thread-index :thread-topic:subject:cc:to:from:arc-authentication-results; bh=a60tyhjMfmICZUM+paNGYea2cZtcen6eWgUTcydfhXQ=; b=ziifXQLj7LE7oFaSrGBo5nh6P0ZuSWkDmCHjgptNr6+uBz3bl16m1zfdfLyh1a1D19 Zx8hZWQQRenqd5UGDNKOrUJgnNNyLWW3C/oVdoB2/0FfjVS9t3JC66OJ8WsilN9F0/lt XOAahDIn6RMG+R17Cgcmk4QvAMOF7l3X8r5km6R8lsYJAGgBNMtwrWd61hd6bxZ/ygVv zDhAmA/x0lyU+S5K+pdryLlwc2GXQiaa2JScFn6EbRa23m50EU7YXuesckIEoOmLrdZW tYJkM/87LSrILBtm7LZKijlTIDumuV1Q9S7ReTWkmDJo/ysABcAqc0boXFzDddooTmLI Z4Zw== 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 o22si7534660pgv.232.2018.03.17.22.21.21; Sat, 17 Mar 2018 22:21:47 -0700 (PDT) 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 S1752042AbeCRFRe convert rfc822-to-8bit (ORCPT + 99 others); Sun, 18 Mar 2018 01:17:34 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:5516 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750756AbeCRFRd (ORCPT ); Sun, 18 Mar 2018 01:17:33 -0400 Received: from DGGEMA406-HUB.china.huawei.com (unknown [172.30.72.54]) by Forcepoint Email with ESMTP id 70140EB3D1C90; Sun, 18 Mar 2018 13:17:28 +0800 (CST) Received: from DGGEMA503-MBS.china.huawei.com ([169.254.2.193]) by DGGEMA406-HUB.china.huawei.com ([10.3.20.47]) with mapi id 14.03.0361.001; Sun, 18 Mar 2018 13:17:23 +0800 From: gengdongjiu To: James Morse CC: "rkrcmar@redhat.com" , "corbet@lwn.net" , "christoffer.dall@linaro.org" , "marc.zyngier@arm.com" , "linux@armlinux.org.uk" , "catalin.marinas@arm.com" , "rjw@rjwysocki.net" , "bp@alien8.de" , "lenb@kernel.org" , "kvm@vger.kernel.org" , "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "kvmarm@lists.cs.columbia.edu" , "linux-acpi@vger.kernel.org" , "devel@acpica.org" , "Huangshaoyu (Shawn)" Subject: Re: [PATCH v10 1/5] arm64: KVM: Prepare set virtual SEI syndrome value Thread-Topic: [PATCH v10 1/5] arm64: KVM: Prepare set virtual SEI syndrome value Thread-Index: AdO+eCvKVEAI/Q5kTiOBw3krJZrcgw== Date: Sun, 18 Mar 2018 05:17:22 +0000 Message-ID: <0184EA26B2509940AA629AE1405DD7F201B6C1D7@DGGEMA503-MBS.china.huawei.com> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.45.52.52] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi James, > > Hi Dongjiu Geng, > > On 03/03/18 16:09, Dongjiu Geng wrote: > > Export one API to specify virtual SEI syndrome value for guest, and > > add a helper to get the VSESR_EL2 value. > > This patch adds two helpers that nothing calls... its not big, please merge it with the patch that uses these. OK, thanks, I will merge them. > > > > 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); > > If you move the ISS_MASK into pend_guest_serror(), you wouldn't need this at all. > > It would be better if any validation were in the user-space helpers so we can check user-space hasn't put something funny in the top bits. Yes, I agree your idea, thanks for the good suggestion. > > > +} > > > > > Thanks, > > James