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

Re: [PATCH 3/3] tools: add offsetof() to xen-tools/libs.h


  • To: Juergen Gross <jgross@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 27 Feb 2023 13:43:45 +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=U0kF9jI8hKrUSJfgXViDlmp1tkP4Wv2f6t3kdegWPjQ=; b=YXVOzT6DipW/ss1Omg4UU/DpGMBgWOMUvIxybHMDWXyhYl5VXbUBxcyei8rNlA/F0SsoQrzwJWv416G9LDQTMKU8bvfthZlEN87jm9HAd2kIX+qNuiMGXSQFdQlyVPFHbEJQyjoNjCZ5NGz8b1BRhJR5zCmx1V6x4LdcM8K2CjwroJITN/hQB/OyLiLYJbLYrr6PVfurj9gHaSO26EER7PLUe0JqBvy6w71XD1Fd7BZsYfUocgLQU/4DKKWVvbI6udogd7LjqIgUCmoWVDJN1gxJJgtRrQO27Pbs4oEWFifz8Sm9EArCcyyJiu57NFF6+gWgC96V834gltLn/tfRGg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ThhvA1leYAi6cNI6nEY/lrsGeSU38wVxbQJ7/qsnLhV9PUYufEFj8NUxETkWxTifpPB8qQuzdRb9dbRIDgt0Jlfrln07lnBv1RYN0lwTy1KzTCyoFXo4dWncXgUBWYEtehJMrXmDXZtDbUYzaUBFbol5bJ9eubZEBp+uRgLmtGBJIsHVlTUTAsEHmMw6Vx5DUSvvb+k4yFm+0mupzKex396jM3JR3ZhEsHtnsmweoEuPRqwRCRa5CdKpdxEai13/5c9lU0KnietUX2RT8sm/ieF92QjPTCj0Yr+UHDY8kut4c2o3XGTgjpd7O871oHDwcN5k1QNcliTMuVS2q3/ijQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 27 Feb 2023 12:44:09 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 27.02.2023 13:34, Juergen Gross wrote:
> On 27.02.23 13:31, Jan Beulich wrote:
>> On 27.02.2023 13:09, Juergen Gross wrote:
>>> --- a/tools/firmware/hvmloader/util.h
>>> +++ b/tools/firmware/hvmloader/util.h
>>> @@ -30,9 +30,6 @@ enum {
>>>   #define SEL_DATA32          0x0020
>>>   #define SEL_CODE64          0x0028
>>>   
>>> -#undef offsetof
>>> -#define offsetof(t, m) ((unsigned long)&((t *)0)->m)
>>> -
>>>   #undef NULL
>>>   #define NULL ((void*)0)
>>>   
>>> diff --git a/tools/firmware/include/stddef.h 
>>> b/tools/firmware/include/stddef.h
>>> index c7f974608a..926ae12fa5 100644
>>> --- a/tools/firmware/include/stddef.h
>>> +++ b/tools/firmware/include/stddef.h
>>> @@ -1,10 +1,10 @@
>>>   #ifndef _STDDEF_H_
>>>   #define _STDDEF_H_
>>>   
>>> +#include <xen-tools/libs.h>
>>
>> I'm not convinced firmware/ files can validly include this header.
> 
> This file only contains macros which don't call any external functions.
> 
> Would you be fine with me adding a related comment to it?

If it was to be usable like this, that would be a prereq, but personally
I don't view this as sufficient. The environment code runs in that lives
under firmware/ is simply different (hvmloader, for example, is 32-bit
no matter that the toolstack would normally be 64-bit), so to me it
feels like setting up a trap for ourselves. If Andrew or Roger are fully
convinced this is a good move, I won't be standing in the way ...

Jan



 


Rackspace

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