Re: [PATCH] KVM: x86: fix bogus warning about reserved bits

From: Borislav Petkov
Date: Wed Sep 23 2015 - 07:07:41 EST


On Wed, Sep 23, 2015 at 11:36:47AM +0200, Paolo Bonzini wrote:
> And another patch, which both cranks up the debugging a bit and
> tries another fix:
>
> diff --git a/arch/x86/kvm/cpuid.h b/arch/x86/kvm/cpuid.h
> index dd05b9cef6ae..b2f49bb15ba1 100644
> --- a/arch/x86/kvm/cpuid.h
> +++ b/arch/x86/kvm/cpuid.h
> @@ -105,8 +105,15 @@ static inline bool guest_cpuid_has_x2apic(struct kvm_vcpu *vcpu)
> static inline bool guest_cpuid_is_amd(struct kvm_vcpu *vcpu)
> {
> struct kvm_cpuid_entry2 *best;
> + static bool first;
>
> best = kvm_find_cpuid_entry(vcpu, 0, 0);
> + if (first && best) {
> + printk("cpuid(0).ebx = %x\n", best->ebx);
> + first = false;
> + } else if (first)
> + printk_ratelimited("cpuid(0) not initialized yet\n");
> +
> return best && best->ebx == X86EMUL_CPUID_VENDOR_AuthenticAMD_ebx;

Do I see it correctly that that "first" thing is never true?

In any case, I changed it to initialize to true but still no output from
that function.

[ 102.448438] walk_shadow_page_get_mmio_spte: detect reserved bits on spte, addr 0xb8000 (level 4, 0xf0000000000f8)
[ 102.458706] walk_shadow_page_get_mmio_spte: detect reserved bits on spte, addr 0xb8000 (level 3, 0xf000000000078)
[ 102.468955] walk_shadow_page_get_mmio_spte: detect reserved bits on spte, addr 0xb8000 (level 2, 0xf000000000078)
[ 102.479337] dump hierarchy:
[ 102.482152] ------ spte 0x416edb027 level 4.
[ 102.482154] ------ spte 0x416eda027 level 3.
[ 102.482155] ------ spte 0x416ed5027 level 2.
[ 102.482157] ------ spte 0xffff0000000b8f67 level 1.
[ 102.482158] ------------[ cut here ]------------
[ 102.482196] WARNING: CPU: 6 PID: 3550 at arch/x86/kvm/mmu.c:3396 handle_mmio_page_fault.part.57+0x1a/0x20 [kvm]()
[ 102.482236] Modules linked in: tun sha256_ssse3 sha256_generic drbg binfmt_misc ipv6 vfat fat fuse dm_crypt dm_mod kvm_amd kvm crc32_pclmul aesni_intel aes_x86_64 lrw gf128mul glue_helper ablk_helper cryptd amd64_edac_mod fam15h_power k10temp edac_core amdkfd amd_iommu_v2 radeon acpi_cpufreq
[ 102.482240] CPU: 6 PID: 3550 Comm: qemu-system-x86 Not tainted 4.3.0-rc2+ #1
[ 102.482242] Hardware name: To be filled by O.E.M. To be filled by O.E.M./M5A97 EVO R2.0, BIOS 1503 01/16/2013
[ 102.482249] ffffffffa030c992 ffff880424b8fb78 ffffffff812c758a 0000000000000000
[ 102.482253] ffff880424b8fbb0 ffffffff810534c1 ffff8804160e0000 000000000000000f
[ 102.482257] 00000000000b8000 0000000000000000 00000000ffffffff ffff880424b8fbc0
[ 102.482259] Call Trace:
[ 102.482268] [<ffffffff812c758a>] dump_stack+0x4e/0x84
[ 102.482273] [<ffffffff810534c1>] warn_slowpath_common+0x91/0xd0
[ 102.482276] [<ffffffff810535ba>] warn_slowpath_null+0x1a/0x20
[ 102.482306] [<ffffffffa02deb0a>] handle_mmio_page_fault.part.57+0x1a/0x20 [kvm]
[ 102.482334] [<ffffffffa02e6420>] tdp_page_fault+0x2a0/0x2b0 [kvm]
[ 102.482340] [<ffffffff810a282d>] ? __lock_acquire+0x57d/0x17a0
[ 102.482369] [<ffffffffa02e0665>] kvm_mmu_page_fault+0x35/0x240 [kvm]
[ 102.482376] [<ffffffffa03656b8>] pf_interception+0x108/0x1d0 [kvm_amd]
[ 102.482381] [<ffffffffa0367d10>] handle_exit+0x150/0xa40 [kvm_amd]
[ 102.482408] [<ffffffffa02d7398>] ? kvm_arch_vcpu_ioctl_run+0x4c8/0x16f0 [kvm]
[ 102.482435] [<ffffffffa02d7403>] kvm_arch_vcpu_ioctl_run+0x533/0x16f0 [kvm]
[ 102.482461] [<ffffffffa02d7398>] ? kvm_arch_vcpu_ioctl_run+0x4c8/0x16f0 [kvm]
[ 102.482466] [<ffffffff816bde42>] ? mutex_lock_killable_nested+0x312/0x480
[ 102.482485] [<ffffffffa02be979>] ? kvm_vcpu_ioctl+0x79/0x6f0 [kvm]
[ 102.482490] [<ffffffff8107e133>] ? preempt_count_sub+0xb3/0x110
[ 102.482509] [<ffffffffa02bec3f>] kvm_vcpu_ioctl+0x33f/0x6f0 [kvm]
[ 102.482515] [<ffffffff811939d7>] do_vfs_ioctl+0x2d7/0x530
[ 102.482519] [<ffffffff8119f889>] ? __fget_light+0x29/0x90
[ 102.482523] [<ffffffff81193c7c>] SyS_ioctl+0x4c/0x90
[ 102.482527] [<ffffffff816c209b>] entry_SYSCALL_64_fastpath+0x16/0x73
[ 102.482531] ---[ end trace b8899512fc52cf2e ]---

Thanks.

--
Regards/Gruss,
Boris.

ECO tip #101: Trim your mails when you reply.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/