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

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


  • To: Julien Grall <julien@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Wed, 14 Oct 2020 16:00:59 +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=ibaylR7xBjPsK6RSBCivOJaDHm8ur6lAqEqHCqFu66E=; b=jwRMq9QRiYu/v0wOt6TPc3/DMkAozzNqbB3F64NKWtML1g3Czy+qmzpy/YV8kbuR+Fxjhh0JDdbnbQkZF4BKsxHSfzjES5n7yhcztVl/j5gkVSq+WPUCeU871IigS7oxVNpYx3nemXdygSxVWcz5yOWR2W5w4A0R7lSXf2HW/hPsqcjj1ru9IPVfctWNE0rvVIivVTpt19zMco8gZi8Hj0lD2XU7ELjn5HKjNKUmAIuWZ/c9UNuJEFTIeimBknnQRP3D3UAJIQ50nk0oIzfMkG31i9UmpPSRd2LfOxk7feqxzgOKmJ5L5DZNO+HIo0IB9XjSHaDIybtIuh9E+Nh85g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZFwRAeuTl6I9b+HPZciS4XNqT9JKU+IZ9bd4zlsYlOx6QOy9pYEhfuGW3alO6kaDKVk8DQnzul9Y3ffdI9Vypj03g6Uy13cZ9LSGIeWZ7sU/3aM7FGkw2WRk5q0M4LP9UOyokBHlkFS7Bq+EaQqYSJgA67MZhjUADoZrTMwNNTcFvzd1e5M9ibC4zwbmBagG+s4KsCSv7okkiLvQDkLqIKojeJh0A6dLj/Cabxpzlf7DiuS3qPM2UQCXc2PyJyJyZ/mdnjS/7HHDycdajc4rlWvLKHyblynZURc5B1j8qpA4T61V3KRbpJfX7YKA8axxIRK+QSDLjeX1AgTpcNpQig==
  • Authentication-results-original: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Cc: "open list:X86" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Wed, 14 Oct 2020 16:01:19 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHWohbM+uoR14U9oEmwJFjy+kmnIqmW8XGAgABQygA=
  • Thread-topic: [PATCH] xen/arm: Warn user on cpu errata 832075


> On 14 Oct 2020, at 12:11, Julien Grall <julien@xxxxxxx> wrote:
> 
> Hi Bertrand,
> 
> 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.
> 
> I think we should update SUPPORT.MD to say we will not security support those 
> processors. Stefano, what do you think?

That could make sense to do that yes.
If Stefano confirms then i can do this in a v2

> 
>> An equivalent warning is already given to the user by KVM on cores
>> affected by this errata.
> 
> I don't seem to find the warning in Linux. Do you have a link?

sure:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=abf532cceaca9c21a148498091f87de1b8ae9b49

> 
>> 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;
> 
> I was going to suggest to use WARN_ON_ONCE() but it looks like it never made 
> upstream :(.

I did do this as it was done in the smc warning function (that’s why i pushed a 
patch for it).

Cheers
Bertrand

> 
>> +    }
>> +
>> +    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
> 
> -- 
> Julien Grall


 


Rackspace

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