All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
To: Jin Dongming <jin.dongming@np.css.fujitsu.com>
Cc: Avi Kivity <avi@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>,
	KVM list <kvm@vger.kernel.org>
Subject: Re: [PATCH] KVM: IOAPIC: only access APIC registers one dword at a time
Date: Fri, 02 Jul 2010 15:38:02 +0800	[thread overview]
Message-ID: <4C2D975A.2050704@cn.fujitsu.com> (raw)
In-Reply-To: <4C2D95EA.6080209@np.css.fujitsu.com>



Jin Dongming wrote:

>>  
>>  	switch (len) {
>> -	case 8:
>> -		*(u64 *) val = result;
>> -		break;
>> -	case 1:
>> -	case 2:
>>  	case 4:
>> -		memcpy(val, (char *)&result, len);
> 
> Here the parameter len is not used for reading data from ioapic register, before switch case
> the value of ioapic register has been read by ioapic_read_indirect().
> 

Yeah, it's right, but it's rarely operation that guest using incorrect width to access
the registers, so i don't think it's worthy to move the width judgment before the real
registers read.

> 
>> +		*(u32 *) val = result;
>>  		break;
>> +
>>  	default:
>>  		printk(KERN_WARNING "ioapic: wrong length %d\n", len);
> 
> And I think here is not good to print warning message. Maybe it is better to do
> such kind of checking at the first of this function before ioapic_read_indirect().
> 

ditto

Thanks for your review, Jin!

  reply	other threads:[~2010-07-02  7:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-02  4:38 [PATCH] KVM: IOAPIC: only access APIC registers one dword at a time Xiao Guangrong
2010-07-02  7:31 ` Jin Dongming
2010-07-02  7:38   ` Xiao Guangrong [this message]
2010-07-02  8:00     ` [PATCH v2] " Xiao Guangrong
2010-07-02 17:42       ` Marcelo Tosatti
2010-07-03  8:20         ` Xiao Guangrong
2010-07-03 10:11       ` Avi Kivity
2010-07-05  3:47         ` Xiao Guangrong
2010-07-05  6:23           ` Gleb Natapov
2010-07-05  7:54           ` Avi Kivity
2010-07-05  7:56             ` Xiao Guangrong
2010-07-05  8:25               ` 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=4C2D975A.2050704@cn.fujitsu.com \
    --to=xiaoguangrong@cn.fujitsu.com \
    --cc=avi@redhat.com \
    --cc=jin.dongming@np.css.fujitsu.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.