* [PATCH 1/2] KVM: arm64: Drop useless __GFP_HIGHMEM from kvm struct allocation
2025-11-19 9:38 [PATCH 0/2] KVM: arm64: Fixes to KVM struct allocation Oliver Upton
@ 2025-11-19 9:38 ` Oliver Upton
2025-11-20 7:08 ` Nathan Chancellor
2025-11-19 9:38 ` [PATCH 2/2] KVM: arm64: Use kvzalloc() for " Oliver Upton
` (4 subsequent siblings)
5 siblings, 1 reply; 8+ messages in thread
From: Oliver Upton @ 2025-11-19 9:38 UTC (permalink / raw)
To: kvmarm
Cc: Marc Zyngier, Joey Gouly, Suzuki K Poulose, Zenghui Yu,
Oliver Upton, Vishal Moola (Oracle), Nathan Chancellor
A recent change on the receiving end of vmalloc() started warning about
unsupported GFP flags passed by the caller. Nathan reports that this
warning fires in kvm_arch_alloc_vm(), owing to the fact that KVM is
passing a meaningless __GFP_HIGHMEM.
Do as the warning says and fix the code.
Cc: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Reported-by: Nathan Chancellor <nathan@kernel.org>
Closes: https://lore.kernel.org/kvmarm/20251118224448.GA998046@ax162/
Signed-off-by: Oliver Upton <oupton@kernel.org>
---
arch/arm64/kvm/arm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
index 870953b4a8a7..e791fa52f874 100644
--- a/arch/arm64/kvm/arm.c
+++ b/arch/arm64/kvm/arm.c
@@ -440,7 +440,7 @@ struct kvm *kvm_arch_alloc_vm(void)
if (!has_vhe())
return kzalloc(sz, GFP_KERNEL_ACCOUNT);
- return __vmalloc(sz, GFP_KERNEL_ACCOUNT | __GFP_HIGHMEM | __GFP_ZERO);
+ return __vmalloc(sz, GFP_KERNEL_ACCOUNT | __GFP_ZERO);
}
int kvm_arch_vcpu_precreate(struct kvm *kvm, unsigned int id)
--
2.47.3
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH 1/2] KVM: arm64: Drop useless __GFP_HIGHMEM from kvm struct allocation
2025-11-19 9:38 ` [PATCH 1/2] KVM: arm64: Drop useless __GFP_HIGHMEM from kvm " Oliver Upton
@ 2025-11-20 7:08 ` Nathan Chancellor
0 siblings, 0 replies; 8+ messages in thread
From: Nathan Chancellor @ 2025-11-20 7:08 UTC (permalink / raw)
To: Oliver Upton
Cc: kvmarm, Marc Zyngier, Joey Gouly, Suzuki K Poulose, Zenghui Yu,
Vishal Moola (Oracle)
On Wed, Nov 19, 2025 at 01:38:21AM -0800, Oliver Upton wrote:
> A recent change on the receiving end of vmalloc() started warning about
> unsupported GFP flags passed by the caller. Nathan reports that this
> warning fires in kvm_arch_alloc_vm(), owing to the fact that KVM is
> passing a meaningless __GFP_HIGHMEM.
>
> Do as the warning says and fix the code.
>
> Cc: Vishal Moola (Oracle) <vishal.moola@gmail.com>
> Reported-by: Nathan Chancellor <nathan@kernel.org>
> Closes: https://lore.kernel.org/kvmarm/20251118224448.GA998046@ax162/
> Signed-off-by: Oliver Upton <oupton@kernel.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Thanks for the patch!
> ---
> arch/arm64/kvm/arm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
> index 870953b4a8a7..e791fa52f874 100644
> --- a/arch/arm64/kvm/arm.c
> +++ b/arch/arm64/kvm/arm.c
> @@ -440,7 +440,7 @@ struct kvm *kvm_arch_alloc_vm(void)
> if (!has_vhe())
> return kzalloc(sz, GFP_KERNEL_ACCOUNT);
>
> - return __vmalloc(sz, GFP_KERNEL_ACCOUNT | __GFP_HIGHMEM | __GFP_ZERO);
> + return __vmalloc(sz, GFP_KERNEL_ACCOUNT | __GFP_ZERO);
> }
>
> int kvm_arch_vcpu_precreate(struct kvm *kvm, unsigned int id)
> --
> 2.47.3
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/2] KVM: arm64: Use kvzalloc() for kvm struct allocation
2025-11-19 9:38 [PATCH 0/2] KVM: arm64: Fixes to KVM struct allocation Oliver Upton
2025-11-19 9:38 ` [PATCH 1/2] KVM: arm64: Drop useless __GFP_HIGHMEM from kvm " Oliver Upton
@ 2025-11-19 9:38 ` Oliver Upton
2025-11-19 10:32 ` [PATCH 0/2] KVM: arm64: Fixes to KVM " Joey Gouly
` (3 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Oliver Upton @ 2025-11-19 9:38 UTC (permalink / raw)
To: kvmarm; +Cc: Marc Zyngier, Joey Gouly, Suzuki K Poulose, Zenghui Yu,
Oliver Upton
Physically-allocated KVM structs aren't necessary when in VHE mode as
there's no need to share with the hyp's address space. Of course, there
can still be a performance benefit from physical allocations.
Use kvzalloc() for opportunistic physical allocations.
Signed-off-by: Oliver Upton <oupton@kernel.org>
---
arch/arm64/kvm/arm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
index e791fa52f874..ecbe2c8dc00c 100644
--- a/arch/arm64/kvm/arm.c
+++ b/arch/arm64/kvm/arm.c
@@ -440,7 +440,7 @@ struct kvm *kvm_arch_alloc_vm(void)
if (!has_vhe())
return kzalloc(sz, GFP_KERNEL_ACCOUNT);
- return __vmalloc(sz, GFP_KERNEL_ACCOUNT | __GFP_ZERO);
+ return kvzalloc(sz, GFP_KERNEL_ACCOUNT);
}
int kvm_arch_vcpu_precreate(struct kvm *kvm, unsigned int id)
--
2.47.3
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH 0/2] KVM: arm64: Fixes to KVM struct allocation
2025-11-19 9:38 [PATCH 0/2] KVM: arm64: Fixes to KVM struct allocation Oliver Upton
2025-11-19 9:38 ` [PATCH 1/2] KVM: arm64: Drop useless __GFP_HIGHMEM from kvm " Oliver Upton
2025-11-19 9:38 ` [PATCH 2/2] KVM: arm64: Use kvzalloc() for " Oliver Upton
@ 2025-11-19 10:32 ` Joey Gouly
2025-11-19 13:08 ` Marc Zyngier
` (2 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Joey Gouly @ 2025-11-19 10:32 UTC (permalink / raw)
To: Oliver Upton; +Cc: kvmarm, Marc Zyngier, Suzuki K Poulose, Zenghui Yu
On Wed, Nov 19, 2025 at 01:38:20AM -0800, Oliver Upton wrote:
> Small fix to drop __GFP_HIGHMEM from KVM struct allocation GFP flags,
> which was always completely pointless and now trips a WARN for passing
> such an unsupported flag to vmalloc().
>
> Oliver Upton (2):
> KVM: arm64: Drop useless __GFP_HIGHMEM from kvm struct allocation
> KVM: arm64: Use kvzalloc() for kvm struct allocation
>
> arch/arm64/kvm/arm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>
> base-commit: dcb6fa37fd7bc9c3d2b066329b0d27dedf8becaa
Also nice to drop a usage of a __-prefixed function.
Reviewed-by: Joey Gouly <joey.gouly@arm.com>
> --
> 2.47.3
>
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH 0/2] KVM: arm64: Fixes to KVM struct allocation
2025-11-19 9:38 [PATCH 0/2] KVM: arm64: Fixes to KVM struct allocation Oliver Upton
` (2 preceding siblings ...)
2025-11-19 10:32 ` [PATCH 0/2] KVM: arm64: Fixes to KVM " Joey Gouly
@ 2025-11-19 13:08 ` Marc Zyngier
2025-11-19 19:12 ` Vishal Moola (Oracle)
2025-11-19 22:35 ` Oliver Upton
5 siblings, 0 replies; 8+ messages in thread
From: Marc Zyngier @ 2025-11-19 13:08 UTC (permalink / raw)
To: Oliver Upton; +Cc: kvmarm, Joey Gouly, Suzuki K Poulose, Zenghui Yu
On Wed, 19 Nov 2025 09:38:20 +0000,
Oliver Upton <oupton@kernel.org> wrote:
>
> Small fix to drop __GFP_HIGHMEM from KVM struct allocation GFP flags,
> which was always completely pointless and now trips a WARN for passing
> such an unsupported flag to vmalloc().
>
> Oliver Upton (2):
> KVM: arm64: Drop useless __GFP_HIGHMEM from kvm struct allocation
> KVM: arm64: Use kvzalloc() for kvm struct allocation
>
> arch/arm64/kvm/arm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Seems sensible. FWIW:
Reviewed-by: Marc Zyngier <maz@kernel.org>
M.
--
Without deviation from the norm, progress is not possible.
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH 0/2] KVM: arm64: Fixes to KVM struct allocation
2025-11-19 9:38 [PATCH 0/2] KVM: arm64: Fixes to KVM struct allocation Oliver Upton
` (3 preceding siblings ...)
2025-11-19 13:08 ` Marc Zyngier
@ 2025-11-19 19:12 ` Vishal Moola (Oracle)
2025-11-19 22:35 ` Oliver Upton
5 siblings, 0 replies; 8+ messages in thread
From: Vishal Moola (Oracle) @ 2025-11-19 19:12 UTC (permalink / raw)
To: Oliver Upton
Cc: kvmarm, Marc Zyngier, Joey Gouly, Suzuki K Poulose, Zenghui Yu
On Wed, Nov 19, 2025 at 01:38:20AM -0800, Oliver Upton wrote:
> Small fix to drop __GFP_HIGHMEM from KVM struct allocation GFP flags,
> which was always completely pointless and now trips a WARN for passing
> such an unsupported flag to vmalloc().
>
> Oliver Upton (2):
> KVM: arm64: Drop useless __GFP_HIGHMEM from kvm struct allocation
> KVM: arm64: Use kvzalloc() for kvm struct allocation
>
> arch/arm64/kvm/arm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
For the series:
Acked-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH 0/2] KVM: arm64: Fixes to KVM struct allocation
2025-11-19 9:38 [PATCH 0/2] KVM: arm64: Fixes to KVM struct allocation Oliver Upton
` (4 preceding siblings ...)
2025-11-19 19:12 ` Vishal Moola (Oracle)
@ 2025-11-19 22:35 ` Oliver Upton
5 siblings, 0 replies; 8+ messages in thread
From: Oliver Upton @ 2025-11-19 22:35 UTC (permalink / raw)
To: kvmarm, Oliver Upton
Cc: Marc Zyngier, Joey Gouly, Suzuki K Poulose, Zenghui Yu
On Wed, 19 Nov 2025 01:38:20 -0800, Oliver Upton wrote:
> Small fix to drop __GFP_HIGHMEM from KVM struct allocation GFP flags,
> which was always completely pointless and now trips a WARN for passing
> such an unsupported flag to vmalloc().
>
> Oliver Upton (2):
> KVM: arm64: Drop useless __GFP_HIGHMEM from kvm struct allocation
> KVM: arm64: Use kvzalloc() for kvm struct allocation
>
> [...]
Applied to next, thanks!
[1/2] KVM: arm64: Drop useless __GFP_HIGHMEM from kvm struct allocation
https://git.kernel.org/kvmarm/kvmarm/c/297877069bc2
[2/2] KVM: arm64: Use kvzalloc() for kvm struct allocation
https://git.kernel.org/kvmarm/kvmarm/c/cb17d79ff51d
--
Best,
Oliver
^ permalink raw reply [flat|nested] 8+ messages in thread