* [Qemu-devel] [PULL 0/3] xen-170114
@ 2014-01-17 15:38 Stefano Stabellini
2014-01-17 15:39 ` [Qemu-devel] [PULL 1/3] xenfb: map framebuffer read-only and handle unmap errors Stefano Stabellini
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Stefano Stabellini @ 2014-01-17 15:38 UTC (permalink / raw)
To: Anthony Liguori; +Cc: Anthony Perard, xen-devel, qemu-devel, Stefano Stabellini
The following changes since commit 1cf892ca2689c84960b4ce4d2723b6bee453711c:
SPARC: Fix LEON3 power down instruction (2014-01-15 15:37:33 +1000)
are available in the git repository at:
git://xenbits.xen.org/people/sstabellini/qemu-dm.git xen-170114
for you to fetch changes up to 794798e36eda77802ce7cc7d7d6b1c65751e8a76:
xen_pt: Fix passthrough of device with ROM. (2014-01-17 15:29:33 +0000)
----------------------------------------------------------------
Anthony PERARD (2):
xen_pt: Fix debug output.
xen_pt: Fix passthrough of device with ROM.
Stefano Stabellini (1):
xenfb: map framebuffer read-only and handle unmap errors
hw/display/xenfb.c | 7 ++++++-
hw/xen/xen_pt.c | 8 ++++----
2 files changed, 10 insertions(+), 5 deletions(-)
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Qemu-devel] [PULL 1/3] xenfb: map framebuffer read-only and handle unmap errors
2014-01-17 15:38 [Qemu-devel] [PULL 0/3] xen-170114 Stefano Stabellini
@ 2014-01-17 15:39 ` Stefano Stabellini
2014-01-17 15:39 ` [Qemu-devel] [PULL 2/3] xen_pt: Fix debug output Stefano Stabellini
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Stefano Stabellini @ 2014-01-17 15:39 UTC (permalink / raw)
To: anthony; +Cc: anthony.perard, xen-devel, qemu-devel, Stefano Stabellini
The framebuffer is needlessly mapped (PROT_READ | PROT_WRITE), map it
PROT_READ instead.
The framebuffer is unmapped by replacing the framebuffer pages with
anonymous shared memory, calling mmap. Check for return errors and print
a warning.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
hw/display/xenfb.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
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;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Qemu-devel] [PULL 2/3] xen_pt: Fix debug output.
2014-01-17 15:38 [Qemu-devel] [PULL 0/3] xen-170114 Stefano Stabellini
2014-01-17 15:39 ` [Qemu-devel] [PULL 1/3] xenfb: map framebuffer read-only and handle unmap errors Stefano Stabellini
@ 2014-01-17 15:39 ` Stefano Stabellini
2014-01-17 15:39 ` [Qemu-devel] [PULL 3/3] xen_pt: Fix passthrough of device with ROM Stefano Stabellini
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Stefano Stabellini @ 2014-01-17 15:39 UTC (permalink / raw)
To: anthony; +Cc: anthony.perard, xen-devel, qemu-devel, Stefano Stabellini
From: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
hw/xen/xen_pt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c
index d58cb61..eee4354 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);
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Qemu-devel] [PULL 3/3] xen_pt: Fix passthrough of device with ROM.
2014-01-17 15:38 [Qemu-devel] [PULL 0/3] xen-170114 Stefano Stabellini
2014-01-17 15:39 ` [Qemu-devel] [PULL 1/3] xenfb: map framebuffer read-only and handle unmap errors Stefano Stabellini
2014-01-17 15:39 ` [Qemu-devel] [PULL 2/3] xen_pt: Fix debug output Stefano Stabellini
@ 2014-01-17 15:39 ` Stefano Stabellini
2014-01-30 14:18 ` [Qemu-devel] [PULL 0/3] xen-170114 Stefano Stabellini
2014-01-31 0:23 ` Peter Maydell
4 siblings, 0 replies; 6+ messages in thread
From: Stefano Stabellini @ 2014-01-17 15:39 UTC (permalink / raw)
To: anthony; +Cc: anthony.perard, xen-devel, qemu-devel, Stefano Stabellini
From: Anthony PERARD <anthony.perard@citrix.com>
QEMU does not need and should not allocate memory for the ROM of a
passthrough PCI device. So this patch initialize the particular region
like any other PCI BAR of a passthrough device.
When a guest will access the ROM, Xen will take care of the IO, QEMU
will not be involved in it.
Xen set a limit of memory available for each guest, allocating memory
for a ROM can hit this limit.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Reported-and-Tested-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
hw/xen/xen_pt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c
index eee4354..be4220b 100644
--- a/hw/xen/xen_pt.c
+++ b/hw/xen/xen_pt.c
@@ -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);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PULL 0/3] xen-170114
2014-01-17 15:38 [Qemu-devel] [PULL 0/3] xen-170114 Stefano Stabellini
` (2 preceding siblings ...)
2014-01-17 15:39 ` [Qemu-devel] [PULL 3/3] xen_pt: Fix passthrough of device with ROM Stefano Stabellini
@ 2014-01-30 14:18 ` Stefano Stabellini
2014-01-31 0:23 ` Peter Maydell
4 siblings, 0 replies; 6+ messages in thread
From: Stefano Stabellini @ 2014-01-30 14:18 UTC (permalink / raw)
To: Stefano Stabellini; +Cc: Anthony Perard, xen-devel, qemu-devel, Anthony Liguori
ping?
On Fri, 17 Jan 2014, Stefano Stabellini wrote:
> The following changes since commit 1cf892ca2689c84960b4ce4d2723b6bee453711c:
>
> SPARC: Fix LEON3 power down instruction (2014-01-15 15:37:33 +1000)
>
> are available in the git repository at:
>
> git://xenbits.xen.org/people/sstabellini/qemu-dm.git xen-170114
>
> for you to fetch changes up to 794798e36eda77802ce7cc7d7d6b1c65751e8a76:
>
> xen_pt: Fix passthrough of device with ROM. (2014-01-17 15:29:33 +0000)
>
> ----------------------------------------------------------------
> Anthony PERARD (2):
> xen_pt: Fix debug output.
> xen_pt: Fix passthrough of device with ROM.
>
> Stefano Stabellini (1):
> xenfb: map framebuffer read-only and handle unmap errors
>
> hw/display/xenfb.c | 7 ++++++-
> hw/xen/xen_pt.c | 8 ++++----
> 2 files changed, 10 insertions(+), 5 deletions(-)
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PULL 0/3] xen-170114
2014-01-17 15:38 [Qemu-devel] [PULL 0/3] xen-170114 Stefano Stabellini
` (3 preceding siblings ...)
2014-01-30 14:18 ` [Qemu-devel] [PULL 0/3] xen-170114 Stefano Stabellini
@ 2014-01-31 0:23 ` Peter Maydell
4 siblings, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2014-01-31 0:23 UTC (permalink / raw)
To: Stefano Stabellini
Cc: Anthony Perard, xen-devel@lists.xen.org, QEMU Developers,
Anthony Liguori
On 17 January 2014 15:38, Stefano Stabellini
<stefano.stabellini@eu.citrix.com> wrote:
> The following changes since commit 1cf892ca2689c84960b4ce4d2723b6bee453711c:
>
> SPARC: Fix LEON3 power down instruction (2014-01-15 15:37:33 +1000)
>
> are available in the git repository at:
>
> git://xenbits.xen.org/people/sstabellini/qemu-dm.git xen-170114
>
> for you to fetch changes up to 794798e36eda77802ce7cc7d7d6b1c65751e8a76:
>
> xen_pt: Fix passthrough of device with ROM. (2014-01-17 15:29:33 +0000)
Applied, thanks.
-- PMM
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-01-31 0:23 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-17 15:38 [Qemu-devel] [PULL 0/3] xen-170114 Stefano Stabellini
2014-01-17 15:39 ` [Qemu-devel] [PULL 1/3] xenfb: map framebuffer read-only and handle unmap errors Stefano Stabellini
2014-01-17 15:39 ` [Qemu-devel] [PULL 2/3] xen_pt: Fix debug output Stefano Stabellini
2014-01-17 15:39 ` [Qemu-devel] [PULL 3/3] xen_pt: Fix passthrough of device with ROM Stefano Stabellini
2014-01-30 14:18 ` [Qemu-devel] [PULL 0/3] xen-170114 Stefano Stabellini
2014-01-31 0:23 ` Peter Maydell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).