From: Avi Kivity <avi@redhat.com>
To: Gleb Natapov <gleb@redhat.com>
Cc: kvm@vger.kernel.org, mtosatti@redhat.com
Subject: Re: [PATCHv5 4/4] KVM: emulator: optimize "rep ins" handling.
Date: Sun, 05 Aug 2012 18:20:29 +0300 [thread overview]
Message-ID: <501E8F3D.3080603@redhat.com> (raw)
In-Reply-To: <20120805151837.GT27579@redhat.com>
On 08/05/2012 06:18 PM, Gleb Natapov wrote:
> On Sun, Aug 05, 2012 at 06:03:12PM +0300, Avi Kivity wrote:
>> On 07/30/2012 05:38 PM, Gleb Natapov wrote:
>> > Optimize "rep ins" by allowing emulator to write back more than one
>> > datum at a time. Introduce new operand type OP_MEM_STR which tells
>> > writeback() that dst contains pointer to an array that should be written
>> > back as opposite to just one data element.
>> >
>> >
>> > if (ctxt->rep_prefix && (ctxt->d & String)) {
>> > + unsigned int count;
>> > struct read_cache *r = &ctxt->io_read;
>> > - register_address_increment(ctxt, &ctxt->regs[VCPU_REGS_RCX], -1);
>> > + if ((ctxt->d & SrcMask) == SrcSI)
>> > + count = ctxt->src.count;
>> > + else
>> > + count = ctxt->dst.count;
>> > + register_address_increment(ctxt, &ctxt->regs[VCPU_REGS_RCX],
>> > + -count);
>> >
>>
>> count is unsigned. Does it sign extend correctly in
>> register_address_increment()?
>>
> I think it sign extent before register_address_increment() when compiler
> sees -count. count is in the range 1-1024 here, so there shouldn't be a
> problem. By I welcome better suggestions.
There is actually no problem since the 'inc' parameter is signed.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2012-08-05 15:20 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-30 14:38 [PATCHv5 0/4] improve speed of "rep ins" emulation Gleb Natapov
2012-07-30 14:38 ` [PATCHv5 1/4] Provide userspace IO exit completion callback Gleb Natapov
2012-08-02 19:26 ` Marcelo Tosatti
2012-08-05 14:49 ` Gleb Natapov
2012-07-30 14:38 ` [PATCHv5 2/4] KVM: emulator: make x86 emulation modes enum instead of defines Gleb Natapov
2012-07-30 14:38 ` [PATCHv5 3/4] KVM: emulator: string_addr_inc() cleanup Gleb Natapov
2012-07-30 14:38 ` [PATCHv5 4/4] KVM: emulator: optimize "rep ins" handling Gleb Natapov
2012-08-05 15:03 ` Avi Kivity
2012-08-05 15:18 ` Gleb Natapov
2012-08-05 15:20 ` Avi Kivity [this message]
2012-08-06 8:50 ` Avi Kivity
2012-08-06 8:58 ` Gleb Natapov
2012-08-06 9:28 ` Avi Kivity
2012-08-06 11:05 ` Gleb Natapov
2012-08-06 11:39 ` Avi Kivity
2012-08-06 11:49 ` Gleb Natapov
2012-08-06 12:08 ` Avi Kivity
2012-08-07 12:07 ` Gleb Natapov
2012-08-13 14:39 ` [PATCHv5 0/4] improve speed of "rep ins" emulation Richard W.M. Jones
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=501E8F3D.3080603@redhat.com \
--to=avi@redhat.com \
--cc=gleb@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.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;
as well as URLs for NNTP newsgroup(s).