Skip to content

Commit

Permalink
Revert "Merge remote-tracking branch 'qemu-kvm/memory/batch' into sta…
Browse files Browse the repository at this point in the history
…ging"

This reverts commit 8ef9ea8, reversing
changes made to 444dc48.

From Avi:

  Please revert the entire pull (git revert 8ef9ea8) while I work this
  out - it isn't trivial.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
  • Loading branch information
Anthony Liguori committed Aug 25, 2011
1 parent f065aa0 commit 01e0451
Show file tree
Hide file tree
Showing 49 changed files with 658 additions and 638 deletions.
1 change: 0 additions & 1 deletion Makefile.hw
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ include $(SRC_PATH)/rules.mak
$(call set-vpath, $(SRC_PATH):$(SRC_PATH)/hw)

QEMU_CFLAGS+=-I..
QEMU_CFLAGS += $(GLIB_CFLAGS)

include $(SRC_PATH)/Makefile.objs

Expand Down
1 change: 1 addition & 0 deletions Makefile.target
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ obj-$(CONFIG_VIRTIO) += virtio.o virtio-blk.o virtio-balloon.o virtio-net.o virt
obj-y += vhost_net.o
obj-$(CONFIG_VHOST_NET) += vhost.o
obj-$(CONFIG_REALLY_VIRTFS) += 9pfs/virtio-9p-device.o
obj-y += rwhandler.o
obj-$(CONFIG_KVM) += kvm.o kvm-all.o
obj-$(CONFIG_NO_KVM) += kvm-stub.o
obj-y += memory.o
Expand Down
12 changes: 4 additions & 8 deletions hw/an5206.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "boards.h"
#include "loader.h"
#include "elf.h"
#include "exec-memory.h"

