All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@arm.com>
To: Ben Sanda <Ben.Sanda@dornerworks.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: George Dunlap <george.dunlap@citrix.com>
Subject: Re: [PATCH 3/6] xentrace: P2M lookup suport for ARM platform
Date: Wed, 30 Mar 2016 19:38:52 +0100	[thread overview]
Message-ID: <56FC1D3C.4040407@arm.com> (raw)
In-Reply-To: <A2A949C387F3A54C9B4DAC2DCD2E9A85E3337CFF@Quimby.dw.local>

On 28/03/16 19:55, Ben Sanda wrote:
> Julien and George,

Hi Ben,

Sorry for the late answer.

> Thank you for the comments. I had one question I wanted to ask.
>
>> A DOMID_XEN page could be read only too. For instance, the meta-data
>> of the trace buffer is read-only (see t_info), we don't want a domain
>> to be able to overwrite them.
>
>> However, all the foreign page are mapped read-write. You will need to
>> rework the code to map a foreign domain (see
>> XENMAPSPACE_gmfn_foreign) to allow read-only foreign page (maybe by
>> adding a new p2m_type_t?).
>
> I understand what you are saying in general, but I'm not familiar
> enough with the Xen memory mapping system to know how to actually
> implement this. The p2m_type_t p2m_ram_ro exists, which I could assign
> to read-only pages, but I'm unsure as to how to detect whether a
> request is to a read only mapping or a read-write. The normal (non
> DOMID_XEN) p2m_lookup function normally does this by reading the root-
> level page tables and somehow extracting the mapping type from the
> lpae_t structure. Given that we are not looking up the page tables for
> non-translated addresses, I'm not sure where/how to find the correct
> mapping type. Can I still lookup the page table entries for the MFN
> address and extract the p2m_type_t the same way?

You can know if the page is writable by looking to the page field 
u.inuse.type_info (PGT_writable_page means the page is writable).

Regards,

-- 
Julien Grall

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

  reply	other threads:[~2016-03-30 18:38 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-16 20:51 [PATCH 0/6] xentrace/xenalyze support on ARM Benjamin Sanda
2016-03-16 20:51 ` [PATCH 1/6] Flask: Support for ARM xentrace Benjamin Sanda
2016-03-17 14:56   ` Julien Grall
2016-03-17 15:03   ` Julien Grall
2016-03-25 19:27   ` Konrad Rzeszutek Wilk
2016-03-28 15:52     ` Ben Sanda
2016-03-16 20:51 ` [PATCH 2/6] xenalyze: Support for ARM platform Benjamin Sanda
2016-03-16 20:59   ` Andrew Cooper
2016-03-17 10:39     ` George Dunlap
2016-03-16 20:51 ` [PATCH 3/6] xentrace: P2M lookup suport " Benjamin Sanda
2016-03-17 16:21   ` Julien Grall
2016-03-28 18:55     ` Ben Sanda
2016-03-30 18:38       ` Julien Grall [this message]
2016-03-16 20:51 ` [PATCH 4/6] xentrace: ARM platform DOMID_XEN mapping support Benjamin Sanda
2016-03-17 15:53   ` Julien Grall
2016-03-16 20:51 ` [PATCH 5/6] xentrace: Trace buffer support for ARM platform Benjamin Sanda
2016-03-16 20:51 ` [PATCH 6/6] xentrace: ARM platform timestamp support Benjamin Sanda
2016-03-25 19:31   ` Konrad Rzeszutek Wilk
2016-03-31 16:38     ` Stefano Stabellini
2016-03-31 16:44       ` Ben Sanda
2016-04-01 13:05         ` Stefano Stabellini
2016-03-17 15:00 ` [PATCH 0/6] xentrace/xenalyze support on ARM Julien Grall
2016-03-17 16:50   ` Ben Sanda
2016-03-17 17:01     ` Julien Grall
2016-03-17 17:04       ` Ben Sanda
2016-03-18 17:12         ` Wei Liu
2016-03-17 17:23 ` George Dunlap

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=56FC1D3C.4040407@arm.com \
    --to=julien.grall@arm.com \
    --cc=Ben.Sanda@dornerworks.com \
    --cc=george.dunlap@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 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.