All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mats Petersson <mats.petersson@citrix.com>
To: xen-devel@lists.xen.org
Subject: Re: [PATCH 1/2, v2] x86: use MOV instead of PUSH/POP when saving/restoring register state
Date: Tue, 30 Oct 2012 15:19:46 +0000	[thread overview]
Message-ID: <508FF012.30901@citrix.com> (raw)
In-Reply-To: <508FF1E202000078000A5786@nat28.tlf.novell.com>

On 30/10/12 14:27, Jan Beulich wrote:
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> Acked-by: Keir Fraser <keir@xen.org>
> ---
> This patch did not change from its v1 submission.
>
> --- a/xen/arch/x86/x86_64/compat/entry.S
> +++ b/xen/arch/x86/x86_64/compat/entry.S
> @@ -21,8 +21,7 @@ ENTRY(compat_hypercall)
>   UNLIKELY_START(ne, msi_check)
>           movl  $HYPERCALL_VECTOR,%edi
>           call  check_for_unexpected_msi
> -        RESTORE_ALL
> -        SAVE_ALL
> +        LOAD_C_CLOBBERED
>   UNLIKELY_END(msi_check)
>   
>           GET_CURRENT(%rbx)
> @@ -173,8 +172,7 @@ compat_bad_hypercall:
>   /* %rbx: struct vcpu, interrupts disabled */
>   compat_restore_all_guest:
>           ASSERT_INTERRUPTS_DISABLED
> -        RESTORE_ALL
> -        addq  $8,%rsp
> +        RESTORE_ALL adj=8
>   .Lft0:  iretq
>   
>   .section .fixup,"ax"
> --- a/xen/arch/x86/x86_64/entry.S
> +++ b/xen/arch/x86/x86_64/entry.S
> @@ -47,12 +47,10 @@ restore_all_guest:
>           cmpl  $1,%ecx
>           ja    .Lforce_iret
>   
> -        addq  $8,%rsp
> -        popq  %rcx                    # RIP
> -        popq  %r11                    # CS
> -        cmpw  $FLAT_USER_CS32,%r11
> -        popq  %r11                    # RFLAGS
> -        popq  %rsp                    # RSP
> +        cmpw  $FLAT_USER_CS32,16(%rsp)# CS
> +        movq  8(%rsp),%rcx            # RIP
> +        movq  24(%rsp),%r11           # RFLAGS
> +        movq  32(%rsp),%rsp           # RSP
>           je    1f
>           sysretq
>   1:      sysretl
> @@ -101,8 +99,7 @@ failsafe_callback:
>           ALIGN
>   /* No special register assumptions. */
>   restore_all_xen:
> -        RESTORE_ALL
> -        addq  $8,%rsp
> +        RESTORE_ALL adj=8
>           iretq
>   
>   /*
> @@ -311,8 +308,7 @@ ENTRY(int80_direct_trap)
>   UNLIKELY_START(ne, msi_check)
>           movl  $0x80,%edi
>           call  check_for_unexpected_msi
> -        RESTORE_ALL
> -        SAVE_ALL
> +        LOAD_C_CLOBBERED
>   UNLIKELY_END(msi_check)
>   
>           GET_CURRENT(%rbx)
> --- a/xen/include/asm-x86/x86_64/asm_defns.h
> +++ b/xen/include/asm-x86/x86_64/asm_defns.h
> @@ -5,11 +5,11 @@
>   
>   #ifdef CONFIG_FRAME_POINTER
>   /* Indicate special exception stack frame by inverting the frame pointer. */
> -#define SETUP_EXCEPTION_FRAME_POINTER           \
> -        movq  %rsp,%rbp;                        \
> +#define SETUP_EXCEPTION_FRAME_POINTER(offs)     \
> +        leaq  offs(%rsp),%rbp;                  \
>           notq  %rbp
>   #else
> -#define SETUP_EXCEPTION_FRAME_POINTER
> +#define SETUP_EXCEPTION_FRAME_POINTER(off)
Is it too pedantic to say that "off" here should be "offs"?
Just for consistency...

--
Mats

  reply	other threads:[~2012-10-30 15:19 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-02 15:20 [PATCH 0/3] x86: adjust entry frame generation Jan Beulich
2012-10-02 15:26 ` [PATCH 1/3] x86: use MOV instead of PUSH/POP when saving/restoring register state Jan Beulich
2012-10-02 17:01   ` Keir Fraser
2012-10-02 17:57   ` Konrad Rzeszutek Wilk
2012-10-03 13:01     ` Jan Beulich
2012-10-02 15:26 ` [PATCH 2/3] x86: consolidate frame state manipulation functions Jan Beulich
2012-10-02 17:01   ` Keir Fraser
2012-10-02 15:27 ` [PATCH 3/3] x86: save/restore only partial register state where possible Jan Beulich
2012-10-02 17:02   ` Keir Fraser
2012-10-03 13:05     ` Jan Beulich
2012-10-03 14:35       ` Keir Fraser
2012-10-30 14:26         ` Jan Beulich
2012-10-30 14:20 ` [PATCH 0/2, v2] x86: adjust entry frame generation Jan Beulich
2012-10-30 14:27   ` [PATCH 1/2, v2] x86: use MOV instead of PUSH/POP when saving/restoring register state Jan Beulich
2012-10-30 15:19     ` Mats Petersson [this message]
2012-10-30 14:36       ` Keir Fraser
2012-10-30 15:33       ` Jan Beulich
2012-10-30 14:29   ` [PATCH 2/2, v2] x86: save/restore only partial register state where possible Jan Beulich
2012-10-30 14:35   ` [PATCH 0/2, v2] x86: adjust entry frame generation Keir Fraser

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=508FF012.30901@citrix.com \
    --to=mats.petersson@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.