linux/arch/riscv
David Matlack 837f66c712 KVM: Allow for different capacities in kvm_mmu_memory_cache structs
Allow the capacity of the kvm_mmu_memory_cache struct to be chosen at
declaration time rather than being fixed for all declarations. This will
be used in a follow-up commit to declare an cache in x86 with a capacity
of 512+ objects without having to increase the capacity of all caches in
KVM.

This change requires each cache now specify its capacity at runtime,
since the cache struct itself no longer has a fixed capacity known at
compile time. To protect against someone accidentally defining a
kvm_mmu_memory_cache struct directly (without the extra storage), this
commit includes a WARN_ON() in kvm_mmu_topup_memory_cache().

In order to support different capacities, this commit changes the
objects pointer array to be dynamically allocated the first time the
cache is topped-up.

While here, opportunistically clean up the stack-allocated
kvm_mmu_memory_cache structs in riscv and arm64 to use designated
initializers.

No functional change intended.

Reviewed-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: David Matlack <dmatlack@google.com>
Message-Id: <20220516232138.1783324-22-dmatlack@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-24 04:52:00 -04:00
..
boot riscv: dts: icicle: sort nodes alphabetically 2022-06-01 15:28:51 -07:00
configs RISC-V: configs: Configs that had RPMSG_CHAR now get RPMSG_CTRL 2022-04-26 08:19:53 -07:00
errata riscv: add memory-type errata for T-Head 2022-05-11 21:36:33 -07:00
include riscv: Move alternative length validation into subsection 2022-06-02 15:55:22 -07:00
kernel Bitmap patches for 5.19-rc1 2022-06-04 14:04:27 -07:00
kvm KVM: Allow for different capacities in kvm_mmu_memory_cache structs 2022-06-24 04:52:00 -04:00
lib riscv: Fixed misaligned memory access. Fixed pointer comparison. 2022-03-10 10:24:04 -08:00
mm riscv: mm: init: make pt_ops_set_[early|late|fixmap] static 2022-06-02 14:50:41 -07:00
net riscv, bpf: Implement more atomic operations for RV64 2022-04-11 16:54:54 +02:00
purgatory RISC-V: Add purgatory 2022-05-19 12:18:59 -07:00
Kbuild riscv: move errata/ and kvm/ builds to arch/riscv/Kbuild 2022-06-01 22:26:32 -07:00
Kconfig RISC-V: Only default to spinwait on SBI-0.1 and M-mode 2022-06-01 18:59:26 -07:00
Kconfig.debug RISC-V: Remove EARLY_PRINTK support 2018-12-17 10:23:46 -08:00
Kconfig.erratas riscv: add memory-type errata for T-Head 2022-05-11 21:36:33 -07:00
Kconfig.socs RISC-V Patches for the 5.19 Merge Window, Part 1 2022-05-31 14:10:54 -07:00
Makefile riscv: move errata/ and kvm/ builds to arch/riscv/Kbuild 2022-06-01 22:26:32 -07:00