# HG changeset patch # User mafetter@fleming.research # Date 1114002152 0 # Node ID 05621922c024073c0574e8c6855f741b81ad4c86 # Parent 1803018b3b05c9e057a20f225c16a96ae5ada7b8# Parent d10fe13887d7fc7821adceec7481ea60bd6a09dd bitkeeper revision 1.1340 (426652e8h-OWfDH7vm_elbT4wtH2cA) Merge maf46@ssh-relay1.cl.cam.ac.uk:/usr/groups/xeno/BK/xen-unstable.bk into fleming.research:/scratch/fleming/mafetter/xen-unstable.bk Signed-off-by: michael.fetterman@cl.cam.ac.uk diff -r 1803018b3b05 -r 05621922c024 xen/arch/x86/x86_32/asm-offsets.c --- a/xen/arch/x86/x86_32/asm-offsets.c Wed Apr 20 12:32:43 2005 +0000 +++ b/xen/arch/x86/x86_32/asm-offsets.c Wed Apr 20 13:02:32 2005 +0000 @@ -15,6 +15,13 @@ #define OFFSET(_sym, _str, _mem) \ DEFINE(_sym, offsetof(_str, _mem)); +/* base-2 logarithm */ +#define __L2(_x) (((_x) & 0x00000002) ? 1 : 0) +#define __L4(_x) (((_x) & 0x0000000c) ? ( 2 + __L2( (_x)>> 2)) : __L2( _x)) +#define __L8(_x) (((_x) & 0x000000f0) ? ( 4 + __L4( (_x)>> 4)) : __L4( _x)) +#define __L16(_x) (((_x) & 0x0000ff00) ? ( 8 + __L8( (_x)>> 8)) : __L8( _x)) +#define LOG_2(_x) (((_x) & 0xffff0000) ? (16 + __L16((_x)>>16)) : __L16(_x)) + void __dummy__(void) { OFFSET(XREGS_eax, struct xen_regs, eax); @@ -78,4 +85,7 @@ void __dummy__(void) BLANK(); DEFINE(FIXMAP_apic_base, fix_to_virt(FIX_APIC_BASE)); + BLANK(); + + DEFINE(IRQSTAT_shift, LOG_2(sizeof(irq_cpustat_t))); } diff -r 1803018b3b05 -r 05621922c024 xen/arch/x86/x86_32/entry.S --- a/xen/arch/x86/x86_32/entry.S Wed Apr 20 12:32:43 2005 +0000 +++ b/xen/arch/x86/x86_32/entry.S Wed Apr 20 13:02:32 2005 +0000 @@ -140,7 +140,7 @@ vmx_test_all_events: cli # tests must not race interrupts /*test_softirqs:*/ movl EDOMAIN_processor(%ebx),%eax - shl $6,%eax # sizeof(irq_cpustat) == 64 + shl $IRQSTAT_shift,%eax test %ecx,SYMBOL_NAME(irq_stat)(%eax,1) jnz vmx_process_softirqs @@ -270,7 +270,7 @@ test_all_events: cli # tests must not race interrupts /*test_softirqs:*/ movl EDOMAIN_processor(%ebx),%eax - shl $6,%eax # sizeof(irq_cpustat) == 64 + shl $IRQSTAT_shift,%eax test %ecx,SYMBOL_NAME(irq_stat)(%eax,1) jnz process_softirqs /*test_guest_events:*/ diff -r 1803018b3b05 -r 05621922c024 xen/arch/x86/x86_64/asm-offsets.c --- a/xen/arch/x86/x86_64/asm-offsets.c Wed Apr 20 12:32:43 2005 +0000 +++ b/xen/arch/x86/x86_64/asm-offsets.c Wed Apr 20 13:02:32 2005 +0000 @@ -15,6 +15,13 @@ #define OFFSET(_sym, _str, _mem) \ DEFINE(_sym, offsetof(_str, _mem)); +/* base-2 logarithm */ +#define __L2(_x) (((_x) & 0x00000002) ? 1 : 0) +#define __L4(_x) (((_x) & 0x0000000c) ? ( 2 + __L2( (_x)>> 2)) : __L2( _x)) +#define __L8(_x) (((_x) & 0x000000f0) ? ( 4 + __L4( (_x)>> 4)) : __L4( _x)) +#define __L16(_x) (((_x) & 0x0000ff00) ? ( 8 + __L8( (_x)>> 8)) : __L8( _x)) +#define LOG_2(_x) (((_x) & 0xffff0000) ? (16 + __L16((_x)>>16)) : __L16(_x)) + void __dummy__(void) { OFFSET(XREGS_r15, struct xen_regs, r15); @@ -77,4 +84,7 @@ void __dummy__(void) OFFSET(MULTICALL_arg3, multicall_entry_t, args[3]); OFFSET(MULTICALL_arg4, multicall_entry_t, args[4]); OFFSET(MULTICALL_result, multicall_entry_t, args[5]); + BLANK(); + + DEFINE(IRQSTAT_shift, LOG_2(sizeof(irq_cpustat_t))); } diff -r 1803018b3b05 -r 05621922c024 xen/arch/x86/x86_64/entry.S --- a/xen/arch/x86/x86_64/entry.S Wed Apr 20 12:32:43 2005 +0000 +++ b/xen/arch/x86/x86_64/entry.S Wed Apr 20 13:02:32 2005 +0000 @@ -130,7 +130,7 @@ test_all_events: cli # tests must not race interrupts /*test_softirqs:*/ movl EDOMAIN_processor(%rbx),%eax - shl $6,%rax # sizeof(irq_cpustat) == 64 + shl $IRQSTAT_shift,%rax leaq SYMBOL_NAME(irq_stat)(%rip),%rcx testl $~0,(%rcx,%rax,1) jnz process_softirqs @@ -237,16 +237,13 @@ ENTRY(vmx_asm_do_resume) vmx_test_all_events: GET_CURRENT(%rbx) /* test_all_events: */ - xorq %rcx,%rcx - notq %rcx cli # tests must not race interrupts /*test_softirqs:*/ - movq EDOMAIN_processor(%rbx),%rax -#if 0 - shl $6,%rax # sizeof(irq_cpustat) == 64 - test %rcx,SYMBOL_NAME(irq_stat)(%rax,1) -#endif - jnz vmx_process_softirqs + movl EDOMAIN_processor(%rbx),%eax + shl $IRQSTAT_shift,%rax + leaq SYMBOL_NAME(irq_stat)(%rip), %rdx + testl $~0,(%rdx,%rax,1) + jnz vmx_process_softirqs vmx_restore_all_guest: call SYMBOL_NAME(load_cr2) diff -r 1803018b3b05 -r 05621922c024 xen/include/asm-x86/config.h --- a/xen/include/asm-x86/config.h Wed Apr 20 12:32:43 2005 +0000 +++ b/xen/include/asm-x86/config.h Wed Apr 20 13:02:32 2005 +0000 @@ -16,7 +16,9 @@ #define CONFIG_X86_LOCAL_APIC 1 #define CONFIG_X86_GOOD_APIC 1 #define CONFIG_X86_IO_APIC 1 -#define CONFIG_X86_L1_CACHE_SHIFT 5 + +/* Intel P4 currently has largest cache line (L2 line size is 128 bytes). */ +#define CONFIG_X86_L1_CACHE_SHIFT 7 #define CONFIG_ACPI 1 #define CONFIG_ACPI_BOOT 1 @@ -53,12 +55,6 @@ #define OPT_CONSOLE_STR "com1,vga" -/* - * Just to keep compiler happy. - * NB. DO NOT CHANGE SMP_CACHE_BYTES WITHOUT FIXING arch/i386/entry.S!!! - * It depends on size of irq_cpustat_t, for example, being 64 bytes. :-) - */ -#define SMP_CACHE_BYTES 64 #define NR_CPUS 16 /* Linkage for x86 */