All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
	Xen-devel <xen-devel@lists.xen.org>
Cc: Jan Beulich <JBeulich@suse.com>
Subject: Re: [PATCH for-4.11] x86/traps: Improve code generation for set_ist()
Date: Fri, 27 Apr 2018 15:29:05 +0200	[thread overview]
Message-ID: <51914f52-d66f-e876-1503-d8158969510b@suse.com> (raw)
In-Reply-To: <1524834453-22865-1-git-send-email-andrew.cooper3@citrix.com>

On 27/04/18 15:07, Andrew Cooper wrote:
> The IST field in an IDT entry is a 3 bit field, with 5 adjacent reserved bits
> which we always write as zero.  By expressing this as a byte field in a union,
> we turn an invocation of enable_each_ist() from
> 
>   4b 8b 14 d3                     mov    (%r11,%r10,8),%rdx
>   48 b8 ff ff ff ff f8 ff ff ff   movabs $0xfffffff8ffffffff,%rax
>   48 be 00 00 00 00 01 00 00 00   movabs $0x100000000,%rsi
>   48 8b 8a 80 00 00 00            mov    0x80(%rdx),%rcx
>   48 21 c1                        and    %rax,%rcx
>   48 09 f1                        or     %rsi,%rcx
>   48 be 00 00 00 00 02 00 00 00   movabs $0x200000000,%rsi
>   48 89 8a 80 00 00 00            mov    %rcx,0x80(%rdx)
>   48 8b 4a 20                     mov    0x20(%rdx),%rcx
>   48 21 c1                        and    %rax,%rcx
>   48 23 82 20 01 00 00            and    0x120(%rdx),%rax
>   48 09 f1                        or     %rsi,%rcx
>   48 89 4a 20                     mov    %rcx,0x20(%rdx)
>   48 b9 00 00 00 00 03 00 00 00   movabs $0x300000000,%rcx
>   48 09 c8                        or     %rcx,%rax
>   48 89 82 20 01 00 00            mov    %rax,0x120(%rdx)
> 
> into
> 
>   4b 8b 04 d3                     mov    (%r11,%r10,8),%rax
>   c6 80 84 00 00 00 01            movb   $0x1,0x84(%rax)
>   c6 40 24 02                     movb   $0x2,0x24(%rax)
>   c6 80 24 01 00 00 03            movb   $0x3,0x124(%rax)
> 
> which is far more simple.  As the IDT is typically live, this is more
> obviously safe.
> 
> The net delta for this change is:
> 
>   add/remove: 0/0 grow/shrink: 0/7 up/down: 0/-334 (-334)
> 
> While making changes here, tidy up the set_ist() declaration.  Drop the
> always_inline (I don't recall why I wrote it like that originally) and the ist
> parameter need not be unsigned long (although it will be const-propagated in
> practice).
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Release-acked-by: Juergen Gross <jgross@suse.com>


Juergen

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

      parent reply	other threads:[~2018-04-27 13:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-27 13:07 [PATCH for-4.11] x86/traps: Improve code generation for set_ist() Andrew Cooper
2018-04-27 13:28 ` Jan Beulich
2018-04-27 13:29 ` Juergen Gross [this message]

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=51914f52-d66f-e876-1503-d8158969510b@suse.com \
    --to=jgross@suse.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --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.