ia64/xen-unstable

changeset 4381:85103482f510

bitkeeper revision 1.1236.1.160 (424a861f1fQwwCOgZWaGK3g0CTOOkw)

Tidy up vm_assist handling.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Mar 30 10:57:35 2005 +0000 (2005-03-30)
parents d1595511060c
children 98982c364df7
files linux-2.4.29-xen-sparse/arch/xen/kernel/head.S linux-2.4.29-xen-sparse/arch/xen/kernel/setup.c linux-2.6.11-xen-sparse/arch/xen/i386/kernel/head.S linux-2.6.11-xen-sparse/arch/xen/i386/kernel/setup.c linux-2.6.11-xen-sparse/arch/xen/kernel/fixup.c linux-2.6.11-xen-sparse/arch/xen/kernel/reboot.c tools/libxc/xc_linux_build.c tools/libxc/xc_vmx_build.c xen/arch/x86/dom0_ops.c xen/arch/x86/domain.c xen/arch/x86/domain_build.c xen/common/domain.c xen/common/elf.c xen/common/kernel.c xen/include/asm-ia64/config.h xen/include/asm-x86/mm.h xen/include/public/arch-x86_32.h xen/include/public/arch-x86_64.h xen/include/xen/sched.h
line diff
     1.1 --- a/linux-2.4.29-xen-sparse/arch/xen/kernel/head.S	Wed Mar 30 10:00:28 2005 +0000
     1.2 +++ b/linux-2.4.29-xen-sparse/arch/xen/kernel/head.S	Wed Mar 30 10:57:35 2005 +0000
     1.3 @@ -2,7 +2,6 @@
     1.4  .section __xen_guest
     1.5      .ascii "GUEST_OS=linux,GUEST_VER=2.4,XEN_VER=3.0,VIRT_BASE=0xC0000000"
     1.6      .ascii ",LOADER=generic"
     1.7 -    .ascii ",PT_MODE_WRITABLE"
     1.8      .byte  0
     1.9  
    1.10  .text
     2.1 --- a/linux-2.4.29-xen-sparse/arch/xen/kernel/setup.c	Wed Mar 30 10:00:28 2005 +0000
     2.2 +++ b/linux-2.4.29-xen-sparse/arch/xen/kernel/setup.c	Wed Mar 30 10:57:35 2005 +0000
     2.3 @@ -228,8 +228,10 @@ void __init setup_arch(char **cmdline_p)
     2.4      blk_nohighio = 1;
     2.5  #endif
     2.6  
     2.7 -    HYPERVISOR_vm_assist(VMASST_CMD_enable,
     2.8 -                         VMASST_TYPE_4gb_segments);
     2.9 +    HYPERVISOR_vm_assist(
    2.10 +        VMASST_CMD_enable, VMASST_TYPE_4gb_segments);
    2.11 +    HYPERVISOR_vm_assist(
    2.12 +        VMASST_CMD_enable, VMASST_TYPE_writable_pagetables);
    2.13          
    2.14      HYPERVISOR_set_callbacks(
    2.15          __KERNEL_CS, (unsigned long)hypervisor_callback,
     3.1 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/head.S	Wed Mar 30 10:00:28 2005 +0000
     3.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/head.S	Wed Mar 30 10:57:35 2005 +0000
     3.3 @@ -4,7 +4,6 @@
     3.4  .section __xen_guest
     3.5  	.ascii	"GUEST_OS=linux,GUEST_VER=2.6,XEN_VER=3.0,VIRT_BASE=0xC0000000"
     3.6  	.ascii	",LOADER=generic"
     3.7 -	.ascii	",PT_MODE_WRITABLE"
     3.8  	.byte	0
     3.9  
    3.10  .text
     4.1 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/setup.c	Wed Mar 30 10:00:28 2005 +0000
     4.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/setup.c	Wed Mar 30 10:57:35 2005 +0000
     4.3 @@ -1409,8 +1409,10 @@ void __init setup_arch(char **cmdline_p)
     4.4  	/* Register a call for panic conditions. */
     4.5  	notifier_chain_register(&panic_notifier_list, &xen_panic_block);
     4.6  
     4.7 -	HYPERVISOR_vm_assist(VMASST_CMD_enable,
     4.8 -			     VMASST_TYPE_4gb_segments);
     4.9 +	HYPERVISOR_vm_assist(
    4.10 +		VMASST_CMD_enable, VMASST_TYPE_4gb_segments);
    4.11 +	HYPERVISOR_vm_assist(
    4.12 +		VMASST_CMD_enable, VMASST_TYPE_writable_pagetables);
    4.13  
    4.14  	memcpy(&boot_cpu_data, &new_cpu_data, sizeof(new_cpu_data));
    4.15  	early_cpu_init();
     5.1 --- a/linux-2.6.11-xen-sparse/arch/xen/kernel/fixup.c	Wed Mar 30 10:00:28 2005 +0000
     5.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/kernel/fixup.c	Wed Mar 30 10:57:35 2005 +0000
     5.3 @@ -50,8 +50,8 @@
     5.4  
     5.5      if ( !test_and_set_bit(0, &printed) )
     5.6      {
     5.7 -        HYPERVISOR_vm_assist(VMASST_CMD_disable,
     5.8 -                             VMASST_TYPE_4gb_segments_notify);
     5.9 +        HYPERVISOR_vm_assist(
    5.10 +            VMASST_CMD_disable, VMASST_TYPE_4gb_segments_notify);
    5.11  
    5.12          DP("");
    5.13          DP("***************************************************************");
    5.14 @@ -79,8 +79,8 @@
    5.15  
    5.16  static int __init fixup_init(void)
    5.17  {
    5.18 -    HYPERVISOR_vm_assist(VMASST_CMD_enable,
    5.19 -                         VMASST_TYPE_4gb_segments_notify);
    5.20 +    HYPERVISOR_vm_assist(
    5.21 +        VMASST_CMD_enable, VMASST_TYPE_4gb_segments_notify);
    5.22      return 0;
    5.23  }
    5.24  __initcall(fixup_init);
     6.1 --- a/linux-2.6.11-xen-sparse/arch/xen/kernel/reboot.c	Wed Mar 30 10:00:28 2005 +0000
     6.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/kernel/reboot.c	Wed Mar 30 10:57:35 2005 +0000
     6.3 @@ -110,18 +110,15 @@ static void __do_suspend(void)
     6.4      HYPERVISOR_shared_info = (shared_info_t *)empty_zero_page;
     6.5      clear_fixmap(FIX_SHARED_INFO);
     6.6  
     6.7 -    memcpy(&suspend_record->resume_info, &xen_start_info, sizeof(xen_start_info));
     6.8 +    memcpy(&suspend_record->resume_info, &xen_start_info,
     6.9 +           sizeof(xen_start_info));
    6.10  
    6.11      HYPERVISOR_suspend(virt_to_machine(suspend_record) >> PAGE_SHIFT);
    6.12  
    6.13 -    HYPERVISOR_vm_assist(VMASST_CMD_enable,
    6.14 -			 VMASST_TYPE_4gb_segments);
    6.15 -    HYPERVISOR_vm_assist(VMASST_CMD_enable,
    6.16 -			 VMASST_TYPE_writable_pagetables);
    6.17 -
    6.18      shutting_down = -1; 
    6.19  
    6.20 -    memcpy(&xen_start_info, &suspend_record->resume_info, sizeof(xen_start_info));
    6.21 +    memcpy(&xen_start_info, &suspend_record->resume_info,
    6.22 +           sizeof(xen_start_info));
    6.23  
    6.24  #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
    6.25      set_fixmap_ma(FIX_SHARED_INFO, xen_start_info.shared_info);
     7.1 --- a/tools/libxc/xc_linux_build.c	Wed Mar 30 10:00:28 2005 +0000
     7.2 +++ b/tools/libxc/xc_linux_build.c	Wed Mar 30 10:57:35 2005 +0000
     7.3 @@ -22,7 +22,6 @@ struct domain_setup_info
     7.4      unsigned long v_kernend;
     7.5      unsigned long v_kernentry;
     7.6  
     7.7 -    unsigned int use_writable_pagetables;
     7.8      unsigned int load_bsd_symtab;
     7.9  
    7.10      unsigned long symtab_addr;
    7.11 @@ -88,10 +87,6 @@ static int setup_guest(int xc_handle,
    7.12      if ( rc != 0 )
    7.13          goto error_out;
    7.14  
    7.15 -    if (dsi.use_writable_pagetables)
    7.16 -        xc_domain_setvmassist(xc_handle, dom, VMASST_CMD_enable,
    7.17 -                              VMASST_TYPE_writable_pagetables);
    7.18 -
    7.19      if (dsi.load_bsd_symtab)
    7.20          loadelfsymtab(image, xc_handle, dom, NULL, &dsi);
    7.21  
    7.22 @@ -580,9 +575,6 @@ static int parseelfimage(char *elfbase,
    7.23      if ( (p = strstr(guestinfo, "VIRT_BASE=")) != NULL )
    7.24          dsi->v_start = strtoul(p+10, &p, 0);
    7.25  
    7.26 -    if ( (p = strstr(guestinfo, "PT_MODE_WRITABLE")) != NULL )
    7.27 -        dsi->use_writable_pagetables = 1;
    7.28 -
    7.29      if ( (p = strstr(guestinfo, "BSD_SYMTAB")) != NULL )
    7.30          dsi->load_bsd_symtab = 1;
    7.31  
     8.1 --- a/tools/libxc/xc_vmx_build.c	Wed Mar 30 10:00:28 2005 +0000
     8.2 +++ b/tools/libxc/xc_vmx_build.c	Wed Mar 30 10:57:35 2005 +0000
     8.3 @@ -27,7 +27,6 @@ struct domain_setup_info
     8.4      unsigned long v_kernend;
     8.5      unsigned long v_kernentry;
     8.6  
     8.7 -    unsigned int use_writable_pagetables;
     8.8      unsigned int load_bsd_symtab;
     8.9  
    8.10      unsigned long symtab_addr;
    8.11 @@ -198,10 +197,6 @@ static int setup_guest(int xc_handle,
    8.12      if ( rc != 0 )
    8.13          goto error_out;
    8.14  
    8.15 -    if (dsi.use_writable_pagetables)
    8.16 -        xc_domain_setvmassist(xc_handle, dom, VMASST_CMD_enable,
    8.17 -                              VMASST_TYPE_writable_pagetables);
    8.18 -
    8.19      if (dsi.load_bsd_symtab)
    8.20          loadelfsymtab(image, xc_handle, dom, NULL, &dsi);
    8.21  
    8.22 @@ -708,7 +703,6 @@ static int parseelfimage(char *elfbase,
    8.23      }
    8.24  
    8.25      dsi->v_start = 0x00000000;
    8.26 -    dsi->use_writable_pagetables = 0;
    8.27      dsi->load_bsd_symtab = 0;
    8.28  
    8.29      dsi->v_kernstart = kernstart - LINUX_PAGE_OFFSET;
     9.1 --- a/xen/arch/x86/dom0_ops.c	Wed Mar 30 10:00:28 2005 +0000
     9.2 +++ b/xen/arch/x86/dom0_ops.c	Wed Mar 30 10:57:35 2005 +0000
     9.3 @@ -435,8 +435,15 @@ void arch_getdomaininfo_ctxt(
     9.4      memcpy(c->debugreg, 
     9.5             ed->arch.debugreg, 
     9.6             sizeof(ed->arch.debugreg));
     9.7 +#if defined(__i386__)
     9.8      c->event_callback_cs     = ed->arch.event_selector;
     9.9      c->event_callback_eip    = ed->arch.event_address;
    9.10      c->failsafe_callback_cs  = ed->arch.failsafe_selector;
    9.11      c->failsafe_callback_eip = ed->arch.failsafe_address;
    9.12 +#elif defined(__x86_64__)
    9.13 +    c->event_callback_eip    = ed->arch.event_address;
    9.14 +    c->failsafe_callback_eip = ed->arch.failsafe_address;
    9.15 +    c->syscall_callback_eip  = ed->arch.syscall_address;
    9.16 +#endif
    9.17 +    c->vm_assist = ed->domain->vm_assist;
    9.18  }
    10.1 --- a/xen/arch/x86/domain.c	Wed Mar 30 10:00:28 2005 +0000
    10.2 +++ b/xen/arch/x86/domain.c	Wed Mar 30 10:57:35 2005 +0000
    10.3 @@ -494,10 +494,19 @@ int arch_set_info_guest(
    10.4      for ( i = 0; i < 8; i++ )
    10.5          (void)set_debugreg(ed, i, c->debugreg[i]);
    10.6  
    10.7 +#if defined(__i386__)
    10.8      ed->arch.event_selector    = c->event_callback_cs;
    10.9      ed->arch.event_address     = c->event_callback_eip;
   10.10      ed->arch.failsafe_selector = c->failsafe_callback_cs;
   10.11      ed->arch.failsafe_address  = c->failsafe_callback_eip;
   10.12 +#elif defined(__x86_64__)
   10.13 +    ed->arch.event_address     = c->event_callback_eip;
   10.14 +    ed->arch.failsafe_address  = c->failsafe_callback_eip;
   10.15 +    ed->arch.syscall_address   = c->syscall_callback_eip;
   10.16 +#endif
   10.17 +
   10.18 +    if ( ed->eid == 0 )
   10.19 +        d->vm_assist = c->vm_assist;
   10.20  
   10.21      phys_basetab = c->pt_base;
   10.22      ed->arch.guest_table = ed->arch.phys_table = mk_pagetable(phys_basetab);
    11.1 --- a/xen/arch/x86/domain_build.c	Wed Mar 30 10:00:28 2005 +0000
    11.2 +++ b/xen/arch/x86/domain_build.c	Wed Mar 30 10:57:35 2005 +0000
    11.3 @@ -129,10 +129,6 @@ int construct_dom0(struct domain *d,
    11.4      if ( rc != 0 )
    11.5          return rc;
    11.6  
    11.7 -    /* Set up domain options */
    11.8 -    if ( dsi.use_writable_pagetables )
    11.9 -        vm_assist(d, VMASST_CMD_enable, VMASST_TYPE_writable_pagetables);
   11.10 -
   11.11      /* Align load address to 4MB boundary. */
   11.12      dsi.v_start &= ~((1UL<<22)-1);
   11.13  
    12.1 --- a/xen/common/domain.c	Wed Mar 30 10:00:28 2005 +0000
    12.2 +++ b/xen/common/domain.c	Wed Mar 30 10:57:35 2005 +0000
    12.3 @@ -358,13 +358,9 @@ long vm_assist(struct domain *p, unsigne
    12.4      {
    12.5      case VMASST_CMD_enable:
    12.6          set_bit(type, &p->vm_assist);
    12.7 -        if (vm_assist_info[type].enable)
    12.8 -            (*vm_assist_info[type].enable)(p);
    12.9          return 0;
   12.10      case VMASST_CMD_disable:
   12.11          clear_bit(type, &p->vm_assist);
   12.12 -        if (vm_assist_info[type].disable)
   12.13 -            (*vm_assist_info[type].disable)(p);
   12.14          return 0;
   12.15      }
   12.16  
    13.1 --- a/xen/common/elf.c	Wed Mar 30 10:00:28 2005 +0000
    13.2 +++ b/xen/common/elf.c	Wed Mar 30 10:57:35 2005 +0000
    13.3 @@ -118,9 +118,6 @@ int parseelfimage(char *elfbase,
    13.4      {
    13.5          if ( (p = strstr(guestinfo, "VIRT_BASE=")) != NULL )
    13.6              dsi->v_start = simple_strtoul(p+10, &p, 0);
    13.7 -        
    13.8 -        if ( (p = strstr(guestinfo, "PT_MODE_WRITABLE")) != NULL )
    13.9 -            dsi->use_writable_pagetables = 1;
   13.10      }
   13.11  
   13.12      dsi->v_kernstart = kernstart;
    14.1 --- a/xen/common/kernel.c	Wed Mar 30 10:00:28 2005 +0000
    14.2 +++ b/xen/common/kernel.c	Wed Mar 30 10:57:35 2005 +0000
    14.3 @@ -75,7 +75,6 @@ long do_xen_version(int cmd)
    14.4      return (XEN_VERSION<<16) | (XEN_SUBVERSION);
    14.5  }
    14.6  
    14.7 -vm_assist_info_t vm_assist_info[MAX_VMASST_TYPE + 1];
    14.8  long do_vm_assist(unsigned int cmd, unsigned int type)
    14.9  {
   14.10      return vm_assist(current->domain, cmd, type);
    15.1 --- a/xen/include/asm-ia64/config.h	Wed Mar 30 10:00:28 2005 +0000
    15.2 +++ b/xen/include/asm-ia64/config.h	Wed Mar 30 10:57:35 2005 +0000
    15.3 @@ -51,13 +51,6 @@ extern unsigned long xenheap_size;
    15.4  // from linux/include/linux/mm.h
    15.5  extern struct page *mem_map;
    15.6  
    15.7 -// defined in include/asm-x86/mm.h, not really used for ia64
    15.8 -typedef struct {
    15.9 -    void	(*enable)(struct domain *p);
   15.10 -    void	(*disable)(struct domain *p);
   15.11 -} vm_assist_info_t;
   15.12 -extern vm_assist_info_t vm_assist_info[];
   15.13 -
   15.14  // xen/include/asm/config.h
   15.15  extern char _end[]; /* standard ELF symbol */
   15.16  
    16.1 --- a/xen/include/asm-x86/mm.h	Wed Mar 30 10:00:28 2005 +0000
    16.2 +++ b/xen/include/asm-x86/mm.h	Wed Mar 30 10:57:35 2005 +0000
    16.3 @@ -246,14 +246,6 @@ void memguard_unguard_range(void *p, uns
    16.4  #define memguard_unguard_range(_p,_l)  ((void)0)
    16.5  #endif
    16.6  
    16.7 -
    16.8 -typedef struct {
    16.9 -    void	(*enable)(struct domain *);
   16.10 -    void	(*disable)(struct domain *);
   16.11 -} vm_assist_info_t;
   16.12 -extern vm_assist_info_t vm_assist_info[];
   16.13 -
   16.14 -
   16.15  /* Writable Pagetables */
   16.16  typedef struct {
   16.17      /* Linear address where the guest is updating the p.t. page. */
    17.1 --- a/xen/include/public/arch-x86_32.h	Wed Mar 30 10:00:28 2005 +0000
    17.2 +++ b/xen/include/public/arch-x86_32.h	Wed Mar 30 10:57:35 2005 +0000
    17.3 @@ -140,6 +140,7 @@ typedef struct {
    17.4      unsigned long event_callback_eip;
    17.5      unsigned long failsafe_callback_cs;     /* CS:EIP of failsafe callback  */
    17.6      unsigned long failsafe_callback_eip;
    17.7 +    unsigned long vm_assist;                /* VMASST_TYPE_* bitmap */
    17.8  } PACKED full_execution_context_t;
    17.9  
   17.10  typedef struct {
    18.1 --- a/xen/include/public/arch-x86_64.h	Wed Mar 30 10:00:28 2005 +0000
    18.2 +++ b/xen/include/public/arch-x86_64.h	Wed Mar 30 10:57:35 2005 +0000
    18.3 @@ -190,10 +190,10 @@ typedef struct {
    18.4      unsigned long kernel_ss, kernel_esp;  /* Virtual TSS (only SS1/ESP1)  */
    18.5      unsigned long pt_base;                  /* CR3 (pagetable base)         */
    18.6      unsigned long debugreg[8];              /* DB0-DB7 (debug registers)    */
    18.7 -    unsigned long event_callback_cs;        /* CS:EIP of event callback     */
    18.8      unsigned long event_callback_eip;
    18.9 -    unsigned long failsafe_callback_cs;     /* CS:EIP of failsafe callback  */
   18.10      unsigned long failsafe_callback_eip;
   18.11 +    unsigned long syscall_callback_eip;
   18.12 +    unsigned long vm_assist;                /* VMASST_TYPE_* bitmap */
   18.13  } PACKED full_execution_context_t;
   18.14  
   18.15  typedef struct {
    19.1 --- a/xen/include/xen/sched.h	Wed Mar 30 10:00:28 2005 +0000
    19.2 +++ b/xen/include/xen/sched.h	Wed Mar 30 10:57:35 2005 +0000
    19.3 @@ -155,8 +155,6 @@ struct domain_setup_info
    19.4      unsigned long v_kernstart;
    19.5      unsigned long v_kernend;
    19.6      unsigned long v_kernentry;
    19.7 -
    19.8 -    unsigned int use_writable_pagetables;
    19.9  };
   19.10  
   19.11  #include <asm/uaccess.h> /* for KERNEL_DS */