All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien@xen.org>
To: Michal Orzel <michal.orzel@amd.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Cc: xen-devel@lists.xenproject.org, stefano.stabellini@amd.com,
	Volodymyr_Babchuk@epam.com, bertrand.marquis@arm.com
Subject: Re: [XEN v2 02/11] xen/arm: Use the correct format specifier
Date: Fri, 20 Jan 2023 17:49:07 +0000	[thread overview]
Message-ID: <42b138a6-59f5-7614-d96f-30e1784c97a4@xen.org> (raw)
In-Reply-To: <2017e0d4-dd02-e81d-99f4-1ef47fc9e774@amd.com>



On 20/01/2023 16:03, Michal Orzel wrote:
> Hi Julien,

Hi Michal,

> 
> On 20/01/2023 16:09, Julien Grall wrote:
>>
>>
>> On 20/01/2023 14:40, Michal Orzel wrote:
>>> Hello,
>>
>> Hi,
>>
>>>
>>> On 20/01/2023 10:32, Julien Grall wrote:
>>>>
>>>>
>>>> Hi,
>>>>
>>>> On 19/01/2023 22:54, Stefano Stabellini wrote:
>>>>> On Tue, 17 Jan 2023, Ayan Kumar Halder wrote:
>>>>>> 1. One should use 'PRIpaddr' to display 'paddr_t' variables.
>>>>>> 2. One should use 'PRIx64' to display 'u64' in hex format. The current
>>>>>> use of 'PRIpaddr' for printing PTE is buggy as this is not a physical
>>>>>> address.
>>>>>>
>>>>>> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
>>>>>
>>>>> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
>>>>
>>>>
>>>> I have committed the patch.
>>> The CI test jobs (static-mem) failed on this patch:
>>> https://gitlab.com/xen-project/xen/-/pipelines/752911309
>>
>> Thanks for the report.
>>
>>>
>>> I took a look at it and this is because in the test script we
>>> try to find a node whose unit-address does not have leading zeroes.
>>> However, after this patch, we switched to PRIpaddr which is defined as 016lx/016llx and
>>> we end up creating nodes like:
>>>
>>> memory@0000000050000000
>>>
>>> instead of:
>>>
>>> memory@60000000
>>>
>>> We could modify the script,
>>
>> TBH, I think it was a mistake for the script to rely on how Xen describe
>> the memory banks in the Device-Tree.
>>
>> For instance, from my understanding, it would be valid for Xen to create
>> a single node for all the banks or even omitting the unit-address if
>> there is only one bank.
>>
>>> but do we really want to create nodes
>>> with leading zeroes? The dt spec does not mention it, although [1]
>>> specifies that the Linux convention is not to have leading zeroes.
>>
>> Reading through the spec in [2], it suggested the current naming is
>> fine. That said the example match the Linux convention (I guess that's
>> not surprising...).
>>
>> I am open to remove the leading. However, I think the CI also needs to
>> be updated (see above why).
> Yes, the CI needs to be updated as well.

Can either you or Ayan look at it?

> I'm in favor of removing leading zeroes because this is what Xen uses in all
> the other places when creating nodes (or copying them from the host dtb) including xl
> when creating dtb for domUs. Having a mismatch may be confusing and having a unit-address
> with leading zeroes looks unusual.

I decided to revert the patch mainly because it will be easier to review 
the fix if it is folded in this patch.

I would consider to create a wrapper on top of fdt_begin_node() that 
will take the name of the node and the unit. Something like:

/* XXX: Explain why the wrapper is needed */
static void domain_fdt_begin_node(void *fdt, const char *name, uint64_t 
unit)
{
    char buf[X];

    snprintf(buf, sizeof(buf), "%s@%"PRIx64, ...);
    /* XXX check the return of snprintf() */


    return fdt_begin_node(buf);
}

X would be a value that is large enough to accommodate the existing name.

The reason I don't suggest a new PRI* is because I can't think of a name 
that is short and descriptive enough to understand the different with 
the existing PRIpaddr.

Cheers,

