diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2014-01-31 00:13:02 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2014-01-31 00:13:02 +0000 |
commit | 97374ce538883af677fd94803b71df2d55a9a4de (patch) | |
tree | 886e1d89b827d2f059cf184ac4a99cd8d00dc18e /hw | |
parent | 8e02b359267f8919de799525a4ccd4d37ef2d127 (diff) | |
parent | 794798e36eda77802ce7cc7d7d6b1c65751e8a76 (diff) | |
download | hqemu-97374ce538883af677fd94803b71df2d55a9a4de.zip hqemu-97374ce538883af677fd94803b71df2d55a9a4de.tar.gz |
Merge remote-tracking branch 'sstabellini/xen-170114' into staging
* sstabellini/xen-170114:
xen_pt: Fix passthrough of device with ROM.
xen_pt: Fix debug output.
xenfb: map framebuffer read-only and handle unmap errors
Message-id: alpine.DEB.2.02.1401171537140.21510@kaball.uk.xensource.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/display/xenfb.c | 7 | ||||
-rw-r--r-- | hw/xen/xen_pt.c | 8 |
2 files changed, 10 insertions, 5 deletions
diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c index f0333a0..cb9d456 100644 --- a/hw/display/xenfb.c +++ b/hw/display/xenfb.c @@ -495,7 +495,7 @@ static int xenfb_map_fb(struct XenFB *xenfb) munmap(map, n_fbdirs * XC_PAGE_SIZE); xenfb->pixels = xc_map_foreign_pages(xen_xc, xenfb->c.xendev.dom, - PROT_READ | PROT_WRITE, fbmfns, xenfb->fbpages); + PROT_READ, fbmfns, xenfb->fbpages); if (xenfb->pixels == NULL) goto out; @@ -903,6 +903,11 @@ static void fb_disconnect(struct XenDevice *xendev) fb->pixels = mmap(fb->pixels, fb->fbpages * XC_PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0); + if (fb->pixels == MAP_FAILED) { + xen_be_printf(xendev, 0, + "Couldn't replace the framebuffer with anonymous memory errno=%d\n", + errno); + } common_unbind(&fb->c); fb->feature_update = 0; fb->bug_trigger = 0; diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c index d58cb61..be4220b 100644 --- a/hw/xen/xen_pt.c +++ b/hw/xen/xen_pt.c @@ -420,8 +420,8 @@ static int xen_pt_register_regions(XenPCIPassthroughState *s) "xen-pci-pt-bar", r->size); pci_register_bar(&s->dev, i, type, &s->bar[i]); - XEN_PT_LOG(&s->dev, "IO region %i registered (size=0x%lx"PRIx64 - " base_addr=0x%lx"PRIx64" type: %#x)\n", + XEN_PT_LOG(&s->dev, "IO region %i registered (size=0x%08"PRIx64 + " base_addr=0x%08"PRIx64" type: %#x)\n", i, r->size, r->base_addr, type); } @@ -440,8 +440,8 @@ static int xen_pt_register_regions(XenPCIPassthroughState *s) s->bases[PCI_ROM_SLOT].access.maddr = d->rom.base_addr; - memory_region_init_rom_device(&s->rom, OBJECT(s), NULL, NULL, - "xen-pci-pt-rom", d->rom.size); + memory_region_init_io(&s->rom, OBJECT(s), &ops, &s->dev, + "xen-pci-pt-rom", d->rom.size); pci_register_bar(&s->dev, PCI_ROM_SLOT, PCI_BASE_ADDRESS_MEM_PREFETCH, &s->rom); |