From: Paolo Bonzini <pbonzini@redhat.com>
To: Wanpeng Li <wanpeng.li@hotmail.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kvm: x86: fix load xsave feature warning
Date: Thu, 9 Jul 2015 14:50:43 +0200 [thread overview]
Message-ID: <559E6E23.4050309@redhat.com> (raw)
In-Reply-To: <BLU436-SMTP108B0B5832A6A495D4850E080900@phx.gbl>
On 09/07/2015 09:44, Wanpeng Li wrote:
> [ 68.196974] WARNING: CPU: 1 PID: 2140 at arch/x86/kvm/x86.c:3161 kvm_arch_vcpu_ioctl+0xe88/0x1340 [kvm]()
> [ 68.196975] Modules linked in: snd_hda_codec_hdmi i915 rfcomm bnep bluetooth i2c_algo_bit rfkill nfsd drm_kms_helper nfs_acl nfs drm lockd grace sunrpc fscache snd_hda_codec_realtek snd_hda_codec_generic snd_hda_intel snd_hda_codec snd_hda_core snd_hwdep snd_pcm snd_seq_dummy snd_seq_oss x86_pkg_temp_thermal snd_seq_midi kvm_intel snd_seq_midi_event snd_rawmidi kvm snd_seq ghash_clmulni_intel fuse snd_timer aesni_intel parport_pc ablk_helper snd_seq_device cryptd ppdev snd lp parport lrw dcdbas gf128mul i2c_core glue_helper lpc_ich video shpchp mfd_core soundcore serio_raw acpi_cpufreq ext4 mbcache jbd2 sd_mod crc32c_intel ahci libahci libata e1000e ptp pps_core
> [ 68.197005] CPU: 1 PID: 2140 Comm: qemu-system-x86 Not tainted 4.2.0-rc1+ #2
> [ 68.197006] Hardware name: Dell Inc. OptiPlex 7020/0F5C5X, BIOS A03 01/08/2015
> [ 68.197007] ffffffffa03b0657 ffff8800d984bca8 ffffffff815915a2 0000000000000000
> [ 68.197009] 0000000000000000 ffff8800d984bce8 ffffffff81057c0a 00007ff6d0001000
> [ 68.197010] 0000000000000002 ffff880211c1a000 0000000000000004 ffff8800ce0288c0
> [ 68.197012] Call Trace:
> [ 68.197017] [<ffffffff815915a2>] dump_stack+0x45/0x57
> [ 68.197020] [<ffffffff81057c0a>] warn_slowpath_common+0x8a/0xc0
> [ 68.197022] [<ffffffff81057cfa>] warn_slowpath_null+0x1a/0x20
> [ 68.197029] [<ffffffffa037bed8>] kvm_arch_vcpu_ioctl+0xe88/0x1340 [kvm]
> [ 68.197035] [<ffffffffa037aede>] ? kvm_arch_vcpu_load+0x4e/0x1c0 [kvm]
> [ 68.197040] [<ffffffffa03696a6>] kvm_vcpu_ioctl+0xc6/0x5c0 [kvm]
> [ 68.197043] [<ffffffff811252d2>] ? perf_pmu_enable+0x22/0x30
> [ 68.197044] [<ffffffff8112663e>] ? perf_event_context_sched_in+0x7e/0xb0
> [ 68.197048] [<ffffffff811a6882>] do_vfs_ioctl+0x2c2/0x4a0
> [ 68.197050] [<ffffffff8107bf33>] ? finish_task_switch+0x173/0x220
> [ 68.197053] [<ffffffff8123307f>] ? selinux_file_ioctl+0x4f/0xd0
> [ 68.197055] [<ffffffff8122cac3>] ? security_file_ioctl+0x43/0x60
> [ 68.197057] [<ffffffff811a6ad9>] SyS_ioctl+0x79/0x90
> [ 68.197060] [<ffffffff81597e57>] entry_SYSCALL_64_fastpath+0x12/0x6a
> [ 68.197061] ---[ end trace 558a5ebf9445fc80 ]---
>
> After commit (0c4109bec0 'x86/fpu/xstate: Fix up bad get_xsave_addr()
> assumptions'), there is no assumption an xsave bit is present in the
> hardware (pcntxt_mask) that it is always present in a given xsave buffer.
> An enabled state to be present on 'pcntxt_mask', but *not* in 'xstate_bv'
> could happen when the last 'xsave' did not request that this feature be
> saved (unlikely) or because the "init optimization" caused it to not be
> saved. This patch kill the assumption.
>
> Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
> ---
> Note: This patch against latest linus tree.
>
> arch/x86/kvm/x86.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index bbaf44e..7125cefe 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -3157,8 +3157,7 @@ static void load_xsave(struct kvm_vcpu *vcpu, u8 *src)
> cpuid_count(XSTATE_CPUID, index,
> &size, &offset, &ecx, &edx);
> memcpy(dest, src + offset, size);
> - } else
> - WARN_ON_ONCE(1);
> + }
>
> valid -= feature;
> }
>
I'll apply this tomorrow, thanks.
Paolo
prev parent reply other threads:[~2015-07-09 12:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-09 7:44 [PATCH] kvm: x86: fix load xsave feature warning Wanpeng Li
2015-07-09 12:50 ` Paolo Bonzini [this message]
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=559E6E23.4050309@redhat.com \
--to=pbonzini@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wanpeng.li@hotmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.