[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/3] xen/arm: Sync sysregs and cpuinfo with Linux 5.18-rc3


  • To: Julien Grall <julien@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Wed, 4 May 2022 07:39:38 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=o6VHyoo9axMNr1V+wqh6VafmQkySppERg10V7U9lyyM=; b=SFNdUwFjV3EUMrcyibJkhGjcnZXJ22+/lZTQ+iIqE/tVMCQN6jC8wkGGdppEmsasf5QOTlZ89GKpbwc6k2UAn59QbhqhHle/UZtV2jh6IhuNm4SZ7Oi6EglHHBF7Ss2DfsmT5257/lrf64Pw56ql9i238zbglkMhqvLpVyqnEd6p/9weQ6L7HRRUfR1JsosTdltaGWK4PSkk4h2DJYkvAzlOmgN+pk7d63lw4Xk7fM8OsqD/VZOWH4kdU3MRwY2GIvUsKuvD2vQUeO0lbVaga/peisRfA5NRruITuhIWqbLfHg4d46U4ri129we3vivXuXV+2ihRJzADufuKNMLWmw==
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=o6VHyoo9axMNr1V+wqh6VafmQkySppERg10V7U9lyyM=; b=bHVmBexrz1x0P3XRCHtflgj3FPSo8YhKuVHH1oYuGi+y1WQYR7ecE+zssBH9hkkW0Pr5C+xKoV3hk3tAUI92A5PIP46zh4My3saD08pXZfAgLWg6NghIGMwc1xgtcQuEstohUxK9+PadUcaV0xWn6f4QwB+KWgG9x4bKRpcosoKLltfJxgz3Lwdpm4jFLcJ3tZ/ytkLONaO8aeed1OOyfdytXvz/kOx/4KRTnVplGbAem9rP1JD2niJD2Machp7LnPOeUILEeBvY3Phfxj8IDLb4AXytk/snt9xIzpPqkCLN9wf/6F0tibwNzOfGpBzDMCAMUEN4jHS5BDOpqFqOKw==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=Dx0z1afT19KF/t6HY9GDnkkyejvalkQL1P05YwzE13yT5xzcnwksCOLuzuwn9nVmCMA8NH529mpZu2cdzb21YbKFuP+k2in912DERtr3IcKO08pzhIkjwg76SNT/1y5ypk7sAItVvfp82asyu66XJXffQwY+Q8Mp9IY4kJCNHOodvwdBJoS5mNb/tw9pLc4B23n2/pvd67e8CzHrdD+3udCikcNbLOzrEPcsEcbKDayz35WgpOw7rK7jaxAS8GmngWaqMZM2SqzRGMyW5vXRcXrbuuwqMY/G7LPyclaFsOX62HiQc0wqf37UPzSUmon1Ib9GrxE+9Z+2rfcPq3PMmA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iJdKhf9Cxuc93JXXAMLZBWG+pnXJWMN0Q3uYScqdXi9X2gpx2D9x1ARPJZwXuJHl142j+qINzPlA/x2nPBpgDXdH9W5//y5jaFxPNW1pH4AticIUJgCEOoGatGhoCLHoI+M2IuZ5NlDaZfFFazWEGdb2J5ZVhltbEj4kpnu+WEkqaBckzXBSw0CxPUfDIrADv1sKMEzL/HT2OvRmtGDqm7tbfQL072jEr867jb+Oh2tfS9y7nGybQIp1P4RADMUdZkMDGO+/5wp9T5Pf2QQ2aocT3svqLTDpobzGUR5YW6O+NcEjxQOyzH5V5QUt5RO4BBXl+MoGjdR0y1O+NpPKXQ==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Wed, 04 May 2022 07:40:06 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHYXtGhqgeBKorGIE+S3ZHm07cmGK0Nc+GAgADisYA=
  • Thread-topic: [PATCH 1/3] xen/arm: Sync sysregs and cpuinfo with Linux 5.18-rc3

Hi Julien,

