Skip to content

Commit ee1bc69

Browse files
committed
powerpc/kvm: Fix build error when PPC_MEM_KEYS/PPC_PSERIES=n
lkp reported a randconfig failure: In file included from arch/powerpc/include/asm/book3s/64/pkeys.h:6, from arch/powerpc/kvm/book3s_64_mmu_host.c:15: arch/powerpc/include/asm/book3s/64/hash-pkey.h: In function 'hash__vmflag_to_pte_pkey_bits': >> arch/powerpc/include/asm/book3s/64/hash-pkey.h:10:23: error: 'VM_PKEY_BIT0' undeclared 10 | return (((vm_flags & VM_PKEY_BIT0) ? H_PTE_PKEY_BIT0 : 0x0UL) | | ^~~~~~~~~~~~ We added the include of book3s/64/pkeys.h for pte_to_hpte_pkey_bits(), but that header on its own should only be included when PPC_MEM_KEYS=y. Instead include linux/pkeys.h, which brings in the right definitions when PPC_MEM_KEYS=y and also provides empty stubs when PPC_MEM_KEYS=n. Fixes: e4e8bc1 ("powerpc/kvm: Fix PR KVM with KUAP/MEM_KEYS enabled") Cc: [email protected] # v5.11+ Reported-by: kernel test robot <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 30c4008 commit ee1bc69

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/powerpc/kvm/book3s_64_mmu_host.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
*/
99

1010
#include <linux/kvm_host.h>
11+
#include <linux/pkeys.h>
1112

1213
#include <asm/kvm_ppc.h>
1314
#include <asm/kvm_book3s.h>
1415
#include <asm/book3s/64/mmu-hash.h>
15-
#include <asm/book3s/64/pkeys.h>
1616
#include <asm/machdep.h>
1717
#include <asm/mmu_context.h>
1818
#include <asm/hw_irq.h>

0 commit comments

Comments
 (0)