From: "Roger Pau Monné" <roger.pau@citrix.com>
To: George Dunlap <george.dunlap@eu.citrix.com>,
Julien Grall <julien.grall.oss@gmail.com>,
Julien Grall <julien.grall@citrix.com>,
Olaf Hering <olaf@aepfle.de>
Cc: Ian Campbell <ian.campbell@citrix.com>, xen-devel@lists.xen.org
Subject: Re: [PATCH v4 0/9] add xenalyze to staging
Date: Tue, 16 Jun 2015 09:21:11 +0200 [thread overview]
Message-ID: <557FCE67.4040405@citrix.com> (raw)
In-Reply-To: <557ED74C.1050504@eu.citrix.com>
El 15/06/15 a les 15.46, George Dunlap ha escrit:
> On 06/15/2015 01:44 PM, Julien Grall wrote:
>> Hi George,
>>
>> On 15/06/2015 10:23, George Dunlap wrote:
>>> On 06/10/2015 12:21 AM, Julien Grall wrote:
>>>> On 09/06/2015 07:38, George Dunlap wrote:
>>>>> On 06/09/2015 12:31 PM, Julien Grall wrote:
>>>>>> On 09/06/2015 06:18, Olaf Hering wrote:
>>>>>>> On Wed, Jun 03, Julien Grall wrote:
>>>>>>>
>>>>>>>> xentrace is not working as we don't have the infrastructure for ARM
>>>>>>>> in Xen.
>>>>>>>
>>>>>>> Why is that? After a very quick look __trace_var is available
>>>>>>> unconditionally.
>>>>>>
>>>>>> Multiple reasons, the shared page for trace is not correctly exposed,
>>>>>> __trace_var/__trace_hypercall is not even used on ARM. I may miss some
>>>>>> other bugs that I didn't spot while looking to the code.
>>>>>
>>>>> Code in xen/common will generate traces (e.g., the scheduling code), so
>>>>> useful traces are already in place for ARM, even if no arm-specific
>>>>> code
>>>>> has trace points yet.
>>>>>
>>>>>> So I don't think we should build a non-working binary until someone
>>>>>> fixes the various problem of the trace system on ARM.
>>>>>
>>>>> If the shared page really doesn't work, then yes, we should probably
>>>>> not
>>>>> build it on ARM for the release.
>>>>>
>>>>> Would it be very difficult to get working?
>>>>
>>>> I don't think this is very difficult. But it's not trivial and will
>>>> require some work in order to properly bring up xentrace on ARM.
>>>>
>>>> There was a thread about it last year [1] with Globallogic. I gave some
>>>> insight [2] on what to fix in order to get xentrace for ARM.
>>>>
>>>> Note that on x86 for foreign mapping, the check for xen domid is open
>>>> opencode the check for xen domid (see p2m_add_foreign).
>>>>
>>>> Also, one things I forgot to mention last year is foreign mapping is
>>>> always RW in the stage 2 P2M. Although, AFAIU, trace buffer should be
>>>> mapped RO in order to avoid the guest writing in it (see
>>>> share_xen_page_with_guest).
>>>
>>> On the contrary, the trace buffer uses the traditional Xen
>>> producer/consumer interface for transferring data. The user-space
>>> consumer needs to modify the consumer pointer to let Xen know that there
>>> is space to produce more trace records. The tracing code in the
>>> hypervisor is programmed defensively to make sure that a buggy consumer
>>> can't crash the hypervisor.
>>
>> I think we are not talking about the same things. My comment was a
>> reference to the call to xen_share_page_with_privileged_guests in
>> xen/common/trace.c
>>
>> AFAIU, the code request to share read-only the page (i.e the guest can't
>> write in this memory).
>>
>> The page will be mapped with the foreign mapping hypercall (the foreign
>> domid is xen_dom) always with RW not matter the shared attribute (i.e RW
>> or RO).
>
> Oh, right -- the trace *buffers* are read-write, but there's a "trace
> info" struct that contains an array of the mfns that make up the
> buffers. *That* is read-only, since there's no reason for the guest to
> modify it.
>
> Is this an issue because for ARM you have to attach Xen's mfn to a pfn
> in the guest? Is this also an issue with PVH?
TBH I've never tried to use xentrace on PVH, so I'm not sure what's missing.
I see that foreign mappings are always RW, maybe we should check if the
page we are going to add to the p2m has write permissions set and use
that instead of always using RW? On x86 this can be achieved in
p2m_add_foreign without much fuss, but I'm not sure what side-effects it
might have.
Roger.
next prev parent reply other threads:[~2015-06-16 7:21 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-23 8:24 [PATCH v4 0/9] add xenalyze to staging Olaf Hering
2015-05-23 8:24 ` [PATCH v4 1/9] xentrace: install into sbin Olaf Hering
2015-05-25 8:33 ` Wei Liu
2015-06-02 17:03 ` George Dunlap
2015-05-23 8:24 ` [PATCH v4 2/9] xenalyze: add to tools/xentrace/ Olaf Hering
2015-05-25 8:34 ` Wei Liu
2015-06-02 17:06 ` George Dunlap
2015-05-23 8:24 ` [PATCH v4 3/9] xenalyze: increase NR_CPUS to 256 Olaf Hering
2015-05-23 8:24 ` [PATCH v4 4/9] xenalyze: print newline after unknown hvm events Olaf Hering
2015-05-23 8:24 ` [PATCH v4 5/9] xenalyze: include odd mmio states in default output Olaf Hering
2015-05-23 8:24 ` [PATCH v4 6/9] xenalyze: handle TRC_TRACE_WRAP_BUFFER Olaf Hering
2015-05-23 8:24 ` [PATCH v4 7/9] xenalyze: handle more events in sched_process Olaf Hering
2015-06-02 17:12 ` George Dunlap
2015-06-09 10:44 ` Olaf Hering
2015-05-23 8:24 ` [PATCH v4 8/9] xenalyze: remove traling whitespaces Olaf Hering
2015-05-23 8:24 ` [PATCH v4 9/9] xenalyze: remove argp_program_version Olaf Hering
2015-06-02 17:16 ` [PATCH v4 0/9] add xenalyze to staging George Dunlap
2015-06-03 10:33 ` Ian Campbell
2015-06-03 10:10 ` Ian Campbell
2015-06-03 10:15 ` Ian Campbell
2015-06-03 10:33 ` George Dunlap
2015-06-03 10:59 ` Ian Campbell
2015-06-03 11:16 ` George Dunlap
2015-06-03 11:21 ` George Dunlap
2015-06-03 11:34 ` Ian Campbell
2015-06-03 10:35 ` Julien Grall
2015-06-03 10:38 ` Andrew Cooper
2015-06-03 10:38 ` George Dunlap
2015-06-03 10:41 ` Andrew Cooper
2015-06-03 10:42 ` George Dunlap
2015-06-03 10:49 ` George Dunlap
2015-06-09 10:18 ` Olaf Hering
2015-06-09 11:31 ` Julien Grall
2015-06-09 11:38 ` George Dunlap
2015-06-09 23:21 ` Julien Grall
2015-06-15 9:23 ` George Dunlap
2015-06-15 12:44 ` Julien Grall
2015-06-15 13:46 ` George Dunlap
2015-06-16 7:21 ` Roger Pau Monné [this message]
2015-06-09 6:54 ` Olaf Hering
2015-06-09 11:07 ` Olaf Hering
2015-06-10 21:23 ` 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=557FCE67.4040405@citrix.com \
--to=roger.pau@citrix.com \
--cc=george.dunlap@eu.citrix.com \
--cc=ian.campbell@citrix.com \
--cc=julien.grall.oss@gmail.com \
--cc=julien.grall@citrix.com \
--cc=olaf@aepfle.de \
--cc=xen-devel@lists.xen.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).