From: gengdongjiu <gengdongjiu@huawei.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
Igor Mammedov <imammedo@redhat.com>,
Shannon Zhao <zhaoshenglong@huawei.com>,
Paolo Bonzini <pbonzini@redhat.com>,
QEMU Developers <qemu-devel@nongnu.org>,
qemu-arm <qemu-arm@nongnu.org>, kvm-devel <kvm@vger.kernel.org>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
Christoffer Dall <christoffer.dall@linaro.org>,
Marc Zyngier <marc.zyngier@arm.com>,
"Will Deacon" <will.deacon@arm.com>,
James Morse <james.morse@arm.com>,
Tyler Baicar <tbaicar@codeaurora.org>,
Ard Biesheuvel <ard.biesheuvel@linaro.org>,
"Ingo Molnar" <mingo@kernel.org>, <bp@suse.de>,
<shiju.jose@huawei.com>, <zjzhang@codeaurora.org>,
arm-mail-list <linux-arm-kernel@lists.infradead.org>,
"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>,
lkml - Kernel Mailing List <linux-kernel@vger.kernel.org>,
<linux-acpi@vger.kernel.org>, <devel@acpica.org>,
<john.garry@huawei.com>, <jonathan.cameron@huawei.com>,
<shameerali.kolothum.thodi@huawei.com>,
<huangdaode@hisilicon.com>, <wangzhou1@hisilicon.com>,
Huangshaoyu <huangshaoyu@huawei.com>,
wuquanming <wuquanming@huawei.com>,
Linuxarm <linuxarm@huawei.com>, <zhengqiang10@huawei.com>
Subject: Re: [PATCH v11 4/6] target-arm: kvm64: detect guest RAS EXTENSION feature
Date: Wed, 6 Sep 2017 17:35:33 +0800 [thread overview]
Message-ID: <5e3c8d25-6260-d00e-dda3-d160a9973701@huawei.com> (raw)
In-Reply-To: <CAFEAcA9oecuzXXrdo3zZHxF3AgrDUh_NHxz-znto4GU+OoxVFw@mail.gmail.com>
Hi Peter,
Thanks very much for your review, I will check your comments in detail and reply.
On 2017/9/6 1:26, Peter Maydell wrote:
> On 18 August 2017 at 15:23, Dongjiu Geng <gengdongjiu@huawei.com> wrote:
>> check if kvm supports guest RAS EXTENSION. if so, set
>> corresponding feature bit for vcpu.
>>
>> Signed-off-by: Dongjiu Geng <gengdongjiu@huawei.com>
>> ---
>> linux-headers/linux/kvm.h | 1 +
>> target/arm/cpu.h | 3 +++
>> target/arm/kvm64.c | 8 ++++++++
>> 3 files changed, 12 insertions(+)
>>
>> diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h
>> index 7971a4f..2aa176e 100644
>> --- a/linux-headers/linux/kvm.h
>> +++ b/linux-headers/linux/kvm.h
>> @@ -929,6 +929,7 @@ struct kvm_ppc_resize_hpt {
>> #define KVM_CAP_PPC_SMT_POSSIBLE 147
>> #define KVM_CAP_HYPERV_SYNIC2 148
>> #define KVM_CAP_HYPERV_VP_INDEX 149
>> +#define KVM_CAP_ARM_RAS_EXTENSION 150
>>
>> #ifdef KVM_CAP_IRQ_ROUTING
>>
>
> Hi. Changes to linux-headers need to be done as a patch of their
> own created using scripts/update-linux-headers.sh run against a
> mainline kernel tree (and with a commit message that quotes the
> kernel commit hash used). This ensures that we have a consistent
> set of headers that don't diverge from the kernel copy.
>
>> diff --git a/target/arm/cpu.h b/target/arm/cpu.h
>> index b39d64a..6b0961b 100644
>> --- a/target/arm/cpu.h
>> +++ b/target/arm/cpu.h
>> @@ -611,6 +611,8 @@ struct ARMCPU {
>>
>> /* CPU has memory protection unit */
>> bool has_mpu;
>> + /* CPU has ras extension unit */
>> + bool has_ras_extension;
>> /* PMSAv7 MPU number of supported regions */
>> uint32_t pmsav7_dregion;
>>
>> @@ -1229,6 +1231,7 @@ enum arm_features {
>> ARM_FEATURE_THUMB_DSP, /* DSP insns supported in the Thumb encodings */
>> ARM_FEATURE_PMU, /* has PMU support */
>> ARM_FEATURE_VBAR, /* has cp15 VBAR */
>> + ARM_FEATURE_RAS_EXTENSION, /*has RAS extension support */
>
> Missing space after '/*' ?
>
>> };
>>
>> static inline int arm_feature(CPUARMState *env, int feature)
>> diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c
>> index a16abc8..0781367 100644
>> --- a/target/arm/kvm64.c
>> +++ b/target/arm/kvm64.c
>> @@ -518,6 +518,14 @@ int kvm_arch_init_vcpu(CPUState *cs)
>> unset_feature(&env->features, ARM_FEATURE_PMU);
>> }
>>
>> + if (kvm_check_extension(cs->kvm_state, KVM_CAP_ARM_RAS_EXTENSION)) {
>> + cpu->has_ras_extension = true;
>> + set_feature(&env->features, ARM_FEATURE_RAS_EXTENSION);
>> + } else {
>> + cpu->has_ras_extension = false;
>> + unset_feature(&env->features, ARM_FEATURE_RAS_EXTENSION);
>> + }
>> +
>
> Shouldn't we need to also tell the kernel that we actually want
> it to expose RAS to the guest? Compare the PMU code in this
> function, where we set a kvm_init_features bit to do this.
> (This suggests that your ABI for the kernel part of this feature
> may not be correct?)
>
> You should also not be calling set_feature() here -- if the
> CPU features bit doesn't say "this CPU should have the RAS
> extensions" we shouldn't create a CPU with them. Instead
> you should set it in kvm_arm_get_host_cpu_features() (again,
> compare the PMU code).
>
> thanks
> -- PMM
>
> .
>
next prev parent reply other threads:[~2017-09-06 9:36 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-18 14:23 [PATCH v11 0/6] Add RAS virtualization support for armv8 SEA and SEI Dongjiu Geng
2017-08-18 14:21 ` [Qemu-devel] " no-reply
2017-08-18 14:23 ` [PATCH v11 1/6] ACPI: add APEI/HEST/CPER structures and macros Dongjiu Geng
2017-08-24 12:33 ` Shannon Zhao
2017-08-25 10:37 ` gengdongjiu
2017-08-26 1:00 ` Shannon Zhao
2017-08-26 1:45 ` gengdongjiu
2017-08-18 14:23 ` [PATCH v11 2/6] ACPI: Add APEI GHES Table Generation support Dongjiu Geng
2017-08-24 13:03 ` Shannon Zhao
2017-08-25 11:20 ` gengdongjiu
2017-08-26 1:08 ` Shannon Zhao
2017-08-26 2:49 ` gengdongjiu
2017-08-29 10:20 ` [Qemu-devel] " Igor Mammedov
2017-08-29 11:15 ` gengdongjiu
2017-09-01 9:58 ` gengdongjiu
2017-09-01 11:51 ` Igor Mammedov
2017-08-18 14:23 ` [PATCH v11 3/6] ACPI: build and enable APEI GHES in the Makefile and configuration Dongjiu Geng
2017-08-24 13:04 ` Shannon Zhao
2017-08-25 11:20 ` gengdongjiu
2017-08-18 14:23 ` [PATCH v11 4/6] target-arm: kvm64: detect guest RAS EXTENSION feature Dongjiu Geng
2017-09-05 17:26 ` Peter Maydell
2017-09-06 9:35 ` gengdongjiu [this message]
2017-08-18 14:23 ` [PATCH v11 5/6] target-arm: kvm64: handle SIGBUS signal for synchronous External Abort Dongjiu Geng
2017-09-05 17:46 ` Peter Maydell
2017-08-18 14:23 ` [PATCH v11 6/6] target-arm: kvm64: Handle SError interrupt for the guest OS Dongjiu Geng
2017-09-05 17:50 ` Peter Maydell
2017-09-08 14:26 [PATCH v11 4/6] target-arm: kvm64: detect guest RAS EXTENSION feature gengdongjiu
2017-09-08 14:55 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5e3c8d25-6260-d00e-dda3-d160a9973701@huawei.com \
--to=gengdongjiu@huawei.com \
--cc=ard.biesheuvel@linaro.org \
--cc=bp@suse.de \
--cc=christoffer.dall@linaro.org \
--cc=devel@acpica.org \
--cc=edk2-devel@lists.01.org \
--cc=huangdaode@hisilicon.com \
--cc=huangshaoyu@huawei.com \
--cc=imammedo@redhat.com \
--cc=james.morse@arm.com \
--cc=john.garry@huawei.com \
--cc=jonathan.cameron@huawei.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=marc.zyngier@arm.com \
--cc=mingo@kernel.org \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=shameerali.kolothum.thodi@huawei.com \
--cc=shiju.jose@huawei.com \
--cc=tbaicar@codeaurora.org \
--cc=wangzhou1@hisilicon.com \
--cc=will.deacon@arm.com \
--cc=wuquanming@huawei.com \
--cc=zhaoshenglong@huawei.com \
--cc=zhengqiang10@huawei.com \
--cc=zjzhang@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®