public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: Bernhard Kaindl <bk-l3A5Bk7waGM@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH] kvm: testsuite: silence warnings on x86_64
Date: Thu, 24 Jan 2008 18:21:56 +0200	[thread overview]
Message-ID: <4798BB24.9080100@qumranet.com> (raw)
In-Reply-To: <alpine.LNX.1.00.0801241628040.5231-aORvohZ8rX8NvFgr0RP9cw@public.gmane.org>

Bernhard Kaindl wrote:
> I did not test this patch as I did not find documentation on how to run the
> test cases and I could not find a make target to run them from make.
>
>   
  make -C user test_cases
  user/kvmctl user/test/x86/bootstrap user/test/x86/access.flat

(we should rename user -> test)


> --- kvm-60/user/test/x86/access.c
> +++ kvm-60/user/test/x86/access.c	2008/01/24 15:14:16
> @@ -1,6 +1,7 @@
>  
>  #include "smp.h"
>  #include "printf.h"
> +#include "string.h"
>  
>  #define true 1
>  #define false 0
> @@ -569,7 +570,7 @@
>      int r;
>  
>      printf("starting test\n\n");
> -    smp_init(ac_test_run);
> +    smp_init((void (*)(void))ac_test_run);
>      r = ac_test_run();
>      return r ? 0 : 1;
>  }
>   

Better to add a wrapper that conforms to the expected signature, and 
makes sure the return value of ac_test_run() is not lost.

Haven't run access.flat on smp for a long while; the results should be 
interesting after the page fault scaling work.

>  = i;
> @@ -105,7 +104,7 @@
>  
>  void test_push(void *mem)
>  {
> -	unsigned long tmp;
> +	unsigned long tmp = 0;
>  	unsigned long *stack_top = mem + 4096;
>  	unsigned long *new_stack_top;
>  	unsigned long memw = 0x123456789abcdeful;
>   

I'm needlessly pedantic, but the correct fix is to pass the constraint 
"=&r"(tmp) in the write section.  This tells gcc the register is 
clobbered ("=") and not to pass any inputs in it ("&").

-- 
Any sufficiently difficult bug is indistinguishable from a feature.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

  parent reply	other threads:[~2008-01-24 16:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-24 16:06 [PATCH] kvm: testsuite: silence warnings on x86_64 Bernhard Kaindl
     [not found] ` <alpine.LNX.1.00.0801241628040.5231-aORvohZ8rX8NvFgr0RP9cw@public.gmane.org>
2008-01-24 16:21   ` Avi Kivity [this message]
     [not found]     ` <4798BB24.9080100-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-01-24 17:43       ` Bernhard Kaindl
     [not found]         ` <alpine.LNX.1.00.0801241808470.5231-aORvohZ8rX8NvFgr0RP9cw@public.gmane.org>
2008-01-27  7:15           ` Avi Kivity
2008-01-31 10:23       ` Carlo Marcelo Arenas Belon
2008-01-31 10:38         ` Avi Kivity
2008-01-31 10:45         ` Avi Kivity
     [not found]           ` <47A1A6DB.6080804-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-01-31 12:15             ` [PATCH 0/2] testsuite: fixes for smp compilation issues Carlo Marcelo Arenas Belon
2008-01-31 12:18               ` [PATCH 1/2] testsuite: make smp_init parameter be a function that returns int Carlo Marcelo Arenas Belon
2008-01-31 12:20               ` [PATCH 2/2] testsuite: fix building smp.flat Carlo Marcelo Arenas Belon

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=4798BB24.9080100@qumranet.com \
    --to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
    --cc=bk-l3A5Bk7waGM@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.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