Re: [PATCH] arm64/kvm: Fix zapping stage2 page table wrongly

2020-09-02 Thread Gavin Shan
Hi Marc, On 9/2/20 9:10 PM, Marc Zyngier wrote: On 2020-09-02 11:59, Alexandru Elisei wrote: [...] From 2a345a826a47f9061bb37045a1d89ea54b51fb80 Mon Sep 17 00:00:00 2001 From: Marc Zyngier Date: Wed, 2 Sep 2020 11:18:29 +0100 Subject: [PATCH] KVM: arm64: Do not try to map PUDs when they a

Re: [PATCH] arm64/kvm: Fix zapping stage2 page table wrongly

2020-09-02 Thread Auger Eric
Hi Marc, On 9/2/20 1:10 PM, Marc Zyngier wrote: > On 2020-09-02 11:59, Alexandru Elisei wrote: >> Hi, >> >> On 8/22/20 3:44 AM, Gavin Shan wrote: >>> Depending on the kernel configuration, PUD_SIZE could be equal to >>> PMD_SIZE. For example, both of them are 512MB with the following >>> kernel co

Re: [PATCH] arm64/kvm: Fix zapping stage2 page table wrongly

2020-09-02 Thread Alexandru Elisei
Hi Marc, On 9/2/20 1:04 PM, Marc Zyngier wrote: > On 2020-09-02 12:53, Alexandru Elisei wrote: >> Hi Marc, >> >> On 9/2/20 12:10 PM, Marc Zyngier wrote: >>> On 2020-09-02 11:59, Alexandru Elisei wrote: Hi, On 8/22/20 3:44 AM, Gavin Shan wrote: > Depending on the kernel configura

Re: [PATCH] arm64/kvm: Fix zapping stage2 page table wrongly

2020-09-02 Thread Marc Zyngier
On 2020-09-02 12:53, Alexandru Elisei wrote: Hi Marc, On 9/2/20 12:10 PM, Marc Zyngier wrote: On 2020-09-02 11:59, Alexandru Elisei wrote: Hi, On 8/22/20 3:44 AM, Gavin Shan wrote: Depending on the kernel configuration, PUD_SIZE could be equal to PMD_SIZE. For example, both of them are 512MB

Re: [PATCH] arm64/kvm: Fix zapping stage2 page table wrongly

2020-09-02 Thread Alexandru Elisei
Hi, On 9/2/20 12:53 PM, Alexandru Elisei wrote: > [..] > And we end up jumping back to retry forever. IMO, in user_mem_abort(), if > PUD_SIZE > == PMD_SIZE, we should try to map PMD_SIZE instead of PUD_SIZE. Maybe > something > like this? > > diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mm

Re: [PATCH] arm64/kvm: Fix zapping stage2 page table wrongly

2020-09-02 Thread Alexandru Elisei
Hi Marc, On 9/2/20 12:10 PM, Marc Zyngier wrote: > On 2020-09-02 11:59, Alexandru Elisei wrote: >> Hi, >> >> On 8/22/20 3:44 AM, Gavin Shan wrote: >>> Depending on the kernel configuration, PUD_SIZE could be equal to >>> PMD_SIZE. For example, both of them are 512MB with the following >>> kernel c

Re: [PATCH] arm64/kvm: Fix zapping stage2 page table wrongly

2020-09-02 Thread Marc Zyngier
On 2020-09-02 11:59, Alexandru Elisei wrote: Hi, On 8/22/20 3:44 AM, Gavin Shan wrote: Depending on the kernel configuration, PUD_SIZE could be equal to PMD_SIZE. For example, both of them are 512MB with the following kernel configuration. In this case, both PUD and PMD are folded to PGD. C

Re: [PATCH] arm64/kvm: Fix zapping stage2 page table wrongly

2020-09-02 Thread Alexandru Elisei
Hi, On 8/22/20 3:44 AM, Gavin Shan wrote: > Depending on the kernel configuration, PUD_SIZE could be equal to > PMD_SIZE. For example, both of them are 512MB with the following > kernel configuration. In this case, both PUD and PMD are folded > to PGD. > >CONFIG_ARM64_64K_PAGES y >CONFIG

Re: [PATCH] arm64/kvm: Fix zapping stage2 page table wrongly

2020-09-01 Thread Marc Zyngier
Hi Gavin, On 2020-08-23 00:59, Gavin Shan wrote: Hi Marc, On 8/22/20 8:01 PM, Marc Zyngier wrote: On Sat, 22 Aug 2020 03:44:44 +0100, Gavin Shan wrote: Depending on the kernel configuration, PUD_SIZE could be equal to PMD_SIZE. For example, both of them are 512MB with the following kernel c

Re: [PATCH] arm64/kvm: Fix zapping stage2 page table wrongly

2020-08-22 Thread Gavin Shan
Hi Marc, On 8/22/20 8:01 PM, Marc Zyngier wrote: On Sat, 22 Aug 2020 03:44:44 +0100, Gavin Shan wrote: Depending on the kernel configuration, PUD_SIZE could be equal to PMD_SIZE. For example, both of them are 512MB with the following kernel configuration. In this case, both PUD and PMD are fo

Re: [PATCH] arm64/kvm: Fix zapping stage2 page table wrongly

2020-08-22 Thread Marc Zyngier
Hi Gavin, Adding the usual suspects to the Cc list. On Sat, 22 Aug 2020 03:44:44 +0100, Gavin Shan wrote: > > Depending on the kernel configuration, PUD_SIZE could be equal to > PMD_SIZE. For example, both of them are 512MB with the following > kernel configuration. In this case, both PUD and P

[PATCH] arm64/kvm: Fix zapping stage2 page table wrongly

2020-08-21 Thread Gavin Shan
Depending on the kernel configuration, PUD_SIZE could be equal to PMD_SIZE. For example, both of them are 512MB with the following kernel configuration. In this case, both PUD and PMD are folded to PGD. CONFIG_ARM64_64K_PAGES y CONFIG_ARM64_VA_BITS 42 CONFIG_PGTABLE_LEVELS2 Wit