[PATCH v2] KVM: IOAPIC: only access APIC registers one dword at a time

2010-07-02 Thread Xiao Guangrong
The IOAPIC spec says: When accessing these registers, accesses must be done one dword at a time. For example, software should never access byte 2 from the Data register before accessing bytes 0 and 1. The hardware will not attempt to recover from a bad programming model in this case. So, this pat

Re: [PATCH v2] KVM: IOAPIC: only access APIC registers one dword at a time

2010-07-02 Thread Marcelo Tosatti
On Fri, Jul 02, 2010 at 04:00:12PM +0800, Xiao Guangrong wrote: > The IOAPIC spec says: > > When accessing these registers, accesses must be done one dword at a time. > For example, software should never access byte 2 from the Data register before > accessing bytes 0 and 1. The hardware will not a

Re: [PATCH v2] KVM: IOAPIC: only access APIC registers one dword at a time

2010-07-03 Thread Xiao Guangrong
Marcelo Tosatti wrote: >> +if (len != 4) { >> +printk(KERN_WARNING "ioapic: wrong length %d\n", len); >> +return 0; >> +} >> + > > Just remove the printks please, as guests can flood hosts dmesg. > OK, please review this one, thanks, Marcelo! Subject: [PATCH v

Re: [PATCH v2] KVM: IOAPIC: only access APIC registers one dword at a time

2010-07-03 Thread Avi Kivity
On 07/02/2010 11:00 AM, Xiao Guangrong wrote: The IOAPIC spec says: When accessing these registers, accesses must be done one dword at a time. For example, software should never access byte 2 from the Data register before accessing bytes 0 and 1. The hardware will not attempt to recover from a b

Re: [PATCH v2] KVM: IOAPIC: only access APIC registers one dword at a time

2010-07-04 Thread Xiao Guangrong
Avi Kivity wrote: > On 07/02/2010 11:00 AM, Xiao Guangrong wrote: >> The IOAPIC spec says: >> >> When accessing these registers, accesses must be done one dword at a >> time. >> For example, software should never access byte 2 from the Data >> register before >> accessing bytes 0 and 1. The hardw

Re: [PATCH v2] KVM: IOAPIC: only access APIC registers one dword at a time

2010-07-04 Thread Gleb Natapov
On Mon, Jul 05, 2010 at 11:47:06AM +0800, Xiao Guangrong wrote: > > There might be guests that use incorrect access despite the > > documentation; if real hardware supports it, it should work. So we need > > to start with just a warning, and allow the access. Later we can drop > > the invalid acc

Re: [PATCH v2] KVM: IOAPIC: only access APIC registers one dword at a time

2010-07-05 Thread Avi Kivity
On 07/05/2010 06:47 AM, Xiao Guangrong wrote: Avi Kivity wrote: On 07/02/2010 11:00 AM, Xiao Guangrong wrote: The IOAPIC spec says: When accessing these registers, accesses must be done one dword at a time. For example, software should never access byte 2 from the Data register befo

Re: [PATCH v2] KVM: IOAPIC: only access APIC registers one dword at a time

2010-07-05 Thread Xiao Guangrong
Avi Kivity wrote: > >>> There might be guests that use incorrect access despite the >>> documentation; if real hardware supports it, it should work. So we need >>> to start with just a warning, and allow the access. Later we can drop >>> the invalid access. >>> >> If the OS contravene t

Re: [PATCH v2] KVM: IOAPIC: only access APIC registers one dword at a time

2010-07-05 Thread Avi Kivity
On 07/05/2010 10:56 AM, Xiao Guangrong wrote: Well, there's the spec and there's real life, but in this case we can try and if we see a problem we'll re-add the other access length. OK, i'll do it as your suggestion, thanks. I meant that you can drop access length != 4, same as in