ia64/xen-unstable

changeset 2425:417427e14fbb

bitkeeper revision 1.1159.69.7 (41394659gzch_AlptZgctoWrGnWAGw)

Fix WBINVD by adding a new hypercall.
Various drivers still use wbinvd directly rather than using the
helper macro in system.h. They should be fixed by sending patches
to the appropriate maintainers (e.g., DRM, AGP, ...).
author kaf24@scramble.cl.cam.ac.uk
date Sat Sep 04 04:36:41 2004 +0000 (2004-09-04)
parents a0d6f6965951
children 0811d135075f
files linux-2.6.8.1-xen-sparse/include/asm-xen/asm-i386/system.h xen/arch/x86/memory.c xen/include/hypervisor-ifs/dom0_ops.h xen/include/hypervisor-ifs/hypervisor-if.h
line diff
     1.1 --- a/linux-2.6.8.1-xen-sparse/include/asm-xen/asm-i386/system.h	Fri Sep 03 22:26:21 2004 +0000
     1.2 +++ b/linux-2.6.8.1-xen-sparse/include/asm-xen/asm-i386/system.h	Sat Sep 04 04:36:41 2004 +0000
     1.3 @@ -122,9 +122,13 @@ static inline unsigned long _get_base(ch
     1.4  
     1.5  #endif	/* __KERNEL__ */
     1.6  
     1.7 -#define wbinvd() \
     1.8 -	BUG();
     1.9 -//	__asm__ __volatile__ ("wbinvd": : :"memory");
    1.10 +static inline void wbinvd(void)
    1.11 +{
    1.12 +    mmu_update_t u;
    1.13 +    u.ptr = MMU_EXTENDED_COMMAND;
    1.14 +    u.val = MMUEXT_FLUSH_CACHE;
    1.15 +    (void)HYPERVISOR_mmu_update(&u, 1, NULL);
    1.16 +}
    1.17  
    1.18  static inline unsigned long get_limit(unsigned long segment)
    1.19  {
     2.1 --- a/xen/arch/x86/memory.c	Fri Sep 03 22:26:21 2004 +0000
     2.2 +++ b/xen/arch/x86/memory.c	Sat Sep 04 04:36:41 2004 +0000
     2.3 @@ -905,6 +905,18 @@ static int do_extended_command(unsigned 
     2.4          __flush_tlb_one(ptr);
     2.5          break;
     2.6  
     2.7 +    case MMUEXT_FLUSH_CACHE:
     2.8 +        if ( unlikely(!IS_CAPABLE_PHYSDEV(d)) )
     2.9 +        {
    2.10 +            MEM_LOG("Non-physdev domain tried to FLUSH_CACHE.\n");
    2.11 +            okay = 0;
    2.12 +        }
    2.13 +        else
    2.14 +        {
    2.15 +            wbinvd();
    2.16 +        }
    2.17 +        break;
    2.18 +
    2.19      case MMUEXT_SET_LDT:
    2.20      {
    2.21          unsigned long ents = val >> MMUEXT_CMD_SHIFT;
     3.1 --- a/xen/include/hypervisor-ifs/dom0_ops.h	Fri Sep 03 22:26:21 2004 +0000
     3.2 +++ b/xen/include/hypervisor-ifs/dom0_ops.h	Sat Sep 04 04:36:41 2004 +0000
     3.3 @@ -19,7 +19,7 @@
     3.4   * This makes sure that old versions of dom0 tools will stop working in a
     3.5   * well-defined way (rather than crashing the machine, for instance).
     3.6   */
     3.7 -#define DOM0_INTERFACE_VERSION   0xAAAA0012
     3.8 +#define DOM0_INTERFACE_VERSION   0xAAAA0013
     3.9  
    3.10  #define MAX_DOMAIN_NAME    16
    3.11  
     4.1 --- a/xen/include/hypervisor-ifs/hypervisor-if.h	Fri Sep 03 22:26:21 2004 +0000
     4.2 +++ b/xen/include/hypervisor-ifs/hypervisor-if.h	Sat Sep 04 04:36:41 2004 +0000
     4.3 @@ -117,6 +117,9 @@
     4.4   *   val[7:0] == MMUEXT_INVLPG:
     4.5   *   ptr[:2]  -- Linear address to be flushed from the TLB.
     4.6   * 
     4.7 + *   val[7:0] == MMUEXT_FLUSH_CACHE:
     4.8 + *   No additional arguments. Writes back and flushes cache contents.
     4.9 + * 
    4.10   *   val[7:0] == MMUEXT_SET_LDT:
    4.11   *   ptr[:2]  -- Linear address of LDT base (NB. must be page-aligned).
    4.12   *   val[:8]  -- Number of entries in LDT.
    4.13 @@ -143,15 +146,16 @@
    4.14  #define MMU_MACHPHYS_UPDATE      2 /* ptr = MA of frame to modify entry for  */
    4.15  #define MMU_EXTENDED_COMMAND     3 /* least 8 bits of val demux further      */
    4.16  #define MMUEXT_PIN_TABLE         0 /* ptr = MA of frame to pin               */
    4.17 -#define MMUEXT_UNPIN_TABLE       4 /* ptr = MA of frame to unpin             */
    4.18 -#define MMUEXT_NEW_BASEPTR       5 /* ptr = MA of new pagetable base         */
    4.19 -#define MMUEXT_TLB_FLUSH         6 /* ptr = NULL                             */
    4.20 -#define MMUEXT_INVLPG            7 /* ptr = VA to invalidate                 */
    4.21 -#define MMUEXT_SET_LDT           8 /* ptr = VA of table; val = # entries     */
    4.22 +#define MMUEXT_UNPIN_TABLE       1 /* ptr = MA of frame to unpin             */
    4.23 +#define MMUEXT_NEW_BASEPTR       2 /* ptr = MA of new pagetable base         */
    4.24 +#define MMUEXT_TLB_FLUSH         3 /* ptr = NULL                             */
    4.25 +#define MMUEXT_INVLPG            4 /* ptr = VA to invalidate                 */
    4.26 +#define MMUEXT_FLUSH_CACHE       5
    4.27 +#define MMUEXT_SET_LDT           6 /* ptr = VA of table; val = # entries     */
    4.28 +#define MMUEXT_SET_FOREIGNDOM    7 /* val[31:16] = dom                       */
    4.29 +#define MMUEXT_CLEAR_FOREIGNDOM  8
    4.30  #define MMUEXT_TRANSFER_PAGE     9 /* ptr = MA of frame; val[31:16] = dom    */
    4.31 -#define MMUEXT_SET_FOREIGNDOM   10 /* val[31:16] = dom                       */
    4.32 -#define MMUEXT_CLEAR_FOREIGNDOM 11
    4.33 -#define MMUEXT_REASSIGN_PAGE    12
    4.34 +#define MMUEXT_REASSIGN_PAGE    10
    4.35  #define MMUEXT_CMD_MASK        255
    4.36  #define MMUEXT_CMD_SHIFT         8
    4.37