diff options
| author | Marc Zyngier <maz@kernel.org> | 2024-06-18 10:12:15 +0100 |
|---|---|---|
| committer | Marc Zyngier <maz@kernel.org> | 2024-08-30 12:04:20 +0100 |
| commit | 97634dac1974d28e5ffc067d257f0b0f79b5ed2e (patch) | |
| tree | 78070f13c3fd3683c0278484fc0fe51b6be8925d /arch/arm64/include/asm/kvm_nested.h | |
| parent | be04cebf3e78874627dc1042991d5d504464a5cc (diff) | |
KVM: arm64: nv: Make ps_to_output_size() generally available
Make this helper visible to at.c, we are going to need it.
Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'arch/arm64/include/asm/kvm_nested.h')
| -rw-r--r-- | arch/arm64/include/asm/kvm_nested.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/kvm_nested.h b/arch/arm64/include/asm/kvm_nested.h index 43e531c67311..e8bc6d67aba2 100644 --- a/arch/arm64/include/asm/kvm_nested.h +++ b/arch/arm64/include/asm/kvm_nested.h @@ -227,4 +227,18 @@ static inline u64 kvm_encode_nested_level(struct kvm_s2_trans *trans) shift; \ }) +static inline unsigned int ps_to_output_size(unsigned int ps) +{ + switch (ps) { + case 0: return 32; + case 1: return 36; + case 2: return 40; + case 3: return 42; + case 4: return 44; + case 5: + default: + return 48; + } +} + #endif /* __ARM64_KVM_NESTED_H */ |