Re: [Qemu-devel] Re: [PATCH v2 4/9] provide in-kernel apic

Previous thread: KVM: use proper hrtimer function to retrieve expiration time by Marcelo Tosatti on Thursday, October 8, 2009 - 6:55 am. (2 messages)

Next thread: buildbot failure in qemu-kvm on default_x86_64_out_of_tree by qemu-kvm on Thursday, October 8, 2009 - 7:42 am. (1 message)
From: Anthony Liguori
Date: Thursday, October 8, 2009 - 6:55 am

You should probably just setup VMState such that it directly saves 
kvm_lapic_state and then have the pre/post functions call the kernel 
ioctls to sync it.  There's not a whole lot of point switching the state 

Same applies here as ioapic.  Should be a separate device.

-- 
Regards,

Anthony Liguori

--

From: Avi Kivity
Date: Thursday, October 8, 2009 - 7:09 am

It ensures the two models are compatible.  Since they're the same device 
from the point of view of the guest, there's no reason for them to have 
different representations or to be incompatible.


-- 
error compiling committee.c: too many arguments to function

--

From: Glauber Costa
Date: Thursday, October 8, 2009 - 7:22 am

live migration between something that has in-kernel irqchip and something that
has not is likely to be a completely untested thing. And this is the only reason
we might think of it as the same device. I don't see any value in supporting this
combination
--

From: Jamie Lokier
Date: Friday, October 9, 2009 - 3:06 am

Not just live migration.  ACPI sleep + savevm + loadvm + ACPI resume,
for example.

-- Jamie
--

From: Glauber Costa
Date: Friday, October 9, 2009 - 7:30 am

Yes, but in this case too, I'd expect the irqchipness of qemu not to change.
--

From: Jamie Lokier
Date: Friday, October 9, 2009 - 9:48 am

If I've just been sent an image produced by someone running KVM, and
my machine is not KVM-capable, or I cannot upgrade the KVM kernel
module because it's in use by other VMs (had this problem a few
times), there's no choice but to change the irqchipness.

-- Jamie
--

From: Glauber Costa
Date: Friday, October 9, 2009 - 11:06 am

As gleb mentioned, requiring such a change to happen offline (across a reboot)
is not that much of a pain.

There are thousands of scenarios in which it will have to happen anyway,
including major bumps in qemu version. 
--

From: Anthony Liguori
Date: Friday, October 9, 2009 - 12:49 pm

You cannot migrate from KVM to TCG so this use-case is irrelevant.


-- 
Regards,

Anthony Liguori

--

From: Avi Kivity
Date: Sunday, October 11, 2009 - 2:10 am

I agree it's mostly irrelevant, however nothing in principle prevents 
such a migration, as long as the cpuid feature bits are implemented on 
both sides.

-- 
error compiling committee.c: too many arguments to function

--

From: Anthony Liguori
Date: Monday, October 12, 2009 - 6:41 am

Sure, in principle it's certainly possible but in practice, it isn't 
today and I don't see anything that's likely to happen in the near term 
future that would make it.

-- 
Regards,

Anthony Liguori

--

From: Anthony Liguori
Date: Thursday, October 8, 2009 - 7:26 am

The problem is, the in-kernel apic is not part of the qemu source tree.  
If we add a field to the qemu apic, then we would break the in-kernel 
apic and vice-versa.  It's far easier to just have the in-kernel apic as 
a separate model.

Most importantly though, the code should reflect how things behave.  
It's extremely difficult to look at the apic code and figure out what 
bits are used and what bits aren't used when the in-kernel apic is enabled.

Regards,

Anthony Liguori


--

From: Avi Kivity
Date: Thursday, October 8, 2009 - 7:31 am

You need to handle it anyway due to save/restore; that is the new field 

That doesn't mean they need to be separate devices.

-- 
error compiling committee.c: too many arguments to function

--

From: Anthony Liguori
Date: Thursday, October 8, 2009 - 7:39 am

Not necessarily.  If it's a bug fix, we may disable the older versions 

But they are.  The in-kernel device models are not mere accelerations.  
There are features that are only enabled with in-kernel device models 
(like PCI passthrough).  In fact, in-kernel PIT is not at all an 
acceleration, it's there because it's functionally different.

The sync stuff is really ugly too.  It would be much cleaner to have a 
separate state for the in-kernel device models that saved the structures 
from the kernel directly instead of having to translate between 
formats.  More straight forward code means it's all easier to 
understand, easier to debug, etc.

Regards,

Anthony Liguori
--

From: Glauber Costa
Date: Thursday, October 8, 2009 - 7:46 am

One may arguee that I am stupid, but I have caught myself reading code that
was totally unused in the quest for irqchip related bugs...

--

From: Glauber Costa
Date: Thursday, October 8, 2009 - 7:44 am

Not necessarily. You can grab the structures directly from the kernel definition
, copy that over, issue the ioctl, and just make sure the source and destination
have compatible kernels.


--

Previous thread: KVM: use proper hrtimer function to retrieve expiration time by Marcelo Tosatti on Thursday, October 8, 2009 - 6:55 am. (2 messages)

Next thread: buildbot failure in qemu-kvm on default_x86_64_out_of_tree by qemu-kvm on Thursday, October 8, 2009 - 7:42 am. (1 message)