From: Leonardo Bras <leobras@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
Sean Christopherson <seanjc@google.com>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Wanpeng Li <wanpengli@tencent.com>,
Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>
Cc: Leonardo Bras <leobras@redhat.com>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v1 0/2] x86/kvm/fpu: Fix guest migration bugs that can crash guest
Date: Sat, 5 Feb 2022 05:16:57 -0300 [thread overview]
Message-ID: <20220205081658.562208-1-leobras@redhat.com> (raw)
This patchset comes from a bug I found during qemu guest migration from a
host with newer CPU to a host with an older version of this CPU, and thus
having less FPU features.
When the guests were created, the one with less features is used as
config, so migration is possible.
Patch 1 fix a bug that always happens during this migration, and is
related to the fact that xsave saves all feature flags, but xrstor does
not touch the PKRU flag.
Patch 2 comes from a concearn I have of the same bug as above hapenning
through different means, such as a future bug in qemu, and rendering
a lot of VMs unmigratable. Also, I think it makes sense to limit the
fatures to what the vcpu supports, as if it were baremetal it would crash.
Please let me know of anything to improve!
Best regards,
Leo
Leonardo Bras (2):
x86/kvm/fpu: Mask guest fpstate->xfeatures with guest_supported_xcr0
x86/kvm/fpu: Limit setting guest fpu features based on
guest_supported_xcr0
arch/x86/kvm/cpuid.c | 3 +++
arch/x86/kvm/x86.c | 3 ++-
2 files changed, 5 insertions(+), 1 deletion(-)
--
2.35.1
next reply other threads:[~2022-02-05 8:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-05 8:16 Leonardo Bras [this message]
2022-02-05 8:16 ` [PATCH v1 1/2] x86/kvm/fpu: Mask guest fpstate->xfeatures with guest_supported_xcr0 Leonardo Bras
2022-02-07 13:30 ` Paolo Bonzini
2022-02-07 20:24 ` Leonardo Bras Soares Passos
2022-02-07 21:00 ` Paolo Bonzini
2022-02-07 22:45 ` Leonardo Bras Soares Passos
2022-02-07 22:59 ` Paolo Bonzini
2022-02-08 2:14 ` Leonardo Bras Soares Passos
2022-02-05 8:16 ` [PATCH v1 2/2] x86/kvm/fpu: Limit setting guest fpu features based on guest_supported_xcr0 Leonardo Bras
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=20220205081658.562208-1-leobras@redhat.com \
--to=leobras@redhat.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=tglx@linutronix.de \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.com \
--cc=x86@kernel.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®