Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1666120

Re: [PATCH 3/3] x86/xen: Move paravirt IOPL switching to slow the path

From Andrew Cooper <andrew.cooper3@citrix.com>
Newsgroups linux.kernel
Subject Re: [PATCH 3/3] x86/xen: Move paravirt IOPL switching to slow the path
Date 2017-06-14 20:10 +0200
Message-ID <tSkTT-64-1@gated-at.bofh.it> (permalink)
References <tSfUd-5dU-9@gated-at.bofh.it> <tSfUd-5dU-7@gated-at.bofh.it> <tSkAx-8cx-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 14/06/17 18:40, Andy Lutomirski wrote:
> On Wed, Jun 14, 2017 at 5:40 AM, Brian Gerst <brgerst@gmail.com> wrote:
>> Since tasks using IOPL are very rare, move the switching code to the slow
>> path for lower impact on normal tasks.
> I think that Andrew Cooper added a vmassist that we could opt in to
> that makes Xen PV IOPL switching work more or less just like native.
> We could maybe opt in to that and avoid needing this stuff at all on
> newer hypervisors.

Indeed.

HYPERVISOR_vm_assist(VMASST_CMD_enable, VMASST_TYPE_architectural_iopl);

(if recognised) does two things.

1) virtual IOPL is picked up from EFLAGS in the iret frame, exactly like
native.
2) The guest kernel is assumed to have virtual CPL0 for the purpose of
privilege calculations.

Xen never runs with the real IOPL different to 0, or a PV guests could
disable interrupts with popf.  As a result, all IO port access does trap
to Xen for auditing.  What part 2) does is avoid having the awkward
double-step of Linux needing to set IOPL to 1 for kernel level IO access
to avoid faulting.

The assist should be available in Xen 4.7 and later (or wherever vendors
have backported it to).

~Andrew

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 3/3] x86/xen: Move paravirt IOPL switching to slow the path Brian Gerst <brgerst@gmail.com> - 2017-06-14 14:50 +0200
  Re: [PATCH 3/3] x86/xen: Move paravirt IOPL switching to slow the  path Juergen Gross <jgross@suse.com> - 2017-06-14 15:20 +0200
    Re: [PATCH 3/3] x86/xen: Move paravirt IOPL switching to slow the path Brian Gerst <brgerst@gmail.com> - 2017-06-14 19:40 +0200
      Re: [PATCH 3/3] x86/xen: Move paravirt IOPL switching to slow the  path Juergen Gross <jgross@suse.com> - 2017-06-14 19:40 +0200
  Re: [PATCH 3/3] x86/xen: Move paravirt IOPL switching to slow the path Andy Lutomirski <luto@kernel.org> - 2017-06-14 19:50 +0200
    Re: [PATCH 3/3] x86/xen: Move paravirt IOPL switching to slow the  path Andrew Cooper <andrew.cooper3@citrix.com> - 2017-06-14 20:10 +0200
      Re: [PATCH 3/3] x86/xen: Move paravirt IOPL switching to slow the path Brian Gerst <brgerst@gmail.com> - 2017-06-14 20:30 +0200
        Re: [PATCH 3/3] x86/xen: Move paravirt IOPL switching to slow the path Andy Lutomirski <luto@kernel.org> - 2017-06-15 03:40 +0200

csiph-web