[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH] xen/arm64: Hide FEAT_SME
Hi Julien, On 14/08/2024 22:00, Julien Grall wrote: CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email. Newer hardware may support FEAT_SME. Xen doesn't have any knowledge but it will still expose the feature to the VM. If the OS is trying to use SME, then it will crash. Solve by hiding FEAT_SME. Signed-off-by: Julien Grall <julien@xxxxxxx> --- The current approach used to create the domain cpuinfo is to hide (i.e. a denylist) what we know Xen is not supporting. The drawback with this approach is for newly introduced feature, Xen will expose it by default. If a kernel is trying to use it then it will crash. I can't really make my mind whether it would be better to expose only what we support (i.e. use an allowlist). AFAICT, there is no security concerns with the current approach because ID_* registers are not a way to tell the kernel which features are supported. A guest kernel could still try to access the new registers. So the most annoying bits is that booting Xen on a new HW may lead to an OS crashing. --- xen/arch/arm/cpufeature.c | 3 +++ xen/arch/arm/include/asm/cpufeature.h | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/cpufeature.c b/xen/arch/arm/cpufeature.c index ef77473bf8e3..b45dbe3c668d 100644 --- a/xen/arch/arm/cpufeature.c +++ b/xen/arch/arm/cpufeature.c @@ -208,6 +208,9 @@ static int __init create_domain_cpuinfo(void) domain_cpuinfo.pfr64.sve = 0; domain_cpuinfo.zfr64.bits[0] = 0; + /* Hide SMT support as Xen does not support it */ + domain_cpuinfo.pfr64.sme = 0; Instead of this, can we do the following :- domain_cpuinfo.pfr64.res1 = 0; This would imply that SME, RNDR_trap, CSV2_frac, NMI, etc are not supported. If later Xen decides to support any of these, then they can be selectively turned on for a domain in do_sysreg() (Similar to SVE). - Ayan
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |