linux/arch/powerpc/include/asm
Jordan Niethe 6ccbbc33f0 KVM: PPC: Add helper library for Guest State Buffers
The PAPR "Nestedv2" guest API introduces the concept of a Guest State
Buffer for communication about L2 guests between L1 and L0 hosts.

In the new API, the L0 manages the L2 on behalf of the L1. This means
that if the L1 needs to change L2 state (e.g. GPRs, SPRs, partition
table...), it must request the L0 perform the modification. If the
nested host needs to read L2 state likewise this request must
go through the L0.

The Guest State Buffer is a Type-Length-Value style data format defined
in the PAPR which assigns all relevant partition state a unique
identity. Unlike a typical TLV format the length is redundant as the
length of each identity is fixed but is included for checking
correctness.

A guest state buffer consists of an element count followed by a stream
of elements, where elements are composed of an ID number, data length,
then the data:

  Header:

   <---4 bytes--->
  +----------------+-----
  | Element Count  | Elements...
  +----------------+-----

  Element:

   <----2 bytes---> <-2 bytes-> <-Length bytes->
  +----------------+-----------+----------------+
  | Guest State ID |  Length   |      Data      |
  +----------------+-----------+----------------+

Guest State IDs have other attributes defined in the PAPR such as
whether they are per thread or per guest, or read-only.

Introduce a library for using guest state buffers. This includes support
for actions such as creating buffers, adding elements to buffers,
reading the value of elements and parsing buffers. This will be used
later by the nestedv2 guest support.

