rename and clarify NR_hypercalls
PATCH 1/1 rename and clarify NR_hypercalls
This patch makes it obvious that NR_hypercalls has to be power-of-2 and renames it to MAX_HYPERCALL_NUMBER, which is what it really is.
Signed-off-by Muli Ben-Yehuda <[email protected]>
xen/arch/x86/x86_32/entry.S +3 -3
@@ -168,7 +168,7 @@ ENTRY(hypercall) SAVE_ALL(b) sti GET_CURRENT(%ebx) - andl $(NR_hypercalls-1),%eax + andl $(MAX_HYPERCALL_NUMBER-1),%eax PERFC_INCR(PERFC_hypercalls, %eax) #ifndef NDEBUG /* Deliberately corrupt parameter regs not used by this hypercall. */
@@ -646,7 +646,7 @@ ENTRY(hypercall_table) .long do_arch_sched_op .long do_callback_op /* 30 */ .long do_xenoprof_op - .rept NR_hypercalls-((.-hypercall_table)/4) + .rept MAX_HYPERCALL_NUMBER-((.-hypercall_table)/4) .long do_ni_hypercall .endr
@@ -683,6 +683,6 @@ ENTRY(hypercall_args_table) .byte 2 /* do_arch_sched_op */ .byte 2 /* do_callback_op */ /* 30 */ .byte 3 /* do_xenoprof_op */ - .rept NR_hypercalls-(.-hypercall_args_table) + .rept MAX_HYPERCALL_NUMBER-(.-hypercall_args_table) .byte 0 /* do_ni_hypercall */ .endr
xen/arch/x86/x86_32/traps.c +1 -1
@@ -425,7 +425,7 @@ static void hypercall_page_initialise_ri/* Fill in all the transfer points with template machine code. */ -for ( i =0 ; i < NR_hypercalls; i++ ) +for ( i =0 ; i <MAX_HYPERCALL_NUMBER ; i++ ) { p = (char *)(hypercall_page + (i *32 ));
xen/arch/x86/x86_64/entry.S +4 -4
@@ -124,7 +124,7 @@ ENTRY(syscall_enter) /*hypercall:*/ movq %r10,%rcx - andq $(NR_hypercalls-1),%rax + andq $(MAX_HYPERCALL_NUMBER-1),%rax #ifndef NDEBUG /* Deliberately corrupt parameter regs not used by this hypercall. */ pushq %rdi; pushq %rsi; pushq %rdx; pushq %rcx; pushq %r8 ; pushq %r9
@@ -136,7 +136,7 @@ ENTRY(syscall_enter) rep stosq popq %r9 ; popq %r8 ; popq %rcx; popq %rdx; popq %rsi; popq %rdi movq UREGS_rax(%rsp),%rax - andq $(NR_hypercalls-1),%rax + andq $(MAX_HYPERCALL_NUMBER-1),%rax pushq %rax pushq UREGS_rip+8(%rsp) #endif
@@ -554,7 +554,7 @@ ENTRY(hypercall_table) .quad do_arch_sched_op .quad do_callback_op /* 30 */ .quad do_xenoprof_op - .rept NR_hypercalls-((.-hypercall_table)/8) + .rept MAX_HYPERCALL_NUMBER-((.-hypercall_table)/8) .quad do_ni_hypercall .endr
@@ -591,6 +591,6 @@ ENTRY(hypercall_args_table) .byte 2 /* do_arch_sched_op */ .byte 2 /* do_callback_op */ /* 30 */ .byte 3 /* do_xenoprof_op */ - .rept NR_hypercalls-(.-hypercall_args_table) + .rept MAX_HYPERCALL_NUMBER-(.-hypercall_args_table) .byte 0 /* do_ni_hypercall */ .endr
xen/include/asm-x86/config.h +1 -1
@@ -65,7 +65,7 @@#define barrier () __asm__ __volatile__("": : :"memory") -#define NR_hypercalls 32 +#define MAX_HYPERCALL_NUMBER (1 << 5)#ifndef NDEBUG #define MEMORY_GUARD
xen/include/asm-x86/multicall.h +2 -2
@@ -13,7 +13,7 @@ do { \ __asm__ __volatile__ ( \ "movq "STR(MULTICALL_op)"(%0),%%rax; " \ - "andq $("STR(NR_hypercalls)"-1),%%rax; " \ + "andq $("STR(MAX_HYPERCALL_NUMBER)"-1),%%rax; " \ "leaq "STR(hypercall_table)"(%%rip),%%rdi; "\ "leaq (%%rdi,%%rax,8),%%rax; " \ "movq "STR(MULTICALL_arg0)"(%0),%%rdi; " \
@@ -40,7 +40,7 @@ "pushl "STR(MULTICALL_arg1)"(%0); " \ "pushl "STR(MULTICALL_arg0)"(%0); " \ "movl "STR(MULTICALL_op)"(%0),%%eax; " \ - "andl $("STR(NR_hypercalls)"-1),%%eax; " \ + "andl $("STR(MAX_HYPERCALL_NUMBER)"-1),%%eax; " \"call *hypercall_table(,%%eax,4); " \ "movl %%eax,"STR(MULTICALL_result)"(%0); "\"addl $20,%%esp; " \
xen/include/xen/perfc_defn.h +1 -1
@@ -23,7 +23,7 @@ PERFCOUNTER_ARRAY(shm_l4_updates,PERFCOUNTER_ARRAY (snapshot_copies,"entries copied per snapshot" , PERFC_MAX_PT_UPDATES) -PERFCOUNTER_ARRAY(hypercalls, "hypercalls", NR_hypercalls) +PERFCOUNTER_ARRAY(hypercalls, "hypercalls", MAX_HYPERCALL_NUMBER) PERFCOUNTER_ARRAY(exceptions, "exceptions", 32)#define VMX_PERF_EXIT_REASON_SIZE 44
Signature · 2 lines
Muli Ben-Yehuda http://www.mulix.org | http://mulix.livejournal.com/