From mboxrd@z Thu Jan 1 00:00:00 1970 From: Borislav Petkov Subject: Re: [PATCH] KVM: x86: fix bogus warning about reserved bits Date: Wed, 23 Sep 2015 13:07:33 +0200 Message-ID: <20150923110733.GA3528@pd.tnic> References: <1442910329-3357-1-git-send-email-pbonzini@redhat.com> <20150922175647.GC3568@pd.tnic> <5601C266.4060601@redhat.com> <20150923075635.GA3564@pd.tnic> <560272AF.40802@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org To: Paolo Bonzini Return-path: Received: from mail.skyhub.de ([78.46.96.112]:55493 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754042AbbIWLHg (ORCPT ); Wed, 23 Sep 2015 07:07:36 -0400 Content-Disposition: inline In-Reply-To: <560272AF.40802@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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] [] dump_stack+0x4e/0x84 [ 102.482273] [] warn_slowpath_common+0x91/0xd0 [ 102.482276] [] warn_slowpath_null+0x1a/0x20 [ 102.482306] [] handle_mmio_page_fault.part.57+0x1a/0x20 [kvm] [ 102.482334] [] tdp_page_fault+0x2a0/0x2b0 [kvm] [ 102.482340] [] ? __lock_acquire+0x57d/0x17a0 [ 102.482369] [] kvm_mmu_page_fault+0x35/0x240 [kvm] [ 102.482376] [] pf_interception+0x108/0x1d0 [kvm_amd] [ 102.482381] [] handle_exit+0x150/0xa40 [kvm_amd] [ 102.482408] [] ? kvm_arch_vcpu_ioctl_run+0x4c8/0x16f0 [kvm] [ 102.482435] [] kvm_arch_vcpu_ioctl_run+0x533/0x16f0 [kvm] [ 102.482461] [] ? kvm_arch_vcpu_ioctl_run+0x4c8/0x16f0 [kvm] [ 102.482466] [] ? mutex_lock_killable_nested+0x312/0x480 [ 102.482485] [] ? kvm_vcpu_ioctl+0x79/0x6f0 [kvm] [ 102.482490] [] ? preempt_count_sub+0xb3/0x110 [ 102.482509] [] kvm_vcpu_ioctl+0x33f/0x6f0 [kvm] [ 102.482515] [] do_vfs_ioctl+0x2d7/0x530 [ 102.482519] [] ? __fget_light+0x29/0x90 [ 102.482523] [] SyS_ioctl+0x4c/0x90 [ 102.482527] [] entry_SYSCALL_64_fastpath+0x16/0x73 [ 102.482531] ---[ end trace b8899512fc52cf2e ]--- Thanks. -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply.