ia64/xen-unstable

changeset 7228:89b1b67fc2c4

Emulate guest reads of CR4, masking features that Xen
does not export to guests.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Oct 05 16:54:09 2005 +0100 (2005-10-05)
parents 438f1b53682b
children a37a4abc1191
files xen/arch/x86/traps.c
line diff
     1.1 --- a/xen/arch/x86/traps.c	Wed Oct 05 16:32:07 2005 +0100
     1.2 +++ b/xen/arch/x86/traps.c	Wed Oct 05 16:54:09 2005 +0100
     1.3 @@ -895,6 +895,14 @@ static int emulate_privileged_op(struct 
     1.4              *reg = pagetable_get_paddr(v->arch.guest_table);
     1.5              break;
     1.6  
     1.7 +        case 4: /* Read CR4 */
     1.8 +            /*
     1.9 +             * Guests can read CR4 to see what features Xen has enabled. We
    1.10 +             * therefore lie about PGE & PSE as they are unavailable to guests.
    1.11 +             */
    1.12 +            *reg = read_cr4() & ~(X86_CR4_PGE|X86_CR4_PSE);
    1.13 +            break;
    1.14 +
    1.15          default:
    1.16              goto fail;
    1.17          }