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

Re: [PATCH] x86/amd: Fix DE_CFG truncation in amd_check_zenbleed()


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 31 Jul 2023 11:02:33 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vPcyrBG36cU2uUO4yJSjElzVjCLqsd0hqdFY+PKFFtA=; b=GpKhWLnaAyoYf0y4QsU+7FAEElJXxelU9wPv+GVecz9YhiEByaNELFR/R7gNqsJpo9PV+UgQJh/hZNC8TAthPSZted+RscNwL8yffG27NavC51S3u1qSNb7s24TtT518HjcQyOH0smImb+GLcm41ieHk7fvgRaIqZ9sKIPcxifIASZ/sT1wq/+aIvaphLbBnaKflxSKzslOFemXjhZuSB8riEXRnGSFN6iu1vWxKzSR9izd4CleZkMezHXRDjW3Ez9gOW2uKSFtyc4sc+JudPKcedgcJTSLc0v9V0s2F4ji9ladczpsBBfKZ4SdpAYbDl3iWpfd3X6kam5a1DERprQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZUlt8Y76Y0NXkniCzEW5TbX6IVs0tqoaeEUL3hk6zmxUhAMUvk5rXgdBT+lIRL5kZvjC++mzTnleFhZ8KNFnExThi/DmeNQCqEK6rI6OJWXn5Z4GK16h4Bp3OqqvfWSxEV1uASz8O13Y8PSOmg8jOOJpT9soxirCLBYm33KzA8CuggZ4MzMLy28iRHFh91A7nS+CbddEvTMwJimIoqO+CPhaJDBMNdqltphZ8YMg20Kmrh3ix4XFhya6Q6G1DSkKHBUGNqqaCTIv54T/MSwyE8frDPepI1Ib248+vRR8lYioN3itMkfoJ7GW5VQlezeuIKOlhICCzptiJ/1TI+Sjmg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 31 Jul 2023 09:02:43 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 28.07.2023 20:17, Andrew Cooper wrote:
> This line:
> 
>       val &= ~chickenbit;
> 
> ends up truncating val to 32 bits, and turning off various errata workarounds
> in Zen2 systems.
> 
> Fixes: f91c5ea97067 ("x86/amd: Mitigations for Zenbleed")
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> ---
> CC: Jan Beulich <JBeulich@xxxxxxxx>
> CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> CC: Wei Liu <wl@xxxxxxx>
> 
> The choice is between int or uint64_t.  This is one case where the insistence
> on using unsigned int as a default data type is genuinely unsafe.

It is not. The (unsigned) type should have been wide enough. From a Misra
perspective I'm pretty sure we would be better off using uint64_t. But in
the interest of getting this in without a lot of discussion I'll leave the
decision up to you; either way
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

Jan



 


Rackspace

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