diff options
Diffstat (limited to 'hw')
-rw-r--r-- | hw/arm/highbank.c | 3 | ||||
-rw-r--r-- | hw/arm/vexpress.c | 12 | ||||
-rw-r--r-- | hw/arm/virt.c | 10 | ||||
-rw-r--r-- | hw/intc/arm_gic_kvm.c | 7 |
4 files changed, 23 insertions, 9 deletions
diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c index ddd10dc26f..07cb4e057b 100644 --- a/hw/arm/highbank.c +++ b/hw/arm/highbank.c @@ -278,8 +278,7 @@ static void calxeda_init(MachineState *machine, enum cxmachines machine_id) if (bios_name != NULL) { sysboot_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); if (sysboot_filename != NULL) { - uint32_t filesize = get_image_size(sysboot_filename); - if (load_image_targphys("sysram.bin", 0xfff88000, filesize) < 0) { + if (load_image_targphys(sysboot_filename, 0xfff88000, 0x8000) < 0) { hw_error("Unable to load %s\n", bios_name); } g_free(sysboot_filename); diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index e9a7cede64..54dd9673aa 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -563,6 +563,7 @@ static void vexpress_common_init(MachineState *machine) */ if (bios_name) { char *fn; + int image_size; if (drive_get(IF_PFLASH, 0, 0)) { error_report("The contents of the first flash device may be " @@ -571,12 +572,17 @@ static void vexpress_common_init(MachineState *machine) exit(1); } fn = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); - if (!fn || load_image_targphys(fn, map[VE_NORFLASH0], - VEXPRESS_FLASH_SIZE) < 0) { - error_report("Could not load ROM image '%s'", bios_name); + if (!fn) { + error_report("Could not find ROM image '%s'", bios_name); exit(1); } + image_size = load_image_targphys(fn, map[VE_NORFLASH0], + VEXPRESS_FLASH_SIZE); g_free(fn); + if (image_size < 0) { + error_report("Could not load ROM image '%s'", bios_name); + exit(1); + } } /* Motherboard peripherals: the wiring is the same but the diff --git a/hw/arm/virt.c b/hw/arm/virt.c index b652b07ced..febff22768 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -553,6 +553,7 @@ static void create_flash(const VirtBoardInfo *vbi) if (bios_name) { char *fn; + int image_size; if (drive_get(IF_PFLASH, 0, 0)) { error_report("The contents of the first flash device may be " @@ -561,11 +562,16 @@ static void create_flash(const VirtBoardInfo *vbi) exit(1); } fn = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); - if (!fn || load_image_targphys(fn, flashbase, flashsize) < 0) { - error_report("Could not load ROM image '%s'", bios_name); + if (!fn) { + error_report("Could not find ROM image '%s'", bios_name); exit(1); } + image_size = load_image_targphys(fn, flashbase, flashsize); g_free(fn); + if (image_size < 0) { + error_report("Could not load ROM image '%s'", bios_name); + exit(1); + } } create_one_flash("virt.flash0", flashbase, flashsize); diff --git a/hw/intc/arm_gic_kvm.c b/hw/intc/arm_gic_kvm.c index 0d207508a0..e1952ad974 100644 --- a/hw/intc/arm_gic_kvm.c +++ b/hw/intc/arm_gic_kvm.c @@ -370,6 +370,11 @@ static void kvm_arm_gic_put(GICState *s) * the appropriate CPU interfaces in the kernel) */ kvm_dist_put(s, 0x800, 8, s->num_irq, translate_targets); + /* irq_state[n].trigger -> GICD_ICFGRn + * (restore configuration registers before pending IRQs so we treat + * level/edge correctly) */ + kvm_dist_put(s, 0xc00, 2, s->num_irq, translate_trigger); + /* irq_state[n].pending + irq_state[n].level -> GICD_ISPENDRn */ kvm_dist_put(s, 0x280, 1, s->num_irq, translate_clear); kvm_dist_put(s, 0x200, 1, s->num_irq, translate_pending); @@ -378,8 +383,6 @@ static void kvm_arm_gic_put(GICState *s) kvm_dist_put(s, 0x380, 1, s->num_irq, translate_clear); kvm_dist_put(s, 0x300, 1, s->num_irq, translate_active); - /* irq_state[n].trigger -> GICD_ICFRn */ - kvm_dist_put(s, 0xc00, 2, s->num_irq, translate_trigger); /* s->priorityX[irq] -> ICD_IPRIORITYRn */ kvm_dist_put(s, 0x400, 8, s->num_irq, translate_priority); |