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

Re: [PATCH] xen/arm: Warn user on cpu errata 832075


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Wed, 14 Oct 2020 16:03:04 +0000
  • Accept-language: en-GB, en-US
  • 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=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-SenderADCheck; bh=GroZN5Oqf9xFuSrmWp1qhjNI82PUQGs7fZy6KTEnEic=; b=CKqbunyaF5epRNEaqaNOuM1M4JPm9LVNTFO8JbvNDCDjzmKwS6Pko1rE412Op8ADpBWH9/y+HKQvk3unnswvyfhIYO3jsE7rFoTkUAGVpCuVGJ/6JTAvZTik7vPMKefiOOAY+QPpHWkVgKvlX7Xihhy9zCghjv1sJdN9Wnr6G7BjW2a/RNeDc1NExrjHeGOLC+KtfR8NzFPwSqHMYrpd4oQLIJESh+2udEjVA37D2nJGN9LmRFCM/uim3YONs6kKtgU8gLoQVKadRDbkdqBumYH/o4GbBgIS+wz3UfN8FiufXyU7c/4eeiWpQLG+Tae4m8X7+VKCWgBr5kXeGhaI9g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Lp7ObyWYb73RaX2wEIYA0VozMEjCUbcd9BN+pSgq9LiScvpXioC+SMEqSoZkadIG7j1sMncWqbxRCJtt8WhQrFQv58lt8GZG1SZ+UnbbUv+2X/GZNQaaJG0OVx1LQ9B2XGiFypzdKwqcJlADB7D0mAnMs14F4jnouIvzkBeQGPmhuGfi6jkWI0KBWB+JsJb8u2gvEQvkjAxw/MajCF8LK12xfNUWph0xYl71UhGwonpv1xxn8BH/f7zOXB1bmf0Wb2ibtE8F73yhxWJZXIFkbkTpMcfmeust/JRni3E4pqS/Z3m3UmAk7Y+fzz0vskQGFi5tJ/NcwTpQM0lJ18PZbQ==
  • Authentication-results-original: citrix.com; dkim=none (message not signed) header.d=none;citrix.com; dmarc=none action=none header.from=arm.com;
  • Cc: "open list:X86" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Wed, 14 Oct 2020 16:03:30 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: citrix.com; dkim=none (message not signed) header.d=none;citrix.com; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHWohbM+uoR14U9oEmwJFjy+kmnIqmW9/2AgABK1AA=
  • Thread-topic: [PATCH] xen/arm: Warn user on cpu errata 832075


> On 14 Oct 2020, at 12:35, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
> 
> On 14/10/2020 11:41, Bertrand Marquis wrote:
>> When a Cortex A57 processor is affected by CPU errata 832075, a guest
>> not implementing the workaround for it could deadlock the system.
>> Add a warning during boot informing the user that only trusted guests
>> should be executed on the system.
>> An equivalent warning is already given to the user by KVM on cores
>> affected by this errata.
>> 
>> Signed-off-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>
>> ---
>> xen/arch/arm/cpuerrata.c | 21 +++++++++++++++++++++
>> 1 file changed, 21 insertions(+)
>> 
>> diff --git a/xen/arch/arm/cpuerrata.c b/xen/arch/arm/cpuerrata.c
>> index 6c09017515..8f9ab6dde1 100644
>> --- a/xen/arch/arm/cpuerrata.c
>> +++ b/xen/arch/arm/cpuerrata.c
>> @@ -240,6 +240,26 @@ static int enable_ic_inv_hardening(void *data)
>> 
>> #endif
>> 
>> +#ifdef CONFIG_ARM64_ERRATUM_832075
>> +
>> +static int warn_device_load_acquire_errata(void *data)
>> +{
>> +    static bool warned = false;
>> +
>> +    if ( !warned )
>> +    {
>> +        warning_add("This CPU is affected by the errata 832075.\n"
>> +                    "Guests without required CPU erratum workarounds\n"
>> +                    "can deadlock the system!\n"
>> +                    "Only trusted guests should be used on this system.\n");
>> +        warned = true;
> 
> This is an antipattern, which probably wants fixing elsewhere as well.
> 
> warning_add() is __init.  It's not legitimate to call from a non-init
> function, and a less useless build system would have modpost to object.
> 
> The ARM_SMCCC_ARCH_WORKAROUND_1 instance asserts based on system state,
> but this provides no safety at all.
> 
> 
> What warning_add() actually does is queue messages for some point near
> the end of boot.  It's not clear that this is even a clever thing to do.
> 
> I'm very tempted to suggest a blanket change to printk_once().

If this is needed then this could be done in an other serie ?
Would be good to keep this patch as purely handling the errata.

Regards
Bertrand

> 
> ~Andrew
> 
>> +    }
>> +
>> +    return 0;
>> +}
>> +
>> +#endif
>> +
>> #ifdef CONFIG_ARM_SSBD
>> 
>> enum ssbd_state ssbd_state = ARM_SSBD_RUNTIME;
>> @@ -419,6 +439,7 @@ static const struct arm_cpu_capabilities arm_errata[] = {
>>         .capability = ARM64_WORKAROUND_DEVICE_LOAD_ACQUIRE,
>>         MIDR_RANGE(MIDR_CORTEX_A57, 0x00,
>>                    (1 << MIDR_VARIANT_SHIFT) | 2),
>> +        .enable = warn_device_load_acquire_errata,
>>     },
>> #endif
>> #ifdef CONFIG_ARM64_ERRATUM_834220




 


Rackspace

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