[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v3 17/21] vhost: skip ROM sections
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL v3 17/21] vhost: skip ROM sections |
Date: |
Tue, 31 Jan 2017 15:15:06 +0200 |
vhost does not support RO protections on memory at the moment - adding
ROMs would mean that e.g. a buggy guest might change them in-memory - a
condition from which guest reset does not recover. Not nice.
We also definitely don't want to try logging writes into ROMs -
in particular guests set very high addresses for ROM BARs
so logging these writes would waste a lot of memory.
Maybe ROMs could be supported with the iotlb variant -
not sure, but there seems to be no good reason for virtio
to try to do DMA from ROM. So let's just skip ROM memory.
Suggested-by: Laurent Vivier <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Laurent Vivier <address@hidden>
Tested-by: Laurent Vivier <address@hidden>
---
hw/virtio/vhost.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index b124d97..febe519 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -612,7 +612,8 @@ static void vhost_set_memory(MemoryListener *listener,
static bool vhost_section(MemoryRegionSection *section)
{
- return memory_region_is_ram(section->mr);
+ return memory_region_is_ram(section->mr) &&
+ !memory_region_is_rom(section->mr);
}
static void vhost_begin(MemoryListener *listener)
--
MST
- [Qemu-devel] [PULL v3 05/21] compiler: expression version of QEMU_BUILD_BUG_ON, (continued)
- [Qemu-devel] [PULL v3 05/21] compiler: expression version of QEMU_BUILD_BUG_ON, Michael S. Tsirkin, 2017/01/31
- [Qemu-devel] [PULL v3 06/21] ARRAY_SIZE: check that argument is an array, Michael S. Tsirkin, 2017/01/31
- [Qemu-devel] [PULL v3 07/21] pci: mark ROMs read-only, Michael S. Tsirkin, 2017/01/31
- [Qemu-devel] [PULL v3 08/21] intel_iommu: fix and simplify size calculation in process_device_iotlb_desc(), Michael S. Tsirkin, 2017/01/31
- [Qemu-devel] [PULL v3 09/21] hw/pcie: Introduce a base class for PCI Express Root Ports, Michael S. Tsirkin, 2017/01/31
- [Qemu-devel] [PULL v3 11/21] hw/pcie: Introduce Generic PCI Express Root Port, Michael S. Tsirkin, 2017/01/31
- [Qemu-devel] [PULL v3 10/21] hw/ioh3420: derive from PCI Express Root Port base class, Michael S. Tsirkin, 2017/01/31
- [Qemu-devel] [PULL v3 12/21] hw/i386: check if nvdimm is enabled before plugging, Michael S. Tsirkin, 2017/01/31
- [Qemu-devel] [PULL v3 14/21] hcd-xhci: check & correct param before using it, Michael S. Tsirkin, 2017/01/31
- [Qemu-devel] [PULL v3 13/21] msix: Follow CODING_STYLE, Michael S. Tsirkin, 2017/01/31
- [Qemu-devel] [PULL v3 17/21] vhost: skip ROM sections,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL v3 18/21] vhost-user: delete chardev on cleanup, Michael S. Tsirkin, 2017/01/31
- [Qemu-devel] [PULL v3 16/21] virtio: make virtio_should_notify static, Michael S. Tsirkin, 2017/01/31
- [Qemu-devel] [PULL v3 15/21] pci: Convert msix_init() to Error and fix callers, Michael S. Tsirkin, 2017/01/31
- [Qemu-devel] [PULL v3 19/21] hw/pci: disable pci-bridge's shpc by default, Michael S. Tsirkin, 2017/01/31
- [Qemu-devel] [PULL v3 20/21] arm: better stub version for MISMATCH_CHECK, Michael S. Tsirkin, 2017/01/31
- [Qemu-devel] [PULL v3 21/21] arm: add trailing ; after MISMATCH_CHECK, Michael S. Tsirkin, 2017/01/31
- Re: [Qemu-devel] [PULL v3 00/21] virtio, vhost, pci: fixes, features, Peter Maydell, 2017/01/31
- Re: [Qemu-devel] [PULL v3 00/21] virtio, vhost, pci: fixes, features, Michael S. Tsirkin, 2017/01/31
- Re: [Qemu-devel] [PULL v3 00/21] virtio, vhost, pci: fixes, features, Marc-André Lureau, 2017/01/31