All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Andy Lutomirski <luto@amacapital.net>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [RFC PATCH] x86_64,entry,xen: Do not invoke espfix64 on Xen
Date: Tue, 15 Jul 2014 15:00:56 -0400	[thread overview]
Message-ID: <53C57A68.10100@oracle.com> (raw)
In-Reply-To: <CALCETrVU=y_ym9ZGwSDy1bwpx+qxga8V=kEi4g9Pubnv0A91nw@mail.gmail.com>

On 07/15/2014 01:22 PM, Andy Lutomirski wrote:
> On Tue, Jul 15, 2014 at 10:19 AM, Boris Ostrovsky
> <boris.ostrovsky@oracle.com> wrote:
>> On 07/15/2014 12:23 PM, Andy Lutomirski wrote:
>>>
>>> diff --git a/arch/x86/kernel/paravirt_patch_64.c
>>> b/arch/x86/kernel/paravirt_patch_64.c
>>> index 3f08f34..a1da673 100644
>>> --- a/arch/x86/kernel/paravirt_patch_64.c
>>> +++ b/arch/x86/kernel/paravirt_patch_64.c
>>> @@ -6,7 +6,6 @@ DEF_NATIVE(pv_irq_ops, irq_disable, "cli");
>>>    DEF_NATIVE(pv_irq_ops, irq_enable, "sti");
>>>    DEF_NATIVE(pv_irq_ops, restore_fl, "pushq %rdi; popfq");
>>>    DEF_NATIVE(pv_irq_ops, save_fl, "pushfq; popq %rax");
>>> -DEF_NATIVE(pv_cpu_ops, iret, "iretq");
>>>    DEF_NATIVE(pv_mmu_ops, read_cr2, "movq %cr2, %rax");
>>>    DEF_NATIVE(pv_mmu_ops, read_cr3, "movq %cr3, %rax");
>>>    DEF_NATIVE(pv_mmu_ops, write_cr3, "movq %rdi, %cr3");
>>> @@ -50,7 +49,6 @@ unsigned native_patch(u8 type, u16 clobbers, void *ibuf,
>>>                  PATCH_SITE(pv_irq_ops, save_fl);
>>>                  PATCH_SITE(pv_irq_ops, irq_enable);
>>>                  PATCH_SITE(pv_irq_ops, irq_disable);
>>> -               PATCH_SITE(pv_cpu_ops, iret);
>>
>>
>> Does this mean that we are no longer patching IRET with a jump to a
>> hypercall?
>>
> IIUC this means that, on native, we are no longer patching
> INTERRUPT_RETURN with an "iretq" instruction, so INTERRUPT_RETURN will
> remain a "jmp native_iret".  I'm not sure why this patch was there in
> the first place.  On Xen, it should still get patched with the
> hypercall (although someone should verify this).

Right, I missed the fact that this is native_patch.

I did some light testing and it appears to work. Are you targeting this 
for 3.16?

One way or the other we need to disable espfix64 on PV --- I discovered 
that one of Peter's tests crashes the hypervisor.


-boris

  reply	other threads:[~2014-07-15 18:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-15 16:23 [RFC PATCH] x86_64,entry,xen: Do not invoke espfix64 on Xen Andy Lutomirski
2014-07-15 17:19 ` Boris Ostrovsky
2014-07-15 17:22   ` Andy Lutomirski
2014-07-15 19:00     ` Boris Ostrovsky [this message]
2014-07-15 19:00       ` H. Peter Anvin
2014-07-15 19:04         ` Boris Ostrovsky
2014-07-15 19:02       ` 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=53C57A68.10100@oracle.com \
    --to=boris.ostrovsky@oracle.com \
    --cc=hpa@zytor.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    /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.