[PATCH V2 1/8] KVM: arm64: ptdump: Test PMD_TYPE_MASK for block mapping

Anshuman Khandual posted 8 patches 9 months, 4 weeks ago
[PATCH V2 1/8] KVM: arm64: ptdump: Test PMD_TYPE_MASK for block mapping
Posted by Anshuman Khandual 9 months, 4 weeks ago
Test given page table entries against PMD_TYPE_SECT on PMD_TYPE_MASK mask
bits for identifying block mappings in stage 2 page tables.

Cc: Marc Zyngier <maz@kernel.org>
Cc: Oliver Upton <oliver.upton@linux.dev>
Cc: James Morse <james.morse@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: kvmarm@lists.linux.dev
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
---
 arch/arm64/kvm/ptdump.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/kvm/ptdump.c b/arch/arm64/kvm/ptdump.c
index e4a342e903e2..098416d7e5c2 100644
--- a/arch/arm64/kvm/ptdump.c
+++ b/arch/arm64/kvm/ptdump.c
@@ -52,8 +52,8 @@ static const struct ptdump_prot_bits stage2_pte_bits[] = {
 		.set	= "AF",
 		.clear	= "  ",
 	}, {
-		.mask	= PTE_TABLE_BIT | PTE_VALID,
-		.val	= PTE_VALID,
+		.mask	= PMD_TYPE_MASK,
+		.val	= PMD_TYPE_SECT,
 		.set	= "BLK",
 		.clear	= "   ",
 	},
-- 
2.25.1
Re: [PATCH V2 1/8] KVM: arm64: ptdump: Test PMD_TYPE_MASK for block mapping
Posted by Catalin Marinas 9 months, 1 week ago
On Fri, Feb 21, 2025 at 10:12:20AM +0530, Anshuman Khandual wrote:
> Test given page table entries against PMD_TYPE_SECT on PMD_TYPE_MASK mask
> bits for identifying block mappings in stage 2 page tables.
> 
> Cc: Marc Zyngier <maz@kernel.org>
> Cc: Oliver Upton <oliver.upton@linux.dev>
> Cc: James Morse <james.morse@arm.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: kvmarm@lists.linux.dev
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
> ---
>  arch/arm64/kvm/ptdump.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/kvm/ptdump.c b/arch/arm64/kvm/ptdump.c
> index e4a342e903e2..098416d7e5c2 100644
> --- a/arch/arm64/kvm/ptdump.c
> +++ b/arch/arm64/kvm/ptdump.c
> @@ -52,8 +52,8 @@ static const struct ptdump_prot_bits stage2_pte_bits[] = {
>  		.set	= "AF",
>  		.clear	= "  ",
>  	}, {
> -		.mask	= PTE_TABLE_BIT | PTE_VALID,
> -		.val	= PTE_VALID,
> +		.mask	= PMD_TYPE_MASK,
> +		.val	= PMD_TYPE_SECT,
>  		.set	= "BLK",
>  		.clear	= "   ",
>  	},

Marc, Oliver - are you ok with this patch going in through the arm64
tree?

Thanks.

-- 
Catalin
Re: [PATCH V2 1/8] KVM: arm64: ptdump: Test PMD_TYPE_MASK for block mapping
Posted by Marc Zyngier 9 months, 1 week ago
On 2025-03-11 18:10, Catalin Marinas wrote:
> On Fri, Feb 21, 2025 at 10:12:20AM +0530, Anshuman Khandual wrote:
>> Test given page table entries against PMD_TYPE_SECT on PMD_TYPE_MASK 
>> mask
>> bits for identifying block mappings in stage 2 page tables.
>> 
>> Cc: Marc Zyngier <maz@kernel.org>
>> Cc: Oliver Upton <oliver.upton@linux.dev>
>> Cc: James Morse <james.morse@arm.com>
>> Cc: Catalin Marinas <catalin.marinas@arm.com>
>> Cc: Will Deacon <will@kernel.org>
>> Cc: linux-arm-kernel@lists.infradead.org
>> Cc: kvmarm@lists.linux.dev
>> Cc: linux-kernel@vger.kernel.org
>> Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
>> ---
>>  arch/arm64/kvm/ptdump.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>> 
>> diff --git a/arch/arm64/kvm/ptdump.c b/arch/arm64/kvm/ptdump.c
>> index e4a342e903e2..098416d7e5c2 100644
>> --- a/arch/arm64/kvm/ptdump.c
>> +++ b/arch/arm64/kvm/ptdump.c
>> @@ -52,8 +52,8 @@ static const struct ptdump_prot_bits 
>> stage2_pte_bits[] = {
>>  		.set	= "AF",
>>  		.clear	= "  ",
>>  	}, {
>> -		.mask	= PTE_TABLE_BIT | PTE_VALID,
>> -		.val	= PTE_VALID,
>> +		.mask	= PMD_TYPE_MASK,
>> +		.val	= PMD_TYPE_SECT,
>>  		.set	= "BLK",
>>  		.clear	= "   ",
>>  	},
> 
> Marc, Oliver - are you ok with this patch going in through the arm64
> tree?

Yup, looks OK to me.

Acked-by: Marc Zyngier <maz@kernel.org>

         M.
-- 
Jazz is not dead. It just smells funny...