From: Avi Kivity <avi@redhat.com>
To: "Li, Jiongxi" <jiongxi.li@intel.com>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH 1/5]KVM: x86, apicv: add APICv register virtualization support
Date: Sun, 16 Sep 2012 12:41:47 +0300 [thread overview]
Message-ID: <50559EDB.3070909@redhat.com> (raw)
In-Reply-To: <D9137FCD9CFF644B965863BCFBEDABB8781AAD@SHSMSX101.ccr.corp.intel.com>
On 09/14/2012 05:14 PM, Li, Jiongxi wrote:
> Sorry for the late response
>
>> -----Original Message-----
>> From: Avi Kivity [mailto:avi@redhat.com]
>> Sent: Friday, September 07, 2012 12:02 AM
>> To: Li, Jiongxi
>> Cc: kvm@vger.kernel.org
>> Subject: Re: [PATCH 1/5]KVM: x86, apicv: add APICv register virtualization
>> support
>>
>> On 09/05/2012 08:41 AM, Li, Jiongxi wrote:
>> > - APIC read doesn't cause VM-Exit
>> > - APIC write becomes trap-like
>> >
>> >
>> > +/* emulate APIC access in a trap manner */ int
>> > +kvm_apic_write_nodecode(struct kvm_vcpu *vcpu, u32 offset) {
>> > + u32 val;
>> > +
>> > + /* hw has done the conditional check and inst decode */
>> > + offset &= 0xff0;
>> > + if ((offset != APIC_EOI) &&
>> > + apic_reg_read(vcpu->arch.apic, offset, 4, &val))
>> > + return 1;
>>
>> TMICT is a write-only register IIRC.
>>
> I haven't seen TMICT write-only in SDM. Also in there is ' apic_get_reg(apci,APIC_TMICT)' call in 'apic_get_tmcct' function.
I can't see it either now. So this is okay.
>> > +
>> > + /* TODO: optimize to just emulate side effect w/o one more write */
>> > + return apic_reg_write(vcpu->arch.apic, offset, val);
>>
>> val may be uninitialized here.
>>
> Can you elaborate that? For APIC_EOI, there is no need to use val. For apic_reg_read fails case, it will return before apic_reg_write
Right, but the compiler may complain. Best to initialize val to zero.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2012-09-16 9:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-05 5:41 [PATCH 1/5]KVM: x86, apicv: add APICv register virtualization support Li, Jiongxi
2012-09-06 16:01 ` Avi Kivity
2012-09-14 14:14 ` Li, Jiongxi
2012-09-16 9:41 ` Avi Kivity [this message]
2012-09-18 14:38 ` Li, Jiongxi
2012-09-19 9:12 ` 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=50559EDB.3070909@redhat.com \
--to=avi@redhat.com \
--cc=jiongxi.li@intel.com \
--cc=kvm@vger.kernel.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