[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] x86/current: Annotate get_cpu_info() as attr_const



The result of this calculation will always be identical, even across context
switch in x86.  Tell the compiler.

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>

  add/remove: 0/0 grow/shrink: 0/15 up/down: 0/-300 (-300)
  Function                                     old     new   delta
  nsvm_vcpu_vmexit_event                       114     111      -3
  nsvm_vcpu_reset                              178     175      -3
  nestedsvm_vcpu_interrupt                     302     299      -3
  compat_memory_op.cold                        200     197      -3
  vcpu_block_enable_events                      30      26      -4
  nestedsvm_vmexit_defer                        90      86      -4
  dom0_construct                              8441    8435      -6
  svm_vmexit_do_clgi                           206     198      -8
  nsvm_vcpu_vmrun                             2530    2522      -8
  compat_multicall                            1194    1178     -16
  arch_do_domctl                              8621    8605     -16
  hvm_set_param.cold                            74      44     -30
  do_multicall                                1165    1133     -32
  ept_set_entry                               2023    1978     -45
  compat_memory_op                            7440    7321    -119
---
 xen/arch/x86/include/asm/current.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/include/asm/current.h 
b/xen/arch/x86/include/asm/current.h
index a7c9473428b2..fd30422707d9 100644
--- a/xen/arch/x86/include/asm/current.h
+++ b/xen/arch/x86/include/asm/current.h
@@ -83,7 +83,7 @@ static inline struct cpu_info 
*get_cpu_info_from_stack(unsigned long sp)
     return (struct cpu_info *)((sp | (STACK_SIZE - 1)) + 1) - 1;
 }
 
-static inline struct cpu_info *get_cpu_info(void)
+static inline attr_const struct cpu_info *get_cpu_info(void)
 {
 #ifdef __clang__
     /* Clang complains that sp in the else case is not initialised. */
-- 
2.39.5




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.