Path: blob/master/arch/powerpc/include/uapi/asm/kvm_para.h
26516 views
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */1/*2* Copyright IBM Corp. 20083*4* Authors: Hollis Blanchard <[email protected]>5*/67#ifndef _UAPI__POWERPC_KVM_PARA_H__8#define _UAPI__POWERPC_KVM_PARA_H__910#include <linux/types.h>1112/*13* Additions to this struct must only occur at the end, and should be14* accompanied by a KVM_MAGIC_FEAT flag to advertise that they are present15* (albeit not necessarily relevant to the current target hardware platform).16*17* Struct fields are always 32 or 64 bit aligned, depending on them being 3218* or 64 bit wide respectively.19*20* See Documentation/virt/kvm/ppc-pv.rst21*/22struct kvm_vcpu_arch_shared {23__u64 scratch1;24__u64 scratch2;25__u64 scratch3;26__u64 critical; /* Guest may not get interrupts if == r1 */27__u64 sprg0;28__u64 sprg1;29__u64 sprg2;30__u64 sprg3;31__u64 srr0;32__u64 srr1;33__u64 dar; /* dear on BookE */34__u64 msr;35__u32 dsisr;36__u32 int_pending; /* Tells the guest if we have an interrupt */37__u32 sr[16];38__u32 mas0;39__u32 mas1;40__u64 mas7_3;41__u64 mas2;42__u32 mas4;43__u32 mas6;44__u32 esr;45__u32 pir;4647/*48* SPRG4-7 are user-readable, so we can only keep these consistent49* between the shared area and the real registers when there's an50* intervening exit to KVM. This also applies to SPRG3 on some51* chips.52*53* This suffices for access by guest userspace, since in PR-mode54* KVM, an exit must occur when changing the guest's MSR[PR].55* If the guest kernel writes to SPRG3-7 via the shared area, it56* must also use the shared area for reading while in kernel space.57*/58__u64 sprg4;59__u64 sprg5;60__u64 sprg6;61__u64 sprg7;62};6364#define KVM_SC_MAGIC_R0 0x4b564d21 /* "KVM!" */6566#define KVM_HCALL_TOKEN(num) _EV_HCALL_TOKEN(EV_KVM_VENDOR_ID, num)6768#include <asm/epapr_hcalls.h>6970#define KVM_FEATURE_MAGIC_PAGE 17172/* Magic page flags from host to guest */7374#define KVM_MAGIC_FEAT_SR (1 << 0)7576/* MASn, ESR, PIR, and high SPRGs */77#define KVM_MAGIC_FEAT_MAS0_TO_SPRG7 (1 << 1)7879/* Magic page flags from guest to host */8081#define MAGIC_PAGE_FLAG_NOT_MAPPED_NX (1 << 0)828384#endif /* _UAPI__POWERPC_KVM_PARA_H__ */858687