Received: by 10.223.176.46 with SMTP id f43csp1188612wra; Wed, 24 Jan 2018 12:07:33 -0800 (PST) X-Google-Smtp-Source: AH8x227Lmm8hS2yHWP63jgRmMXP0GWC4Vcu1+RQowZmF0cB8m5FLO719+7VFyZGi3Puj2I3j5Hnh X-Received: by 10.99.106.69 with SMTP id f66mr2403420pgc.283.1516824453470; Wed, 24 Jan 2018 12:07:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516824453; cv=none; d=google.com; s=arc-20160816; b=QtQIc39kTUeXFO3vLkOH9uyGU1ECYt4FG3pf/uOA/wHUVYvRM+jnwNZrQf+5SzLZSO E9VohEx9jctVOyq8+WFxm18ulpP9LsSbmfS+DCw+ZjXv2KC7eDPSTmJBJEIf9lx/1XxU UaEpJgld2OpslHitlkcp7R+jREwi507ZwSY7s4kZGyIF4JyN8H/WlaVwB4ifathQ7Fim OI6EQ+xsyTEG0O7sS8TxKXXpdzgMTrGxQLWXdigvn018RaJhRxd6Ce1l5n/9WCOcwrmm jTsQWO14XvWQ7br0+L+j9r/CuWhRgqfTxsHTih3v1yhhQnWRS1O8+4yh8jlygspX6fVQ Vj0A== 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=4+EanW3FN2RNW+YaKtKLY8V8epRtm72uQ+SKNAhHQoY=; b=u8tu9JYnsFGyHkNRpUc6FORXiHil4heZXSGLgV0IwsLoe0QDSHBE2UIWi94hWMuM5m hW/mCqU6mCTSSqRmV5cb6d6+RiBVMj5mwFvWOva796HzltIOxPdif829L7gr7TSQHIMk HV0bPDy7QFN4FH6ldhv9rxEjW9kOHQQlP+rZaJN3jllDPviHP3E5otxAkRhOCrpd3qRZ 0ZO9lXWtY02J6sA0EIzF4lcp88g11/zfZM/pDYcirps9EH0RMJU7TadtnuIrk153mNcF L/CPdsWr3a6zTfOR6D5u7iyH1LqqWk6bAdPI0rfwObl+9iO9gBe5mTHk6ZEOgvcj7aZl BpRw== 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 f3-v6si660552pld.374.2018.01.24.12.07.19; Wed, 24 Jan 2018 12:07:33 -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 S932304AbeAXUGZ convert rfc822-to-8bit (ORCPT + 99 others); Wed, 24 Jan 2018 15:06:25 -0500 Received: from szxga02-in.huawei.com ([45.249.212.188]:2519 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932123AbeAXUGX (ORCPT ); Wed, 24 Jan 2018 15:06:23 -0500 Received: from DGGEMA405-HUB.china.huawei.com (unknown [172.30.72.55]) by Forcepoint Email with ESMTP id 6E93270F2A3A8; Thu, 25 Jan 2018 04:06:19 +0800 (CST) Received: from DGGEMA503-MBS.china.huawei.com ([169.254.2.193]) by DGGEMA405-HUB.china.huawei.com ([10.3.20.46]) with mapi id 14.03.0361.001; Thu, 25 Jan 2018 04:06:15 +0800 From: gengdongjiu To: James Morse CC: "christoffer.dall@linaro.org" , "marc.zyngier@arm.com" , "linux@armlinux.org.uk" , "catalin.marinas@arm.com" , "rjw@rjwysocki.net" , "bp@alien8.de" , "robert.moore@intel.com" , "lv.zheng@intel.com" , "corbet@lwn.net" , "will.deacon@arm.com" , "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 Subject: Re: [PATCH v9 5/7] arm64: kvm: Introduce KVM_ARM_SET_SERROR_ESR ioctl Thread-Topic: [PATCH v9 5/7] arm64: kvm: Introduce KVM_ARM_SET_SERROR_ESR ioctl Thread-Index: AdOVGvr+RfR7XQx6RYOgDhjLjd6TFg== Date: Wed, 24 Jan 2018 20:06:15 +0000 Message-ID: <0184EA26B2509940AA629AE1405DD7F201A9E8EA@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.50.90] 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, Thanks a lot for your review and comments. > > Hi Dongjiu Geng, > > On 06/01/18 16:02, Dongjiu Geng wrote: > > The ARM64 RAS SError Interrupt(SEI) syndrome value is specific to the > > guest and user space needs a way to tell KVM this value. So we add a > > new ioctl. Before user space specifies the Exception Syndrome Register > > ESR(ESR), it firstly checks that whether KVM has the capability to set > > the guest ESR, If has, will set it. Otherwise, nothing to do. > > > > For this ESR specifying, Only support for AArch64, not support AArch32. > > After this patch user-space can trigger an SError in the guest. If it wants to migrate the guest, how does the pending SError get migrated? > > I think we need to fix migration first. Andrew Jones suggested using > KVM_GET/SET_VCPU_EVENTS: > https://www.spinics.net/lists/arm-kernel/msg616846.html > > Given KVM uses kvm_inject_vabt() on v8.0 hardware too, we should cover systems without the v8.2 RAS Extensions with the same API. I > think this means a bit to read/write whether SError is pending, and another to indicate the ESR should be set/read. > CPUs without the v8.2 RAS Extensions can reject pending-SError that had an ESR. For the CPUs without the v8.2 RAS Extensions, its ESR is always 0, we only can inject a SError with ESR 0 to guest, cannot set its ESR. About how about to use the KVM_GET/SET_VCPU_EVENTS, I will check the code, and consider your suggestion at the same time. The IOCTL KVM_GET/SET_VCPU_EVENTS has been used by X86. > > user-space can then use the 'for migration' calls to make a 'new' SError pending. > > Now that the cpufeature bits are queued, I think this can be split up into two separate series for v4.16-rc1, one to tackle NOTIFY_SEI and > the associated plumbing. The second for the KVM 'make SError pending' API. Ok, thanks for your suggestion, will split it. > > > > diff --git a/arch/arm64/kvm/guest.c b/arch/arm64/kvm/guest.c index > > 5c7f657..738ae90 100644 > > --- a/arch/arm64/kvm/guest.c > > +++ b/arch/arm64/kvm/guest.c > > @@ -277,6 +277,11 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu, > > return -EINVAL; > > } > > > > +int kvm_arm_set_sei_esr(struct kvm_vcpu *vcpu, u32 *syndrome) { > > + return -EINVAL; > > +} > > Does nothing in the patch that adds the support? This is a bit odd. > (oh, its hiding in patch 6...) To make this patch simple and small, I add it in patch 6. > > > Thanks, > > James