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

Re: [PATCH v6 2/4] xen: change <asm/bug.h> to <xen/bug.h>


  • To: Oleksii <oleksii.kurochko@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 9 Mar 2023 10:49:59 +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=kpfYcVI//I2EfD76DvdgLBHXoHZGlKodctP3jzX1nU8=; b=c75rmCerBI3UARxLXgAV3+omoeDNOVDLZnCTOjPmSIXiz5DvoOECm+mvHJNkuns6agi1IQ+3MdaC+yd6JPMITvPLg0Vk2L8wxxPsGBmuXbuLM0RT4GAR4VIAPWC2rsZUUHhE5nwaMibLxj2+7oyN0t1tjffQkQc/aQlmWJO2TIUF1O7Gkdgg+X2+nAyxnsHllH5LJI/oAHj7CrRqqtFqA/iWhTWZPNhZ2c0I6X3d9loh11fK+42+jaelt4lf/aZLhY3ow0V4OBFiDO8mq2JKwo3vuipCE3BljmIgJ6+lqkPzjnmikAMoNRyHqG2uM89Lh1mSMiRkc2inAbl6YpSMPg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kGVZMIKNnOay42fIoIS/wmqv59bxwiO4SgH6nbYxsrm349Mbu5Upg/jY7XrVBMREjxWbOckC1n6uFyGxaefpM+JDFBfcKcTIOURlhUNoVvYKutwvbUZw/CYwLI5b13WpJVqLuaZxIWJApNNIt0DPVTqvXG4OlPMPa2sOD2g9CbNppBt27/c1qOZU8gaGU3LvPnU07G/b4vOc3hLWQvjeQKn9w/2uPCVIIAERde6zRY2OEof4JRHHMQr0Kd3CcMx2ONbWNRzErCmuPM1DWVUSXCm6jgAO2+RY7mTT1ke4AESZsANqaUMiSlAwwULWlL4oKBmacTC4kRw3uHKAaYLwKg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Julien Grall <julien@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Gianluca Guida <gianluca@xxxxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 09 Mar 2023 09:50:08 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 08.03.2023 18:25, Oleksii wrote:
> On Wed, 2023-03-08 at 16:27 +0100, Jan Beulich wrote:
>> On 07.03.2023 16:50, Oleksii Kurochko wrote:
>>> --- a/xen/arch/arm/include/asm/bug.h
>>> +++ b/xen/arch/arm/include/asm/bug.h
>>> @@ -1,6 +1,8 @@
>>>  #ifndef __ARM_BUG_H__
>>>  #define __ARM_BUG_H__
>>>  
>>> +#include <xen/types.h>
>>> +
>>>  #if defined(CONFIG_ARM_32)
>>>  # include <asm/arm32/bug.h>
>>>  #elif defined(CONFIG_ARM_64)
>>> @@ -9,10 +11,16 @@
>>>  # error "unknown ARM variant"
>>>  #endif
>>>  
>>> +#undef BUG_DISP_WIDTH
>>> +#undef BUG_LINE_LO_WIDTH
>>> +#undef BUG_LINE_HI_WIDTH
>>
>> Why? For Arm ...
>>
>>>  #define BUG_DISP_WIDTH    24
>>>  #define BUG_LINE_LO_WIDTH (31 - BUG_DISP_WIDTH)
>>>  #define BUG_LINE_HI_WIDTH (31 - BUG_DISP_WIDTH)
>>
>> ... you could purge these as unused, even in a standalone prereq
>> patch.
>> And on x86 ...
>>
>>> --- a/xen/arch/x86/include/asm/bug.h
>>> +++ b/xen/arch/x86/include/asm/bug.h
>>> @@ -1,19 +1,18 @@
>>>  #ifndef __X86_BUG_H__
>>>  #define __X86_BUG_H__
>>>  
>>> +#undef BUG_DISP_WIDTH
>>> +#undef BUG_LINE_LO_WIDTH
>>> +#undef BUG_LINE_HI_WIDTH
>>> +
>>>  #define BUG_DISP_WIDTH    24
>>>  #define BUG_LINE_LO_WIDTH (31 - BUG_DISP_WIDTH)
>>>  #define BUG_LINE_HI_WIDTH (31 - BUG_DISP_WIDTH)
>>
>> ... there's no reason to #undef just to the #define again to the same
>> values. All of this would be removed in a subsequent patch anyway,
>> and
>> it's less code churn (with code nevertheless being correct) if you
>> get
>> rid of the #define-s right away (as iirc you had it in an earlier
>> version). If you agree then with these adjustments
>> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
> 
> It won't be compilation issue (redefinition) in the current one case
> because defines are the same as in <xen/bug.h> so it is possible to not
> add #undef in this patch.

Avoiding to add the #undef is the minimal approach. Yet as indicated I
think the #define-s should also be dropped right here (x86) and in a
prereq patch (Arm).

Jan



 


Rackspace

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