[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Ping: [PATCH] x86emul: avoid using _PRE_EFLAGS() in a few cases


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 28 Jun 2021 14:14:22 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=M90D9+BdxAf5Mno841pb00beQDnilbxJZ2fZ/0gnGZg=; b=a9GAl74VtNegW6DcUHF6baSSgdaFKVNlVBt1lzxBvU0SaDB6+0fkdWXzRDpf0yrlpJrYbTG5f0BJ/birylbwLqxy7yjrN6Lg8DFppEJxBAHdDu3iOAS3L0Lo6oo+gXJxwMNTciy2QUxGgdiH1KiSdj4nehjaxbwR56BQEryqNSWdc5IVxE6oh1thWZK75D2Sz1jc9aGnn7XPjzVqVRGXSI4ILtRytkEQdoh0/iXSzU8WlJvrmiWTzV4pQUZc2oIOKM1/G3f7N36C4PoHY0qTFMMEXCb956ASIyYG3WTnmYFuVEjCQGqmDP1u1//b+bk9MER7zWHWa6b9Me7GE2gc/Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fs/xqZLINdwa5bYp5EoujBIkT7M8W7uORxbS9nXiQsWJQRn9HCQf+bA4wZCxN1rVGp7+hvwdDm7QZ8slitqeZEAlz/nnVnMo5FHVXXjtGbB1yI1AhFLfF5liwUbmojk+xhS8hYNuGmO8q9dl6GpAbOlNlNSCzWMtVIAl6ELAgJ07Tk/2hh1nzqnDXI51SXIOi7Xozd+CE7OG1HCgDnKQRuTKccIY9Y85lqF/ZIrVN8yHGFUMOaXGo8Ao0yBIop4PjUFsz9okg3awHs5avYZ7hKokn2TtIp2sxvKqPi3W68fc+djMj5TvlEpv+Xk1O+GnQYApnFUBuv2SL/go5t58Lw==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 28 Jun 2021 12:14:31 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 02.06.2021 16:37, Jan Beulich wrote:
> The macro expanding to quite a few insns, replace its use by simply
> clearing the status flags when the to be executed insn doesn't depend
> on their initial state, in cases where this is easily possible. (There
> are more cases where the uses are hidden inside macros, and where some
> of the users of the macros want guest flags put in place before running
> the insn, i.e. the macros can't be updated as easily.)
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Anyone?

Thanks, Jan

> --- a/xen/arch/x86/x86_emulate/x86_emulate.c
> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c
> @@ -6863,7 +6863,8 @@ x86_emulate(
>          }
>          opc[2] = 0xc3;
>  
> -        invoke_stub(_PRE_EFLAGS("[eflags]", "[mask]", "[tmp]"),
> +        _regs.eflags &= ~EFLAGS_MASK;
> +        invoke_stub("",
>                      _POST_EFLAGS("[eflags]", "[mask]", "[tmp]"),
>                      [eflags] "+g" (_regs.eflags),
>                      [tmp] "=&r" (dummy), "+m" (*mmvalp)
> @@ -8111,7 +8112,8 @@ x86_emulate(
>          opc[2] = 0xc3;
>  
>          copy_VEX(opc, vex);
> -        invoke_stub(_PRE_EFLAGS("[eflags]", "[mask]", "[tmp]"),
> +        _regs.eflags &= ~EFLAGS_MASK;
> +        invoke_stub("",
>                      _POST_EFLAGS("[eflags]", "[mask]", "[tmp]"),
>                      [eflags] "+g" (_regs.eflags),
>                      "=a" (dst.val), [tmp] "=&r" (dummy)
> @@ -11698,13 +11700,14 @@ int x86_emul_rmw(
>          break;
>  
>      case rmw_xadd:
> +        *eflags &= ~EFLAGS_MASK;
>          switch ( state->op_bytes )
>          {
>              unsigned long dummy;
>  
>  #define XADD(sz, cst, mod) \
>          case sz: \
> -            asm ( _PRE_EFLAGS("[efl]", "[msk]", "[tmp]") \
> +            asm ( "" \
>                    COND_LOCK(xadd) " %"#mod"[reg], %[mem]; " \
>                    _POST_EFLAGS("[efl]", "[msk]", "[tmp]") \
>                    : [reg] "+" #cst (state->ea.val), \
> 
> 




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.