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

Ping: [PATCH] x86emul: pad blob-execution "okay" messages


  • 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:15:08 +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=Q3xhD2WCbCxNPzWRzSrAxXsfY7wluQcriH8hyeBCdB8=; b=IbvRasCDg6V6OCEQF6nkpbrPuqcfGjc1a0uBNwJ876ONe8unOTIHsolUA0MtJjuP+HRVGPkZ1fEzmAwAJ+tWmVCuu5BNJ6XZ6LHN6qm95Uh83pwx612r0OdHwT/DbrqOWRqpvwSC/UQMCZ+oKJmSvNJiAu4XYe1/xzgy6jtpYTqd/mduGAeng3+ANU1tzX3boPPvfS83an57WSyTZlM0zv5CMsP3FjsaBJ6dSvWtfL5ZCv2KhAFTLwwLx/1L5de9/xqonp4aF1IcrZFrbfMVb9WymKTxI+R/qscgQlloxcapd34cMKc9Lx5+UdEs0gsoHDb/nHOx8s4V969PB2LuLw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i/d2uoENX2TTCf2W/ZRcksPJdLNNrbDCxhNk0iW7/3mB7hTmih/hIU1aLwshmA4GqlCHgJN/DUlcirwOxA6xUyl4Pzk5JHR//mSKduzIc1SQUDdV9zQU6PVkAPa+klqS5og6CzIx03DZerbbxHiFQzHawJX9u4ytr45mM6iYEBHfVJR5dGZzlfjMm7EY3JtJyVIjTS7CM7/eYgh92p8rq+I5jn6P5oGzWlLJRhK3kUSkov1ofBpU07GO9v3jVPfc0icVL+mTsMMyCR0GtUC1Ey+rg64gq6XWWXJKwzr/Fxm/jvOpLHRnh0DuxxxaPZlzn0f9BnvSMYF/R8tqoXJWww==
  • 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:15:17 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 02.06.2021 16:38, Jan Beulich wrote:
> We already do so in the native execution case, and a few descriptions (I
> did notice this with SHA ones) are short enough for the output to look
> slightly odd.
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Again - anyone?

Thanks, Jan

> ---
> Many descriptions are longer than 37 characters, so I wonder whether we
> wouldn't want to bump the padding to 50, 60, or even 70. And this
> perhaps despite then going out of sync with the individual insn tests
> earlier on (which I wouldn't want to touch).
> 
> --- a/tools/tests/x86_emulator/test_x86_emulator.c
> +++ b/tools/tests/x86_emulator/test_x86_emulator.c
> @@ -5181,6 +5181,8 @@ int main(int argc, char **argv)
>  
>      for ( j = 0; j < ARRAY_SIZE(blobs); j++ )
>      {
> +        unsigned int nr;
> +
>          if ( blobs[j].check_cpu && !blobs[j].check_cpu() )
>              continue;
>  
> @@ -5196,7 +5198,8 @@ int main(int argc, char **argv)
>  
>          if ( ctxt.addr_size == sizeof(void *) * CHAR_BIT )
>          {
> -            i = printf("Testing %s native execution...", blobs[j].name);
> +            nr = printf("Testing %s native execution...", blobs[j].name);
> +
>              if ( blobs[j].set_regs )
>                  blobs[j].set_regs(&regs);
>              asm volatile (
> @@ -5212,11 +5215,13 @@ int main(int argc, char **argv)
>              );
>              if ( !blobs[j].check_regs(&regs) )
>                  goto fail;
> -            printf("%*sokay\n", i < 40 ? 40 - i : 0, "");
> +
> +            printf("%*sokay\n", nr < 40 ? 40 - nr : 0, "");
>          }
>  
> -        printf("Testing %s %u-bit code sequence",
> -               blobs[j].name, ctxt.addr_size);
> +        nr = printf("Testing %s %u-bit code sequence",
> +                    blobs[j].name, ctxt.addr_size);
> +
>          if ( blobs[j].set_regs )
>              blobs[j].set_regs(&regs);
>          regs.eip = (unsigned long)res;
> @@ -5233,7 +5238,10 @@ int main(int argc, char **argv)
>                  regs.eip < (unsigned long)res + blobs[j].size )
>          {
>              if ( (i++ & 8191) == 0 )
> +            {
>                  printf(".");
> +                ++nr;
> +            }
>              rc = x86_emulate(&ctxt, &emulops);
>              if ( rc != X86EMUL_OKAY )
>              {
> @@ -5242,13 +5250,17 @@ int main(int argc, char **argv)
>                  return 1;
>              }
>          }
> -        for ( ; i < 2 * 8192; i += 8192 )
> +        for ( ; i < 2 * 8192; i += 8192 ) {
>              printf(".");
> +            ++nr;
> +        }
> +
>          if ( (regs.eip != 0x12345678) ||
>               (regs.esp != ((unsigned long)res + MMAP_SZ)) ||
>               !blobs[j].check_regs(&regs) )
>              goto fail;
> -        printf("okay\n");
> +
> +        printf("%*sokay\n", nr < 40 ? 40 - nr : 0, "");
>      }
>  
>      return 0;
> 
> 




 


Rackspace

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