Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-15 Thread Avi Kivity
Rusty Russell wrote: > On Thu, 2007-04-12 at 06:32 +0300, Avi Kivity wrote: > >> I hadn't considered an always-blocking (or unbuffered) networking API. >> It's very counter to current APIs, but does make sense with things like >> syslets. Without syslets, I don't think it's very useful as you

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-15 Thread Rusty Russell
On Thu, 2007-04-12 at 06:32 +0300, Avi Kivity wrote: > I hadn't considered an always-blocking (or unbuffered) networking API. > It's very counter to current APIs, but does make sense with things like > syslets. Without syslets, I don't think it's very useful as you need > some artificial threads

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-11 Thread Avi Kivity
Rusty Russell wrote: > On Wed, 2007-04-11 at 17:28 +0300, Avi Kivity wrote: > >> Rusty Russell wrote: >> >>> On Wed, 2007-04-11 at 07:26 +0300, Avi Kivity wrote: >>> >>> Nope. Being async is critical for copyless networking: >> With async operations, the s

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-11 Thread Rusty Russell
On Wed, 2007-04-11 at 17:28 +0300, Avi Kivity wrote: > Rusty Russell wrote: > > On Wed, 2007-04-11 at 07:26 +0300, Avi Kivity wrote: > > > >> Nope. Being async is critical for copyless networking: > >> > With async operations, the saga continues like this: the host-side > driver allocates an s

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-11 Thread Avi Kivity
Rusty Russell wrote: > On Wed, 2007-04-11 at 07:26 +0300, Avi Kivity wrote: > >> Nope. Being async is critical for copyless networking: >> >> - in the transmit path, so need to stop the sender (guest) from touching >> the memory until it's on the wire. This means 100% of packets sent will >> b

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-11 Thread Rusty Russell
On Wed, 2007-04-11 at 07:26 +0300, Avi Kivity wrote: > Nope. Being async is critical for copyless networking: > > - in the transmit path, so need to stop the sender (guest) from touching > the memory until it's on the wire. This means 100% of packets sent will > be blocked. Hi Avi, You

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-10 Thread Avi Kivity
Rusty Russell wrote: > On Mon, 2007-04-09 at 16:38 +0300, Avi Kivity wrote: > >> Moreover, some things just don't lend themselves to a userspace >> abstraction. If we want to expose tso (tcp segmentation offload), we >> can easily do so with a kernel driver since the kernel interfaces are >>

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-10 Thread Rusty Russell
On Mon, 2007-04-09 at 16:38 +0300, Avi Kivity wrote: > Moreover, some things just don't lend themselves to a userspace > abstraction. If we want to expose tso (tcp segmentation offload), we > can easily do so with a kernel driver since the kernel interfaces are > all tso aware. Tacking on tso

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-10 Thread Avi Kivity
Evgeniy Polyakov wrote: > On Mon, Apr 09, 2007 at 04:38:18PM +0300, Avi Kivity ([EMAIL PROTECTED]) > wrote: > >>> But I don't get this "we can enhance the kernel but not userspace" vibe >>> 8( >>> >>> >> I've been waiting for network aio since ~2003. If it arrives in the >> next few

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-10 Thread Avi Kivity
Evgeniy Polyakov wrote: > On Tue, Apr 10, 2007 at 03:17:45PM +0300, Avi Kivity ([EMAIL PROTECTED]) > wrote: > >>> Check a link please in case we are talking about different ideas: >>> http://marc.info/?l=linux-netdev&m=112262743505711&w=2 >>> >>> >>> >> I don't really understand what y

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-10 Thread Evgeniy Polyakov
On Tue, Apr 10, 2007 at 03:17:45PM +0300, Avi Kivity ([EMAIL PROTECTED]) wrote: > >Check a link please in case we are talking about different ideas: > >http://marc.info/?l=linux-netdev&m=112262743505711&w=2 > > > > > > I don't really understand what you're testing there. in particular, how > c

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-10 Thread Avi Kivity
Evgeniy Polyakov wrote: >> This is what Xen does. It is actually less performant than copying, IIRC. >> >> The problem with flipping pages around is that physical addresses are >> cached both in the kvm mmu and in the on-chip tlbs, necessitating >> expensive page table walks and tlb invalidation

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-10 Thread Evgeniy Polyakov
On Tue, Apr 10, 2007 at 02:21:24PM +0300, Avi Kivity ([EMAIL PROTECTED]) wrote: > >You want to implement zero-copy network device between host and guest, if > >I understood this thread correctly? > >So, for sending part, device allocates pages from receiver's memory (or > >from shared memory), rece

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-10 Thread Avi Kivity
Evgeniy Polyakov wrote: >>> But it looks from this discussion, that it will not prevent from >>> changing in-kernel driver - place a hook into skb allocation path and >>> allocate data from opposing memory - get pages from another side and put >>> them into fragments, then copy headers into skb->da

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-10 Thread Evgeniy Polyakov
On Tue, Apr 10, 2007 at 11:19:52AM +0300, Avi Kivity ([EMAIL PROTECTED]) wrote: > I meant, network aio in the mainline kernel. I am aware of the various > out-of-tree implementations. If potential users do not pay attention to initial implementaion, it is quite hard to them to get into. But actua

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-10 Thread Evgeniy Polyakov
On Mon, Apr 09, 2007 at 04:38:18PM +0300, Avi Kivity ([EMAIL PROTECTED]) wrote: > >But I don't get this "we can enhance the kernel but not userspace" vibe > >8( > > > > I've been waiting for network aio since ~2003. If it arrives in the > next few days, I'm all for it; much more than kvm can u

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-09 Thread Avi Kivity
Rusty Russell wrote: > On Mon, 2007-04-09 at 10:10 +0300, Avi Kivity wrote: > >> Rusty Russell wrote: >> >>> I'm a little puzzled by your response. Hmm... >>> >>> lguest's userspace network frontend does exactly as many copies as >>> Ingo's in-host-kernel code. One from the Guest,

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-09 Thread Rusty Russell
On Mon, 2007-04-09 at 10:10 +0300, Avi Kivity wrote: > Rusty Russell wrote: > > I'm a little puzzled by your response. Hmm... > > > > lguest's userspace network frontend does exactly as many copies as > > Ingo's in-host-kernel code. One from the Guest, one to the Guest. > > kvm pvnet is

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-09 Thread Avi Kivity
Rusty Russell wrote: > On Sun, 2007-04-08 at 08:36 +0300, Avi Kivity wrote: > >> Rusty Russell wrote: >> >>> Hi Avi, >>> >>> I don't think you've thought about this very hard. The receive copy is >>> completely independent with whether the packet is going to the guest via >>> a kernel

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-08 Thread Rusty Russell
On Sun, 2007-04-08 at 08:36 +0300, Avi Kivity wrote: > Rusty Russell wrote: > > Hi Avi, > > > > I don't think you've thought about this very hard. The receive copy is > > completely independent with whether the packet is going to the guest via > > a kernel driver or via userspace, so not relev

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-08 Thread Muli Ben-Yehuda
On Sun, Apr 08, 2007 at 08:36:14AM +0300, Avi Kivity wrote: > That is not the common case. Nor is it true when there is a > mismatch between the card's capabilties and guest expectations and > constraints. For example, guest memory is not physically contiguous > so a NIC that won't do scatter/ga

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-07 Thread Avi Kivity
Rusty Russell wrote: > On Thu, 2007-04-05 at 10:17 +0300, Avi Kivity wrote: > >> Rusty Russell wrote: >> >>> You didn't quote Anthony's point about "it's more about there not being >>> good enough userspace interfaces to do network IO." >>> >>> It's easier to write a kernel-space network dr

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-06 Thread Ingo Molnar
* Rusty Russell <[EMAIL PROTECTED]> wrote: > > prototyping new kernel APIs to implement user-space network drivers, > > on a crufty codebase is not something that should be done lightly. > > I think you overestimate my radicalism. I was considering readv() and > writev() on the tap device. o

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-06 Thread Ingo Molnar
* Ingo Molnar <[EMAIL PROTECTED]> wrote: > * Anthony Liguori <[EMAIL PROTECTED]> wrote: > > > [...] Did Linux have extremely high quality code in 1994? > > yes! It was crutial to strive for extremely high quality code all the > time. That was the only way to grow Linux's codebase, which was >

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-06 Thread Ingo Molnar
* Anthony Liguori <[EMAIL PROTECTED]> wrote: > [...] Did Linux have extremely high quality code in 1994? yes! It was crutial to strive for extremely high quality code all the time. That was the only way to grow Linux's codebase, which was ~300,000 lines of code in 1994, to the current 7.2+ mil

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-05 Thread Rusty Russell
On Thu, 2007-04-05 at 13:36 +0200, Ingo Molnar wrote: > prototyping new kernel APIs to implement user-space network drivers, on > a crufty codebase is not something that should be done lightly. I think you overestimate my radicalism. I was considering readv() and writev() on the tap device. Qem

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-05 Thread Rusty Russell
On Thu, 2007-04-05 at 10:17 +0300, Avi Kivity wrote: > Rusty Russell wrote: > > You didn't quote Anthony's point about "it's more about there not being > > good enough userspace interfaces to do network IO." > > > > It's easier to write a kernel-space network driver, but it's not > > obviously the

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-05 Thread Anthony Liguori
Dong, Eddie wrote: > Avi Kivity wrote: > >> Dong, Eddie wrote: >> >>> Avi Kivity wrote: >>> >>> > With PIC in Xen, CPU2K gets 6.5% performance gain in old 1000HZ > linux kernel, KB gets 14% gain. We also did a shared PIC model > which share PIC state among Qemu & VMM wit

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-05 Thread Anthony Liguori
Avi Kivity wrote: > Dong, Eddie wrote: >> Avi Kivity wrote: >> With PIC in Xen, CPU2K gets 6.5% performance gain in old 1000HZ linux kernel, KB gets 14% gain. We also did a shared PIC model which share PIC state among Qemu & VMM with less LOC in VMM, it can get similar perfor

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-05 Thread Dong, Eddie
Avi Kivity wrote: > Dong, Eddie wrote: >> Avi Kivity wrote: >> With PIC in Xen, CPU2K gets 6.5% performance gain in old 1000HZ linux kernel, KB gets 14% gain. We also did a shared PIC model which share PIC state among Qemu & VMM with less LOC in VMM, it can get similar p

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-05 Thread Avi Kivity
Dong, Eddie wrote: > Avi Kivity wrote: > >>> With PIC in Xen, CPU2K gets 6.5% performance gain in old 1000HZ linux >>> kernel, KB gets 14% gain. We also did a shared PIC model which share >>> PIC state among Qemu & VMM with less LOC in VMM, it can get >>> similar performance gain (5.8% in my te

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-05 Thread Dong, Eddie
Dor Laor wrote: > So for the sake of the next arguments, what was the fuel running the > decision of moving all the X-PI[c|t] things into the Xen? PIT is in Xen at very beginning when HVM support is designed due to performance reason. Moving PIC to VMM is also for performance reason at that time

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-05 Thread Dong, Eddie
Avi Kivity wrote: >> With PIC in Xen, CPU2K gets 6.5% performance gain in old 1000HZ linux >> kernel, KB gets 14% gain. We also did a shared PIC model which share >> PIC state among Qemu & VMM with less LOC in VMM, it can get >> similar performance gain (5.8% in my test). >> BTW, at that time, PIT

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-05 Thread Dong, Eddie
Dor Laor wrote: >> Dor Laor wrote: >>> >>> Do you know why Xen guy choose of implementing it in Xen? Why >>> didn't they rip Qemu implementation? >>> >> With PIC in Xen, CPU2K gets 6.5% performance gain in old 1000HZ linux >> kernel, KB gets 14% gain. We also did a shared PIC model which share >

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-05 Thread Dor Laor
>Dor Laor wrote: >> >> Do you know why Xen guy choose of implementing it in Xen? Why didn't >> they rip Qemu implementation? >> >With PIC in Xen, CPU2K gets 6.5% performance gain in old 1000HZ linux >kernel, KB gets 14% gain. We also did a shared PIC model which share > PIC state among Qemu & VMM

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-05 Thread Anthony Liguori
Ingo Molnar wrote: > * Rusty Russell <[EMAIL PROTECTED]> wrote: > > >> It's easier to write a kernel-space network driver, but it's not >> obviously the right thing to do until we can show that an efficient >> packet-level userspace interface isn't possible. I don't think that's >> been done

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-05 Thread Avi Kivity
Dong, Eddie wrote: > Dor Laor wrote: > >> Do you know why Xen guy choose of implementing it in Xen? Why didn't >> they rip Qemu implementation? >> >> > With PIC in Xen, CPU2K gets 6.5% performance gain in old 1000HZ linux > kernel, KB gets 14% gain. We also did a shared PIC model which sha

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-05 Thread Dong, Eddie
Dor Laor wrote: > > Do you know why Xen guy choose of implementing it in Xen? Why didn't > they rip Qemu implementation? > With PIC in Xen, CPU2K gets 6.5% performance gain in old 1000HZ linux kernel, KB gets 14% gain. We also did a shared PIC model which share PIC state among Qemu & VMM with l

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-05 Thread Ingo Molnar
* Ingo Molnar <[EMAIL PROTECTED]> wrote: > * Rusty Russell <[EMAIL PROTECTED]> wrote: > > > It's easier to write a kernel-space network driver, but it's not > > obviously the right thing to do until we can show that an efficient > > packet-level userspace interface isn't possible. I don't thi

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-05 Thread Ingo Molnar
* Avi Kivity <[EMAIL PROTECTED]> wrote: > [...] But the difference in cruftiness between kvm and qemu code > should not enter into the discussion of where to do things. i agree that it doesnt enter the discussion for the *PIC question, but it very much enters the discussion for the question th

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-05 Thread Avi Kivity
Ingo Molnar wrote: > * Avi Kivity <[EMAIL PROTECTED]> wrote: > > >>> so right now the only option for a clean codebase is the KVM >>> in-kernel code. >>> >> I strongly disagree with this. >> > > are you disagreeing with my statement that the KVM kernel-side code is > the only clean

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-05 Thread Ingo Molnar
* Avi Kivity <[EMAIL PROTECTED]> wrote: > > so right now the only option for a clean codebase is the KVM > > in-kernel code. > > I strongly disagree with this. are you disagreeing with my statement that the KVM kernel-side code is the only clean codebase here? To me this is a clear fact :) I

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-05 Thread Avi Kivity
Ingo Molnar wrote: > so right now the only option for a clean codebase is the KVM in-kernel > code. I strongly disagree with this. Bad code in userspace is not an excuse for shoving stuff into the kernel, where maintaining it is much more expensive, and the cause of a mistake can be system cra

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-05 Thread Ingo Molnar
* Rusty Russell <[EMAIL PROTECTED]> wrote: > It's easier to write a kernel-space network driver, but it's not > obviously the right thing to do until we can show that an efficient > packet-level userspace interface isn't possible. I don't think that's > been done, and it would be interesting

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-05 Thread Avi Kivity
Rusty Russell wrote: > You didn't quote Anthony's point about "it's more about there not being > good enough userspace interfaces to do network IO." > > It's easier to write a kernel-space network driver, but it's not > obviously the right thing to do until we can show that an efficient > packet-le

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-04 Thread Avi Kivity
Anthony Liguori wrote: > > Yeah, I think this is a good point. If we're going to push the APIC > into the kernel, we might as well put the PIT there too. The timing > stuff is an absolute mess in QEMU since it wants to get a fast high > res clock but isn't aware of things like CPU migration.

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-04 Thread Avi Kivity
Ingo Molnar wrote: > * Avi Kivity <[EMAIL PROTECTED]> wrote: > > >>> It still exists in userspace. Having the code duplication >>> (especially when it's not the same code base) is unfortunate. >>> >> This remains true. >> > > but it's the wrong argument. Of course there's duplicate

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-04 Thread Rusty Russell
On Wed, 2007-04-04 at 23:21 +0200, Ingo Molnar wrote: > * Anthony Liguori <[EMAIL PROTECTED]> wrote: > > > But why is it a good thing to do PV drivers in the kernel? You lose > > flexibility and functionality to gain performance. [...] > > in Linux a kernel-space network driver can still be tun

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-04 Thread Dor Laor
>But why is it a good thing to do PV drivers in the kernel? You lose >flexibility and functionality to gain performance. Really, it's more >about there not being good enough userspace interfaces to do network IO. > >> The lapic/PIC code >> should also be available in Qemu for OSs that dont have

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-04 Thread Dor Laor
>Avi Kivity wrote: >> Nakajima, Jun wrote: >>> I compared the performance on Xen and KVM for kernel build using the >>> same guest image. Looks like KVM was (kvm-17) three times slower as >>> far as we tested, and that high load of qemu was one of the >>> symptoms. We are looking at the shadow code

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-04 Thread Ingo Molnar
* Anthony Liguori <[EMAIL PROTECTED]> wrote: > But why is it a good thing to do PV drivers in the kernel? You lose > flexibility and functionality to gain performance. [...] in Linux a kernel-space network driver can still be tunneled over user-space code, and hence you can add arbitrary add-

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-04 Thread Anthony Liguori
Ingo Molnar wrote: > * Avi Kivity <[EMAIL PROTECTED]> wrote: > > >>> It still exists in userspace. Having the code duplication >>> (especially when it's not the same code base) is unfortunate. >>> >> This remains true. >> > > but it's the wrong argument. Of course there's duplicate

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-04 Thread Ingo Molnar
* Anthony Liguori <[EMAIL PROTECTED]> wrote: > > Keeping the apic in the kernel simplifies this with the cost of > > maintaining an apic/pic implementation. > > Hrm, this is definitely starting to sound like a PITA to deal with. > Maybe in-kernel platform devices are unavoidable :-/ yes, ver

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-04 Thread Ingo Molnar
* Avi Kivity <[EMAIL PROTECTED]> wrote: > > It still exists in userspace. Having the code duplication > > (especially when it's not the same code base) is unfortunate. > > This remains true. but it's the wrong argument. Of course there's duplicate functionality, and that's _good_ because it

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-04 Thread Anthony Liguori
Gregory Haskins wrote: On Wed, Apr 4, 2007 at 10:20 AM, in message <[EMAIL PROTECTED]>, > Anthony Liguori <[EMAIL PROTECTED]> wrote: > >> The devices are already written to take a set_irq function. Instead of >> hijacking the emulated PIC device, I think it would be better

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-04 Thread Anthony Liguori
Nakajima, Jun wrote: > Avi Kivity wrote: > >> Nakajima, Jun wrote: >> >>> Most of H/W-virtualization capable processors out there don't support >>> that feature today. I think the decision (kvm or qemu) should be done >>> based on performance data. I'm not worried about maintenance issues;

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-04 Thread Gregory Haskins
>>> On Wed, Apr 4, 2007 at 10:20 AM, in message <[EMAIL PROTECTED]>, Anthony Liguori <[EMAIL PROTECTED]> wrote: > > The devices are already written to take a set_irq function. Instead of > hijacking the emulated PIC device, I think it would be better if in > pc.c, we just conditionally created

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-04 Thread Nakajima, Jun
Avi Kivity wrote: > Nakajima, Jun wrote: >> I compared the performance on Xen and KVM for kernel build using the >> same guest image. Looks like KVM was (kvm-17) three times slower as >> far as we tested, and that high load of qemu was one of the >> symptoms. We are looking at the shadow code, but

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-04 Thread Avi Kivity
Nakajima, Jun wrote: > I compared the performance on Xen and KVM for kernel build using the > same guest image. Looks like KVM was (kvm-17) three times slower as far > as we tested, and that high load of qemu was one of the symptoms. We are > looking at the shadow code, but the load of qemu looks v

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-04 Thread Avi Kivity
Anthony Liguori wrote: >> >>> BTW, I see CPU utilization of qemu is almost always 99% in the top >>> command when I run kernel build in an x86-64 Linux guest. >>> >> > > qemu would be 99% even if all the time is being spent in the guest > context. > > If the user time is high, an oprofile r

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-04 Thread Nakajima, Jun
Avi Kivity wrote: > Nakajima, Jun wrote: >> Most of H/W-virtualization capable processors out there don't support >> that feature today. I think the decision (kvm or qemu) should be done >> based on performance data. I'm not worried about maintenance issues; >> the APIC code is not expected to chan

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-04 Thread Anthony Liguori
Dor Laor wrote: If we do this, then we can probably just handle the TPR as a special case anyway and not bother returning to userspace when the TPR is updated through MMIO. That saves the round trip without adding emulation complexity. >>> That means the emulation

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-04 Thread Anthony Liguori
Dor Laor wrote: > This pushes towards in kernel apic too. Can't see how we avoid it. > > Does it really? IIUC, we would avoid TPR traps entirely and would just need to synchronize the TPR whenever we go down to userspace. >>> It's a bit more comp

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-04 Thread Avi Kivity
Nakajima, Jun wrote: > Most of H/W-virtualization capable processors out there don't support > that feature today. I think the decision (kvm or qemu) should be done > based on performance data. I'm not worried about maintenance issues; the > APIC code is not expected to change frequently. I'm a bit

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-04 Thread Dor Laor
This pushes towards in kernel apic too. Can't see how we avoid it. >>> >>> Does it really? IIUC, we would avoid TPR traps entirely and would >>> just need to synchronize the TPR whenever we go down to userspace. >>> >> >> It's a bit more complex than that, as userspace would need to

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-04 Thread Dor Laor
>>> >>> If we do this, then we can probably just handle the TPR as a special >>> case anyway and not bother returning to userspace when the TPR is >>> updated through MMIO. That saves the round trip without adding >>> emulation complexity. >> >> That means the emulation is split among user space a

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-04 Thread Nakajima, Jun
Avi Kivity wrote: > Anthony Liguori wrote: >> >>> >>> This pushes towards in kernel apic too. Can't see how we avoid it. >>> >> >> Does it really? IIUC, we would avoid TPR traps entirely and would >> just need to synchronize the TPR whenever we go down to userspace. >> > > It's a bit more co

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-04 Thread Avi Kivity
Anthony Liguori wrote: >>> >>> If we do this, then we can probably just handle the TPR as a special >>> case anyway and not bother returning to userspace when the TPR is >>> updated through MMIO. That saves the round trip without adding >>> emulation complexity. >> >> That means the emulation i

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-04 Thread Anthony Liguori
Avi Kivity wrote: > Anthony Liguori wrote: >>> Maybe some brave soul can hack kvm to patch the new instruction in >>> place of the mmio instruction Windows uses to bang on the tpr. >> >> It seems like that shouldn't be too hard assuming that the MMIO >> instructions are <= the new CR8 instruction

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-04 Thread Avi Kivity
Anthony Liguori wrote: > >> >> This pushes towards in kernel apic too. Can't see how we avoid it. >> > > Does it really? IIUC, we would avoid TPR traps entirely and would > just need to synchronize the TPR whenever we go down to userspace. > It's a bit more complex than that, as userspace wou

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-04 Thread Avi Kivity
Anthony Liguori wrote: >> Maybe some brave soul can hack kvm to patch the new instruction in >> place of the mmio instruction Windows uses to bang on the tpr. > > It seems like that shouldn't be too hard assuming that the MMIO > instructions are <= the new CR8 instruction. It would require knowi

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-04 Thread Anthony Liguori
Dor Laor wrote: This is for the TPR right? VT has special logic to handle TPR virtualization doesn't it? I thought SVM did too... >>> Yes, the TPR. Both VT and SVM virtualize CR8 in 64-bit mode. SVM >>> also supports CR8 in 32-bit mode through a nwe instruction enco

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-04 Thread Anthony Liguori
Avi Kivity wrote: > Anthony Liguori wrote: >> Avi Kivity wrote: >>> Anthony Liguori wrote: Then again, are we really positive that we have to move the APIC into the kernel? A lot of things will get much more complicated. >>> >>> The following arguments are in favor: >>> - allow in-

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-04 Thread Dor Laor
>>> This is for the TPR right? VT has special logic to handle TPR >>> virtualization doesn't it? I thought SVM did too... >>> >> >> Yes, the TPR. Both VT and SVM virtualize CR8 in 64-bit mode. SVM >> also supports CR8 in 32-bit mode through a nwe instruction encoding, >> but >> nobody uses that

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-04 Thread Nakajima, Jun
Avi Kivity wrote: > Anthony Liguori wrote: >> Avi Kivity wrote: >>> Anthony Liguori wrote: Then again, are we really positive that we have to move the APIC into the kernel? A lot of things will get much more complicated. >>> >>> The following arguments are in favor: >>> - allow in

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-04 Thread Avi Kivity
Anthony Liguori wrote: > Avi Kivity wrote: >> Anthony Liguori wrote: >>> >>> Then again, are we really positive that we have to move the APIC >>> into the kernel? A lot of things will get much more complicated. >> >> The following arguments are in favor: >> - allow in-kernel paravirt drivers to i

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-04 Thread Anthony Liguori
Avi Kivity wrote: > Anthony Liguori wrote: >> >> Then again, are we really positive that we have to move the APIC into >> the kernel? A lot of things will get much more complicated. > > The following arguments are in favor: > - allow in-kernel paravirt drivers to interrupt the guest without > go

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-04 Thread Avi Kivity
Anthony Liguori wrote: > > Then again, are we really positive that we have to move the APIC into > the kernel? A lot of things will get much more complicated. The following arguments are in favor: - allow in-kernel paravirt drivers to interrupt the guest without going through qemu (which involv

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-04 Thread Anthony Liguori
Avi Kivity wrote: > Gregory Haskins wrote: >> Hi Dor, >> Please find a patch attached for your review which adds support for >> dynamic substitution of the PIC/APIC code to QEMU. This will allow us >> to selectively chose the KVM in-kernel apic emulation vs the QEMU >> user-space apic emulatio

Re: [kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-03 Thread Avi Kivity
Gregory Haskins wrote: > Hi Dor, > Please find a patch attached for your review which adds support for dynamic > substitution of the PIC/APIC code to QEMU. This will allow us to selectively > chose the KVM in-kernel apic emulation vs the QEMU user-space apic emulation. > Support for both is k

[kvm-devel] QEMU PIC indirection patch for in-kernel APIC work

2007-04-02 Thread Gregory Haskins
Hi Dor, Please find a patch attached for your review which adds support for dynamic substitution of the PIC/APIC code to QEMU. This will allow us to selectively chose the KVM in-kernel apic emulation vs the QEMU user-space apic emulation. Support for both is key to allow "--no-kvm" type oper