mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
pc,pci,virtio fixes and cleanups
This includes pc and pci cleanups, future-proofing of ROM files, and a virtio bugfix correcting splice on virtio console. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) iQEcBAABAgAGBQJSGvbsAAoJECgfDbjSjVRp0qsH/2N/b/5bNhL6gx5Kjigzv7Lt bmCUsSsUm/Rnhke2SpDPVdIOU9W5WIX2zte8qiXuBJi3j/RS9procbgUZrCetpUI GHQOn+n8e2TX/P9CIcHaN/bA1b+Kx+bvaVbDL/6P2PJvodbDGwDLp/9y+Tisv5Ye kLow8Y4ZJcaTlmPf/Mh1AnhNa3gel231A3qwugVUNDSyITM6pG/0M07xk8YBj+JJ 6DYrlK0bKMNDxPu5St+YP94D1ODv2zM1aio/TdMUaNfqTZM1iqGTj3zKkBS2PjT0 RhuU2x4N91lY/uCdudtWSj5dYtfRT/xw7qwNAz9IHNz6RlGeX0n++ClMC8z9Y8A= =Pc09 -----END PGP SIGNATURE----- Merge remote-tracking branch 'mst/tags/for_anthony' into stable-1.5 pc,pci,virtio fixes and cleanups This includes pc and pci cleanups, future-proofing of ROM files, and a virtio bugfix correcting splice on virtio console. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Mon 26 Aug 2013 01:34:20 AM CDT using RSA key ID D28D5469 # gpg: Can't check signature: public key not found # By Markus Armbruster (5) and others # Via Michael S. Tsirkin * mst/tags/for_anthony: virtio: virtqueue_get_avail_bytes: fix desc_pa when loop over the indirect descriptor table pc_piix: Kill pc_init1() memory region args pc: pc_compat_1_4() now can call pc_compat_1_5() pc: Create pc_compat_*() functions pc: Kill pc_init_pci_1_0() pc: Don't explode QEMUMachineInitArgs into local variables needlessly pc: Don't prematurely explode QEMUMachineInitArgs ppc: Don't duplicate QEMUMachineInitArgs in PPCE500Params ppc: Don't explode QEMUMachineInitArgs into local variables needlessly sun4: Don't prematurely explode QEMUMachineInitArgs q35: Add PCIe switch to example q35 configuration loader: store FW CFG ROM files in RAM arch_init: align MR size to target page size pc: cleanup 1.4 compat support Message-id: 1377535318-30491-1-git-send-email-mst@redhat.com
This commit is contained in:
commit
3e998a7788
13 changed files with 233 additions and 272 deletions
|
@ -811,10 +811,7 @@ static SPARCCPU *cpu_devinit(const char *cpu_model, const struct hwdef *hwdef)
|
|||
}
|
||||
|
||||
static void sun4uv_init(MemoryRegion *address_space_mem,
|
||||
ram_addr_t RAM_size,
|
||||
const char *boot_devices,
|
||||
const char *kernel_filename, const char *kernel_cmdline,
|
||||
const char *initrd_filename, const char *cpu_model,
|
||||
QEMUMachineInitArgs *args,
|
||||
const struct hwdef *hwdef)
|
||||
{
|
||||
SPARCCPU *cpu;
|
||||
|
@ -829,10 +826,10 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
|
|||
FWCfgState *fw_cfg;
|
||||
|
||||
/* init CPUs */
|
||||
cpu = cpu_devinit(cpu_model, hwdef);
|
||||
cpu = cpu_devinit(args->cpu_model, hwdef);
|
||||
|
||||
/* set up devices */
|
||||
ram_init(0, RAM_size);
|
||||
ram_init(0, args->ram_size);
|
||||
|
||||
prom_init(hwdef->prom_addr, bios_name);
|
||||
|
||||
|
@ -878,13 +875,15 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
|
|||
|
||||
initrd_size = 0;
|
||||
initrd_addr = 0;
|
||||
kernel_size = sun4u_load_kernel(kernel_filename, initrd_filename,
|
||||
kernel_size = sun4u_load_kernel(args->kernel_filename,
|
||||
args->initrd_filename,
|
||||
ram_size, &initrd_size, &initrd_addr,
|
||||
&kernel_addr, &kernel_entry);
|
||||
|
||||
sun4u_NVRAM_set_params(nvram, NVRAM_SIZE, "Sun4u", RAM_size, boot_devices,
|
||||
sun4u_NVRAM_set_params(nvram, NVRAM_SIZE, "Sun4u", args->ram_size,
|
||||
args->boot_device,
|
||||
kernel_addr, kernel_size,
|
||||
kernel_cmdline,
|
||||
args->kernel_cmdline,
|
||||
initrd_addr, initrd_size,
|
||||
/* XXX: need an option to load a NVRAM image */
|
||||
0,
|
||||
|
@ -898,16 +897,16 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
|
|||
fw_cfg_add_i16(fw_cfg, FW_CFG_MACHINE_ID, hwdef->machine_id);
|
||||
fw_cfg_add_i64(fw_cfg, FW_CFG_KERNEL_ADDR, kernel_entry);
|
||||
fw_cfg_add_i64(fw_cfg, FW_CFG_KERNEL_SIZE, kernel_size);
|
||||
if (kernel_cmdline) {
|
||||
if (args->kernel_cmdline) {
|
||||
fw_cfg_add_i32(fw_cfg, FW_CFG_CMDLINE_SIZE,
|
||||
strlen(kernel_cmdline) + 1);
|
||||
fw_cfg_add_string(fw_cfg, FW_CFG_CMDLINE_DATA, kernel_cmdline);
|
||||
strlen(args->kernel_cmdline) + 1);
|
||||
fw_cfg_add_string(fw_cfg, FW_CFG_CMDLINE_DATA, args->kernel_cmdline);
|
||||
} else {
|
||||
fw_cfg_add_i32(fw_cfg, FW_CFG_CMDLINE_SIZE, 0);
|
||||
}
|
||||
fw_cfg_add_i64(fw_cfg, FW_CFG_INITRD_ADDR, initrd_addr);
|
||||
fw_cfg_add_i64(fw_cfg, FW_CFG_INITRD_SIZE, initrd_size);
|
||||
fw_cfg_add_i16(fw_cfg, FW_CFG_BOOT_DEVICE, boot_devices[0]);
|
||||
fw_cfg_add_i16(fw_cfg, FW_CFG_BOOT_DEVICE, args->boot_device[0]);
|
||||
|
||||
fw_cfg_add_i16(fw_cfg, FW_CFG_SPARC64_WIDTH, graphic_width);
|
||||
fw_cfg_add_i16(fw_cfg, FW_CFG_SPARC64_HEIGHT, graphic_height);
|
||||
|
@ -949,40 +948,19 @@ static const struct hwdef hwdefs[] = {
|
|||
/* Sun4u hardware initialisation */
|
||||
static void sun4u_init(QEMUMachineInitArgs *args)
|
||||
{
|
||||
ram_addr_t RAM_size = args->ram_size;
|
||||
const char *cpu_model = args->cpu_model;
|
||||
const char *kernel_filename = args->kernel_filename;
|
||||
const char *kernel_cmdline = args->kernel_cmdline;
|
||||
const char *initrd_filename = args->initrd_filename;
|
||||
const char *boot_devices = args->boot_device;
|
||||
sun4uv_init(get_system_memory(), RAM_size, boot_devices, kernel_filename,
|
||||
kernel_cmdline, initrd_filename, cpu_model, &hwdefs[0]);
|
||||
sun4uv_init(get_system_memory(), args, &hwdefs[0]);
|
||||
}
|
||||
|
||||
/* Sun4v hardware initialisation */
|
||||
static void sun4v_init(QEMUMachineInitArgs *args)
|
||||
{
|
||||
ram_addr_t RAM_size = args->ram_size;
|
||||
const char *cpu_model = args->cpu_model;
|
||||
const char *kernel_filename = args->kernel_filename;
|
||||
const char *kernel_cmdline = args->kernel_cmdline;
|
||||
const char *initrd_filename = args->initrd_filename;
|
||||
const char *boot_devices = args->boot_device;
|
||||
sun4uv_init(get_system_memory(), RAM_size, boot_devices, kernel_filename,
|
||||
kernel_cmdline, initrd_filename, cpu_model, &hwdefs[1]);
|
||||
sun4uv_init(get_system_memory(), args, &hwdefs[1]);
|
||||
}
|
||||
|
||||
/* Niagara hardware initialisation */
|
||||
static void niagara_init(QEMUMachineInitArgs *args)
|
||||
{
|
||||
ram_addr_t RAM_size = args->ram_size;
|
||||
const char *cpu_model = args->cpu_model;
|
||||
const char *kernel_filename = args->kernel_filename;
|
||||
const char *kernel_cmdline = args->kernel_cmdline;
|
||||
const char *initrd_filename = args->initrd_filename;
|
||||
const char *boot_devices = args->boot_device;
|
||||
sun4uv_init(get_system_memory(), RAM_size, boot_devices, kernel_filename,
|
||||
kernel_cmdline, initrd_filename, cpu_model, &hwdefs[2]);
|
||||
sun4uv_init(get_system_memory(), args, &hwdefs[2]);
|
||||
}
|
||||
|
||||
static QEMUMachine sun4u_machine = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue