From: Juergen Gross <jgross@suse.com>
To: Andy Lutomirski <luto@amacapital.net>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
X86 ML <x86@kernel.org>,
Boris Ostrovsky <boris.ostrovsky@oracle.com>,
"H. Peter Anvin" <hpa@zytor.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>
Subject: Re: [PATCH v1] xen: get rid of paravirt op adjust_exception_frame
Date: Wed, 26 Jul 2017 20:43:35 +0200 [thread overview]
Message-ID: <d1e4a07e-29f1-88e0-349d-18778efa700b@suse.com> (raw)
In-Reply-To: <3487CD8D-4BC6-46D1-861A-A6FF31EB6087@amacapital.net>
On 26/07/17 19:57, Andy Lutomirski wrote:
>
>
>> On Jul 26, 2017, at 11:50 AM, Juergen Gross <jgross@suse.com> wrote:
>>
>>> On 26/07/17 15:48, Andy Lutomirski wrote:
>>>> On Mon, Jul 24, 2017 at 7:28 AM, Juergen Gross <jgross@suse.com> wrote:
>>>> When running as Xen pv-guest the exception frame on the stack contains
>>>> %r11 and %rcx additional to the other data pushed by the processor.
>>>>
>>>> Instead of having a paravirt op being called for each exception type
>>>> prepend the Xen specific code to each exception entry. When running as
>>>> Xen pv-guest just use the exception entry with prepended instructions,
>>>> otherwise use the entry without the Xen specific code.
>>>
>>> I think this is a nice cleanup, but I'm wondering if it would be even
>>> nicer if the Xen part was kept out-of-line. That is, could Xen have
>>> little stubs like:
>>>
>>> xen_alignment_check:
>>> pop %rcx
>>> pop %r11
>>> jmp alignment_check
>>>
>>> rather than using the macros in entry_64.S that you have? Then you
>>> could adjust set_trap_gate instead of pack_gate and maybe even do
>>> something like:
>>>
>>> #define set_trap_gate(..., name, ...) set_native_or_xen_trap_gate(...,
>>> name, xen_##name, ...)
>>
>> I think I'll have something like:
>>
>> #define pv_trap_entry(name) (xen_pv_domain() ? xen_ ## name : name)
>>
>> and use it like:
>>
>> set_intr_gate(X86_TRAP_AC, pv_trap_entry(alignment_check));
>>
>> This will avoid having to define macros for all variants of
>> set_intr_gate(), e.g. set_intr_gate_ist(), set_system_intr_gate().
>>
>> Do you have any objections?
>>
>
> Sounds good to me.
>
> FWIW, I have no real objection to putting the Xen entry right before the native entry and falling through. I don't love the ip -= 3 bit, though, and I think that the PV_ENTRY macro is too magical.
>
> This might be okay, though:
>
> XEN_PV_ENTRY_FALLTHROUGH(foo)
> ENTRY(foo)
ENTRY() aligns on 16 byte boundary. So I have to avoid ENTRY(foo) above
in the Xen case when I want to fall through.
So either I have to do something like PV_ENTRY (I could avoid the magic
"3" by using the xen_foo entry via pv_trap_entry()), or I need the stub
with "jmp" for Xen.
Juergen
next prev parent reply other threads:[~2017-07-26 18:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-24 14:28 Juergen Gross
2017-07-26 12:59 ` Boris Ostrovsky
2017-07-26 13:48 ` Andy Lutomirski
2017-07-26 14:01 ` [Xen-devel] " Andrew Cooper
2017-07-26 14:09 ` Andy Lutomirski
2017-07-26 14:31 ` Andrew Cooper
2017-07-26 15:12 ` Juergen Gross
2017-07-26 15:50 ` Juergen Gross
2017-07-26 17:57 ` Andy Lutomirski
2017-07-26 18:43 ` Juergen Gross [this message]
2017-07-26 20:15 ` Andy Lutomirski
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=d1e4a07e-29f1-88e0-349d-18778efa700b@suse.com \
--to=jgross@suse.com \
--cc=boris.ostrovsky@oracle.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.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
all inboxes | Powered by JetHome®