]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
KVM: arm64: nv: Make ps_to_output_size() generally available
authorMarc Zyngier <maz@kernel.org>
Tue, 18 Jun 2024 09:12:15 +0000 (10:12 +0100)
committerMarc Zyngier <maz@kernel.org>
Fri, 30 Aug 2024 11:04:20 +0000 (12:04 +0100)
Make this helper visible to at.c, we are going to need it.

Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/include/asm/kvm_nested.h
arch/arm64/kvm/nested.c

index 43e531c67311cbd44a7c325dd5c614172304a528..e8bc6d67aba2991657c628d6dd45b3e8b0769c7c 100644 (file)
@@ -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 */
index 234d0f6006c61a89b88e0e1ffbcbc04c9c44b03c..9c8573493d80711d0ac3903937bb0109e0b423f1 100644 (file)
@@ -103,20 +103,6 @@ struct s2_walk_info {
        bool         be;
 };
 
-static 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;
-       }
-}
-
 static u32 compute_fsc(int level, u32 fsc)
 {
        return fsc | (level & 0x3);