Re: k->u migration bug fix

Avi Kivity
2007-08-06T13:25:42Z

Dong, Eddie wrote:
> Fix bug for wrong vcpu->apic due to irq_summary set in user irqchip
> which makes union member vcpu->apic non NULL.
>
> Signed-off-by: Yaozu (Eddie) Dong <eddie.dong-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
>
> diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
> index 470b7a1..03c1433 100644
> --- a/drivers/kvm/kvm_main.c
> +++ b/drivers/kvm/kvm_main.c
> @@ -1068,7 +1068,7 @@ static struct kvm_io_device
> *vcpu_find_pervcpu_dev(struct
> {
> struct kvm_io_device *dev;
>
> - if (vcpu->apic) {
> + if (irqchip_in_kernel(vcpu->kvm) && vcpu->apic) {
> dev = &vcpu->apic->dev;
> if (dev->in_range(dev, addr))
> return dev;
>

Applied. Please don't forget to send an attachment, I had to apply this
by hand.