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

Re: [RFC?] xen/arm: memaccess: Pass struct npfec by reference in p2m_mem_access_check


  • To: Oleksandr Tyshchenko <olekstysh@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 26 Nov 2021 08:46:38 +0100
  • 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=Ue/+97yGCMNvbWu+AvN8iBKquKtgDOSOMnRt2uD6tjQ=; b=SkA78y2HWzYyt5fnOaXzP1bM+LOsGvi8eLs9FME63TpguDyA/g3dBFH8/fUN9/2Rh7tDkwsEeL9melNKOagBwSVbs/T9A6mBgSasIXIPlR3VmvytIQLQLbwZZdHRspfXdzH0GHuhi3RzbTj22PLaQe2nEwi8Nc8v9GhiuDBDYKlddKFYa6073K8Jt8+j1uqJfkUkh6Ynn+izzHi4oVO+DjzrrYYvacRXTSqo66a/OjYHSOLSKXaBkblQ+eXsDcK6trFaCtQ9o3vxh5p4yvwK8km1W/x9gZzLIc5GtVybxrv/e+MjPrLguJJGVYX5l+AyB09EDIIeNIzdnGafYKxwLg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LVfm388N+BwREqt5LODC0Uap4VawNeJMQyLIg/ADxzVXMsq3EDY44tNVa8pKkcR3PTbE+t/9iB5AHN3nbn2FNGLFQSghL/OB0uX8WdTihEIdiZKZe1hSAq14f4+wHMd1gotcKtRickSGzixwyMyP/fsVaj9TWl6bNM16FznGUGbK9Q/UggrF57d0rLh6iFnFWtPRAS16fRYbP8ayVZsqKdWrUuxK1dSGGeOIfV8KOP1F6QZwPKe0AseZeYJhVATUo38uDWal15ydMuiKmY4wbt8f2/kaAlPvicnejErkINM4byPlRknTO7Y8r/b7oUIXNA7bpLdxfxAM1jdLBCecMg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>, Tamas K Lengyel <tamas@xxxxxxxxxxxxx>, Alexandru Isaila <aisaila@xxxxxxxxxxxxxxx>, Petre Pircalabu <ppircalabu@xxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 26 Nov 2021 07:46:55 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 25.11.2021 23:49, Oleksandr Tyshchenko wrote:
> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>
> 
> Today I noticed a "note" when building Xen on Arm64 with
> aarch64-poky-linux-gcc (GCC) 9.3.0. It turned out that Andrew Cooper
> had alredy reported it before [1]:
> 
> mem_access.c: In function 'p2m_mem_access_check':
> mem_access.c:227:6: note: parameter passing for argument of type
> 'const struct npfec' changed in GCC 9.1
>   227 | bool p2m_mem_access_check(paddr_t gpa, vaddr_t gla,
>                                   const struct npfec npfec)
> 
> From the explanation I understand that nothing bad actually is going
> to happen in our case, it is harmless and shown to only draw our
> attention that the ABI changed due to bug (with passing bit-fields
> by value) fixed in GCC 9.1. This information doesn't mean much for us
> as Xen is an embedded project with no external linkage. But, of course,
> it would be better to eliminate the note. You can also find related
> information about the bug at [2].
> 
> So make the note go away by passing bit-fields by reference.
> 
> [1] https://www.mail-archive.com/xen-devel@xxxxxxxxxxxxxxxxxxxx/msg87439.html
> [2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88469
> 
> Reported-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>
> ---
> Compile-tested only.
> ---
>  xen/arch/arm/mem_access.c        | 28 ++++++++++++++--------------
>  xen/arch/arm/traps.c             |  2 +-
>  xen/include/asm-arm/mem_access.h |  2 +-
>  3 files changed, 16 insertions(+), 16 deletions(-)

It's all Arm code, so I'm not the one to judge, but I'd like to recommend
to live with the note or convince distros to backport the gcc side fix.
This definitely was a compiler flaw; see
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91710.

Jan




 


Rackspace

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