qemu-e2k/hw/i386
Igor Druzhinin 3e81a71c9f xen-mapcache: avoid a race on memory map while using MAP_FIXED
When we're replacing the existing mapping there is possibility of a race
on memory map with other threads doing mmap operations - the address being
unmapped/re-mapped could be occupied by another thread in between.

Linux mmap man page recommends keeping the existing mappings in place to
reserve the place and instead utilize the fact that the next mmap operation
with MAP_FIXED flag passed will implicitly destroy the existing mappings
behind the chosen address. This behavior is guaranteed by POSIX / BSD and
therefore is portable.

Note that it wouldn't make the replacement atomic for parallel accesses to
the replaced region - those might still fail with SIGBUS due to
xenforeignmemory_map not being atomic. So we're still not expecting those.

Tested-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
Reviewed-by: Paul Durrant <paul@xen.org>
Message-Id: <1618889702-13104-1-git-send-email-igor.druzhinin@citrix.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
2021-05-10 13:43:58 +01:00
..
kvm Do not include cpu.h if it's not really necessary 2021-05-02 17:24:51 +02:00
xen xen-mapcache: avoid a race on memory map while using MAP_FIXED 2021-05-10 13:43:58 +01:00
acpi-build.c Do not include hw/boards.h if it's not really necessary 2021-05-02 17:24:51 +02:00
acpi-build.h
acpi-common.c acpi: Permit OEM ID and OEM table ID fields to be changed 2021-02-05 08:52:59 -05:00
acpi-common.h acpi: Permit OEM ID and OEM table ID fields to be changed 2021-02-05 08:52:59 -05:00
acpi-microvm.c Do not include hw/boards.h if it's not really necessary 2021-05-02 17:24:51 +02:00
acpi-microvm.h microvm/acpi: add minimal acpi support 2020-09-17 14:16:19 +02:00
amd_iommu.c x86-iommu: Rename QOM type macros 2020-09-02 07:29:25 -04:00
amd_iommu.h Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
e820_memory_layout.c
e820_memory_layout.h
fw_cfg.c i386: move kvm accel files into kvm/ 2020-12-16 14:06:52 -05:00
fw_cfg.h
generic_event_device_x86.c acpi: ged: add x86 device variant. 2020-09-17 14:16:19 +02:00
intel_iommu_internal.h intel_iommu: Use correct shift for 256 bits qi descriptor 2020-07-22 07:57:07 -04:00
intel_iommu.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
Kconfig hw/misc/pvpanic: split-out generic and bus dependent code 2021-01-29 10:47:28 +00:00
kvmvapic.c Do not include cpu.h if it's not really necessary 2021-05-02 17:24:51 +02:00
meson.build microvm/acpi: add minimal acpi support 2020-09-17 14:16:19 +02:00
microvm.c Do not include cpu.h if it's not really necessary 2021-05-02 17:24:51 +02:00
multiboot.c
multiboot.h
pc_piix.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
pc_q35.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
pc_sysfw.c Do not include sysemu/sysemu.h if it's not really necessary 2021-05-02 17:24:50 +02:00
pc.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
port92.c Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
trace-events
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
vmmouse.c vmmouse: put it into the 'input' category 2021-02-20 12:36:19 +01:00
vmport.c Do not include cpu.h if it's not really necessary 2021-05-02 17:24:51 +02:00
x86-iommu-stub.c
x86-iommu.c Do not include hw/boards.h if it's not really necessary 2021-05-02 17:24:51 +02:00
x86.c acpi: Move setters/getters of oem fields to X86MachineState 2021-03-22 18:58:19 -04:00