All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Paul Durrant <xadimgnik@gmail.com>
Cc: "'Stefano Stabellini'" <sstabellini@kernel.org>,
	"'Julien Grall'" <julien@xen.org>, "'Wei Liu'" <wl@xen.org>,
	"'Konrad Rzeszutek Wilk'" <konrad.wilk@oracle.com>,
	"'Andrew Cooper'" <andrew.cooper3@citrix.com>,
	"'Paul Durrant'" <pdurrant@amazon.com>,
	"'Ian Jackson'" <ian.jackson@eu.citrix.com>,
	"'George Dunlap'" <george.dunlap@citrix.com>,
	"'Tim Deegan'" <tim@xen.org>,
	"'Tamas K Lengyel'" <tamas@tklengyel.com>,
	xen-devel@lists.xenproject.org, pdurrant@amzn.com,
	"'Roger Pau Monné'" <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH v3 5/6] mm: add 'is_special_page' macro...
Date: Fri, 6 Mar 2020 14:44:03 +0100	[thread overview]
Message-ID: <3634fc48-5eff-c5d5-f634-e312ad33ab49@suse.com> (raw)
In-Reply-To: <001201d5f3b3$ba28a8a0$2e79f9e0$@xen.org>

On 06.03.2020 13:35, Paul Durrant wrote:
>> -----Original Message-----
>> From: Xen-devel <xen-devel-bounces@lists.xenproject.org> On Behalf Of Jan Beulich
>> Sent: 06 March 2020 12:20
>> To: pdurrant@amzn.com
>> Cc: Stefano Stabellini <sstabellini@kernel.org>; Julien Grall <julien@xen.org>; Wei Liu <wl@xen.org>;
>> Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>; Andrew Cooper <andrew.cooper3@citrix.com>; Paul
>> Durrant <pdurrant@amazon.com>; Ian Jackson <ian.jackson@eu.citrix.com>; George Dunlap
>> <george.dunlap@citrix.com>; Tim Deegan <tim@xen.org>; Tamas K Lengyel <tamas@tklengyel.com>; xen-
>> devel@lists.xenproject.org; Roger Pau Monné <roger.pau@citrix.com>
>> Subject: Re: [Xen-devel] [PATCH v3 5/6] mm: add 'is_special_page' macro...
>>
>> On 05.03.2020 13:45, pdurrant@amzn.com wrote:
>>> --- a/xen/arch/x86/mm/shadow/common.c
>>> +++ b/xen/arch/x86/mm/shadow/common.c
>>> @@ -2087,19 +2087,22 @@ static int sh_remove_all_mappings(struct domain *d, mfn_t gmfn, gfn_t gfn)
>>>           * The qemu helper process has an untyped mapping of this dom's RAM
>>>           * and the HVM restore program takes another.
>>>           * Also allow one typed refcount for
>>> -         * - Xen heap pages, to match share_xen_page_with_guest(),
>>> -         * - ioreq server pages, to match prepare_ring_for_helper().
>>> +         * - special pages, which are explicitly referenced and mapped by
>>> +         *   Xen.
>>> +         * - ioreq server pages, which may be special pages or normal
>>> +         *   guest pages with an extra reference taken by
>>> +         *   prepare_ring_for_helper().
>>>           */
>>>          if ( !(shadow_mode_external(d)
>>>                 && (page->count_info & PGC_count_mask) <= 3
>>>                 && ((page->u.inuse.type_info & PGT_count_mask)
>>> -                   == (is_xen_heap_page(page) ||
>>> +                   == (is_special_page(page) ||
>>>                         (is_hvm_domain(d) && is_ioreq_server_page(d, page))))) )
>>
>> Shouldn't you delete most of this line, after the previous patch
>> converted the ioreq server pages to PGC_extra ones?
> 
> I thought that too originally but then I realise we still have to
> cater for the 'legacy' emulators that still require IOREQ server
> pages to be mapped through the p2m, in which case they will not
> be PGC_extra pages.

Oh, indeed. (I don't suppose we can ever do away with this legacy
mechanism?)

>> Also I notice this construct is used by x86 code only - is there
>> a particular reason it doesn't get placed in an x86 header (at
>> least for the time being)?
> 
> PGC_extra pages are common so maybe it is better off defined here
> so it is available to ARM code?

