qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] memory: Add function pointers checks to memory_


From: Salva Peiró
Subject: Re: [Qemu-devel] [PATCH] memory: Add function pointers checks to memory_region_read/write()
Date: Tue, 8 Sep 2015 08:51:20 +0200

On 9/7/15, Paolo Bonzini <address@hidden> wrote:
>
>
> On 03/09/2015 19:37, Salva Peiró wrote:
>> The file memory.c directly calls the function pointers provided in
>> the MemoryRegionOps to handle read and write operations for memory
>> regions.
>> The function pointers are called without checking if the function
>> pointers are initialised, therefore, causing QEMU to SIGSEGV when
>> accessing a memory address for which the operation is not defined (and not
>> initialised)
>>
>> The patch adds explicit checks to function pointers before issuing the
>> calls.
>
> What device are you encountering this for?  Perhaps this should be done
> in memory_region_init_io instead, so that it is detected early.
>
> Paolo
>

Rigth, I should have started by providing the scenario where the fault occurs.
The problem occurs performing a writeb to the BAR0 of device 1033:194.
That is PCI_DEVICE_ID_NEC_UPD720200  0x0194 at hw/usb/hcd-xhci.c

I've attached tests/nec-usb-xhci-test.c that reproduces the scenario.

Best
--
salva

Attachment: 0001-tests-nec-usb-xhci-test.c.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]