Re: [Qemu-devel] Re: [PATCH 3/3] Add KVM support to QEMU

Blue Swirl
2008-11-01T16:25:29Z

[-- Attachment #1: Type: text/plain, Size: 1608 bytes --]

On 10/29/08, Blue Swirl <blauwirbel@gmail.com> wrote:
> On 10/29/08, Avi Kivity <avi@redhat.com> wrote:
> > Hollis Blanchard wrote:
> >
> > > On Tue, Oct 28, 2008 at 6:36 PM, Anthony Liguori <anthony@codemonkey.ws>
> > wrote:
> > >
> > >
> > > > Something I was thinking about this morning, and I think the first place
> > > > where we'll definitely need a hook, is how to deal with
> > > > kvm_load_registers(). I think there's overlap between KVM and the IO
> > thread
> > > > here.
> > > >
> > > > There are two reasons (I can think of) that most of the device model
> > code
> > > > can't run in conjunction with TCG. The first is that TCG may modify
> > > > CPUState in a non-atomic way. The device model may need to access
> > CPUState
> > > > although there are very few places that it does.
> > > >
> > > >
> > >
> > > Out of curiosity, where are those places?
> > >
> > >
> >
> > local apic -- needs to access interrupt disable flag
> > acpi sleep -- halts the current processor, so tied to cpustate
>
>
> It should be possible to avoid these, just use a qemu_irq for per-CPU
> interrupt lines and halt signals.

Just for fun, I made a set of small patches that convert apic to avoid
env access completely. Only lightly tested.

The fourth patch (suppress_apic_env_use_accessors.diff) is probably
not OK, because I changed the accessors to use the apic state as
registered for the MMIO, previous implementation used instead the apic
state associated with the currently running CPU.

I couldn't find any CPU state handling in acpi.c, is this a KVM
specific addition?

[-- Attachment #2: suppress_apic_env_use_SIPI.diff --]
[-- Type: plain/text, Size: 3840 bytes --]

[-- Attachment #3: suppress_apic_env_use_reset_NMI_SMI.diff --]
[-- Type: plain/text, Size: 5756 bytes --]

[-- Attachment #4: suppress_apic_env_use_cpu.diff --]
[-- Type: plain/text, Size: 7037 bytes --]

[-- Attachment #5: suppress_apic_env_use_accessors.diff --]
[-- Type: plain/text, Size: 4528 bytes --]