* [XEN PATCH] xen/arm: Hide Pointer Authentication (PAC)
@ 2021-01-20 11:27 Vladimir Murzin
2021-01-20 17:19 ` Julien Grall
2021-01-20 17:44 ` Julien Grall
0 siblings, 2 replies; 4+ messages in thread
From: Vladimir Murzin @ 2021-01-20 11:27 UTC (permalink / raw)
To: xen-devel; +Cc: sstabellini, julien, Volodymyr_Babchuk
The ARMv8.3 Pointer Authentication extension is not supported by Xen
at the moment, so do not expose that via ID register.
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
xen/arch/arm/cpufeature.c | 6 +++++
xen/include/asm-arm/cpufeature.h | 38 +++++++++++++++++++++++++++++++-
2 files changed, 43 insertions(+), 1 deletion(-)
diff --git a/xen/arch/arm/cpufeature.c b/xen/arch/arm/cpufeature.c
index 99fe4db28..1d8878380 100644
--- a/xen/arch/arm/cpufeature.c
+++ b/xen/arch/arm/cpufeature.c
@@ -187,6 +187,12 @@ static int __init create_guest_cpuinfo(void)
/* Hide MTE support as Xen does not support it */
guest_cpuinfo.pfr64.mte = 0;
+
+ /* Hide PAC support as Xen does not support it */
+ guest_cpuinfo.isa64.apa = 0;
+ guest_cpuinfo.isa64.api = 0;
+ guest_cpuinfo.isa64.gpa = 0;
+ guest_cpuinfo.isa64.gpi = 0;
#endif
/* Hide AMU support */
diff --git a/xen/include/asm-arm/cpufeature.h b/xen/include/asm-arm/cpufeature.h
index c6e5711b2..43135abef 100644
--- a/xen/include/asm-arm/cpufeature.h
+++ b/xen/include/asm-arm/cpufeature.h
@@ -212,8 +212,44 @@ struct cpuinfo_arm {
};
} mm64;
- struct {
+ union {
uint64_t bits[2];
+ struct {
+ /* ISAR0 */
+ unsigned long __res0:4;
+ unsigned long aes:4;
+ unsigned long sha1:4;
+ unsigned long sha2:4;
+ unsigned long crc32:4;
+ unsigned long atomic:4;
+ unsigned long __res1:4;
+ unsigned long rdm:4;
+ unsigned long sha3:4;
+ unsigned long sm3:4;
+ unsigned long sm4:4;
+ unsigned long dp:4;
+ unsigned long fhm:4;
+ unsigned long ts:4;
+ unsigned long tlb:4;
+ unsigned long rndr:4;
+
+ /* ISAR1 */
+ unsigned long dpb:4;
+ unsigned long apa:4;
+ unsigned long api:4;
+ unsigned long jscvt:4;
+ unsigned long fcma:4;
+ unsigned long lrcpc:4;
+ unsigned long gpa:4;
+ unsigned long gpi:4;
+ unsigned long frintts:4;
+ unsigned long sb:4;
+ unsigned long specres:4;
+ unsigned long bf16:4;
+ unsigned long dgh:4;
+ unsigned long i8mm:4;
+ unsigned long __res0:8;
+ };
} isa64;
struct {
--
2.24.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [XEN PATCH] xen/arm: Hide Pointer Authentication (PAC)
2021-01-20 11:27 [XEN PATCH] xen/arm: Hide Pointer Authentication (PAC) Vladimir Murzin
@ 2021-01-20 17:19 ` Julien Grall
2021-01-20 17:44 ` Julien Grall
1 sibling, 0 replies; 4+ messages in thread
From: Julien Grall @ 2021-01-20 17:19 UTC (permalink / raw)
To: Vladimir Murzin, xen-devel; +Cc: sstabellini, Volodymyr_Babchuk
Hi Vladimir,
On 20/01/2021 11:27, Vladimir Murzin wrote:
> The ARMv8.3 Pointer Authentication extension is not supported by Xen
> at the moment, so do not expose that via ID register.
>
> Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
> Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
As I think this one can be considered as a bug fix to the recent series
from Bertrand. So I will commit it without Ian's RM tag (although he did
gave it on IRC).
Cheers,
--
Julien Grall
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [XEN PATCH] xen/arm: Hide Pointer Authentication (PAC)
2021-01-20 11:27 [XEN PATCH] xen/arm: Hide Pointer Authentication (PAC) Vladimir Murzin
2021-01-20 17:19 ` Julien Grall
@ 2021-01-20 17:44 ` Julien Grall
2021-01-20 17:49 ` Vladimir Murzin
1 sibling, 1 reply; 4+ messages in thread
From: Julien Grall @ 2021-01-20 17:44 UTC (permalink / raw)
To: Vladimir Murzin, xen-devel; +Cc: sstabellini, Volodymyr_Babchuk
Hi Vladimir,
On 20/01/2021 11:27, Vladimir Murzin wrote:
> The ARMv8.3 Pointer Authentication extension is not supported by Xen
> at the moment, so do not expose that via ID register.
>
> Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
> Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
> ---
> xen/arch/arm/cpufeature.c | 6 +++++
> xen/include/asm-arm/cpufeature.h | 38 +++++++++++++++++++++++++++++++-
> 2 files changed, 43 insertions(+), 1 deletion(-)
>
> diff --git a/xen/arch/arm/cpufeature.c b/xen/arch/arm/cpufeature.c
> index 99fe4db28..1d8878380 100644
> --- a/xen/arch/arm/cpufeature.c
> +++ b/xen/arch/arm/cpufeature.c
> @@ -187,6 +187,12 @@ static int __init create_guest_cpuinfo(void)
>
> /* Hide MTE support as Xen does not support it */
> guest_cpuinfo.pfr64.mte = 0;
> +
> + /* Hide PAC support as Xen does not support it */
> + guest_cpuinfo.isa64.apa = 0;
> + guest_cpuinfo.isa64.api = 0;
> + guest_cpuinfo.isa64.gpa = 0;
> + guest_cpuinfo.isa64.gpi = 0;
> #endif
>
> /* Hide AMU support */
> diff --git a/xen/include/asm-arm/cpufeature.h b/xen/include/asm-arm/cpufeature.h
> index c6e5711b2..43135abef 100644
> --- a/xen/include/asm-arm/cpufeature.h
> +++ b/xen/include/asm-arm/cpufeature.h
> @@ -212,8 +212,44 @@ struct cpuinfo_arm {
> };
> } mm64;
>
> - struct {
> + union {
> uint64_t bits[2];
> + struct {
> + /* ISAR0 */
> + unsigned long __res0:4;
> + unsigned long aes:4;
> + unsigned long sha1:4;
> + unsigned long sha2:4;
> + unsigned long crc32:4;
> + unsigned long atomic:4;
> + unsigned long __res1:4;
> + unsigned long rdm:4;
> + unsigned long sha3:4;
> + unsigned long sm3:4;
> + unsigned long sm4:4;
> + unsigned long dp:4;
> + unsigned long fhm:4;
> + unsigned long ts:4;
> + unsigned long tlb:4;
> + unsigned long rndr:4;
> +
> + /* ISAR1 */
> + unsigned long dpb:4;
> + unsigned long apa:4;
> + unsigned long api:4;
> + unsigned long jscvt:4;
> + unsigned long fcma:4;
> + unsigned long lrcpc:4;
> + unsigned long gpa:4;
> + unsigned long gpi:4;
> + unsigned long frintts:4;
> + unsigned long sb:4;
> + unsigned long specres:4;
> + unsigned long bf16:4;
> + unsigned long dgh:4;
> + unsigned long i8mm:4;
> + unsigned long __res0:8;
This unfortunately break the build on arm64 becase __res0 is defined
twiced in the structure:
oss/xen/xen/include/asm/cpufeature.h:251:27: error: duplicate member
‘__res0’
unsigned long __res0:8;
^~~~~~
The change is trivial, so I have resolved it (see change below) and
committed it:
diff --git a/xen/include/asm-arm/cpufeature.h
b/xen/include/asm-arm/cpufeature.h
index 2baf7919615d..70cb67301f74 100644
--- a/xen/include/asm-arm/cpufeature.h
+++ b/xen/include/asm-arm/cpufeature.h
@@ -248,7 +248,7 @@ struct cpuinfo_arm {
unsigned long bf16:4;
unsigned long dgh:4;
unsigned long i8mm:4;
- unsigned long __res0:8;
+ unsigned long __res2:8;
};
} isa64;
Cheers,
--
Julien Grall
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [XEN PATCH] xen/arm: Hide Pointer Authentication (PAC)
2021-01-20 17:44 ` Julien Grall
@ 2021-01-20 17:49 ` Vladimir Murzin
0 siblings, 0 replies; 4+ messages in thread
From: Vladimir Murzin @ 2021-01-20 17:49 UTC (permalink / raw)
To: Julien Grall, xen-devel; +Cc: sstabellini, Volodymyr_Babchuk
On 1/20/21 5:44 PM, Julien Grall wrote:
> Hi Vladimir,
>
> On 20/01/2021 11:27, Vladimir Murzin wrote:
>> The ARMv8.3 Pointer Authentication extension is not supported by Xen
>> at the moment, so do not expose that via ID register.
>>
>> Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
>> Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
>> ---
>> xen/arch/arm/cpufeature.c | 6 +++++
>> xen/include/asm-arm/cpufeature.h | 38 +++++++++++++++++++++++++++++++-
>> 2 files changed, 43 insertions(+), 1 deletion(-)
>>
>> diff --git a/xen/arch/arm/cpufeature.c b/xen/arch/arm/cpufeature.c
>> index 99fe4db28..1d8878380 100644
>> --- a/xen/arch/arm/cpufeature.c
>> +++ b/xen/arch/arm/cpufeature.c
>> @@ -187,6 +187,12 @@ static int __init create_guest_cpuinfo(void)
>> /* Hide MTE support as Xen does not support it */
>> guest_cpuinfo.pfr64.mte = 0;
>> +
>> + /* Hide PAC support as Xen does not support it */
>> + guest_cpuinfo.isa64.apa = 0;
>> + guest_cpuinfo.isa64.api = 0;
>> + guest_cpuinfo.isa64.gpa = 0;
>> + guest_cpuinfo.isa64.gpi = 0;
>> #endif
>> /* Hide AMU support */
>> diff --git a/xen/include/asm-arm/cpufeature.h b/xen/include/asm-arm/cpufeature.h
>> index c6e5711b2..43135abef 100644
>> --- a/xen/include/asm-arm/cpufeature.h
>> +++ b/xen/include/asm-arm/cpufeature.h
>> @@ -212,8 +212,44 @@ struct cpuinfo_arm {
>> };
>> } mm64;
>> - struct {
>> + union {
>> uint64_t bits[2];
>> + struct {
>> + /* ISAR0 */
>> + unsigned long __res0:4;
>> + unsigned long aes:4;
>> + unsigned long sha1:4;
>> + unsigned long sha2:4;
>> + unsigned long crc32:4;
>> + unsigned long atomic:4;
>> + unsigned long __res1:4;
>> + unsigned long rdm:4;
>> + unsigned long sha3:4;
>> + unsigned long sm3:4;
>> + unsigned long sm4:4;
>> + unsigned long dp:4;
>> + unsigned long fhm:4;
>> + unsigned long ts:4;
>> + unsigned long tlb:4;
>> + unsigned long rndr:4;
>> +
>> + /* ISAR1 */
>> + unsigned long dpb:4;
>> + unsigned long apa:4;
>> + unsigned long api:4;
>> + unsigned long jscvt:4;
>> + unsigned long fcma:4;
>> + unsigned long lrcpc:4;
>> + unsigned long gpa:4;
>> + unsigned long gpi:4;
>> + unsigned long frintts:4;
>> + unsigned long sb:4;
>> + unsigned long specres:4;
>> + unsigned long bf16:4;
>> + unsigned long dgh:4;
>> + unsigned long i8mm:4;
>> + unsigned long __res0:8;
>
> This unfortunately break the build on arm64 becase __res0 is defined twiced in the structure:
>
> oss/xen/xen/include/asm/cpufeature.h:251:27: error: duplicate member ‘__res0’
> unsigned long __res0:8;
> ^~~~~~
>
Sorry about that, I should have double checked that patch still compiles.
> The change is trivial, so I have resolved it (see change below) and committed it:
>
> diff --git a/xen/include/asm-arm/cpufeature.h b/xen/include/asm-arm/cpufeature.h
> index 2baf7919615d..70cb67301f74 100644
> --- a/xen/include/asm-arm/cpufeature.h
> +++ b/xen/include/asm-arm/cpufeature.h
> @@ -248,7 +248,7 @@ struct cpuinfo_arm {
> unsigned long bf16:4;
> unsigned long dgh:4;
> unsigned long i8mm:4;
> - unsigned long __res0:8;
> + unsigned long __res2:8;
> };
> } isa64;
>
LGTM, Great Thanks!
Vladimir
> Cheers,
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-01-20 17:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-20 11:27 [XEN PATCH] xen/arm: Hide Pointer Authentication (PAC) Vladimir Murzin
2021-01-20 17:19 ` Julien Grall
2021-01-20 17:44 ` Julien Grall
2021-01-20 17:49 ` Vladimir Murzin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).