xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Sergej Proskurin <proskurin@sec.in.tum.de>
To: Jan Beulich <JBeulich@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wei.liu2@citrix.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, Tim Deegan <tim@xen.org>,
	Julien Grall <julien.grall@arm.com>,
	Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v6 02/14] arm/mem_access: Move PAGE_*_* macros to xen/page-defs.h
Date: Thu, 6 Jul 2017 17:34:16 +0200	[thread overview]
Message-ID: <a2c74a1e-c69a-d1e6-9efb-2cd38347aced@sec.in.tum.de> (raw)
In-Reply-To: <595E7239020000780016939E@prv-mh.provo.novell.com>

Hi Jan,


On 07/06/2017 05:24 PM, Jan Beulich wrote:
>>>> On 06.07.17 at 16:53, <proskurin@sec.in.tum.de> wrote:
>> On 07/06/2017 02:10 PM, Jan Beulich wrote:
>>>>>> On 06.07.17 at 13:50, <proskurin@sec.in.tum.de> wrote:
>>>> --- /dev/null
>>>> +++ b/xen/include/xen/page-defs.h
>>>> @@ -0,0 +1,24 @@
>>>> +#ifndef __XEN_PAGE_DEFS_H__
>>>> +#define __XEN_PAGE_DEFS_H__
>>>> +
>>>> +/* Helpers for different page granularities. */
>>>> +#define PAGE_SIZE_GRAN(gran)        (1UL << PAGE_SHIFT_##gran)
>>>> +#define PAGE_MASK_GRAN(gran)        (~(0ULL) << PAGE_SHIFT_##gran)
>>> Stray parentheses. I'm also unhappy about the type difference
>>> between size and mask. I guess both would best be paddr_t.
>>> That'll then also allow mask to be defined as -size. Another
>>> alternative would be to use 1L for size, thus guaranteeing
>>> suitable sign extension when used in contexts requiring a width
>>> wider than long.
>>>
>> Sounds reasonable. How about using 1L for PAGE_SIZE_GRAN to ensure a
>> suitable sign extension for types wider than long and ~((paddr_t)0) for
>> PAGE_MASK_GRAN?
> Once again - I really think the two should be of identical type.

Alright, then I will use paddr_t in both cases. Thank you.

>>>> +#define PAGE_ALIGN_GRAN(gran, addr) (((addr) + ~PAGE_MASK_##gran) & PAGE_MASK_##gran)
>>>> +
>>>> +#define PAGE_SHIFT_4K               (12)
>>> Stray parentheses again.
>>>
>>> Also, with you adding a new header that'll fall under REST
>>> maintainership, you should have Cc-ed all the REST maintainers
>>> imo.
>> Thank you for adding the REST maintainers in Cc. In addition, I have
>> included Konrad Rzeszutek Wilk and Julien Grall.
> Except that Konrad was Cc-ed, just that his list settings result in
> you not seeing that he was.

Cheers,
~Sergej


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-07-06 15:34 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-06 11:50 [PATCH v6 00/14] arm/mem_access: Walk guest page tables in SW if mem_access is active Sergej Proskurin
2017-07-06 11:50 ` [PATCH v6 01/14] arm/mem_access: Add and cleanup (TCR_|TTBCR_)* defines Sergej Proskurin
2017-07-06 11:50 ` [PATCH v6 02/14] arm/mem_access: Move PAGE_*_* macros to xen/page-defs.h Sergej Proskurin
2017-07-06 12:10   ` Jan Beulich
2017-07-06 14:53     ` Sergej Proskurin
2017-07-06 15:24       ` Jan Beulich
2017-07-06 15:34         ` Sergej Proskurin [this message]
2017-07-06 16:20           ` Jan Beulich
2017-07-07  8:27             ` Sergej Proskurin
2017-07-06 11:50 ` [PATCH v6 03/14] arm/mem_access: Add defines supporting PTs with varying page sizes Sergej Proskurin
2017-07-17 14:12   ` Julien Grall
2017-07-06 11:50 ` [PATCH v6 04/14] arm/lpae: Introduce lpae_is_page helper Sergej Proskurin
2017-07-06 11:50 ` [PATCH v6 05/14] arm/mem_access: Add short-descriptor pte typedefs and macros Sergej Proskurin
2017-07-06 11:50 ` [PATCH v6 06/14] arm/mem_access: Introduce GV2M_EXEC permission Sergej Proskurin
2017-07-06 11:50 ` [PATCH v6 07/14] arm/mem_access: Introduce BIT_ULL bit operation Sergej Proskurin
2017-07-06 11:50 ` [PATCH v6 08/14] arm/mem_access: Introduce GENMASK_ULL " Sergej Proskurin
2017-07-06 12:18   ` Jan Beulich
2017-07-06 14:38     ` Sergej Proskurin
2017-07-06 15:22       ` Jan Beulich
2017-07-06 15:34         ` Sergej Proskurin
2017-07-06 11:50 ` [PATCH v6 09/14] arm/guest_access: Move vgic_access_guest_memory to guest_access.h Sergej Proskurin
2017-07-17 15:38   ` Julien Grall
2017-07-18  9:49     ` Sergej Proskurin
2017-07-18 10:43       ` Julien Grall
2017-07-18 11:59         ` Sergej Proskurin
2017-07-18 12:12           ` Julien Grall
2017-07-18 12:20             ` Sergej Proskurin
2017-07-06 11:50 ` [PATCH v6 10/14] arm/guest_access: Rename vgic_access_guest_memory Sergej Proskurin
2017-07-17 15:43   ` Julien Grall
2017-07-18  8:42     ` Sergej Proskurin
2017-07-18 10:28       ` Julien Grall
2017-07-06 11:50 ` [PATCH v6 11/14] arm/mem_access: Add software guest-page-table walk Sergej Proskurin
2017-07-17 15:47   ` Julien Grall
2017-07-06 11:50 ` [PATCH v6 12/14] arm/mem_access: Add long-descriptor based gpt Sergej Proskurin
2017-07-17 16:18   ` Julien Grall
2017-07-06 11:50 ` [PATCH v6 13/14] arm/mem_access: Add short-descriptor " Sergej Proskurin
2017-07-17 16:26   ` Julien Grall
2017-07-06 11:50 ` [PATCH v6 14/14] arm/mem_access: Walk the guest's pt in software Sergej Proskurin

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=a2c74a1e-c69a-d1e6-9efb-2cd38347aced@sec.in.tum.de \
    --to=proskurin@sec.in.tum.de \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=julien.grall@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.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 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).