KVM: arm/arm64: drop pr_info() of IDMAP page
PATCH 1/1 KVM: arm/arm64: drop pr_info() of IDMAP page
The KVM IDMAP is a mapping of a statically allocated kernel structure, and so printing its physical address leaks the physical placement of the kernel when physical KASLR is in effect. Just remove it, nobody except Marc needs this anyway.
---
CC -stable?
virt/kvm/arm/mmu.c | 1 - 1 file changed, 1 deletion(-)
virt/kvm/arm/mmu.c +0 -1
@@ -1810,7 +1810,6 @@ int kvm_mmu_init(void)*/ BUG_ON ((hyp_idmap_start ^ (hyp_idmap_end -1 )) &PAGE_MASK ); -kvm_info ("IDMAP page: %lx\n" , hyp_idmap_start);kvm_info ("HYP VA range: %lx:%lx\n" ,kern_hyp_va (PAGE_OFFSET ),kern_hyp_va (~0UL ));
Signature · 1 line
2.11.0
PATCH 1/1 KVM: arm/arm64: drop pr_info() of IDMAP page
Quoted 5 lines · Ard Biesheuvel
The KVM IDMAP is a mapping of a statically allocated kernel structure, and so printing its physical address leaks the physical placement of the kernel when physical KASLR is in effect. Just remove it, nobody except Marc needs this anyway.
Bah, even I don't really need it anymore...
Quoted 3 lines
Signed-off-by Ard Biesheuvel <[email protected]>---
CC -stable?
In this day and age, probably.
Quoted 9 lines
virt/kvm/arm/mmu.c | 1 - 1 file changed, 1 deletion(-)virt/kvm/arm/mmu.c +0
-0
virt/kvm/arm/mmu.c int kvm_mmu_init(void) · line 1814
Quoted 6 lines
virt/kvm/arm/mmu.c +0
-1@@ -1810,7 +1810,6 @@ int kvm_mmu_init(void)*/ BUG_ON ((hyp_idmap_start ^ (hyp_idmap_end -1 )) &PAGE_MASK ); -kvm_info ("IDMAP page: %lx\n" , hyp_idmap_start);kvm_info ("HYP VA range: %lx:%lx\n" ,kern_hyp_va (PAGE_OFFSET ),kern_hyp_va (~0UL ));
Instead of removing this particular line, how about turning all these kvm_info into kvm_debug (see [1])?
Thanks,
M.
[1] https://www.spinics.net/lists/arm-kernel/msg637920.html
Signature · 1 line
Jazz is not dead, it just smell funny.
PATCH 1/1 KVM: arm/arm64: drop pr_info() of IDMAP page
Quoted 28 lines · Marc Zyngier
Quoted 5 lines · Ard Biesheuvel
The KVM IDMAP is a mapping of a statically allocated kernel structure, and so printing its physical address leaks the physical placement of the kernel when physical KASLR is in effect. Just remove it, nobody except Marc needs this anyway.
Bah, even I don't really need it anymore...
Quoted 3 lines
Signed-off-by Ard Biesheuvel <[email protected]>---
CC -stable?In this day and age, probably.
Quoted 12 lines
virt/kvm/arm/mmu.c | 1 - 1 file changed, 1 deletion(-)virt/kvm/arm/mmu.c +0
-0@@ -1810,7 +1810,6 @@ int kvm_mmu_init(void)*/ BUG_ON ((hyp_idmap_start ^ (hyp_idmap_end -1 )) &PAGE_MASK );
Quoted 7 lines
virt/kvm/arm/mmu.c int kvm_mmu_init(void) · line 1814
Quoted 3 lines
virt/kvm/arm/mmu.c +0
-1-kvm_info ("IDMAP page: %lx\n" , hyp_idmap_start);kvm_info ("HYP VA range: %lx:%lx\n" ,kern_hyp_va (PAGE_OFFSET ),kern_hyp_va (~0UL ));Instead of removing this particular line, how about turning all these
kvm_infointokvm_debug(see [1])?
Yeah makes sense. Of the complete output
[ 2.046066] kvm [1]: 8-bit VMID [ 2.046072] kvm [1]: IDMAP page: d20e35000 [ 2.046077] kvm [1]: HYP VA range: 800000000000:ffffffffffff [ 2.046888] kvm [1]: vgic-v2 at 2c020000 [ 2.046944] kvm [1]: GIC system register CPU interface enabled [ 2.047585] kvm [1]: vgic interrupt IRQ1 [ 2.047603] kvm [1]: virtual timer IRQ4 [ 2.048282] kvm [1]: Hyp mode initialized successfully
I think only the first and the last one are useful, and perhaps the one about the sysreg interface?