[PATCH v17 02/20] KVM: arm64: Avoid including linux/kvm_host.h in kvm_pgtable.h
Suzuki K Poulose
suzuki.poulose at arm.com
Wed Sep 9 04:24:09 PDT 2026
On 09/09/2026 12:22, Fuad Tabba wrote:
> On Tue, 8 Sept 2026 at 17:22, Suzuki K Poulose <suzuki.poulose at arm.com> wrote:
>>
>> From: Steven Price <steven.price at arm.com>
>>
>> To avoid future include cycles, drop the linux/kvm_host.h include in
>> kvm_pgtable.h and include the lightweight headers required for the types
>> and inline helpers used there. Additionally provide a forward
>> declaration for struct kvm_s2_mmu as it's only used as a pointer in this
>> file.
>>
>> Both pgtable.c and kvm_pkvm.h relied on the indirect inclusion of
>> kvm_host.h, so make that explicit.
>>
>> Signed-off-by: Steven Price <steven.price at arm.com>
>> ---
>> New patch in v13
>
> Is this meant to be here (the "New in patch 13")?
Just trying to carry the legacy, but yes, you're right. I could remove
it. v13, is so ancient now :-)
>
> Reviewed-by: Fuad Tabba <fuad.tabba at linux.dev>
Cheers
Suzuki
>
> Cheers,
> /fuad
>
>
>> ---
>> arch/arm64/include/asm/kvm_pgtable.h | 6 +++++-
>> arch/arm64/include/asm/kvm_pkvm.h | 2 +-
>> arch/arm64/kvm/hyp/pgtable.c | 1 +
>> 3 files changed, 7 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/arm64/include/asm/kvm_pgtable.h b/arch/arm64/include/asm/kvm_pgtable.h
>> index 41a8687938eb6..c2e4b29e605fc 100644
>> --- a/arch/arm64/include/asm/kvm_pgtable.h
>> +++ b/arch/arm64/include/asm/kvm_pgtable.h
>> @@ -8,9 +8,13 @@
>> #define __ARM64_KVM_PGTABLE_H__
>>
>> #include <linux/bits.h>
>> -#include <linux/kvm_host.h>
>> +#include <linux/kvm_types.h>
>> +#include <linux/rbtree_types.h>
>> +#include <linux/rcupdate.h>
>> #include <linux/types.h>
>>
>> +struct kvm_s2_mmu;
>> +
>> #define KVM_PGTABLE_FIRST_LEVEL -1
>> #define KVM_PGTABLE_LAST_LEVEL 3
>>
>> diff --git a/arch/arm64/include/asm/kvm_pkvm.h b/arch/arm64/include/asm/kvm_pkvm.h
>> index beea00e693a0a..54a618d887fa4 100644
>> --- a/arch/arm64/include/asm/kvm_pkvm.h
>> +++ b/arch/arm64/include/asm/kvm_pkvm.h
>> @@ -7,9 +7,9 @@
>> #define __ARM64_KVM_PKVM_H__
>>
>> #include <linux/arm_ffa.h>
>> +#include <linux/kvm_host.h>
>> #include <linux/memblock.h>
>> #include <linux/scatterlist.h>
>> -#include <asm/kvm_host.h>
>> #include <asm/kvm_pgtable.h>
>>
>> /* Maximum number of VMs that can co-exist under pKVM. */
>> diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c
>> index b74dd5ce1efd3..f48253b9d88b5 100644
>> --- a/arch/arm64/kvm/hyp/pgtable.c
>> +++ b/arch/arm64/kvm/hyp/pgtable.c
>> @@ -8,6 +8,7 @@
>> */
>>
>> #include <linux/bitfield.h>
>> +#include <linux/kvm_host.h>
>> #include <asm/kvm_pgtable.h>
>> #include <asm/stage2_pgtable.h>
>>
>> --
>> 2.43.0
>>
More information about the linux-arm-kernel
mailing list