From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751323AbdEBMXa (ORCPT ); Tue, 2 May 2017 08:23:30 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:5819 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751115AbdEBMX1 (ORCPT ); Tue, 2 May 2017 08:23:27 -0400 Subject: Re: [PATCH v3 1/3] arm64: kvm: support kvmtool to detect RAS extension feature To: Christoffer Dall References: <1493530677-4919-1-git-send-email-gengdongjiu@huawei.com> <20170502075631.GE16940@cbox> CC: , , , , , , , , , , , , , , , , , , , , , , , , , gengdongjiu , From: gengdongjiu Message-ID: Date: Tue, 2 May 2017 20:15:03 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <20170502075631.GE16940@cbox> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.142.68.147] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020204.5908786D.0090,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 0e8339b0433e4d36e36cca03b9aee2cc Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Christoffer, thanks for your review and comments. On 2017/5/2 15:56, Christoffer Dall wrote: > Hi Dongjiu, > > Please send a cover letter for patch series with more than a single > patch. OK, got it. > > The subject and description of these patches are also misleading. > Hopefully this is in no way tied to kvmtool, but to userspace > generically, for example also to be used by QEMU? > > On Sun, Apr 30, 2017 at 01:37:55PM +0800, Dongjiu Geng wrote: >> Handle kvmtool's detection for RAS extension, because sometimes >> the APP needs to know the CPU's capacity > > the APP ? > > the CPU's capacity? I will fix it. > >> >> Signed-off-by: Dongjiu Geng >> --- >> arch/arm64/kvm/reset.c | 11 +++++++++++ >> include/uapi/linux/kvm.h | 1 + >> 2 files changed, 12 insertions(+) >> >> diff --git a/arch/arm64/kvm/reset.c b/arch/arm64/kvm/reset.c >> index d9e9697..1004039 100644 >> --- a/arch/arm64/kvm/reset.c >> +++ b/arch/arm64/kvm/reset.c >> @@ -64,6 +64,14 @@ static bool cpu_has_32bit_el1(void) >> return !!(pfr0 & 0x20); >> } >> >> +static bool kvm_arm_support_ras_extension(void) >> +{ >> + u64 pfr0; >> + >> + pfr0 = read_system_reg(SYS_ID_AA64PFR0_EL1); >> + return !!(pfr0 & 0x10000000); >> +} >> + >> /** >> * kvm_arch_dev_ioctl_check_extension >> * >> @@ -87,6 +95,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_RAS_EXTENSION: >> + r = kvm_arm_support_ras_extension(); >> + break; > > You need to document this capability and API in > Documentation/virtual/kvm/api.txt and explain how this works. Ok, thanks for your suggestion. > > > >> 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 f51d508..27fe556 100644 >> --- a/include/uapi/linux/kvm.h >> +++ b/include/uapi/linux/kvm.h >> @@ -883,6 +883,7 @@ struct kvm_ppc_resize_hpt { >> #define KVM_CAP_PPC_MMU_RADIX 134 >> #define KVM_CAP_PPC_MMU_HASH_V3 135 >> #define KVM_CAP_IMMEDIATE_EXIT 136 >> +#define KVM_CAP_ARM_RAS_EXTENSION 137 >> >> #ifdef KVM_CAP_IRQ_ROUTING >> >> -- >> 2.10.1 >> > > Thanks, > -Christoffer > > . >