> On 3 May 2022, at 19:08, Julien Grall <julien@xxxxxxx> wrote:
> 
> Hi Bertrand,
> 
> On 03/05/2022 10:38, Bertrand Marquis wrote:
>> Sync arm64 sysreg bit shift definitions with status of Linux kernel as
>> of 5.18-rc3 version (linux commit b2d229d4ddb1).
>> Sync ID registers sanitization with the status of Linux 5.18-rc3 and add
>> sanitization of ISAR2 registers.
> Please outline which specific commits you are actually backported. This would 
> help to know what changed, why and also keep track of the autorships.
> 
> When possible, the changes should be separated to match each Linux commit we 
> backport.

As those are exactly identical to the linux tree, one can easily use git blame 
on the linux source tree to find those information if it is needed.

I checked a bit and this is not something that was required before (for example 
when the cpufeature was introduced).

> 
>> Complete AA64ISAR2 and AA64MMFR1 with more fields.
>> While there add a comment for MMFR bitfields as for other registers in
>> the cpuinfo structure definition.
> 
> AFAICT, this patch is doing 3 different things that are somewhat related:
> - Sync cpufeature.c
> - Update the headers with unused defines
> - Complete the structure cpufeature.h
> 
> All those changes seem to be independent, so I think they should be done 
> separately. This would help to keep the authorship right (your code vs Linux 
> code).

This and the previous request to split using linux commit will actually end up 
in 10 patches or more.

In the current, the change can easily be checked doing a diff with the 
mentioned Linux version, so I am not really thrilled to make it more complex.

Please confirm that all this is really what you want.

> 
>> Signed-off-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>
>> ---
>> xen/arch/arm/arm64/cpufeature.c | 18 +++++-
>> xen/arch/arm/include/asm/arm64/sysregs.h | 76 ++++++++++++++++++++----
>> xen/arch/arm/include/asm/cpufeature.h | 14 ++++-
>> 3 files changed, 91 insertions(+), 17 deletions(-)
>> diff --git a/xen/arch/arm/arm64/cpufeature.c 
>> b/xen/arch/arm/arm64/cpufeature.c
>> index 6e5d30dc7b..d9039d37b2 100644
>> --- a/xen/arch/arm/arm64/cpufeature.c
>> +++ b/xen/arch/arm/arm64/cpufeature.c
>> @@ -143,6 +143,16 @@ static const struct arm64_ftr_bits ftr_id_aa64isar1[] = 
>> {
>>      ARM64_FTR_END,
>> };
>> +static const struct arm64_ftr_bits ftr_id_aa64isar2[] = {
>> +    ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_HIGHER_SAFE, 
>> ID_AA64ISAR2_CLEARBHB_SHIFT, 4, 0),
>> +    ARM64_FTR_BITS(FTR_VISIBLE_IF_IS_ENABLED(CONFIG_ARM64_PTR_AUTH),
>> +             FTR_STRICT, FTR_EXACT, ID_AA64ISAR2_APA3_SHIFT, 4, 0),
>> +    ARM64_FTR_BITS(FTR_VISIBLE_IF_IS_ENABLED(CONFIG_ARM64_PTR_AUTH),
> So we are using CONFIG_ARM64_PTR_AUTH. But this is not defined in Kconfig. I 
> realize there are more in cpufeature.c (somehow I didn't spot during 
> preview), but I don't think this is right to define CONFIG_* without an 
> associated entry in Kconfig.
> 
> In one hand, I think it would be odd to add an entry in Kconfig because Xen 
> wouldn't properly work if selected. On the other hand, it is useful if when 
> we will implement pointer authentification.
> 
> So maybe we should just add the Kconfig entry with a comment explaning why 
> they are not selected. Any thoughts?

This is really right and a very good catch.

I think it would make sense to introduce those in Kconfig in order to keep the 
code equivalent to Linux.

So I would suggest here to add hidden entries like this:

ARM64_PTR_AUTH
        def_bool n
        depends on ARM64
        help
          Pointer authentication support.
          This feature is not supported by Xen.

Cheers
Bertrand

> 
> Cheers,
> 
> -- 
> Julien Grall




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.