All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Orzel <michal.orzel@arm.com>
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCH v2 2/2] xen/arm: gnttab: modify macros to evaluate all arguments and only once
Date: Tue, 17 May 2022 09:14:14 +0200	[thread overview]
Message-ID: <9eb95e25-1a19-4048-259f-dc2dbee6cac7@arm.com> (raw)
In-Reply-To: <ed8e9d16-56ea-68ab-8221-d654e15b40a0@xen.org>

Hi Julien,

On 16.05.2022 12:19, Julien Grall wrote:
> Hi Michal,
> 
> On 06/05/2022 10:42, Michal Orzel wrote:
>> Modify macros to evaluate all the arguments and make sure the arguments
>> are evaluated only once. Introduce following intermediate macros:
>> gnttab_status_gfn_, gnttab_shared_gfn_ that do not take domain as a
>> parameter. These are to be used locally and allow us to avoid passing
>> NULL from gnttab_get_frame_gfn to the respective macros (without _ suffix).
>> Make use of a domain parameter from gnttab_shared_gfn and gnttab_status_gfn
>> by adding an ASSERT.
>>
>> Signed-off-by: Michal Orzel <michal.orzel@arm.com>
> 
> Most of the helpers below are going to disappear with Oleksandr latest work (see [1]).
> 
> Looking at Oleksandr's patch, I think only gnttab_set_frame_gfn() would end up to use one of the macro parameters twice. So I would like to suggest to chat with Oleksandr if we can tweak his patch (can be done on commit) or we rebase this patch on top of his work.
> 
> Cheers,
> 
> [1] https://lore.kernel.org/xen-devel/1652294845-13980-1-git-send-email-olekstysh@gmail.com/
> 

By looking at Oleksandr patch:
1. there are 2 macros: gnttab_set_frame_gfn, gnttab_need_iommu_mapping that use one of the macro parameters twice.
2. gnttab_get_frame_gfn still passes NULL as a domain parameter to gnttab_shared_gfn/gnttab_status_gfn that do not evaluate domain parameter

I agree that point 1 could be fixed on commit but point 2 requires in my opinion adding intermediate macros to avoid passing NULL (just like I did).

As this would require more work from Oleksandr, I'm ok to rebase my patch on top of his work once merged.

Cheers,
Michal


  reply	other threads:[~2022-05-17  7:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-06  9:42 [PATCH v2 0/2] xen/arm: gnttab: macros modifications Michal Orzel
2022-05-06  9:42 ` [PATCH v2 1/2] xen/arm: gnttab: use static inlines for gnttab_{release_}host_mapping* Michal Orzel
2022-05-06 10:03   ` Jan Beulich
2022-05-10  6:52     ` Michal Orzel
2022-05-12 17:41       ` Julien Grall
2022-05-17 13:20       ` Jan Beulich
2022-05-06  9:42 ` [PATCH v2 2/2] xen/arm: gnttab: modify macros to evaluate all arguments and only once Michal Orzel
2022-05-16 10:19   ` Julien Grall
2022-05-17  7:14     ` Michal Orzel [this message]
2022-05-17 17:27       ` Julien Grall

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=9eb95e25-1a19-4048-259f-dc2dbee6cac7@arm.com \
    --to=michal.orzel@arm.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=bertrand.marquis@arm.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.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 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.