ia64/xen-unstable

changeset 9464:2604abf98ede

Remove special handling of {set,clear}_in_cr4().

Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Tue Mar 28 10:09:44 2006 +0100 (2006-03-28)
parents 47dda4fa5d11
children c745e47d8154 8d59ff95046b
files linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/processor.h linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/processor.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/processor.h	Tue Mar 28 10:01:35 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/processor.h	Tue Mar 28 10:09:44 2006 +0100
     1.3 @@ -237,20 +237,11 @@ extern unsigned long mmu_cr4_features;
     1.4  
     1.5  static inline void set_in_cr4 (unsigned long mask)
     1.6  {
     1.7 +	unsigned cr4;
     1.8  	mmu_cr4_features |= mask;
     1.9 -	switch (mask) {
    1.10 -	case X86_CR4_OSFXSR:
    1.11 -	case X86_CR4_OSXMMEXCPT:
    1.12 -		break;
    1.13 -	default:
    1.14 -		do {
    1.15 -			const char *msg = "Xen unsupported cr4 update\n";
    1.16 -			(void)HYPERVISOR_console_io(
    1.17 -				CONSOLEIO_write, __builtin_strlen(msg),
    1.18 -				(char *)msg);
    1.19 -			BUG();
    1.20 -		} while (0);
    1.21 -	}
    1.22 +	cr4 = read_cr4();
    1.23 +	cr4 |= mask;
    1.24 +	write_cr4(cr4);
    1.25  }
    1.26  
    1.27  static inline void clear_in_cr4 (unsigned long mask)
     2.1 --- a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/processor.h	Tue Mar 28 10:01:35 2006 +0100
     2.2 +++ b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/processor.h	Tue Mar 28 10:09:44 2006 +0100
     2.3 @@ -141,31 +141,21 @@ extern unsigned long mmu_cr4_features;
     2.4  static inline void set_in_cr4 (unsigned long mask)
     2.5  {
     2.6  	mmu_cr4_features |= mask;
     2.7 -	switch (mask) {
     2.8 -	case X86_CR4_OSFXSR:
     2.9 -	case X86_CR4_OSXMMEXCPT:
    2.10 -		break;
    2.11 -	default:
    2.12 -		do {
    2.13 -			const char *msg = "Xen unsupported cr4 update\n";
    2.14 -			(void)HYPERVISOR_console_io(
    2.15 -				CONSOLEIO_write, __builtin_strlen(msg),
    2.16 -				(char *)msg);
    2.17 -			BUG();
    2.18 -		} while (0);
    2.19 -	}
    2.20 +	__asm__("movq %%cr4,%%rax\n\t"
    2.21 +		"orq %0,%%rax\n\t"
    2.22 +		"movq %%rax,%%cr4\n"
    2.23 +		: : "irg" (mask)
    2.24 +		:"ax");
    2.25  }
    2.26  
    2.27  static inline void clear_in_cr4 (unsigned long mask)
    2.28  {
    2.29 -#ifndef CONFIG_XEN
    2.30  	mmu_cr4_features &= ~mask;
    2.31  	__asm__("movq %%cr4,%%rax\n\t"
    2.32  		"andq %0,%%rax\n\t"
    2.33  		"movq %%rax,%%cr4\n"
    2.34  		: : "irg" (~mask)
    2.35  		:"ax");
    2.36 -#endif
    2.37  }
    2.38  
    2.39