From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Razvan Cojocaru <rcojocaru@bitdefender.com>,
Jan Beulich <JBeulich@suse.com>
Cc: tim@xen.org, xen-devel@lists.xen.org
Subject: Re: [PATCH RFC 7/9] xen: Handle resumed instruction based on previous mem_event reply
Date: Thu, 03 Jul 2014 10:18:52 +0100 [thread overview]
Message-ID: <53B51FFC.5060800@citrix.com> (raw)
In-Reply-To: <53B51E64.5020602@bitdefender.com>
On 03/07/2014 10:12, Razvan Cojocaru wrote:
> On 07/03/2014 12:02 PM, Jan Beulich wrote:
>>>>> On 03.07.14 at 10:55, <rcojocaru@bitdefender.com> wrote:
>>> On 07/02/2014 06:56 PM, Jan Beulich wrote:
>>>>>>> On 02.07.14 at 15:33, <rcojocaru@bitdefender.com> wrote:
>>>>> In a scenario where a page fault that triggered a mem_event occured,
>>>>> p2m_mem_access_check() will now be able to either 1) emulate the
>>>>> current instruction, 2) skip the current instruction, or 3) emulate
>>>>> it, but don't allow it to perform any writes. Since some SSE2
>>>>> instructions are problematic to emulate (Firefox uses some),
>>>>> support for setting the A and D (accessed and dirty) bits has been
>>>>> added (please see p2m_set_ad_bits()).
>>>> Sadly that reference is useless - the function doesn't have any
>>>> explanation what all this is about either.
>>> p2m_set_ad_bits() ends up calling the code in
>>> xen/arch/x86/mm/hap/guest_walk.c, namely an "instantiation" of
>>> hap_p2m_ga_to_gfn(GUEST_PAGING_LEVELS)(), which in turn calls
>>> guest_walk_tables() (from xen/arch/x86/mm/guest_walk.c), which sets up
>>> the A/D bits allowing the problematic instructions to run while
>>> bypassing emulation for that specific case.
>> That's the mechanical part one can indeed work out from the patch.
>> The interesting but unexplained thing here is which "some SSE2
>> instructions" you refer to, and what's so special about them (you
>> not also including e.g. AVX here makes me further curious, as in
>> most cases AVX ones are direct extensions of SSEn ones, and hence
>> I'd expect them to be similarly problematic).
> An example that kept appearing with Xen 4.3 and Firefox in our test
> environment was: divsd xmm0, qword ptr [0x21c290]
>
>
> Thanks,
> Razvan Cojocaru
That is a bug in Xen (at least from your point of view). It should be
fixed by either correcting, or as I suspect is more likely, actually
adding emulation support for SSE instructions. Xen's emulation has
traditionally been restricted to the code instruction set and anything
which could reasonably fault against MMIO regions. As a result, its
knowledge of newer instruction sets is limited at best.
~Andrew
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2014-07-03 9:18 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-02 13:33 [PATCH RFC 1/9] xen: Emulate with no writes; compute current instruction length Razvan Cojocaru
2014-07-02 13:33 ` [PATCH RFC 2/9] xen: Optimize introspection access to guest state Razvan Cojocaru
2014-07-02 15:31 ` Andrew Cooper
2014-07-07 14:50 ` Razvan Cojocaru
2014-07-10 8:05 ` Razvan Cojocaru
2014-07-10 8:17 ` Andrew Cooper
2014-07-10 8:23 ` Razvan Cojocaru
2014-07-10 11:57 ` Razvan Cojocaru
2014-07-10 12:16 ` Razvan Cojocaru
2014-07-10 13:01 ` Andrew Cooper
2014-07-02 15:37 ` Jan Beulich
2014-07-03 8:12 ` Razvan Cojocaru
2014-07-03 8:54 ` Jan Beulich
2014-07-02 13:33 ` [PATCH RFC 3/9] xen: Force-enable relevant MSR events; optimize the number of sent MSR events Razvan Cojocaru
2014-07-02 15:35 ` Andrew Cooper
2014-07-02 15:43 ` Jan Beulich
2014-07-09 8:02 ` Razvan Cojocaru
2014-07-23 7:56 ` Jan Beulich
2014-07-23 8:03 ` Razvan Cojocaru
2014-07-02 13:33 ` [PATCH RFC 4/9] xenctrl: Make the headers C++ friendly Razvan Cojocaru
2014-07-02 15:37 ` Andrew Cooper
2014-07-02 13:33 ` [PATCH RFC 5/9] xen: Support for VMCALL mem_events Razvan Cojocaru
2014-07-02 15:47 ` Jan Beulich
2014-07-02 15:54 ` Razvan Cojocaru
2014-07-02 16:11 ` Jan Beulich
2014-07-02 16:23 ` Razvan Cojocaru
2014-07-03 6:28 ` Jan Beulich
2014-07-03 7:29 ` Razvan Cojocaru
2014-07-02 15:54 ` Andrew Cooper
2014-07-02 15:59 ` Razvan Cojocaru
2014-07-02 13:33 ` [PATCH RFC 6/9] xen, libxc: Request page fault injection via libxc Razvan Cojocaru
2014-07-02 15:51 ` Jan Beulich
2014-07-02 16:00 ` Andrew Cooper
2014-07-02 16:58 ` Mihai Donțu
2014-07-02 17:07 ` Andrew Cooper
2014-07-03 8:23 ` Mihai Donțu
2014-07-03 9:32 ` Andrew Cooper
2014-07-03 9:40 ` Razvan Cojocaru
2014-07-02 16:06 ` Razvan Cojocaru
2014-07-02 16:13 ` Jan Beulich
2014-07-02 13:33 ` [PATCH RFC 7/9] xen: Handle resumed instruction based on previous mem_event reply Razvan Cojocaru
2014-07-02 15:56 ` Jan Beulich
2014-07-03 8:55 ` Razvan Cojocaru
2014-07-03 9:02 ` Jan Beulich
2014-07-03 9:12 ` Razvan Cojocaru
2014-07-03 9:18 ` Andrew Cooper [this message]
2014-07-03 9:22 ` Jan Beulich
2014-07-03 9:34 ` Razvan Cojocaru
2014-07-03 10:14 ` Jan Beulich
2014-07-02 13:34 ` [PATCH RFC 8/9] xen: Generic instruction re-execution mechanism for execute faults Razvan Cojocaru
2014-07-02 16:04 ` Andrew Cooper
2014-07-02 13:34 ` [PATCH RFC 9/9] mm: mark pages that have their permissions controlled by a domain Razvan Cojocaru
2014-07-03 10:19 ` Jan Beulich
2014-07-03 11:27 ` Razvan Cojocaru
2014-07-03 12:15 ` Jan Beulich
2014-07-02 15:20 ` [PATCH RFC 1/9] xen: Emulate with no writes; compute current instruction length Andrew Cooper
2014-07-03 7:42 ` Razvan Cojocaru
2014-07-02 15:21 ` Jan Beulich
2014-07-02 15:43 ` Razvan Cojocaru
2014-07-02 16:08 ` Jan Beulich
2014-07-02 16:18 ` Razvan Cojocaru
2014-07-03 6:24 ` Jan Beulich
2014-07-03 7:38 ` Razvan Cojocaru
2014-07-03 8:05 ` Jan Beulich
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=53B51FFC.5060800@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=rcojocaru@bitdefender.com \
--cc=tim@xen.org \
--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 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.