|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [V9 PATCH 7/8] pvh dom0: check for vioapic null ptr in vioapic_range
>>> On 16.04.14 at 02:12, <mukesh.rathor@xxxxxxxxxx> wrote:
> pvh doesn't use apic emulation, as a result vioapic_init is not called
> and vioapic ptr in struct hvm_domain is not initialized. One path that
> would access the ptr for pvh is :
>
> hvm_hap_nested_page_fault -> handle_mmio -> hvmemul_do_io ->
> hvm_mmio_intercept -> vioapic_range
Given this I'm not sure the guard belongs here. The majority of the
handle_mmio() logic should never be used for Dom0. Perhaps you
should simply have a pvh_mmio_handlers[] paralleling
hvm_mmio_handlers[], but (presumably) only having HPET and MSI-X
entries for now?
Jan
> --- a/xen/arch/x86/hvm/vioapic.c
> +++ b/xen/arch/x86/hvm/vioapic.c
> @@ -238,10 +238,11 @@ static int vioapic_write(
>
> static int vioapic_range(struct vcpu *v, unsigned long addr)
> {
> - struct hvm_hw_vioapic *vioapic = domain_vioapic(v->domain);
> + struct hvm_vioapic *vioapic = v->domain->arch.hvm_domain.vioapic;
> + struct hvm_hw_vioapic *hwapic = domain_vioapic(v->domain);
>
> - return ((addr >= vioapic->base_address &&
> - (addr < vioapic->base_address + VIOAPIC_MEM_LENGTH)));
> + return (vioapic && (addr >= hwapic->base_address &&
> + (addr < hwapic->base_address + VIOAPIC_MEM_LENGTH)));
> }
>
> const struct hvm_mmio_handler vioapic_mmio_handler = {
> --
> 1.8.3.1
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |