[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] 3.1.0-rc{0,1} doesn't start
From: |
Eduardo Habkost |
Subject: |
Re: [Qemu-devel] 3.1.0-rc{0,1} doesn't start |
Date: |
Wed, 21 Nov 2018 10:50:08 -0200 |
User-agent: |
Mutt/1.9.2 (2017-12-15) |
On Tue, Nov 20, 2018 at 11:28:59PM -0500, Bandan Das wrote:
> address@hidden writes:
>
> > hello
> >
> >> incomplete because it can return 0 for data. Can you try this:
> >>
> >> diff --git a/target/i386/kvm.c b/target/i386/kvm.c
> >> index f524e7d929..4878ffb90b 100644
> >> --- a/target/i386/kvm.c
> >> +++ b/target/i386/kvm.c
> >> @@ -2002,14 +2002,9 @@ static int kvm_put_msrs(X86CPU *cpu, int level)
> >> #endif
> >>
> >> /* If host supports feature MSR, write down. */
> >> - if (kvm_feature_msrs) {
> >> - int i;
> >> - for (i = 0; i < kvm_feature_msrs->nmsrs; i++)
> >> - if (kvm_feature_msrs->indices[i] ==
> >> MSR_IA32_ARCH_CAPABILITIES)
> >> {
> >> - kvm_msr_entry_add(cpu, MSR_IA32_ARCH_CAPABILITIES,
> >> + if (kvm_arch_get_supported_msr_feature(kvm_state,
> >> MSR_IA32_ARCH_CAPABILI
> >> TIES)) {
> >> + kvm_msr_entry_add(cpu, MSR_IA32_ARCH_CAPABILITIES,
> >> env->features[FEAT_ARCH_CAPABILITIES]);
> >> - break;
> >> - }
> >> }
> >>
> >> /*
> >
> Sorry Gabriele, Eduardo and Paolo pointed out that the patch was incomplete.
> I am not sure however how you are getting non zero data with the rdmsr on an
> AMD.
> Can you please try this instead ?
>
> diff --git a/target/i386/kvm.c b/target/i386/kvm.c
> index f524e7d929..cfec559aa3 100644
> --- a/target/i386/kvm.c
> +++ b/target/i386/kvm.c
> @@ -95,6 +95,7 @@ static bool has_msr_xss;
> static bool has_msr_spec_ctrl;
> static bool has_msr_virt_ssbd;
> static bool has_msr_smi_count;
> +static bool has_msr_arch_capabs;
>
> static uint32_t has_architectural_pmu_version;
> static uint32_t num_architectural_pmu_gp_counters;
> @@ -1481,6 +1482,9 @@ static int kvm_get_supported_msrs(KVMState *s)
> case MSR_VIRT_SSBD:
> has_msr_virt_ssbd = true;
> break;
> + case MSR_IA32_ARCH_CAPABILITIES:
> + has_msr_arch_capabs = true;
> + break;
> }
> }
> }
> @@ -2002,14 +2006,10 @@ static int kvm_put_msrs(X86CPU *cpu, int level)
> #endif
>
> /* If host supports feature MSR, write down. */
> - if (kvm_feature_msrs) {
> - int i;
> - for (i = 0; i < kvm_feature_msrs->nmsrs; i++)
> - if (kvm_feature_msrs->indices[i] == MSR_IA32_ARCH_CAPABILITIES) {
> + if (kvm_arch_get_supported_msr_feature(kvm_state,
> MSR_IA32_ARCH_CAPABILITIES)
> + && has_msr_arch_capabs) {
Unless we have a KVM bug too, has_msr_arch_capabs should be
enough.
If has_msr_arch_capabs is not enough, we'll need to add a comment
explaining why, or we risk reintroducing the same bug later.
> kvm_msr_entry_add(cpu, MSR_IA32_ARCH_CAPABILITIES,
> env->features[FEAT_ARCH_CAPABILITIES]);
> - break;
> - }
> }
>
> /*
>
>
--
Eduardo
- Re: [Qemu-devel] 3.1.0-rc{0,1} doesn't start, (continued)
- Re: [Qemu-devel] 3.1.0-rc{0,1} doesn't start, Bandan Das, 2018/11/19
- Re: [Qemu-devel] 3.1.0-rc{0,1} doesn't start, Eduardo Habkost, 2018/11/19
- Re: [Qemu-devel] 3.1.0-rc{0,1} doesn't start, Paolo Bonzini, 2018/11/20
- Re: [Qemu-devel] 3.1.0-rc{0,1} doesn't start, Eduardo Habkost, 2018/11/20
- Re: [Qemu-devel] 3.1.0-rc{0,1} doesn't start, Paolo Bonzini, 2018/11/20
- Re: [Qemu-devel] 3.1.0-rc{0,1} doesn't start, Bandan Das, 2018/11/20
- Re: [Qemu-devel] 3.1.0-rc{0,1} doesn't start, Paolo Bonzini, 2018/11/21
Re: [Qemu-devel] 3.1.0-rc{0,1} doesn't start, balducci, 2018/11/20
- Re: [Qemu-devel] 3.1.0-rc{0,1} doesn't start, Bandan Das, 2018/11/20
- Re: [Qemu-devel] 3.1.0-rc{0,1} doesn't start, balducci, 2018/11/21
- Re: [Qemu-devel] 3.1.0-rc{0,1} doesn't start,
Eduardo Habkost <=
- [Qemu-devel] [PATCH] kvm: Use KVM_GET_MSR_INDEX_LIST for MSR_IA32_ARCH_CAPABILITIES support, Bandan Das, 2018/11/25
- Re: [Qemu-devel] [PATCH] kvm: Use KVM_GET_MSR_INDEX_LIST for MSR_IA32_ARCH_CAPABILITIES support, Eduardo Habkost, 2018/11/26