To be honest, my question was mainly based on me being puzzled that
Arm (or common) code doesn't need any such adjustment. As a result
I'm wondering whether that's just "luck" (in which case I'd agree
the placement could remain as is), or whether there's a deeper
reason behind that, largely guaranteeing Arm would also never need
it.

Jan

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

  reply	other threads:[~2020-03-06 13:44 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-05 12:44 [Xen-devel] [PATCH v3 0/6] remove one more shared xenheap page: shared_info pdurrant
2020-03-05 12:44 ` [Xen-devel] [PATCH v3 1/6] domain: introduce alloc/free_shared_info() helpers pdurrant
2020-03-05 13:23   ` Xia, Hongyan
2020-03-05 13:25     ` Xia, Hongyan
2020-03-06 11:41   ` Jan Beulich
2020-03-05 12:45 ` [Xen-devel] [PATCH v3 2/6] x86 / p2m: remove page_list check in p2m_alloc_table pdurrant
2020-03-06 11:45   ` Jan Beulich
2020-03-06 12:07     ` Durrant, Paul
2020-03-06 12:46       ` Jan Beulich
2020-03-06 12:50         ` Durrant, Paul
2020-03-06 13:06           ` Jan Beulich
2020-03-06 13:11             ` [Xen-devel] [EXTERNAL][PATCH " Paul Durrant
2020-03-06 13:19               ` Jan Beulich
2020-03-06 13:25                 ` Paul Durrant
2020-03-05 12:45 ` [Xen-devel] [PATCH v3 3/6] x86 / pv: do not treat PGC_extra pages as RAM when constructing dom0 pdurrant
2020-03-06 11:56   ` Jan Beulich
2020-03-06 12:03     ` Durrant, Paul
2020-03-06 13:39       ` Jan Beulich
2020-03-06 13:45         ` Paul Durrant
2020-03-06 13:47           ` Jan Beulich
2020-03-05 12:45 ` [Xen-devel] [PATCH v3 4/6] x86 / ioreq: use a MEMF_no_refcount allocation for server pages pdurrant
2020-03-06 12:03   ` Jan Beulich
2020-03-05 12:45 ` [Xen-devel] [PATCH v3 5/6] mm: add 'is_special_page' macro pdurrant
2020-03-05 15:09   ` Tamas K Lengyel
2020-03-05 15:38     ` Durrant, Paul
2020-03-05 15:58       ` Tamas K Lengyel
2020-03-06  7:02   ` Alan Robinson
2020-03-06  9:22     ` Durrant, Paul
2020-03-06 12:20   ` Jan Beulich
2020-03-06 12:35     ` Paul Durrant
2020-03-06 13:44       ` Jan Beulich [this message]
2020-03-06 13:48         ` Paul Durrant
2020-03-06 13:52           ` Jan Beulich
2020-03-06 13:57             ` Paul Durrant
2020-03-06 14:26         ` Julien Grall
2020-03-06 14:50           ` Jan Beulich
2020-03-05 12:45 ` [Xen-devel] [PATCH v3 6/6] domain: use PGC_extra domheap page for shared_info pdurrant

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=3634fc48-5eff-c5d5-f634-e312ad33ab49@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=julien@xen.org \
    --cc=konrad.wilk@oracle.com \
    --cc=pdurrant@amazon.com \
    --cc=pdurrant@amzn.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=tamas@tklengyel.com \
    --cc=tim@xen.org \
    --cc=wl@xen.org \
    --cc=xadimgnik@gmail.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.