[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 02/31] Revert "memory: Drop FlatRange.romd_mode"
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 02/31] Revert "memory: Drop FlatRange.romd_mode" |
Date: |
Fri, 27 May 2016 12:06:15 +0200 |
This reverts commit 5b5660adf1fdb61db14ec681b10463b8cba633f1,
as it breaks the UEFI guest firmware (known as ArmVirtPkg or AAVMF)
running in the "virt" machine type of "qemu-system-aarch64":
Contrary to the commit message, (a->mr == b->mr) does *not* imply
that (a->romd_mode == b->romd_mode): the pflash device model calls
memory_region_rom_device_set_romd() -- for switching between the above
modes --, and that function changes mr->romd_mode but the current
AddressSpaceDispatch's FlatRange keeps the old value. Therefore
region_del/region_add are not called on the KVM MemoryListener.
Reported-by: Drew Jones <address@hidden>
Tested-by: Drew Jones <address@hidden>
Analyzed-by: Laszlo Ersek <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
memory.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/memory.c b/memory.c
index 4e3cda8..0f52522 100644
--- a/memory.c
+++ b/memory.c
@@ -227,6 +227,7 @@ struct FlatRange {
hwaddr offset_in_region;
AddrRange addr;
uint8_t dirty_log_mask;
+ bool romd_mode;
bool readonly;
};
@@ -251,6 +252,7 @@ static bool flatrange_equal(FlatRange *a, FlatRange *b)
return a->mr == b->mr
&& addrrange_equal(a->addr, b->addr)
&& a->offset_in_region == b->offset_in_region
+ && a->romd_mode == b->romd_mode
&& a->readonly == b->readonly;
}
@@ -310,6 +312,7 @@ static bool can_merge(FlatRange *r1, FlatRange *r2)
r1->addr.size),
int128_make64(r2->offset_in_region))
&& r1->dirty_log_mask == r2->dirty_log_mask
+ && r1->romd_mode == r2->romd_mode
&& r1->readonly == r2->readonly;
}
@@ -663,6 +666,7 @@ static void render_memory_region(FlatView *view,
fr.mr = mr;
fr.dirty_log_mask = memory_region_get_dirty_log_mask(mr);
+ fr.romd_mode = mr->romd_mode;
fr.readonly = readonly;
/* Render the region itself into any gaps left by the current view. */
--
2.5.5
- [Qemu-devel] [PULL 00/31] Misc changes for 2016-05-27, Paolo Bonzini, 2016/05/27
- [Qemu-devel] [PULL 03/31] hw/char: QOM'ify escc.c, Paolo Bonzini, 2016/05/27
- [Qemu-devel] [PULL 04/31] hw/char: QOM'ify etraxfs_ser.c, Paolo Bonzini, 2016/05/27
- [Qemu-devel] [PULL 01/31] Add optionrom compatible with fw_cfg DMA version, Paolo Bonzini, 2016/05/27
- [Qemu-devel] [PULL 05/31] hw/char: QOM'ify lm32_juart.c, Paolo Bonzini, 2016/05/27
- [Qemu-devel] [PULL 08/31] nbd: Don't trim unrequested bytes, Paolo Bonzini, 2016/05/27
- [Qemu-devel] [PULL 06/31] hw/char: QOM'ify lm32_uart.c, Paolo Bonzini, 2016/05/27
- [Qemu-devel] [PULL 02/31] Revert "memory: Drop FlatRange.romd_mode",
Paolo Bonzini <=
- [Qemu-devel] [PULL 07/31] hw/char: QOM'ify milkymist-uart.c, Paolo Bonzini, 2016/05/27
- [Qemu-devel] [PULL 11/31] scsi: mptsas: infinite loop while fetching requests, Paolo Bonzini, 2016/05/27
- [Qemu-devel] [PULL 13/31] scsi: megasas: initialise local configuration data buffer, Paolo Bonzini, 2016/05/27
- [Qemu-devel] [PULL 14/31] scsi: megasas: check 'read_queue_head' index value, Paolo Bonzini, 2016/05/27
- [Qemu-devel] [PULL 10/31] scsi: pvscsi: check command descriptor ring buffer size (CVE-2016-4952), Paolo Bonzini, 2016/05/27
- [Qemu-devel] [PULL 09/31] kvm_stat: Remove, Paolo Bonzini, 2016/05/27
- [Qemu-devel] [PULL 12/31] scsi: megasas: use appropriate property buffer size, Paolo Bonzini, 2016/05/27
- [Qemu-devel] [PULL 15/31] block/iscsi: avoid potential overflow of acb->task->cdb, Paolo Bonzini, 2016/05/27
- [Qemu-devel] [PULL 18/31] atomics: emit an smp_read_barrier_depends() barrier only for Alpha and Thread Sanitizer, Paolo Bonzini, 2016/05/27