All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Julien Grall <julien@xen.org>, Jan Beulich <jbeulich@suse.com>
Cc: <xen-devel@lists.xenproject.org>,
	Julien Grall <julien.grall@arm.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	George Dunlap <george.dunlap@citrix.com>,
	"Ian Jackson" <iwj@xenproject.org>, Wei Liu <wl@xen.org>,
	Tamas K Lengyel <tamas.lengyel@intel.com>
Subject: Re: [PATCH v4 4/4] xen/mm: Provide dummy M2P-related helpers when !CONFIG_HAVE_M2P
Date: Tue, 22 Sep 2020 19:59:35 +0100	[thread overview]
Message-ID: <3778eaa1-c1cc-d458-407f-e5ca3ca028ab@citrix.com> (raw)
In-Reply-To: <e0a73d9b-5c68-9b57-dfe4-34e91b0972bd@xen.org>

On 22/09/2020 19:39, Julien Grall wrote:
> Hi Jan,
>
> On 22/09/2020 09:02, Jan Beulich wrote:
>> On 21.09.2020 20:02, Julien Grall wrote:
>>> --- a/xen/include/xen/mm.h
>>> +++ b/xen/include/xen/mm.h
>>> @@ -685,4 +685,17 @@ static inline void put_page_alloc_ref(struct
>>> page_info *page)
>>>       }
>>>   }
>>>   +/*
>>> + * Dummy implementation of M2P-related helpers for common code when
>>> + * the architecture doesn't have an M2P.
>>> + */
>>> +#ifndef CONFIG_HAS_M2P
>>> +
>>> +#define INVALID_M2P_ENTRY        (~0UL)
>>> +#define SHARED_M2P(_e)           false
>>> +
>>> +static inline void set_gpfn_from_mfn(unsigned long mfn, unsigned
>>> long pfn) {}
>>
>> While I think this would better BUG() or at least ASSERT_UNREACHABLE(),
>> I realize its use in page_alloc.c prevents this. However, if this was a
>> macro, I think the need for having INVALID_P2M_ENTRY would vanish, as
>> long as the stub macro didn't evaluate its 2nd argument.
> This is not very future proof... The cost of defining
> INVALID_M2P_ENTRY is very minimal compare to the damage that may
> result from this choice.
>
>> I'm feeling somewhat uneasy with the SHARED_M2P() definition: This
>> would seem to better be tied to CONFIG_MEM_SHARING rather than M2P
>> existence.
>
> I can see pros and cons in both solution. To me it contains the word
> "M2P" so it makes sense to be protected by HAS_M2P.
>
> If someone else think that it should be protected by
> CONFIG_MEM_SHARING, then I will do the change.
>
> I have added Tamas to give him an opportunity to share his view.

This is clearly guarded by HAS_M2P first first and foremost.

However, the work to actually let MEM_SHARING be turned off in this
regard is rather larger, and not appropriate to delay this series with.

~Andrew


  reply	other threads:[~2020-09-22 19:00 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-21 18:02 [PATCH v4 0/4] xen/arm: Properly disable M2P on Arm Julien Grall
2020-09-21 18:02 ` [PATCH v4 1/4] xen: XENMEM_exchange should only be used/compiled for arch supporting PV guest Julien Grall
2020-09-21 19:46   ` Andrew Cooper
2020-09-22 17:53     ` Julien Grall
2020-09-22  7:35   ` Jan Beulich
2020-09-22 18:05     ` Julien Grall
2020-09-21 18:02 ` [PATCH v4 2/4] xen: Introduce HAS_M2P config and use to protect mfn_to_gmfn call Julien Grall
2020-09-21 20:29   ` Andrew Cooper
2020-09-22 18:20     ` Julien Grall
2020-09-22 18:56       ` Andrew Cooper
2020-09-26 13:00         ` Julien Grall
2020-10-23 15:45           ` Julien Grall
2020-09-22  7:54   ` Jan Beulich
2020-09-22 18:21     ` Julien Grall
2020-09-21 18:02 ` [PATCH v4 3/4] xen: Remove mfn_to_gmfn macro Julien Grall
2020-09-21 20:34   ` Andrew Cooper
2020-09-22 18:23     ` Julien Grall
2020-09-23 22:02     ` Stefano Stabellini
2020-09-21 18:02 ` [PATCH v4 4/4] xen/mm: Provide dummy M2P-related helpers when !CONFIG_HAVE_M2P Julien Grall
2020-09-21 20:37   ` Andrew Cooper
2020-09-22  8:02   ` Jan Beulich
2020-09-22 18:39     ` Julien Grall
2020-09-22 18:59       ` Andrew Cooper [this message]
2020-09-22 20:35         ` Lengyel, Tamas

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=3778eaa1-c1cc-d458-407f-e5ca3ca028ab@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=george.dunlap@citrix.com \
    --cc=iwj@xenproject.org \
    --cc=jbeulich@suse.com \
    --cc=julien.grall@arm.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --cc=tamas.lengyel@intel.com \
    --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 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.