pc, virtio: fixes

A couple of last minute fixes.
 
 Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
 -----BEGIN PGP SIGNATURE-----
 
 iQEcBAABAgAGBQJbZBPqAAoJECgfDbjSjVRpI1MH/RXVFelJL8nd9tcFff64H863
 G7M/VxKI9yOqOWkeiAAjojXrgi7fesiDNzcKXVxlLuC5jTwpmyugKIIwI0CvHYaA
 jg2h5Ytv/jymd0BQPll+J8zLkjNf9D1eC8xpfTkG2OJbpVaaAsIoZjSbwBRsGMfi
 d7DLSf5dN1FMC/2VKyIthar59rFy5mahsdH5arqE6KNOrdMB7+2ESxbli1Sve8Hh
 hDshorVoVScG+ROEwircwS+xQy3ZbxAj93LGtnfA9rwEt2/4gwR8iA0fPKdeS9Vr
 9HSi0LtzGHqKhas1Id3hwe6qVxXyi0yshOrj8LsA6sh96RkCxBtCOgoUbEQ6pGA=
 =Xh4l
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging

pc, virtio: fixes

A couple of last minute fixes.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

# gpg: Signature made Fri 03 Aug 2018 09:35:54 BST
# gpg:                using RSA key 281F0DB8D28D5469
# gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>"
# gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>"
# Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
#      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469

* remotes/mst/tags/for_upstream:
  tests/acpi: update tables after memory hotplug changes
  pc: acpi: fix memory hotplug regression by reducing stub SRAT entry size
  tests/acpi-test: update ACPI tables test blobs
  hw/acpi-build: Add a check for memory-less NUMA nodes
  vhost: check region type before casting

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2018-08-06 09:59:05 +01:00
commit e3a4129abd
8 changed files with 19 additions and 13 deletions

View File

@ -2269,7 +2269,16 @@ static void build_srat_hotpluggable_memory(GArray *table_data, uint64_t base,
numamem = acpi_data_push(table_data, sizeof *numamem);
if (!info) {
build_srat_memory(numamem, cur, end - cur, default_node,
/*
* Entry is required for Windows to enable memory hotplug in OS
* and for Linux to enable SWIOTLB when booted with less than
* 4G of RAM. Windows works better if the entry sets proximity
* to the highest NUMA node in the machine at the end of the
* reserved space.
* Memory devices may override proximity set by this entry,
* providing _PXM method if necessary.
*/
build_srat_memory(numamem, end - 1, 1, default_node,
MEM_AFFINITY_HOTPLUGGABLE | MEM_AFFINITY_ENABLED);
break;
}
@ -2392,9 +2401,12 @@ build_srat(GArray *table_data, BIOSLinker *linker, MachineState *machine)
mem_len = next_base - pcms->below_4g_mem_size;
next_base = mem_base + mem_len;
}
numamem = acpi_data_push(table_data, sizeof *numamem);
build_srat_memory(numamem, mem_base, mem_len, i - 1,
MEM_AFFINITY_ENABLED);
if (mem_len > 0) {
numamem = acpi_data_push(table_data, sizeof *numamem);
build_srat_memory(numamem, mem_base, mem_len, i - 1,
MEM_AFFINITY_ENABLED);
}
}
slots = (table_data->len - numa_start) / sizeof *numamem;
for (; slots < pcms->numa_nodes + 2; slots++) {
@ -2402,14 +2414,6 @@ build_srat(GArray *table_data, BIOSLinker *linker, MachineState *machine)
build_srat_memory(numamem, 0, 0, 0, MEM_AFFINITY_NOFLAGS);
}
/*
* Entry is required for Windows to enable memory hotplug in OS
* and for Linux to enable SWIOTLB when booted with less than
* 4G of RAM. Windows works better if the entry sets proximity
* to the highest NUMA node in the machine.
* Memory devices may override proximity set by this entry,
* providing _PXM method if necessary.
*/
if (hotplugabble_address_space_size) {
build_srat_hotpluggable_memory(table_data, machine->device_memory->base,
hotplugabble_address_space_size,

View File

@ -663,12 +663,14 @@ static void vhost_iommu_region_add(MemoryListener *listener,
struct vhost_iommu *iommu;
Int128 end;
int iommu_idx;
IOMMUMemoryRegion *iommu_mr = IOMMU_MEMORY_REGION(section->mr);
IOMMUMemoryRegion *iommu_mr;
if (!memory_region_is_iommu(section->mr)) {
return;
}
iommu_mr = IOMMU_MEMORY_REGION(section->mr);
iommu = g_malloc0(sizeof(*iommu));
end = int128_add(int128_make64(section->offset_within_region),
section->size);

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.