Now that the guest registers are saved at the same location on the
per-cpu stack for both Intel and AMD, we can enable direct access via
the per-cpu data structure. This will allow to drop the guest registers
parameter from most functions.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
#define NUM_ENTRY_REGS 6
+#define STACK_SIZE PAGE_SIZE
+
#ifndef __ASSEMBLY__
#include <asm/cell.h>
/** Per-CPU states. */
struct per_cpu {
- /** Stack used while in hypervisor mode. */
- u8 stack[PAGE_SIZE];
+ union {
+ /** Stack used while in hypervisor mode. */
+ u8 stack[STACK_SIZE];
+ struct {
+ u8 __fill[STACK_SIZE - sizeof(union registers)];
+ /** Guest registers saved on stack during VM exit. */
+ union registers guest_regs;
+ };
+ };
+
/** Linux stack pointer, used for handover to hypervisor. */
unsigned long linux_sp;