From: "Egger, Christoph" <chegger@amazon.de>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: xen-devel@lists.xenproject.org,
Julien Grall <julien.grall@linaro.org>,
stefano.stabellini@citrix.com, time@xen.org, patches@linaro.org
Subject: Re: [PATCH 3/8] xen/arm: Implement p2m_type_t as an enum
Date: Mon, 9 Dec 2013 12:16:24 +0100 [thread overview]
Message-ID: <52A5A688.3040100@amazon.de> (raw)
In-Reply-To: <1386259001.20047.87.camel@kazak.uk.xensource.com>
On 05.12.13 16:56, Ian Campbell wrote:
> On Thu, 2013-12-05 at 16:51 +0100, Egger, Christoph wrote:
>> On 05.12.13 16:42, Julien Grall wrote:
>>> Until now, Xen doesn't know the type of the page (ram, foreign page, mmio,...).
>>> Introduce p2m_type_t with basic types:
>>> - p2m_invalid: Nothing is mapped here
>>> - p2m_ram_rw: Normal read/write guest RAM
>>> - p2m_ram_ro: Read-only guest RAM
>>> - p2m_mmio_direct: Read/write mapping of device memory
>>> - p2m_map_foreign: RAM page from foreign guest
>>>
>>> Signed-off-by: Julien Grall <julien.grall@linaro.org>
>>> ---
>>> xen/include/asm-arm/p2m.h | 13 ++++++++++---
>>> 1 file changed, 10 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h
>>> index f079f00..b24f94a 100644
>>> --- a/xen/include/asm-arm/p2m.h
>>> +++ b/xen/include/asm-arm/p2m.h
>>> @@ -20,6 +20,16 @@ struct p2m_domain {
>>> uint8_t vmid;
>>> };
>>>
>>> +typedef enum {
>>> + p2m_invalid = 0, /* Nothing mapped here */
>>> + p2m_ram_rw = 1, /* Normal read/write guest RAM */
>>> + p2m_ram_ro = 2, /* Read-only; writes are silently dropped */
>>> + p2m_mmio_direct = 3, /* Read/write mapping of genuine MMIO area */
>>> + p2m_map_foreign = 4, /* Ram pages from foreign domain */
>>> +} p2m_type_t;
>>> +
>>> +#define p2m_is_foreign(_t) ((_t) == p2m_map_foreign)
>>> +
>>
>> Is it possible to merge p2m_type_t with x86 and move into common code?
>
> Not really, the p2m handling is very different on the two arches, even
> if they look superficially similar at this level.
That does not imply there is no common logic from the algorithm POV.
Do you see a way split the algorithm into architecture-specific and
architecture-independent parts?
> x86 has more types than can fit in the available pte space on ARM for a
> start.
>
> I'd like to keep them separate please.
Ok. Then leave the declaration in the architecture specific part
and make the accessors available for the common code.
In OO-languages this is called an 'interface'.
Christoph
next prev parent reply other threads:[~2013-12-09 11:16 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-05 15:42 [PATCH 0/8] xen/arm: Handle correctly foreign mapping Julien Grall
2013-12-05 15:42 ` [PATCH 1/8] DO NOT APPLY: xen/arm: Correctly support foreign page removing on ARM Julien Grall
2013-12-05 15:42 ` [PATCH 2/8] xen/arm: move mfn_to_p2m_entry in arch/arm/p2m.c Julien Grall
2013-12-05 15:47 ` Ian Campbell
2013-12-05 15:50 ` Julien Grall
2013-12-05 15:42 ` [PATCH 3/8] xen/arm: Implement p2m_type_t as an enum Julien Grall
2013-12-05 15:51 ` Egger, Christoph
2013-12-05 15:56 ` Ian Campbell
2013-12-09 11:16 ` Egger, Christoph [this message]
2013-12-09 11:38 ` Ian Campbell
2013-12-05 15:52 ` Ian Campbell
2013-12-05 16:01 ` Julien Grall
2013-12-05 16:14 ` Ian Campbell
2013-12-05 16:28 ` Julien Grall
2013-12-05 16:38 ` Ian Campbell
2013-12-05 16:44 ` Julien Grall
2013-12-05 16:56 ` Ian Campbell
2013-12-05 21:26 ` Julien Grall
2013-12-05 16:07 ` Tim Deegan
2013-12-05 16:19 ` Ian Campbell
2013-12-05 16:31 ` Tim Deegan
2013-12-05 16:39 ` Ian Campbell
2013-12-05 17:24 ` Tim Deegan
2013-12-05 15:42 ` [PATCH 4/8] xen/arm: Store p2m type in each page of the guest Julien Grall
2013-12-05 15:55 ` Ian Campbell
2013-12-05 16:02 ` Ian Campbell
2013-12-05 16:07 ` Julien Grall
2013-12-05 15:42 ` [PATCH 5/8] xen/arm: p2m: Add p2m_get_entry Julien Grall
2013-12-05 16:07 ` Ian Campbell
2013-12-05 16:09 ` Tim Deegan
2013-12-05 15:42 ` [PATCH 6/8] xen/arm: Retrieve p2m type in get_page_from_gfn Julien Grall
2013-12-05 16:23 ` Ian Campbell
2013-12-05 16:45 ` Julien Grall
2013-12-09 2:36 ` Julien Grall
2013-12-09 9:57 ` Ian Campbell
2013-12-05 15:42 ` [PATCH 7/8] xen/arm: Set foreign page type to p2m_map_foreign Julien Grall
2013-12-05 16:34 ` Ian Campbell
2013-12-05 16:41 ` Julien Grall
2013-12-05 16:54 ` Ian Campbell
2013-12-05 17:39 ` Julien Grall
2013-12-05 17:49 ` Ian Campbell
2013-12-09 2:14 ` Julien Grall
2013-12-05 15:42 ` [PATCH 8/8] xen/arm: grant-table: Support read-only mapping Julien Grall
2013-12-05 16:36 ` Ian Campbell
2013-12-05 15:44 ` [PATCH 0/8] xen/arm: Handle correctly foreign mapping Julien Grall
2013-12-05 17:10 ` 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=52A5A688.3040100@amazon.de \
--to=chegger@amazon.de \
--cc=Ian.Campbell@citrix.com \
--cc=julien.grall@linaro.org \
--cc=patches@linaro.org \
--cc=stefano.stabellini@citrix.com \
--cc=time@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).