lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bf2e159e-4e78-407d-b6e9-071916a20816@arm.com>
Date: Thu, 16 May 2024 16:34:34 +0100
From: Steven Price <steven.price@....com>
To: Catalin Marinas <catalin.marinas@....com>
Cc: kvm@...r.kernel.org, kvmarm@...ts.linux.dev, Marc Zyngier
 <maz@...nel.org>, Will Deacon <will@...nel.org>,
 James Morse <james.morse@....com>, Oliver Upton <oliver.upton@...ux.dev>,
 Suzuki K Poulose <suzuki.poulose@....com>, Zenghui Yu
 <yuzenghui@...wei.com>, linux-arm-kernel@...ts.infradead.org,
 linux-kernel@...r.kernel.org, Joey Gouly <joey.gouly@....com>,
 Alexandru Elisei <alexandru.elisei@....com>,
 Christoffer Dall <christoffer.dall@....com>, Fuad Tabba <tabba@...gle.com>,
 linux-coco@...ts.linux.dev,
 Ganapatrao Kulkarni <gankulkarni@...amperecomputing.com>
Subject: Re: [PATCH v2 07/14] arm64: Make the PHYS_MASK_SHIFT dynamic

On 13/05/2024 17:38, Catalin Marinas wrote:
> On Fri, Apr 12, 2024 at 09:42:06AM +0100, Steven Price wrote:
>> diff --git a/arch/arm64/include/asm/kvm_arm.h b/arch/arm64/include/asm/kvm_arm.h
>> index e01bb5ca13b7..9944aca348bd 100644
>> --- a/arch/arm64/include/asm/kvm_arm.h
>> +++ b/arch/arm64/include/asm/kvm_arm.h
>> @@ -398,7 +398,7 @@
>>   * bits in PAR are res0.
>>   */
>>  #define PAR_TO_HPFAR(par)		\
>> -	(((par) & GENMASK_ULL(52 - 1, 12)) >> 8)
>> +	(((par) & GENMASK_ULL(MAX_PHYS_MASK_SHIFT - 1, 12)) >> 8)
> 
> Why does this need to be changed? It's still a constant not dependent on
> the new dynamic IPA size.

Good question - this appears to be a rebase error. Since commit
a0d37784bfd7 ("KVM: arm64: Fix PAR_TO_HPFAR() to work independently of
PA_BITS.") this macro no longer uses PHYS_MASK_SHIFT. Previously the
change was to just to keep this uses the new 'MAX' constant.

>> diff --git a/arch/arm64/include/asm/pgtable-hwdef.h b/arch/arm64/include/asm/pgtable-hwdef.h
>> index ef207a0d4f0d..90dc292bed5f 100644
>> --- a/arch/arm64/include/asm/pgtable-hwdef.h
>> +++ b/arch/arm64/include/asm/pgtable-hwdef.h
>> @@ -206,8 +206,8 @@
>>  /*
>>   * Highest possible physical address supported.
>>   */
>> -#define PHYS_MASK_SHIFT		(CONFIG_ARM64_PA_BITS)
>> -#define PHYS_MASK		((UL(1) << PHYS_MASK_SHIFT) - 1)
>> +#define MAX_PHYS_MASK_SHIFT	(CONFIG_ARM64_PA_BITS)
>> +#define MAX_PHYS_MASK		((UL(1) << PHYS_MASK_SHIFT) - 1)
> 
> I prefer to have MAX as suffix in those definitions, it matches other
> places like TASK_SIZE_MAX, PHYS_ADDR_MAX (I know PHYS_MASK_MAX doesn't
> roll off the tongue easily but very few people tend to read the kernel
> aloud ;)).

I could rename, but actually given the above rebasing errors it appears
these are actually no longer needed, so I'll just drop the MAX_xxx
definitions.

Thanks,

Steve


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