KVM: Wrap kvm_{gfn,hva}_range.pte in a per-action union
authorSean Christopherson <seanjc@google.com>
Sat, 29 Jul 2023 00:41:44 +0000 (17:41 -0700)
committerSean Christopherson <seanjc@google.com>
Thu, 17 Aug 2023 18:26:53 +0000 (11:26 -0700)
commit3e1efe2b67d3d38116ec010968dbcd89d29e4561
tree0b7f4a54e01de5c585f29aaff541877c072bf883
parentfdf0eaf11452d72945af31804e2a1048ee1b574c
KVM: Wrap kvm_{gfn,hva}_range.pte in a per-action union

Wrap kvm_{gfn,hva}_range.pte in a union so that future notifier events can
pass event specific information up and down the stack without needing to
constantly expand and churn the APIs.  Lockless aging of SPTEs will pass
around a bitmap, and support for memory attributes will pass around the
new attributes for the range.

Add a "KVM_NO_ARG" placeholder to simplify handling events without an
argument (creating a dummy union variable is midly annoying).

Opportunstically drop explicit zero-initialization of the "pte" field, as
omitting the field (now a union) has the same effect.

Cc: Yu Zhao <yuzhao@google.com>
Link: https://lore.kernel.org/all/CAOUHufagkd2Jk3_HrVoFFptRXM=hX2CV8f+M-dka-hJU4bP8kw@mail.gmail.com
Reviewed-by: Oliver Upton <oliver.upton@linux.dev>
Acked-by: Yu Zhao <yuzhao@google.com>
Link: https://lore.kernel.org/r/20230729004144.1054885-1-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/arm64/kvm/mmu.c
arch/mips/kvm/mmu.c
arch/riscv/kvm/mmu.c
arch/x86/kvm/mmu/mmu.c
arch/x86/kvm/mmu/tdp_mmu.c
include/linux/kvm_host.h
virt/kvm/kvm_main.c