public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@qumranet.com>
To: Mohammed Gamal <m.gamal005@gmail.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH] kvm: testsuite: Add test for 'call near absolute'
Date: Tue, 09 Sep 2008 16:39:08 +0300	[thread overview]
Message-ID: <48C67C7C.7000808@qumranet.com> (raw)
In-Reply-To: <20080908184616.GA31824@mohd-laptop>

Mohammed Gamal wrote:
> Add test for 'call near abolsute' instruction to the real mode test harness
>
>  
> +void test_call(struct regs *inregs, struct regs *outregs)
> +{
> +	MK_INSN(call1, "mov $0x4000, %eax \n\t"
> +		       "call *%eax\n\t");
> +
> +	exec_in_big_real_mode(inregs, outregs,
> +		   	      insn_call1,
> +			      insn_call1_end - insn_call1);
>   

Please test registers for damage (using regs_equal).

> +}
> +
> +void line_out()
> +{	
> +	/* Just output a blank line */
> +	asm(".org 0x4000 \n\t"
> +	    "mov $10, %al \n\t"
> +	    "out %al, $0xf1 \n\t");
> +}
>   

When the code grows and occupies address 0x4000, this will break.

I suggest:

void test_function(void);
asm ("test_function: mov $1234, %eax; ret");

This sets up a register to see that the call actually did something, and 
avoids the gcc function prologue/epilogue which may clobber registers.



-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2008-09-09 13:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-08 18:46 [PATCH] kvm: testsuite: Add test for 'call near absolute' Mohammed Gamal
2008-09-09 13:39 ` Avi Kivity [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-09-09 14:39 Mohammed Gamal
2008-09-10 15:31 ` Avi Kivity

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=48C67C7C.7000808@qumranet.com \
    --to=avi@qumranet.com \
    --cc=kvm@vger.kernel.org \
    --cc=m.gamal005@gmail.com \
    /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