#define KERNEL_LOAD_ADDR 0x10000
#define AN5206_MBAR_ADDR 0x10000000
Expand All @@ -38,9 +37,6 @@ static void an5206_init(ram_addr_t ram_size,
int kernel_size;
uint64_t elf_entry;
target_phys_addr_t entry;
MemoryRegion *address_space_mem = get_system_memory();
MemoryRegion *ram = g_new(MemoryRegion, 1);
MemoryRegion *sram = g_new(MemoryRegion, 1);

if (!cpu_model)
cpu_model = "m5206";
Expand All @@ -56,12 +52,12 @@ static void an5206_init(ram_addr_t ram_size,
env->rambar0 = AN5206_RAMBAR_ADDR | 1;

/* DRAM at address zero */
memory_region_init_ram(ram, NULL, "an5206.ram", ram_size);
memory_region_add_subregion(address_space_mem, 0, ram);
cpu_register_physical_memory(0, ram_size,
qemu_ram_alloc(NULL, "an5206.ram", ram_size) | IO_MEM_RAM);

/* Internal SRAM. */
memory_region_init_ram(sram, NULL, "an5206.sram", 512);
memory_region_add_subregion(address_space_mem, AN5206_RAMBAR_ADDR, sram);
cpu_register_physical_memory(AN5206_RAMBAR_ADDR, 512,
qemu_ram_alloc(NULL, "an5206.sram", 512) | IO_MEM_RAM);

mcf5206_init(AN5206_MBAR_ADDR, env);

Expand Down
5 changes: 1 addition & 4 deletions hw/arm-misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,13 @@
#ifndef ARM_MISC_H
#define ARM_MISC_H 1

#include "memory.h"

/* The CPU is also modeled as an interrupt controller. */
#define ARM_PIC_CPU_IRQ 0
#define ARM_PIC_CPU_FIQ 1
qemu_irq *arm_pic_init_cpu(CPUState *env);

/* armv7m.c */
qemu_irq *armv7m_init(MemoryRegion *address_space_mem,
int flash_size, int sram_size,
qemu_irq *armv7m_init(int flash_size, int sram_size,
const char *kernel_filename, const char *cpu_model);

/* arm_boot.c */
Expand Down
22 changes: 10 additions & 12 deletions hw/armv7m.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ static void armv7m_reset(void *opaque)
flash_size and sram_size are in kb.
Returns the NVIC array. */

qemu_irq *armv7m_init(MemoryRegion *address_space_mem,
int flash_size, int sram_size,
qemu_irq *armv7m_init(int flash_size, int sram_size,
const char *kernel_filename, const char *cpu_model)
{
CPUState *env;
Expand All @@ -170,9 +169,6 @@ qemu_irq *armv7m_init(MemoryRegion *address_space_mem,
uint64_t lowaddr;
int i;
int big_endian;
MemoryRegion *sram = g_new(MemoryRegion, 1);
MemoryRegion *flash = g_new(MemoryRegion, 1);
MemoryRegion *hack = g_new(MemoryRegion, 1);

flash_size *= 1024;
sram_size *= 1024;
Expand All @@ -198,11 +194,12 @@ qemu_irq *armv7m_init(MemoryRegion *address_space_mem,
#endif

/* Flash programming is done via the SCU, so pretend it is ROM. */
memory_region_init_ram(flash, NULL, "armv7m.flash", flash_size);
memory_region_set_readonly(flash, true);
memory_region_add_subregion(address_space_mem, 0, flash);
memory_region_init_ram(sram, NULL, "armv7m.sram", sram_size);
memory_region_add_subregion(address_space_mem, 0x20000000, sram);
cpu_register_physical_memory(0, flash_size,
qemu_ram_alloc(NULL, "armv7m.flash",
flash_size) | IO_MEM_ROM);
cpu_register_physical_memory(0x20000000, sram_size,
qemu_ram_alloc(NULL, "armv7m.sram",
sram_size) | IO_MEM_RAM);
armv7m_bitband_init();

nvic = qdev_create(NULL, "armv7m_nvic");
Expand Down Expand Up @@ -235,8 +232,9 @@ qemu_irq *armv7m_init(MemoryRegion *address_space_mem,
/* Hack to map an additional page of ram at the top of the address
space. This stops qemu complaining about executing code outside RAM
when returning from an exception. */
memory_region_init_ram(hack, NULL, "armv7m.hack", 0x1000);
memory_region_add_subregion(address_space_mem, 0xfffff000, hack);
cpu_register_physical_memory(0xfffff000, 0x1000,
qemu_ram_alloc(NULL, "armv7m.hack",
0x1000) | IO_MEM_RAM);

qemu_register_reset(armv7m_reset, env);
return pic;
Expand Down
16 changes: 8 additions & 8 deletions hw/axis_dev88.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include "elf.h"
#include "cris-boot.h"
#include "blockdev.h"
#include "exec-memory.h"

#define D(x)
#define DNAND(x)
Expand Down Expand Up @@ -260,9 +259,8 @@ void axisdev88_init (ram_addr_t ram_size,
int i;
int nand_regs;
int gpio_regs;
MemoryRegion *address_space_mem = get_system_memory();
MemoryRegion *phys_ram = g_new(MemoryRegion, 1);
MemoryRegion *phys_intmem = g_new(MemoryRegion, 1);
ram_addr_t phys_ram;
ram_addr_t phys_intmem;

/* init CPUs */
if (cpu_model == NULL) {
Expand All @@ -271,13 +269,15 @@ void axisdev88_init (ram_addr_t ram_size,
env = cpu_init(cpu_model);

/* allocate RAM */
memory_region_init_ram(phys_ram, NULL, "axisdev88.ram", ram_size);
memory_region_add_subregion(address_space_mem, 0x40000000, phys_ram);
phys_ram = qemu_ram_alloc(NULL, "axisdev88.ram", ram_size);
cpu_register_physical_memory(0x40000000, ram_size, phys_ram | IO_MEM_RAM);

/* The ETRAX-FS has 128Kb on chip ram, the docs refer to it as the
internal memory. */
memory_region_init_ram(phys_intmem, NULL, "axisdev88.chipram", INTMEM_SIZE);
memory_region_add_subregion(address_space_mem, 0x38000000, phys_intmem);
phys_intmem = qemu_ram_alloc(NULL, "axisdev88.chipram", INTMEM_SIZE);
cpu_register_physical_memory(0x38000000, INTMEM_SIZE,
phys_intmem | IO_MEM_RAM);


/* Attach a NAND flash to CS1. */
nand = drive_get(IF_MTD, 0, 0);
Expand Down
2 changes: 0 additions & 2 deletions hw/cirrus_vga.c
Original file line number Diff line number Diff line change
Expand Up @@ -2424,7 +2424,6 @@ static void cirrus_update_memory_access(CirrusVGAState *s)
{
unsigned mode;

memory_region_transaction_begin();
if ((s->vga.sr[0x17] & 0x44) == 0x44) {
goto generic_io;
} else if (s->cirrus_srcptr != s->cirrus_srcptr_end) {
Expand All @@ -2444,7 +2443,6 @@ static void cirrus_update_memory_access(CirrusVGAState *s)
unmap_linear_vram(s);
}
}
memory_region_transaction_commit();
}


Expand Down
16 changes: 7 additions & 9 deletions hw/collie.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,25 @@ static void collie_init(ram_addr_t ram_size,
{
StrongARMState *s;
DriveInfo *dinfo;
MemoryRegion *phys_flash = g_new(MemoryRegion, 2);
ram_addr_t phys_flash;

if (!cpu_model) {
cpu_model = "sa1110";
}

s = sa1110_init(collie_binfo.ram_size, cpu_model);

memory_region_init_rom_device(&phys_flash[0], &pflash_cfi01_ops_le,
NULL, "collie.fl1", 0x02000000);
phys_flash = qemu_ram_alloc(NULL, "collie.fl1", 0x02000000);
dinfo = drive_get(IF_PFLASH, 0, 0);
pflash_cfi01_register(SA_CS0, &phys_flash[0],
pflash_cfi01_register(SA_CS0, phys_flash,
dinfo ? dinfo->bdrv : NULL, (64 * 1024),
512, 4, 0x00, 0x00, 0x00, 0x00);
512, 4, 0x00, 0x00, 0x00, 0x00, 0);

memory_region_init_rom_device(&phys_flash[1], &pflash_cfi01_ops_le,
NULL, "collie.fl2", 0x02000000);
phys_flash = qemu_ram_alloc(NULL, "collie.fl2", 0x02000000);
dinfo = drive_get(IF_PFLASH, 0, 1);
pflash_cfi01_register(SA_CS1, &phys_flash[1],
pflash_cfi01_register(SA_CS1, phys_flash,
dinfo ? dinfo->bdrv : NULL, (64 * 1024),
512, 4, 0x00, 0x00, 0x00, 0x00);
512, 4, 0x00, 0x00, 0x00, 0x00, 0);

sysbus_create_simple("scoop", 0x40800000, NULL);

Expand Down
13 changes: 7 additions & 6 deletions hw/dec_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,16 @@ PCIBus *pci_dec_21154_init(PCIBus *parent_bus, int devfn)
static int pci_dec_21154_init_device(SysBusDevice *dev)
{
DECState *s;
int pci_mem_config, pci_mem_data;

s = FROM_SYSBUS(DECState, dev);

memory_region_init_io(&s->host_state.conf_mem, &pci_host_conf_le_ops,
&s->host_state, "pci-conf-idx", 0x1000);
memory_region_init_io(&s->host_state.data_mem, &pci_host_data_le_ops,
&s->host_state, "pci-data-idx", 0x1000);
sysbus_init_mmio_region(dev, &s->host_state.conf_mem);
sysbus_init_mmio_region(dev, &s->host_state.data_mem);
pci_mem_config = pci_host_conf_register_mmio(&s->host_state,
DEVICE_LITTLE_ENDIAN);
pci_mem_data = pci_host_data_register_mmio(&s->host_state,
DEVICE_LITTLE_ENDIAN);
sysbus_init_mmio(dev, 0x1000, pci_mem_config);
sysbus_init_mmio(dev, 0x1000, pci_mem_data);
return 0;
}

Expand Down
7 changes: 2 additions & 5 deletions hw/dummy_m68k.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "boards.h"
#include "loader.h"
#include "elf.h"
#include "exec-memory.h"

#define KERNEL_LOAD_ADDR 0x10000

Expand All @@ -22,8 +21,6 @@ static void dummy_m68k_init(ram_addr_t ram_size,
const char *initrd_filename, const char *cpu_model)
{
CPUState *env;
MemoryRegion *address_space_mem = get_system_memory();
MemoryRegion *ram = g_new(MemoryRegion, 1);
int kernel_size;
uint64_t elf_entry;
target_phys_addr_t entry;
Expand All @@ -40,8 +37,8 @@ static void dummy_m68k_init(ram_addr_t ram_size,
env->vbr = 0;

/* RAM at address zero */
memory_region_init_ram(ram, NULL, "dummy_m68k.ram", ram_size);
memory_region_add_subregion(address_space_mem, 0, ram);
cpu_register_physical_memory(0, ram_size,
qemu_ram_alloc(NULL, "dummy_m68k.ram", ram_size) | IO_MEM_RAM);

/* Load kernel. */
if (kernel_filename) {
Expand Down
16 changes: 5 additions & 11 deletions hw/flash.h
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
#include "memory.h"

/* NOR flash devices */
typedef struct pflash_t pflash_t;

/* pflash_cfi01.c */
extern const MemoryRegionOps pflash_cfi01_ops_be;
extern const MemoryRegionOps pflash_cfi01_ops_le;
extern const MemoryRegionOps pflash_cfi02_ops_be;
extern const MemoryRegionOps pflash_cfi02_ops_le;

pflash_t *pflash_cfi01_register(target_phys_addr_t base, MemoryRegion *mem,
pflash_t *pflash_cfi01_register(target_phys_addr_t base, ram_addr_t off,
BlockDriverState *bs,
uint32_t sector_len, int nb_blocs, int width,
uint16_t id0, uint16_t id1,
uint16_t id2, uint16_t id3);
uint16_t id2, uint16_t id3, int be);

/* pflash_cfi02.c */
pflash_t *pflash_cfi02_register(target_phys_addr_t base, MemoryRegion *mem,
pflash_t *pflash_cfi02_register(target_phys_addr_t base, ram_addr_t off,
BlockDriverState *bs, uint32_t sector_len,
int nb_blocs, int nb_mappings, int width,
uint16_t id0, uint16_t id1,
uint16_t id2, uint16_t id3,
uint16_t unlock_addr0, uint16_t unlock_addr1);
uint16_t unlock_addr0, uint16_t unlock_addr1,
int be);

/* nand.c */
DeviceState *nand_init(BlockDriverState *bdrv, int manf_id, int chip_id);
Expand Down
Loading

0 comments on commit 01e0451

Please sign in to comment.