From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Boris Ostrovsky <boris.ostrovsky@oracle.com>, jbeulich@suse.com
Cc: dietmar.hahn@ts.fujitsu.com, xen-devel@lists.xen.org
Subject: Re: [PATCH] x86: Allow PV guest set X86_CR4_PCE flag
Date: Mon, 10 Aug 2015 15:37:37 +0100 [thread overview]
Message-ID: <55C8B731.2020301@citrix.com> (raw)
In-Reply-To: <1439216842-9651-1-git-send-email-boris.ostrovsky@oracle.com>
On 10/08/15 15:27, Boris Ostrovsky wrote:
> With added PV support for VPMU, guests may legitimately decide to set
> CR4's PCE flag. We should allow this when VPMU is enabled.
>
> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Why? Even a PV guest using VPMU should know that it doesn't actually
control CR4.PCE
All this (appears to) end up doing is putting PCE into the "allow but
ignore" mask.
How about this (not even compile tested) which is a rather shorter way
of doing the same thing:
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 045f6ff..834ce0f 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -721,10 +721,12 @@ static int __init init_pv_cr4_masks(void)
unsigned long common_mask = ~X86_CR4_TSD;
/*
- * All PV guests may attempt to modify TSD, DE and OSXSAVE.
+ * All PV guests may attempt to modify TSD, DE, PCE and OSXSAVE.
*/
if ( cpu_has_de )
common_mask &= ~X86_CR4_DE;
+ if ( cpu_has_pce )
+ common_mask &= ~X86_CR4_PCE;
if ( cpu_has_xsave )
common_mask &= ~X86_CR4_OSXSAVE;
~Andrew
next prev parent reply other threads:[~2015-08-10 14:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-10 14:27 [PATCH] x86: Allow PV guest set X86_CR4_PCE flag Boris Ostrovsky
2015-08-10 14:37 ` Andrew Cooper [this message]
2015-08-10 14:49 ` Boris Ostrovsky
2015-08-10 15:02 ` Andrew Cooper
2015-08-10 15:11 ` Boris Ostrovsky
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=55C8B731.2020301@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=dietmar.hahn@ts.fujitsu.com \
--cc=jbeulich@suse.com \
--cc=xen-devel@lists.xen.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 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.