-- 
Julien Grall


  reply	other threads:[~2023-01-20 17:49 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-17 17:43 [XEN v2 00/11] Add support for 32 bit physical address Ayan Kumar Halder
2023-01-17 17:43 ` [XEN v2 01/11] xen/ns16550: Remove unneeded truncation check in the DT init code Ayan Kumar Halder
2023-01-17 17:43 ` [XEN v2 02/11] xen/arm: Use the correct format specifier Ayan Kumar Halder
2023-01-19 22:54   ` Stefano Stabellini
2023-01-20  9:32     ` Julien Grall
2023-01-20 11:09       ` Ayan Kumar Halder
2023-01-20 14:40       ` Michal Orzel
2023-01-20 15:09         ` Julien Grall
2023-01-20 16:03           ` Michal Orzel
2023-01-20 17:49             ` Julien Grall [this message]
2023-01-20 18:08               ` Ayan Kumar Halder
2023-01-20 23:01                 ` Stefano Stabellini
2023-01-21 10:24                   ` Michal Orzel
2023-01-17 17:43 ` [XEN v2 03/11] xen/arm: domain_build: Replace use of paddr_t in find_domU_holes() Ayan Kumar Halder
2023-01-19 23:02   ` Stefano Stabellini
2023-01-20  9:48     ` Julien Grall
2023-01-20  9:52       ` Julien Grall
2023-01-17 17:43 ` [XEN v2 04/11] xen/arm: Typecast the DT values into paddr_t Ayan Kumar Halder
2023-01-19 23:20   ` Stefano Stabellini
2023-01-19 23:34     ` Stefano Stabellini
2023-01-20 10:16       ` Julien Grall
2023-01-31 10:51         ` Ayan Kumar Halder
2023-01-31 15:57           ` Julien Grall
2023-01-17 17:43 ` [XEN v2 05/11] xen/arm: Use paddr_t instead of u64 for address/size Ayan Kumar Halder
2023-01-18  8:40   ` Jan Beulich
2023-01-18 11:15     ` Ayan Kumar Halder
2023-01-18 13:14       ` Jan Beulich
2023-01-18 13:34         ` George Dunlap
2023-01-18 13:58           ` Jan Beulich
2023-01-18 14:45             ` George Dunlap
2023-01-19 23:24   ` Stefano Stabellini
2023-02-06 19:21     ` Ayan Kumar Halder
2023-02-07  9:03       ` Julien Grall
2023-02-07 10:59         ` Ayan Kumar Halder
2023-02-07 12:18           ` Julien Grall
2023-01-20 10:34   ` Julien Grall
2023-01-17 17:43 ` [XEN v2 06/11] xen/arm: Introduce a wrapper for dt_device_get_address() to handle paddr_t Ayan Kumar Halder
2023-01-19 23:35   ` Stefano Stabellini
2023-01-17 17:43 ` [XEN v2 07/11] xen/arm: smmu: Use writeq_relaxed_non_atomic() for writing to SMMU_CBn_TTBR0 Ayan Kumar Halder
2023-01-19 23:40   ` Stefano Stabellini
2023-01-17 17:43 ` [XEN v2 08/11] xen/arm: guest_walk: LPAE specific bits should be enclosed within "ifndef CONFIG_ARM_PA_32" Ayan Kumar Halder
2023-01-19 23:43   ` Stefano Stabellini
2023-01-20 10:39     ` Julien Grall
2023-01-17 17:43 ` [XEN v2 09/11] xen/arm: Introduce ARM_PA_32 to support 32 bit physical address Ayan Kumar Halder
2023-01-18  8:50   ` Jan Beulich
2023-01-18 11:57     ` Ayan Kumar Halder
2023-01-18 13:19       ` Jan Beulich
2023-01-19 23:48         ` Stefano Stabellini
2023-01-18  9:18   ` Julien Grall
2023-01-30 22:00   ` Julien Grall
2023-01-17 17:43 ` [XEN v2 10/11] xen/arm: Restrict zeroeth_table_offset for ARM_64 Ayan Kumar Halder
2023-01-20  0:19   ` Stefano Stabellini
2023-01-20 10:53     ` Julien Grall
2023-01-20 16:53       ` Stefano Stabellini
2023-01-17 17:43 ` [XEN v2 11/11] xen/arm: p2m: Enable support for 32bit IPA Ayan Kumar Halder
2023-01-20  0:05   ` Stefano Stabellini
2023-01-20 11:06   ` Julien Grall
2023-02-07 15:34     ` Ayan Kumar Halder
2023-02-09 11:45       ` Julien Grall
2023-02-10 15:39         ` Ayan Kumar Halder
2023-02-10 16:19           ` Julien Grall
2023-02-10 17:51             ` Ayan Kumar Halder
2023-02-10 17:58               ` Julien Grall
2023-01-18 10:12 ` [XEN v2 00/11] Add support for 32 bit physical address Michal Orzel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42b138a6-59f5-7614-d96f-30e1784c97a4@xen.org \
    --to=julien@xen.org \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=ayan.kumar.halder@amd.com \
    --cc=bertrand.marquis@arm.com \
    --cc=michal.orzel@amd.com \
    --cc=sstabellini@kernel.org \
    --cc=stefano.stabellini@amd.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.