All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave McCracken <dcm@mccr.org>
To: Xen Developers List <xen-devel@lists.xensource.com>,
	Keir Fraser <Keir.Fraser@eu.citrix.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Subject: [PATCH xen-unstable] Remove PSE flag from guest CR4
Date: Mon, 14 Sep 2009 12:27:16 -0500	[thread overview]
Message-ID: <200909141227.16852.dcm@mccr.org> (raw)

[-- Attachment #1: Type: Text/Plain, Size: 280 bytes --]


When I originally did the Xen hypervisor hugepage patch I also allowed guests 
to see the PSE flag in CR4.  This has proven to be a mistake.  Here is a patch 
to remove that functionality.

All Linux kernels will still allow userspace hugepages without the flag.

Dave McCracken

[-- Attachment #2: xen-hpage-090914-1.patch --]
[-- Type: text/x-patch, Size: 1204 bytes --]

--- xen-unstable/./xen/arch/x86/traps.c	2009-09-14 12:15:46.000000000 -0500
+++ xen-hpage/./xen/arch/x86/traps.c	2009-09-14 12:18:42.000000000 -0500
@@ -752,8 +752,7 @@ static void pv_cpuid(struct cpu_user_reg
         __clear_bit(X86_FEATURE_VME, &d);
         if ( !cpu_has_apic )
             __clear_bit(X86_FEATURE_APIC, &d);
-        if ( !opt_allow_hugepage )
-            __clear_bit(X86_FEATURE_PSE, &d);
+        __clear_bit(X86_FEATURE_PSE, &d);
         __clear_bit(X86_FEATURE_PGE, &d);
         __clear_bit(X86_FEATURE_PSE36, &d);
     }
@@ -2064,12 +2063,9 @@ static int emulate_privileged_op(struct 
         case 4: /* Read CR4 */
             /*
              * Guests can read CR4 to see what features Xen has enabled. We
-             * therefore lie about PGE as it is unavailable to guests.
-             * Also disallow PSE if hugepages are not enabled.
+             * therefore lie about PGE and PSE as they are unavailable to guests.
              */
-            *reg = read_cr4() & ~X86_CR4_PGE;
-            if ( !opt_allow_hugepage )
-                *reg &= ~X86_CR4_PSE;
+            *reg = read_cr4() & ~(X86_CR4_PGE|X86_CR4_PSE);
             break;
 
         default:

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

             reply	other threads:[~2009-09-14 17:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-14 17:27 Dave McCracken [this message]
2009-09-14 17:42 ` [PATCH xen-unstable] Remove PSE flag from guest CR4 Keir Fraser
2009-09-14 17:53   ` Dave McCracken
2009-09-14 19:07     ` Jeremy Fitzhardinge
2009-09-14 19:47       ` Dave McCracken

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=200909141227.16852.dcm@mccr.org \
    --to=dcm@mccr.org \
    --cc=Keir.Fraser@eu.citrix.com \
    --cc=jeremy@goop.org \
    --cc=xen-devel@lists.xensource.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.