Commit 233ccd0d0452682edb51725410e0f8c0384e8b34

Authored by Olof Johansson
Committed by Linus Torvalds
1 parent b749bfcd1b

[PATCH] ppc64: Add VMX save flag to VPA

We need to indicate to the hypervisor that it needs to save our VMX
registers when switching partitions on a shared-processor system, just as
it needs to for FP and PMC registers.

This could be made to be on-demand when VMX is used, but we don't do that
for FP nor PMC right now either so let's not overcomplicate things.

Signed-off-by: Olof Johansson <olof@lixom.net>
Acked-by: Paul Mackerras <paulus@samba.org>
Cc: Anton Blanchard <anton@samba.org>
Cc: <engebret@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 3 changed files with 6 additions and 1 deletions Side-by-side Diff

arch/ppc64/kernel/pSeries_lpar.c
... ... @@ -266,6 +266,10 @@
266 266  
267 267 /* Register the Virtual Processor Area (VPA) */
268 268 flags = 1UL << (63 - 18);
  269 +
  270 + if (cpu_has_feature(CPU_FTR_ALTIVEC))
  271 + paca[cpu].lppaca.vmxregs_in_use = 1;
  272 +
269 273 ret = register_vpa(flags, hwcpu, __pa(vpa));
270 274  
271 275 if (ret)
arch/ppc64/kernel/pacaData.c
... ... @@ -59,6 +59,7 @@
59 59 .fpregs_in_use = 1, \
60 60 .end_of_quantum = 0xfffffffffffffffful, \
61 61 .slb_count = 64, \
  62 + .vmxregs_in_use = 0, \
62 63 }, \
63 64  
64 65 #ifdef CONFIG_PPC_ISERIES
include/asm-ppc64/lppaca.h
... ... @@ -108,7 +108,7 @@
108 108 volatile u32 virtual_decr; // Virtual DECR for shared procsx78-x7B
109 109 u16 slb_count; // # of SLBs to maintain x7C-x7D
110 110 u8 idle; // Indicate OS is idle x7E
111   - u8 reserved5; // Reserved x7F
  111 + u8 vmxregs_in_use; // VMX registers in use x7F
112 112  
113 113  
114 114 //=============================================================================