Re: In kernel PIC support: kernel patch

Gregory Haskins
2007-06-22T12:14:39Z

On Fri, 2007-06-22 at 13:50 +0300, Avi Kivity wrote:
> Dong, Eddie wrote:
>
> > +#include "kvm.h"
> > +#include "virq.h"
> > +
> > +/*
> > + * check if there is pending interrupt without
> > + * intack.
> > + */
> > +int cpu_has_interrupt(struct kvm_vcpu *v)
> > +{
> > + struct pic_state2 *s = kernel_pic(v->kvm);
> > +
> >
>
> Isn't the PIC connected to just one cpu?

I agree with Eddie here. Its true that only one CPU would ever
associate with PIC (and its usually hardwired to the BSP, but it
technically doesn't have to be depending on the architecture). But the
PIC(s) are really a system wide resource that should hang off the kvm
struct, IMHO.

In fact, my own implementation puts the ISA-userint model as hanging off
the kvm structure as well (which would be replaced with a similar PIC
model for layer-2 mode in the future).

-Greg