ia64/xen-unstable

changeset 7104:193022cb9ccc

Merge.
author emellor@ewan
date Wed Sep 28 15:01:09 2005 +0100 (2005-09-28)
parents 89974610d558 eae0c4f0aafd
children 3eda5c985d67
files linux-2.6-xen-sparse/arch/xen/configs/xen_defconfig_x86_32 tools/firmware/vmxassist/gen.c tools/firmware/vmxassist/head.S tools/firmware/vmxassist/setup.c tools/firmware/vmxassist/vmxloader.c tools/ioemu/vl.c xen/arch/x86/shadow32.c xen/arch/x86/shadow_public.c xen/arch/x86/vmx_platform.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/configs/xen_defconfig_x86_32	Wed Sep 28 15:00:11 2005 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/configs/xen_defconfig_x86_32	Wed Sep 28 15:01:09 2005 +0100
     1.3 @@ -2684,7 +2684,7 @@ CONFIG_ACPI_SYSTEM=y
     1.4  #
     1.5  # File systems
     1.6  #
     1.7 -CONFIG_EXT2_FS=m
     1.8 +CONFIG_EXT2_FS=y
     1.9  CONFIG_EXT2_FS_XATTR=y
    1.10  CONFIG_EXT2_FS_POSIX_ACL=y
    1.11  CONFIG_EXT2_FS_SECURITY=y
    1.12 @@ -2913,7 +2913,7 @@ CONFIG_KEYS=y
    1.13  # CONFIG_KEYS_DEBUG_PROC_KEYS is not set
    1.14  CONFIG_SECURITY=y
    1.15  # CONFIG_SECURITY_NETWORK is not set
    1.16 -CONFIG_SECURITY_CAPABILITIES=m
    1.17 +CONFIG_SECURITY_CAPABILITIES=y
    1.18  CONFIG_SECURITY_ROOTPLUG=m
    1.19  CONFIG_SECURITY_SECLVL=m
    1.20  CONFIG_SECURITY_SELINUX=y
     2.1 --- a/tools/firmware/vmxassist/gen.c	Wed Sep 28 15:00:11 2005 +0100
     2.2 +++ b/tools/firmware/vmxassist/gen.c	Wed Sep 28 15:01:09 2005 +0100
     2.3 @@ -23,7 +23,7 @@
     2.4  #include <vm86.h>
     2.5  
     2.6  int
     2.7 -main()
     2.8 +main(void)
     2.9  {
    2.10  	printf("/* MACHINE GENERATED; DO NOT EDIT */\n");
    2.11  	printf("#define VMX_ASSIST_CTX_GS_SEL	0x%x\n",
     3.1 --- a/tools/firmware/vmxassist/head.S	Wed Sep 28 15:00:11 2005 +0100
     3.2 +++ b/tools/firmware/vmxassist/head.S	Wed Sep 28 15:01:09 2005 +0100
     3.3 @@ -110,6 +110,10 @@ 1:
     3.4  _start:
     3.5  	cli
     3.6  
     3.7 +	/* save register parameters to C land */
     3.8 +	movl	%edx, booting_cpu
     3.9 +	movl	%ebx, booting_vector
    3.10 +
    3.11  	/* clear bss */
    3.12  	cld
    3.13  	xorb	%al, %al
    3.14 @@ -129,7 +133,6 @@ 1:
    3.15  	call    main
    3.16  	jmp	halt
    3.17  
    3.18 -
    3.19  /*
    3.20   * Something bad happened, print invoking %eip and loop forever
    3.21   */
     4.1 --- a/tools/firmware/vmxassist/setup.c	Wed Sep 28 15:00:11 2005 +0100
     4.2 +++ b/tools/firmware/vmxassist/setup.c	Wed Sep 28 15:01:09 2005 +0100
     4.3 @@ -29,6 +29,9 @@
     4.4  
     4.5  #define	min(a, b)	((a) > (b) ? (b) : (a))
     4.6  
     4.7 +/* Which CPU are we booting, and what is the initial CS segment? */
     4.8 +int booting_cpu, booting_vector;
     4.9 +
    4.10  unsigned long long gdt[] __attribute__ ((aligned(32))) = {
    4.11  	0x0000000000000000ULL,		/* 0x00: reserved */
    4.12  	0x0000890000000000ULL,		/* 0x08: 32-bit TSS */
    4.13 @@ -201,12 +204,17 @@ enter_real_mode(struct regs *regs)
    4.14  		initialize_real_mode = 0;
    4.15  		regs->eflags |= EFLAGS_VM | 0x02;
    4.16  		regs->ves = regs->vds = regs->vfs = regs->vgs = 0xF000;
    4.17 -		regs->cs = 0xF000; /* ROM BIOS POST entry point */
    4.18 +		if (booting_cpu == 0) {
    4.19 +			regs->cs = 0xF000; /* ROM BIOS POST entry point */
    4.20  #ifdef TEST
    4.21 -		regs->eip = 0xFFE0;
    4.22 +			regs->eip = 0xFFE0;
    4.23  #else
    4.24 -		regs->eip = 0xFFF0;
    4.25 +			regs->eip = 0xFFF0;
    4.26  #endif
    4.27 +		} else {
    4.28 +			regs->cs = booting_vector << 8; /* AP entry point */
    4.29 +			regs->eip = 0;
    4.30 +		}
    4.31  		regs->uesp = 0;
    4.32  		regs->uss = 0;
    4.33  		printf("Starting emulated 16-bit real-mode: ip=%04x:%04x\n",
    4.34 @@ -215,8 +223,8 @@ enter_real_mode(struct regs *regs)
    4.35  		mode = VM86_REAL; /* becomes previous mode */
    4.36  		set_mode(regs, VM86_REAL);
    4.37  
    4.38 -                /* this should get us into 16-bit mode */
    4.39 -                return;
    4.40 +		/* this should get us into 16-bit mode */
    4.41 +		return;
    4.42  	} else {
    4.43  		/* go from protected to real mode */
    4.44  		regs->eflags |= EFLAGS_VM;
    4.45 @@ -334,7 +342,12 @@ start_bios(void)
    4.46  {
    4.47  	unsigned long cr0;
    4.48  
    4.49 -	printf("Start BIOS ...\n");
    4.50 +	if (booting_cpu == 0)
    4.51 +		printf("Start BIOS ...\n");
    4.52 +	else
    4.53 +		printf("Start AP %d from %08x ...\n",
    4.54 +		       booting_cpu, booting_vector << 12);
    4.55 +
    4.56  	initialize_real_mode = 1;
    4.57  	cr0 = get_cr0();
    4.58  #ifndef TEST
    4.59 @@ -345,20 +358,28 @@ start_bios(void)
    4.60  }
    4.61  
    4.62  int
    4.63 -main()
    4.64 +main(void)
    4.65  {
    4.66 -	banner();
    4.67 +	if (booting_cpu == 0)
    4.68 +		banner();
    4.69 +
    4.70  #ifdef TEST
    4.71  	setup_paging();
    4.72  #endif
    4.73 +
    4.74  	setup_gdt();
    4.75  	setup_idt();
    4.76 +
    4.77  #ifndef	TEST
    4.78 -	set_cr4(get_cr4() | CR4_VME); 
    4.79 +	set_cr4(get_cr4() | CR4_VME);
    4.80  #endif
    4.81 +
    4.82  	setup_ctx();
    4.83 -	setup_pic();
    4.84 +
    4.85 +	if (booting_cpu == 0)
    4.86 +		setup_pic();
    4.87 +
    4.88  	start_bios();
    4.89 +
    4.90  	return 0;
    4.91  }
    4.92 -
     5.1 --- a/tools/firmware/vmxassist/vmxloader.c	Wed Sep 28 15:00:11 2005 +0100
     5.2 +++ b/tools/firmware/vmxassist/vmxloader.c	Wed Sep 28 15:01:09 2005 +0100
     5.3 @@ -132,11 +132,12 @@ main(void)
     5.4  		 memcpy((void *)ACPI_PHYSICAL_ADDRESS, acpi, sizeof(acpi));
     5.5  	}
     5.6  #endif
     5.7 -			
     5.8 +
     5.9  	puts("Loading VMXAssist ...\n");
    5.10  	memcpy((void *)TEXTADDR, vmxassist, sizeof(vmxassist));
    5.11 +
    5.12  	puts("Go ...\n");
    5.13 -	((void (*)())TEXTADDR)();
    5.14 +	asm volatile ( "jmp *%%eax" : : "a" (TEXTADDR), "d" (0) );
    5.15 +
    5.16  	return 0;
    5.17  }
    5.18 -
     6.1 --- a/tools/ioemu/vl.c	Wed Sep 28 15:00:11 2005 +0100
     6.2 +++ b/tools/ioemu/vl.c	Wed Sep 28 15:01:09 2005 +0100
     6.3 @@ -2385,7 +2385,8 @@ int
     6.4  setup_mapping(int xc_handle, u32 dom, unsigned long toptab, unsigned long  *mem_page_array, unsigned long *page_table_array, unsigned long v_start, unsigned long v_end)
     6.5  {
     6.6      l1_pgentry_t *vl1tab=NULL, *vl1e=NULL;
     6.7 -    l2_pgentry_t *vl2tab[4], *vl2e=NULL, *vl2_table = NULL;
     6.8 +    l2_pgentry_t *vl2tab[4] = {NULL, NULL, NULL, NULL};
     6.9 +    l2_pgentry_t *vl2e=NULL, *vl2_table = NULL;
    6.10      unsigned long l1tab;
    6.11      unsigned long ppt_alloc = 0;
    6.12      unsigned long count;
     7.1 --- a/xen/arch/x86/shadow32.c	Wed Sep 28 15:00:11 2005 +0100
     7.2 +++ b/xen/arch/x86/shadow32.c	Wed Sep 28 15:01:09 2005 +0100
     7.3 @@ -755,9 +755,13 @@ void free_monitor_pagetable(struct vcpu 
     7.4  
     7.5      /*
     7.6       * Then free monitor_table.
     7.7 +     * Note: for VMX guest, only BSP need do this free.
     7.8       */
     7.9 -    mfn = pagetable_get_pfn(v->arch.monitor_table);
    7.10 -    free_domheap_page(&frame_table[mfn]);
    7.11 +    if (!(VMX_DOMAIN(v) && v->vcpu_id)) {
    7.12 +        mfn = pagetable_get_pfn(v->arch.monitor_table);
    7.13 +        unmap_domain_page(v->arch.monitor_vtable);
    7.14 +        free_domheap_page(&frame_table[mfn]);
    7.15 +    }
    7.16  
    7.17      v->arch.monitor_table = mk_pagetable(0);
    7.18      v->arch.monitor_vtable = 0;
     8.1 --- a/xen/arch/x86/shadow_public.c	Wed Sep 28 15:00:11 2005 +0100
     8.2 +++ b/xen/arch/x86/shadow_public.c	Wed Sep 28 15:01:09 2005 +0100
     8.3 @@ -256,14 +256,16 @@ void free_monitor_pagetable(struct vcpu 
     8.4  {
     8.5      unsigned long mfn;
     8.6  
     8.7 -//    ASSERT( pagetable_val(v->arch.monitor_table) );
     8.8 +    ASSERT( pagetable_val(v->arch.monitor_table) );
     8.9      /*
    8.10       * free monitor_table.
    8.11 +     * Note: for VMX guest, only BSP need do this free.
    8.12       */
    8.13 -    //mfn = (pagetable_val(v->arch.monitor_table)) >> PAGE_SHIFT;
    8.14 -    mfn = pagetable_get_pfn(v->arch.monitor_table);
    8.15 -    unmap_domain_page(v->arch.monitor_vtable);
    8.16 -    free_domheap_page(&frame_table[mfn]);
    8.17 +    if (!(VMX_DOMAIN(v) && v->vcpu_id)) {
    8.18 +        mfn = pagetable_get_pfn(v->arch.monitor_table);
    8.19 +        unmap_domain_page(v->arch.monitor_vtable);
    8.20 +        free_domheap_page(&frame_table[mfn]);
    8.21 +    }
    8.22      v->arch.monitor_table = mk_pagetable(0);
    8.23      v->arch.monitor_vtable = 0;
    8.24  }
    8.25 @@ -358,9 +360,13 @@ void free_monitor_pagetable(struct vcpu 
    8.26  
    8.27      /*
    8.28       * Then free monitor_table.
    8.29 +     * Note: for VMX guest, only BSP need do this free.
    8.30       */
    8.31 -    mfn = pagetable_get_pfn(v->arch.monitor_table);
    8.32 -    free_domheap_page(&frame_table[mfn]);
    8.33 +    if (!(VMX_DOMAIN(v) && v->vcpu_id)) {
    8.34 +        mfn = pagetable_get_pfn(v->arch.monitor_table);
    8.35 +        unmap_domain_page(v->arch.monitor_vtable);
    8.36 +        free_domheap_page(&frame_table[mfn]);
    8.37 +    }
    8.38  
    8.39      v->arch.monitor_table = mk_pagetable(0);
    8.40      v->arch.monitor_vtable = 0;
     9.1 --- a/xen/arch/x86/vmx_platform.c	Wed Sep 28 15:00:11 2005 +0100
     9.2 +++ b/xen/arch/x86/vmx_platform.c	Wed Sep 28 15:01:09 2005 +0100
     9.3 @@ -667,6 +667,7 @@ static void mmio_operands(int type, unsi
     9.4      mpcip->instr = inst->instr;
     9.5      mpcip->operand[0] = inst->operand[0]; /* source */
     9.6      mpcip->operand[1] = inst->operand[1]; /* destination */
     9.7 +    mpcip->immediate = inst->immediate;
     9.8  
     9.9      if (inst->operand[0] & REGISTER) { /* dest is memory */
    9.10          index = operand_index(inst->operand[0]);
    9.11 @@ -833,12 +834,16 @@ void handle_mmio(unsigned long va, unsig
    9.12          mmio_operands(IOREQ_TYPE_XOR, gpa, &mmio_inst, mpcip, regs);
    9.13          break;
    9.14  
    9.15 -    case INSTR_CMP:
    9.16 -        mmio_operands(IOREQ_TYPE_COPY, gpa, &mmio_inst, mpcip, regs);
    9.17 -        break;
    9.18 +    case INSTR_CMP:        /* Pass through */
    9.19 +    case INSTR_TEST:
    9.20 +        mpcip->flags = mmio_inst.flags;
    9.21 +        mpcip->instr = mmio_inst.instr;
    9.22 +        mpcip->operand[0] = mmio_inst.operand[0]; /* source */
    9.23 +        mpcip->operand[1] = mmio_inst.operand[1]; /* destination */
    9.24 +        mpcip->immediate = mmio_inst.immediate;
    9.25  
    9.26 -    case INSTR_TEST:
    9.27 -        mmio_operands(IOREQ_TYPE_COPY, gpa, &mmio_inst, mpcip, regs);
    9.28 +        /* send the request and wait for the value */
    9.29 +        send_mmio_req(IOREQ_TYPE_COPY, gpa, 1, mmio_inst.op_size, 0, IOREQ_READ, 0);
    9.30          break;
    9.31  
    9.32      default: