From: "Daniel P. Berrangé" <berrange@redhat.com>
To: "Richard W.M. Jones" <rjones@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Lara Lazier <laramglazier@gmail.com>,
qemu-devel@nongnu.org
Subject: Re: [PULL 08/15] target/i386: Added consistency checks for CR4
Date: Tue, 31 Aug 2021 18:35:05 +0100 [thread overview]
Message-ID: <YS5oSeJFw6p4gLgZ@redhat.com> (raw)
In-Reply-To: <20210831170304.GA24819@redhat.com>
On Tue, Aug 31, 2021 at 06:03:04PM +0100, Richard W.M. Jones wrote:
> On Thu, Jul 22, 2021 at 05:36:05PM +0200, Paolo Bonzini wrote:
> > From: Lara Lazier <laramglazier@gmail.com>
> >
> > All MBZ bits in CR4 must be zero. (APM2 15.5)
> > Added reserved bitmask and added checks in both
> > helper_vmrun and helper_write_crN.
> >
> > Signed-off-by: Lara Lazier <laramglazier@gmail.com>
> > Message-Id: <20210721152651.14683-2-laramglazier@gmail.com>
> > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>
> FYI this commit causes a regression with -cpu max (regression analyzed
> by Daniel Berrange). See:
>
> https://bugzilla.redhat.com/show_bug.cgi?id=1999700
>
> Rich.
>
> > target/i386/cpu.h | 39 ++++++++++++++++++++++++++++
> > target/i386/tcg/sysemu/misc_helper.c | 3 +++
> > target/i386/tcg/sysemu/svm_helper.c | 9 ++++---
> > 3 files changed, 48 insertions(+), 3 deletions(-)
> >
> > diff --git a/target/i386/cpu.h b/target/i386/cpu.h
> > index 5d98a4e7c0..1f7e8d7f0a 100644
> > --- a/target/i386/cpu.h
> > +++ b/target/i386/cpu.h
> > @@ -240,6 +240,7 @@ typedef enum X86Seg {
> > #define CR4_OSFXSR_SHIFT 9
> > #define CR4_OSFXSR_MASK (1U << CR4_OSFXSR_SHIFT)
> > #define CR4_OSXMMEXCPT_MASK (1U << 10)
> > +#define CR4_UMIP_MASK (1U << 11)
> > #define CR4_LA57_MASK (1U << 12)
> > #define CR4_VMXE_MASK (1U << 13)
> > #define CR4_SMXE_MASK (1U << 14)
> > @@ -251,6 +252,14 @@ typedef enum X86Seg {
> > #define CR4_PKE_MASK (1U << 22)
> > #define CR4_PKS_MASK (1U << 24)
> >
> > +#define CR4_RESERVED_MASK \
> > +(~(target_ulong)(CR4_VME_MASK | CR4_PVI_MASK | CR4_TSD_MASK \
> > + | CR4_DE_MASK | CR4_PSE_MASK | CR4_PAE_MASK \
> > + | CR4_MCE_MASK | CR4_PGE_MASK | CR4_PCE_MASK \
> > + | CR4_OSFXSR_MASK | CR4_OSXMMEXCPT_MASK |CR4_UMIP_MASK \
> > + | CR4_FSGSBASE_MASK | CR4_PCIDE_MASK | CR4_OSXSAVE_MASK \
> > + | CR4_SMEP_MASK | CR4_SMAP_MASK | CR4_PKE_MASK | CR4_PKS_MASK))
> > +
This is missing CR4_LA57_MASK, and adding that makes Fedora kernels
boot again.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2021-08-31 17:36 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-22 15:35 [PULL 00/15] Misc bugfix patches for 2021-07-22 Paolo Bonzini
2021-07-22 15:35 ` [PULL 01/15] qemu-config: never call the callback after an error, fix leak Paolo Bonzini
2021-07-22 15:35 ` [PULL 02/15] qemu-config: fix memory leak on ferror() Paolo Bonzini
2021-07-22 15:36 ` [PULL 03/15] vl: Parse legacy default_machine_opts Paolo Bonzini
2021-07-22 15:36 ` [PULL 04/15] chardev-spice: add missing module_obj directive Paolo Bonzini
2021-07-22 17:41 ` Philippe Mathieu-Daudé
2021-07-22 15:36 ` [PULL 05/15] usb: fix usb-host dependency check Paolo Bonzini
2021-07-22 15:36 ` [PULL 06/15] qemu-config: restore "machine" in qmp_query_command_line_options() Paolo Bonzini
2021-07-22 15:36 ` [PULL 07/15] target/i386: Added V_INTR_PRIO check to virtual interrupts Paolo Bonzini
2021-07-22 15:36 ` [PULL 08/15] target/i386: Added consistency checks for CR4 Paolo Bonzini
2021-08-31 17:03 ` Richard W.M. Jones
2021-08-31 17:12 ` Daniel P. Berrangé
2021-08-31 17:35 ` Daniel P. Berrangé [this message]
2021-07-22 15:36 ` [PULL 09/15] target/i386: Added consistency checks for EFER Paolo Bonzini
2021-07-22 15:36 ` [PULL 10/15] configure: Drop obsolete check for the alloc_size attribute Paolo Bonzini
2021-07-22 15:36 ` [PULL 11/15] meson: fix dependencies for modinfo Paolo Bonzini
2021-07-22 15:36 ` [PULL 12/15] configure: Fix --without-default-features propagation to meson Paolo Bonzini
2021-07-22 15:36 ` [PULL 13/15] configure: Allow vnc to get disabled with --without-default-features Paolo Bonzini
2021-07-22 15:36 ` [PULL 14/15] configure: Fix the default setting of the "xen" feature Paolo Bonzini
2021-07-22 15:36 ` [PULL 15/15] configure: Let --without-default-features disable vhost-kernel and vhost-vdpa Paolo Bonzini
2021-07-23 10:15 ` [PULL 00/15] Misc bugfix patches for 2021-07-22 Peter Maydell
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=YS5oSeJFw6p4gLgZ@redhat.com \
--to=berrange@redhat.com \
--cc=laramglazier@gmail.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rjones@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).