Signed-off-by: Jordan Niethe <jniethe5@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230914030600.16993-9-jniethe5@gmail.com
2023-09-14 22:04:24 +10:00
..
book3s powerpc: Fix pud_mkwrite() definition after pte_mkwrite() API changes 2023-08-31 14:49:38 -07:00
nohash powerpc updates for 6.6 2023-08-31 12:43:10 -07:00
vdso
8xx_immap.h powerpc/include: Declare mpc8xx_immr in 8xx_immap.h 2023-08-16 23:54:47 +10:00
accounting.h
archrandom.h
asm-compat.h
asm-const.h
asm-offsets.h
asm-prototypes.h
asm.h
async_tx.h
atomic.h locking/atomic: make atomic*_{cmp,}xchg optional 2023-06-05 09:57:14 +02:00
backlight.h
barrier.h
bitops.h
bootx.h
bpf_perf_event.h
btext.h
bug.h powerpc/kuap: Simplify KUAP lock/unlock on BOOK3S/32 2023-08-02 22:22:18 +10:00
cache.h powerpc: move the ARCH_DMA_MINALIGN definition to asm/cache.h 2023-06-19 16:19:24 -07:00
cacheflush.h powerpc: implement the new page table range API 2023-08-24 16:20:23 -07:00
cell-pmu.h
cell-regs.h
checksum.h
clocksource.h
cmpxchg.h
code-patching-asm.h
code-patching.h
compat.h
context_tracking.h
copro.h
cpm.h
cpm1.h
cpm2.h powerpc/include: Remove mpc8260.h and m82xx_pci.h 2023-08-16 23:54:47 +10:00
cpu_has_feature.h
cpu_setup.h
cpufeature.h
cpuidle.h
cputable.h powerpc/82xx: Remove CONFIG_8260 and CONFIG_8272 2023-08-18 17:03:14 +10:00
cputhreads.h
cputime.h
crashdump-ppc64.h
current.h
dbdma.h
dbell.h
dcr-generic.h
dcr-mmio.h
dcr-native.h
dcr-regs.h
dcr.h
debug.h
delay.h
device.h
disassemble.h
dma-direct.h
dma.h
drmem.h
dt_cpu_ftrs.h
dtl.h powerpc/pseries: Move hcall_vphn() prototype into vphn.h 2023-08-24 22:33:16 +10:00
edac.h
eeh.h
eeh_event.h
ehv_pic.h
elf.h Revert "powerpc/64s: Remove support for ELFv1 little endian userspace" 2023-07-19 21:28:35 +10:00
elfnote.h
emergency-restart.h
emulated_ops.h
epapr_hcalls.h
exception-64e.h
exception-64s.h
exec.h
extable.h
fadump-internal.h
fadump.h
fb.h
feature-fixups.h powerpc/features: Add capability to update mmu features later 2023-08-02 22:22:17 +10:00
firmware.h
fixmap.h
floppy.h
fsl_gtm.h
fsl_hcalls.h
fsl_lbc.h
fsl_pamu_stash.h
fsl_pm.h
ftrace.h powerpc/ftrace: Add support for -fpatchable-function-entry 2023-08-22 00:09:06 +10:00
futex.h
grackle.h
guest-state-buffer.h KVM: PPC: Add helper library for Guest State Buffers 2023-09-14 22:04:24 +10:00
hardirq.h
head-64.h
heathrow.h
highmem.h
hmi.h
hugetlb.h
hvcall.h
hvconsole.h
hvcserver.h
hvsi.h
hw_breakpoint.h powerpc/watchpoints: Track perf single step directly on the breakpoint 2023-08-16 23:54:50 +10:00
hw_irq.h
hydra.h
i8259.h
ibmebus.h powerpc: Explicitly include correct DT includes 2023-08-02 22:22:19 +10:00
icswx.h
idle.h
imc-pmu.h
immap_cpm2.h
inst.h
interrupt.h
io-defs.h
io-workarounds.h
io.h powerpc: mm: convert to GENERIC_IOREMAP 2023-08-18 10:12:35 -07:00
io_event_irq.h
iommu.h powerpc: Move DMA64_PROPNAME define to a header 2023-08-18 17:03:15 +10:00
ipic.h
irq.h nmi_backtrace: allow excluding an arbitrary CPU 2023-08-18 10:19:00 -07:00
irq_work.h
irqflags.h
isa-bridge.h
jump_label.h
kasan.h
Kbuild powerpc: remove <asm/export.h> 2023-08-16 23:54:48 +10:00
kdebug.h
kdump.h
kexec.h
kexec_ranges.h
keylargo.h
kfence.h powerpc: Make virt_to_pfn() a static inline 2023-08-16 23:54:49 +10:00
kgdb.h
kprobes.h
kup.h powerpc/kuap: Use ASM feature fixups instead of static branches 2023-08-02 22:22:18 +10:00
kvm_asm.h
kvm_book3s.h KVM: PPC: Use accessors for VCORE registers 2023-09-14 22:04:24 +10:00
kvm_book3s_32.h
kvm_book3s_64.h
kvm_book3s_asm.h
kvm_book3s_uvmem.h
kvm_booke.h KVM: PPC: Introduce FPR/VR accessor functions 2023-09-14 22:04:23 +10:00
kvm_booke_hv_asm.h
kvm_fpu.h
kvm_guest.h
kvm_host.h
kvm_para.h
kvm_ppc.h KVM: PPC: Rename accessor generator macros 2023-09-14 22:04:23 +10:00
libata-portmap.h
linkage.h
livepatch.h
local.h locking/arch: Wire up local_try_cmpxchg() 2023-04-29 09:09:16 +02:00
lppaca.h powerpc/pseries: Rework lppaca_shared_proc() to avoid DEBUG_PREEMPT 2023-08-24 22:33:17 +10:00
lv1call.h
machdep.h
macio.h powerpc: Explicitly include correct DT includes 2023-08-02 22:22:19 +10:00
mc146818rtc.h
mce.h
mediabay.h
mem_encrypt.h
membarrier.h
mman.h
mmiowb.h
mmu.h powerpc/64e: Fix circular dependency with CONFIG_SMP disabled 2023-08-23 15:55:21 +10:00
mmu_context.h powerpc/64s: Use dec_mm_active_cpus helper 2023-08-02 22:22:18 +10:00
mmzone.h
module.h powerpc/module: Remove unused .ftrace.tramp section 2023-08-22 00:09:05 +10:00
module.lds.h
mpc5xxx.h
mpc6xx.h
mpc52xx.h powerpc: Drop MPC5200 LocalPlus bus FIFO driver 2023-05-15 23:25:56 +10:00
mpc52xx_psc.h
mpc85xx.h
mpc5121.h
mpic.h
mpic_msgr.h
mpic_timer.h
msi_bitmap.h
nmi.h powerpc: move arch_trigger_cpumask_backtrace from nmi.h to irq.h 2023-06-23 17:04:04 -07:00
nvram.h
ohare.h
opal-api.h
opal.h powerpc/powernv/pci: Remove MVE code 2023-06-21 15:13:57 +10:00
paca.h powerpc: Don't include lppaca.h in paca.h 2023-08-24 22:33:16 +10:00
page.h powerpc: Make virt_to_pfn() a static inline 2023-08-16 23:54:49 +10:00
page_32.h powerpc: move the ARCH_DMA_MINALIGN definition to asm/cache.h 2023-06-19 16:19:24 -07:00
page_64.h
papr-sysparm.h
paravirt.h powerpc: Don't include lppaca.h in paca.h 2023-08-24 22:33:16 +10:00
paravirt_api_clock.h
parport.h
pasemi_dma.h
pci-bridge.h
pci.h powerpc: address missing-prototypes warnings 2023-08-02 22:22:19 +10:00
percpu.h
perf_event.h
perf_event_fsl_emb.h
perf_event_server.h
pgalloc.h powerpc: add pte_free_defer() for pgtables sharing page 2023-08-18 10:12:23 -07:00
pgtable-be-types.h
pgtable-types.h
pgtable.h powerpc updates for 6.6 2023-08-31 12:43:10 -07:00
pkeys.h
plpar_wrappers.h powerpc: Don't include lppaca.h in paca.h 2023-08-24 22:33:16 +10:00
plpks.h
pmac_feature.h
pmac_low_i2c.h
pmac_pfunc.h
pmc.h
pmi.h
pnv-ocxl.h
pnv-pci.h
powernv.h
ppc-opcode.h powerpc/inst: add PPC_TLBILX_LPID 2023-08-16 23:54:48 +10:00
ppc-pci.h
ppc4xx.h
ppc_asm.h powerpc: merge 32-bit and 64-bit _switch implementation 2023-06-15 14:03:55 +10:00
probes.h
processor.h powerpc updates for 6.6 2023-08-31 12:43:10 -07:00
prom.h
ps3.h
ps3av.h
ps3gpu.h
ps3stor.h
pte-walk.h
ptrace.h powerpc: Mark [h]ssr_valid accesses in check_return_regs_valid 2023-06-21 15:13:57 +10:00
qspinlock.h
qspinlock_types.h
reg.h powerpc/reg: Remove #ifdef around mtspr macro 2023-08-16 23:54:48 +10:00
reg_8xx.h
reg_a2.h
reg_booke.h
reg_fsl_emb.h
rheap.h
rio.h
rtas-types.h
rtas-work-area.h
rtas.h powerpc/rtas: export rtas_error_rc() for reuse. 2023-08-18 23:28:57 +10:00
runlatch.h
seccomp.h
sections.h powerpc/ftrace: Extend ftrace support for large kernels to ppc32 2023-08-22 00:09:05 +10:00
secure_boot.h
security_features.h
secvar.h
serial.h
set_memory.h
setjmp.h
setup.h powerpc: Drop zalloc_maybe_bootmem() 2023-08-24 22:33:16 +10:00
sfp-machine.h
shmparam.h
signal.h
simple_spinlock.h powerpc/kcsan: Properly instrument arch_spin_unlock() 2023-06-09 23:29:51 +10:00
simple_spinlock_types.h
smp.h
smu.h
sparsemem.h
spinlock.h
spinlock_types.h
spu.h
spu_csa.h
spu_info.h
spu_priv1.h
sstep.h
stackprotector.h
stacktrace.h
static_call.h
string.h
svm.h
swab.h
swiotlb.h
switch_to.h
synch.h
syscall.h
syscall_wrapper.h
syscalls.h
syscalls_32.h
task_size_32.h
task_size_64.h
tce.h
thread_info.h Revert "powerpc/64s: Remove support for ELFv1 little endian userspace" 2023-07-19 21:28:35 +10:00
time.h
timex.h
tlb.h
tlbflush.h
tm.h
topology.h powerpc: Add HOTPLUG_SMT support 2023-08-02 22:49:43 +10:00
trace.h
trace_clock.h
tsi108.h
tsi108_irq.h
tsi108_pci.h
types.h
uaccess.h powerpc/kuap: KUAP enabling/disabling functions must be __always_inline 2023-08-02 22:22:18 +10:00
udbg.h
uic.h
ultravisor-api.h
ultravisor.h
uninorth.h
unistd.h
uprobes.h
user.h
vas.h
vdso.h
vdso_datapage.h
vermagic.h powerpc/ftrace: Add support for -fpatchable-function-entry 2023-08-22 00:09:06 +10:00
vga.h
vio.h
vmalloc.h
vphn.h powerpc/pseries: Move hcall_vphn() prototype into vphn.h 2023-08-24 22:33:16 +10:00
word-at-a-time.h word-at-a-time: use the same return type for has_zero regardless of endianness 2023-08-02 10:23:36 -07:00
xics.h
xive-regs.h
xive.h
xmon.h
xor.h
xor_altivec.h