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

Re: [PATCH v1 1/4] xen: introduce CONFIG_GENERIC_BUG_FRAME


  • To: Julien Grall <julien@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 13 Feb 2023 16:02:07 +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=GZv9Md6+lu19ooIb0ctvUsQHPY93LbVvBpO/ur3mqFY=; b=c7wJQr8qNj8wfo52Qw8S6U8Fe+j5zfyBRmv1Bqy+nva/+V9hTUGhha/2qoR8VGVRvAKw0ZYWcb0XfemT8f3DfsQL63+vlSDndhiGlhEhkaynpjLEjSi/0MFgOGNavQ/PXhJBxrJD9quyyx5eB3JT+AefUT3z/l8Z09TYxKV+kP2+GL43Ten57c44cgRiRS+AmoRryXf4bpV13sYNh7ZRRdN/e4UBMMo1+U95TESk3nFAGuef8JzFZxj7BMEX18v8BL+GAP2p6IWz1T6SN0GhXkpS817c7xwc59+vbdsCNr4u7bEvUSCPblmNn4qTIWQWwzVnknyw7ovU6SLl90jlFQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g98SUnCFshHsIxLc2gb/gn4hxPZ0/a54GYD8+v+s+8eDHRg+POltfwJ6BmrCSnrV+sHEb/2qchFXRJD3WPzcdgtanfFUNrUr4Uee8Oi86+vbayRw+JSSBSd9Pid+pudFa2I++s65fpLLvDdytJZpv4YJZkz23Xk/+eF4GhogcUXkHh6WP9PDID3MvXrfu0zCxWwK7yobH9y3y6JwBJ5Cr76uXh1Zreemn8fdBaifKP9/daLcNJQJsEwyu/YKGmei0gtwxXsqHiuYKPi8bcoEyX3+W6jRCBtB60ncx8hPlN57ftXmQ6Jczs50vNEGDbW1tkKF8s08TbC/ApwHRqAddg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
  • Delivery-date: Mon, 13 Feb 2023 15:02:21 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 13.02.2023 14:56, Julien Grall wrote:
> On 13/02/2023 13:30, Jan Beulich wrote:
>> On 13.02.2023 14:19, Julien Grall wrote:
>>> On 13/02/2023 12:24, Jan Beulich wrote:
>>>> On 03.02.2023 18:05, Oleksii Kurochko wrote:
>>>>> --- /dev/null
>>>>> +++ b/xen/include/xen/bug.h
>>>>> @@ -0,0 +1,127 @@
>>>>> +#ifndef __XEN_BUG_H__
>>>>> +#define __XEN_BUG_H__
>>>>> +
>>>>> +#define BUG_DISP_WIDTH    24
>>>>> +#define BUG_LINE_LO_WIDTH (31 - BUG_DISP_WIDTH)
>>>>> +#define BUG_LINE_HI_WIDTH (31 - BUG_DISP_WIDTH)
>>>>> +
>>>>> +#define BUGFRAME_run_fn 0
>>>>> +#define BUGFRAME_warn   1
>>>>> +#define BUGFRAME_bug    2
>>>>> +#define BUGFRAME_assert 3
>>>>> +
>>>>> +#define BUGFRAME_NR     4
>>>>> +
>>>>> +#ifndef __ASSEMBLY__
>>>>> +
>>>>> +#include <xen/errno.h>
>>>>> +#include <xen/stringify.h>
>>>>> +#include <xen/types.h>
>>>>> +#include <xen/lib.h>
>>>>
>>>> Again - please sort headers.
>>>>
>>>>> +#include <asm/bug.h>
>>>>> +
>>>>> +#ifndef BUG_FRAME_STUFF
>>>>> +struct bug_frame {
>>>>
>>>> Please can we have a blank line between the above two ones and then 
>>>> similarly
>>>> ahead of the #endif?
>>>>
>>>>> +    signed int loc_disp;    /* Relative address to the bug address */
>>>>> +    signed int file_disp;   /* Relative address to the filename */
>>>>> +    signed int msg_disp;    /* Relative address to the predicate (for 
>>>>> ASSERT) */
>>>>> +    uint16_t line;          /* Line number */
>>>>> +    uint32_t pad0:16;       /* Padding for 8-bytes align */
>>>>
>>>> Already the original comment in Arm code is wrong: The padding doesn't
>>>> guarantee 8-byte alignment; it merely guarantees a multiple of 8 bytes
>>>> size.
>>>> Aiui there's also no need for 8-byte alignment anywhere here (in
>>>> fact there's ".p2align 2" in the generator macros).
>>>
>>> I would rather keep the pad0 here.
>>
>> May I ask why that is?
> 
> It makes clear of the padding (which would have been hidden) when using 
> .p2align 2.

But you realize that I didn't ask to drop the member? Besides (later in
the reply to Oleksii) suggesting to make "line" uint32_t, you zapped the
relevant further part of my reply here:

"I also wonder why this needs to be a named bitfield: Either make it
 plain uint16_t, or if you use a bitfield, then omit the name."

I thought that's clear enough as a request to change representation,
but not asking for plain removal. The part of my reply that you commented
on is merely asking to not move a bogus comment (whether it gets corrected
up front or while being moved is secondary to me).

Jan



 


Rackspace

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