xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v3 09/18] x86emul/test: split generic and testcase specific parts
Date: Mon, 20 Feb 2017 15:13:17 +0000	[thread overview]
Message-ID: <7dee342d-dab4-d059-3db7-df05dde52f22@citrix.com> (raw)
In-Reply-To: <58A445C6020000780013A1CE@prv-mh.provo.novell.com>

On 15/02/17 11:12, Jan Beulich wrote:
> --- a/tools/tests/x86_emulator/test_x86_emulator.c
> +++ b/tools/tests/x86_emulator/test_x86_emulator.c
> @@ -8,19 +8,37 @@
>  
>  #define verbose false /* Switch to true for far more logging. */
>  
> +static void blowfish_set_regs(struct cpu_user_regs *regs)
> +{
> +    regs->eax = 2;
> +    regs->edx = 1;
> +}
> +
> +static bool blowfish_check_regs(const struct cpu_user_regs *regs)
> +{
> +    return regs->eax == 2 && regs->edx == 1;
> +}
> +
>  static const struct {
>      const void *code;
>      size_t size;
>      unsigned int bitness;
>      const char*name;
> +    void (*set_regs)(struct cpu_user_regs *);
> +    bool (*check_regs)(const struct cpu_user_regs *);
>  } blobs[] = {
> -    { blowfish_x86_32, sizeof(blowfish_x86_32), 32, "blowfish" },
> -    { blowfish_x86_32_mno_accumulate_outgoing_args,
> -      sizeof(blowfish_x86_32_mno_accumulate_outgoing_args),
> -      32, "blowfish (push)" },
> +#define BLOWFISH(bits, desc, tag)               \
> +    { .code = blowfish_x86_##bits##tag,         \
> +      .size = sizeof(blowfish_x86_##bits##tag), \

Do you mind putting spaces in around ## ?  They are binary operators
after all, and it will make the result more legible.

Otherwise, Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

> +      .bitness = bits, .name = #desc,           \
> +      .set_regs = blowfish_set_regs,            \
> +      .check_regs = blowfish_check_regs }
>  #ifdef __x86_64__
> -    { blowfish_x86_64, sizeof(blowfish_x86_64), 64, "blowfish" },
> +    BLOWFISH(64, blowfish, ),
>  #endif
> +    BLOWFISH(32, blowfish, ),
> +    BLOWFISH(32, blowfish (push), _mno_accumulate_outgoing_args),
> +#undef BLOWFISH
>  };
>  
>  static unsigned int bytes_read;
> @@ -2565,13 +2583,40 @@ int main(int argc, char **argv)


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

  reply	other threads:[~2017-02-20 15:13 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-15 10:47 [PATCH v3 00/18] x86emul: MMX/SSEn support Jan Beulich
2017-02-15 11:06 ` [PATCH v3 01/18] x86emul: catch exceptions occurring in stubs Jan Beulich
2017-02-15 11:27   ` Andrew Cooper
2017-02-15 11:49     ` Jan Beulich
2017-02-15 16:55     ` [PATCH v3.1 " Jan Beulich
2017-02-15 11:07 ` [PATCH v3 02/18] x86emul: support most memory accessing MMX/SSE{, 2, 3} insns Jan Beulich
2017-02-20 13:45   ` Andrew Cooper
2017-02-20 14:52     ` Jan Beulich
2017-02-20 18:40       ` Andrew Cooper
2017-02-21  8:44         ` Jan Beulich
2017-02-15 11:08 ` [PATCH v3 03/18] x86emul: support MMX/SSE{,2,3} moves Jan Beulich
2017-02-15 11:09 ` [PATCH v3 04/18] x86emul: support MMX/SSE/SSE2 converts Jan Beulich
2017-02-15 11:09 ` [PATCH v3 05/18] x86emul: support {,V}{,U}COMIS{S,D} Jan Beulich
2017-02-20 15:28   ` [PATCH v3 05/18] x86emul: support {, V}{, U}COMIS{S, D} Jan Beulich
2017-02-15 11:10 ` [PATCH v3 06/18] x86emul: support MMX/SSE/SSE2 insns with only register operands Jan Beulich
2017-02-15 11:11 ` [PATCH v3 07/18] x86emul: support {,V}{LD,ST}MXCSR Jan Beulich
2017-02-20 14:52   ` Andrew Cooper
2017-02-20 15:12     ` Jan Beulich
2017-02-20 15:33       ` Jan Beulich
2017-02-15 11:12 ` [PATCH v3 08/18] x86emul: support {,V}MOVNTDQA Jan Beulich
2017-02-20 15:01   ` Andrew Cooper
2017-02-20 15:13     ` Jan Beulich
2017-02-15 11:12 ` [PATCH v3 09/18] x86emul/test: split generic and testcase specific parts Jan Beulich
2017-02-20 15:13   ` Andrew Cooper [this message]
2017-02-15 11:13 ` [PATCH v3 10/18] x86emul: test coverage for SSE/SSE2 insns Jan Beulich
2017-02-20 15:24   ` Andrew Cooper
2017-02-20 15:40     ` Jan Beulich
2017-02-20 15:41       ` Andrew Cooper
2017-02-15 11:14 ` [PATCH v3 11/18] x86emul: honor MMXEXT feature flag Jan Beulich
2017-02-20 15:37   ` Andrew Cooper
2017-02-15 11:14 ` [PATCH v3 12/18] x86emul: add tables for 0f38 and 0f3a extension space Jan Beulich
2017-02-20 16:05   ` Andrew Cooper
2017-02-21  8:52     ` Jan Beulich
2017-02-15 11:15 ` [PATCH v3 13/18] x86emul: support SSSE3 insns Jan Beulich
2017-02-15 11:15 ` [PATCH v3 14/18] x86emul: support SSE4.1 insns Jan Beulich
2017-02-15 11:16 ` [PATCH v3 15/18] x86emul: support SSE4.2 insns Jan Beulich
2017-02-15 11:16 ` [PATCH v3 16/18] x86emul: support PCLMULQDQ Jan Beulich
2017-02-15 11:17 ` [PATCH v3 17/18] x86emul: support AESNI insns Jan Beulich
2017-02-15 11:17 ` [PATCH v3 18/18] x86emul: support SHA insns Jan Beulich

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=7dee342d-dab4-d059-3db7-df05dde52f22@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=xen-devel@lists.xenproject.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).