xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien@xen.org>
To: Costin Lupu <costin.lupu@cs.pub.ro>, xen-devel@lists.xenproject.org
Cc: Ian Jackson <iwj@xenproject.org>, Wei Liu <wl@xen.org>
Subject: Re: [PATCH 3/5] tools/libs/foreignmemory: Fix PAGE_SIZE redefinition error
Date: Thu, 29 Apr 2021 12:29:29 +0100	[thread overview]
Message-ID: <4d527d96-6baa-1558-5df0-363300572044@xen.org> (raw)
In-Reply-To: <7c465859-5af3-3d9f-81f4-2062b29e57f0@cs.pub.ro>



On 28/04/2021 19:27, Costin Lupu wrote:
> Hi Julien,

Hi Costin,

> On 4/28/21 12:03 PM, Julien Grall wrote:
>> Hi Costin,
>>
>> On 27/04/2021 13:05, Costin Lupu wrote:
>>>    tools/libs/foreignmemory/private.h | 6 ++++--
>>>    1 file changed, 4 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/tools/libs/foreignmemory/private.h
>>> b/tools/libs/foreignmemory/private.h
>>> index 1ee3626dd2..f3c1ba2867 100644
>>> --- a/tools/libs/foreignmemory/private.h
>>> +++ b/tools/libs/foreignmemory/private.h
>>> @@ -10,11 +10,13 @@
>>>    #include <xen/xen.h>
>>>    #include <xen/sys/privcmd.h>
>>>    -#ifndef PAGE_SHIFT /* Mini-os, Yukk */
>>> +#ifndef PAGE_SHIFT
>>>    #define PAGE_SHIFT           12
>>>    #endif
>>> -#ifndef __MINIOS__ /* Yukk */
>>> +#ifndef PAGE_SIZE
>>>    #define PAGE_SIZE            (1UL << PAGE_SHIFT)
>>> +#endif
>>> +#ifndef PAGE_MASK
>>>    #define PAGE_MASK            (~(PAGE_SIZE-1))
>>>    #endif
>>
>> Looking at the usage, I believe PAGE_* are referring to the page
>> granularity of Xen rather than the page granularity of the control
>> domain itself.
>>
>> So it would be incorrect to use the domain's page granularity here and
>> would break dom0 using 64KB page granularity on Arm.
>>
>> Instead, we should replace PAGE_* with XC_PAGE_*. If some of them are
>> still referring to the control domain granularity, then we should use
>> getpageshift() (Or equivalent) because the userspace shouldn't rely on a
>> specific page granularity.
> 
> Yes, this makes sense. One thing I need to clarify: what does XC stand
> for? I thought for some time it stands for Xen Control.

I think it is Xen Control, which is a bit confusing for that specific 
define.

Cheers,

-- 
Julien Grall


  reply	other threads:[~2021-04-29 11:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-27 12:05 [PATCH 0/5] Fix redefinition errors for toolstack libs Costin Lupu
2021-04-27 12:05 ` [PATCH 1/5] tools/debugger: Fix PAGE_SIZE redefinition error Costin Lupu
2021-04-29 19:58   ` Tim Deegan
2021-04-30 11:36     ` Costin Lupu
2021-04-30 18:45       ` Tim Deegan
2021-04-30 19:33         ` Costin Lupu
2021-04-27 12:05 ` [PATCH 2/5] tools/libfsimage: Fix PATH_MAX " Costin Lupu
2021-04-28  9:04   ` Julien Grall
2021-04-28 18:35     ` Costin Lupu
2021-04-29 11:39       ` Julien Grall
2021-04-27 12:05 ` [PATCH 3/5] tools/libs/foreignmemory: Fix PAGE_SIZE " Costin Lupu
2021-04-28  9:03   ` Julien Grall
2021-04-28 18:27     ` Costin Lupu
2021-04-29 11:29       ` Julien Grall [this message]
2021-04-27 12:05 ` [PATCH 4/5] tools/libs/gnttab: " Costin Lupu
2021-04-27 12:05 ` [PATCH 5/5] tools/ocaml: Fix redefinition errors Costin Lupu
2021-04-28 12:34 ` [PATCH 0/5] Fix redefinition errors for toolstack libs Christian Lindig
2021-04-28 18:37   ` Costin Lupu

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=4d527d96-6baa-1558-5df0-363300572044@xen.org \
    --to=julien@xen.org \
    --cc=costin.lupu@cs.pub.ro \
    --cc=iwj@xenproject.org \
    --cc=wl@xen.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).