Compare commits
8 Commits
qemu-2.1.1
...
v2.1.2
Author | SHA1 | Date | |
---|---|---|---|
|
562d6b4f7f | ||
|
9a72433843 | ||
|
00dd2b22f6 | ||
|
80f4d021f0 | ||
|
074e347138 | ||
|
9e8d994111 | ||
|
a56b9cfd86 | ||
|
07178559a9 |
@@ -169,6 +169,7 @@ static void rng_egd_set_chardev(Object *obj, const char *value, Error **errp)
|
|||||||
if (b->opened) {
|
if (b->opened) {
|
||||||
error_set(errp, QERR_PERMISSION_DENIED);
|
error_set(errp, QERR_PERMISSION_DENIED);
|
||||||
} else {
|
} else {
|
||||||
|
g_free(s->chr_name);
|
||||||
s->chr_name = g_strdup(value);
|
s->chr_name = g_strdup(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -24,6 +24,7 @@ static void machine_set_accel(Object *obj, const char *value, Error **errp)
|
|||||||
{
|
{
|
||||||
MachineState *ms = MACHINE(obj);
|
MachineState *ms = MACHINE(obj);
|
||||||
|
|
||||||
|
g_free(ms->accel);
|
||||||
ms->accel = g_strdup(value);
|
ms->accel = g_strdup(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,6 +80,7 @@ static void machine_set_kernel(Object *obj, const char *value, Error **errp)
|
|||||||
{
|
{
|
||||||
MachineState *ms = MACHINE(obj);
|
MachineState *ms = MACHINE(obj);
|
||||||
|
|
||||||
|
g_free(ms->kernel_filename);
|
||||||
ms->kernel_filename = g_strdup(value);
|
ms->kernel_filename = g_strdup(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,6 +95,7 @@ static void machine_set_initrd(Object *obj, const char *value, Error **errp)
|
|||||||
{
|
{
|
||||||
MachineState *ms = MACHINE(obj);
|
MachineState *ms = MACHINE(obj);
|
||||||
|
|
||||||
|
g_free(ms->initrd_filename);
|
||||||
ms->initrd_filename = g_strdup(value);
|
ms->initrd_filename = g_strdup(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,6 +110,7 @@ static void machine_set_append(Object *obj, const char *value, Error **errp)
|
|||||||
{
|
{
|
||||||
MachineState *ms = MACHINE(obj);
|
MachineState *ms = MACHINE(obj);
|
||||||
|
|
||||||
|
g_free(ms->kernel_cmdline);
|
||||||
ms->kernel_cmdline = g_strdup(value);
|
ms->kernel_cmdline = g_strdup(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,6 +125,7 @@ static void machine_set_dtb(Object *obj, const char *value, Error **errp)
|
|||||||
{
|
{
|
||||||
MachineState *ms = MACHINE(obj);
|
MachineState *ms = MACHINE(obj);
|
||||||
|
|
||||||
|
g_free(ms->dtb);
|
||||||
ms->dtb = g_strdup(value);
|
ms->dtb = g_strdup(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,6 +140,7 @@ static void machine_set_dumpdtb(Object *obj, const char *value, Error **errp)
|
|||||||
{
|
{
|
||||||
MachineState *ms = MACHINE(obj);
|
MachineState *ms = MACHINE(obj);
|
||||||
|
|
||||||
|
g_free(ms->dumpdtb);
|
||||||
ms->dumpdtb = g_strdup(value);
|
ms->dumpdtb = g_strdup(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -176,6 +182,7 @@ static void machine_set_dt_compatible(Object *obj, const char *value, Error **er
|
|||||||
{
|
{
|
||||||
MachineState *ms = MACHINE(obj);
|
MachineState *ms = MACHINE(obj);
|
||||||
|
|
||||||
|
g_free(ms->dt_compatible);
|
||||||
ms->dt_compatible = g_strdup(value);
|
ms->dt_compatible = g_strdup(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -232,6 +239,7 @@ static void machine_set_firmware(Object *obj, const char *value, Error **errp)
|
|||||||
{
|
{
|
||||||
MachineState *ms = MACHINE(obj);
|
MachineState *ms = MACHINE(obj);
|
||||||
|
|
||||||
|
g_free(ms->firmware);
|
||||||
ms->firmware = g_strdup(value);
|
ms->firmware = g_strdup(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -72,8 +72,10 @@
|
|||||||
#define DPRINTF(fmt, ...)
|
#define DPRINTF(fmt, ...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Leave a chunk of memory at the top of RAM for the BIOS ACPI tables. */
|
/* Leave a chunk of memory at the top of RAM for the BIOS ACPI tables
|
||||||
unsigned acpi_data_size = 0x20000;
|
* (128K) and other BIOS datastructures (less than 4K reported to be used at
|
||||||
|
* the moment, 32K should be enough for a while). */
|
||||||
|
unsigned acpi_data_size = 0x20000 + 0x8000;
|
||||||
void pc_set_legacy_acpi_data_size(void)
|
void pc_set_legacy_acpi_data_size(void)
|
||||||
{
|
{
|
||||||
acpi_data_size = 0x10000;
|
acpi_data_size = 0x10000;
|
||||||
|
@@ -1125,8 +1125,6 @@ static int32_t virtio_net_flush_tx(VirtIONetQueue *q)
|
|||||||
return num_packets;
|
return num_packets;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(vdev->vm_running);
|
|
||||||
|
|
||||||
if (q->async_tx.elem.out_num) {
|
if (q->async_tx.elem.out_num) {
|
||||||
virtio_queue_set_notification(q->tx_vq, 0);
|
virtio_queue_set_notification(q->tx_vq, 0);
|
||||||
return num_packets;
|
return num_packets;
|
||||||
|
@@ -1377,6 +1377,7 @@ static void ppc_spapr_init(MachineState *machine)
|
|||||||
spapr_create_nvram(spapr);
|
spapr_create_nvram(spapr);
|
||||||
|
|
||||||
/* Set up PCI */
|
/* Set up PCI */
|
||||||
|
spapr_pci_msi_init(spapr, SPAPR_PCI_MSI_WINDOW);
|
||||||
spapr_pci_rtas_init();
|
spapr_pci_rtas_init();
|
||||||
|
|
||||||
phb = spapr_create_phb(spapr, 0);
|
phb = spapr_create_phb(spapr, 0);
|
||||||
|
@@ -341,7 +341,7 @@ static void rtas_ibm_change_msi(PowerPCCPU *cpu, sPAPREnvironment *spapr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Setup MSI/MSIX vectors in the device (via cfgspace or MSIX BAR) */
|
/* Setup MSI/MSIX vectors in the device (via cfgspace or MSIX BAR) */
|
||||||
spapr_msi_setmsg(pdev, SPAPR_PCI_MSI_WINDOW, ret_intr_type == RTAS_TYPE_MSIX,
|
spapr_msi_setmsg(pdev, spapr->msi_win_addr, ret_intr_type == RTAS_TYPE_MSIX,
|
||||||
irq, req_num);
|
irq, req_num);
|
||||||
|
|
||||||
/* Add MSI device to cache */
|
/* Add MSI device to cache */
|
||||||
@@ -465,6 +465,34 @@ static const MemoryRegionOps spapr_msi_ops = {
|
|||||||
.endianness = DEVICE_LITTLE_ENDIAN
|
.endianness = DEVICE_LITTLE_ENDIAN
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void spapr_pci_msi_init(sPAPREnvironment *spapr, hwaddr addr)
|
||||||
|
{
|
||||||
|
uint64_t window_size = 4096;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* As MSI/MSIX interrupts trigger by writing at MSI/MSIX vectors,
|
||||||
|
* we need to allocate some memory to catch those writes coming
|
||||||
|
* from msi_notify()/msix_notify().
|
||||||
|
* As MSIMessage:addr is going to be the same and MSIMessage:data
|
||||||
|
* is going to be a VIRQ number, 4 bytes of the MSI MR will only
|
||||||
|
* be used.
|
||||||
|
*
|
||||||
|
* For KVM we want to ensure that this memory is a full page so that
|
||||||
|
* our memory slot is of page size granularity.
|
||||||
|
*/
|
||||||
|
#ifdef CONFIG_KVM
|
||||||
|
if (kvm_enabled()) {
|
||||||
|
window_size = getpagesize();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
spapr->msi_win_addr = addr;
|
||||||
|
memory_region_init_io(&spapr->msiwindow, NULL, &spapr_msi_ops, spapr,
|
||||||
|
"msi", window_size);
|
||||||
|
memory_region_add_subregion(get_system_memory(), spapr->msi_win_addr,
|
||||||
|
&spapr->msiwindow);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* PHB PCI device
|
* PHB PCI device
|
||||||
*/
|
*/
|
||||||
@@ -484,7 +512,6 @@ static void spapr_phb_realize(DeviceState *dev, Error **errp)
|
|||||||
char *namebuf;
|
char *namebuf;
|
||||||
int i;
|
int i;
|
||||||
PCIBus *bus;
|
PCIBus *bus;
|
||||||
uint64_t msi_window_size = 4096;
|
|
||||||
|
|
||||||
if (sphb->index != -1) {
|
if (sphb->index != -1) {
|
||||||
hwaddr windows_base;
|
hwaddr windows_base;
|
||||||
@@ -577,28 +604,6 @@ static void spapr_phb_realize(DeviceState *dev, Error **errp)
|
|||||||
address_space_init(&sphb->iommu_as, &sphb->iommu_root,
|
address_space_init(&sphb->iommu_as, &sphb->iommu_root,
|
||||||
sphb->dtbusname);
|
sphb->dtbusname);
|
||||||
|
|
||||||
/*
|
|
||||||
* As MSI/MSIX interrupts trigger by writing at MSI/MSIX vectors,
|
|
||||||
* we need to allocate some memory to catch those writes coming
|
|
||||||
* from msi_notify()/msix_notify().
|
|
||||||
* As MSIMessage:addr is going to be the same and MSIMessage:data
|
|
||||||
* is going to be a VIRQ number, 4 bytes of the MSI MR will only
|
|
||||||
* be used.
|
|
||||||
*
|
|
||||||
* For KVM we want to ensure that this memory is a full page so that
|
|
||||||
* our memory slot is of page size granularity.
|
|
||||||
*/
|
|
||||||
#ifdef CONFIG_KVM
|
|
||||||
if (kvm_enabled()) {
|
|
||||||
msi_window_size = getpagesize();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
memory_region_init_io(&sphb->msiwindow, NULL, &spapr_msi_ops, spapr,
|
|
||||||
"msi", msi_window_size);
|
|
||||||
memory_region_add_subregion(&sphb->iommu_root, SPAPR_PCI_MSI_WINDOW,
|
|
||||||
&sphb->msiwindow);
|
|
||||||
|
|
||||||
pci_setup_iommu(bus, spapr_pci_dma_iommu, sphb);
|
pci_setup_iommu(bus, spapr_pci_dma_iommu, sphb);
|
||||||
|
|
||||||
pci_bus_set_route_irq_fn(bus, spapr_route_intx_pin_to_irq);
|
pci_bus_set_route_irq_fn(bus, spapr_route_intx_pin_to_irq);
|
||||||
|
@@ -1108,10 +1108,7 @@ static void virtio_vmstate_change(void *opaque, int running, RunState state)
|
|||||||
BusState *qbus = qdev_get_parent_bus(DEVICE(vdev));
|
BusState *qbus = qdev_get_parent_bus(DEVICE(vdev));
|
||||||
VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus);
|
VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus);
|
||||||
bool backend_run = running && (vdev->status & VIRTIO_CONFIG_S_DRIVER_OK);
|
bool backend_run = running && (vdev->status & VIRTIO_CONFIG_S_DRIVER_OK);
|
||||||
|
vdev->vm_running = running;
|
||||||
if (running) {
|
|
||||||
vdev->vm_running = running;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (backend_run) {
|
if (backend_run) {
|
||||||
virtio_set_status(vdev, vdev->status);
|
virtio_set_status(vdev, vdev->status);
|
||||||
@@ -1124,10 +1121,6 @@ static void virtio_vmstate_change(void *opaque, int running, RunState state)
|
|||||||
if (!backend_run) {
|
if (!backend_run) {
|
||||||
virtio_set_status(vdev, vdev->status);
|
virtio_set_status(vdev, vdev->status);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!running) {
|
|
||||||
vdev->vm_running = running;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void virtio_init(VirtIODevice *vdev, const char *name,
|
void virtio_init(VirtIODevice *vdev, const char *name,
|
||||||
|
@@ -70,7 +70,7 @@ struct sPAPRPHBState {
|
|||||||
|
|
||||||
MemoryRegion memspace, iospace;
|
MemoryRegion memspace, iospace;
|
||||||
hwaddr mem_win_addr, mem_win_size, io_win_addr, io_win_size;
|
hwaddr mem_win_addr, mem_win_size, io_win_addr, io_win_size;
|
||||||
MemoryRegion memwindow, iowindow, msiwindow;
|
MemoryRegion memwindow, iowindow;
|
||||||
|
|
||||||
uint32_t dma_liobn;
|
uint32_t dma_liobn;
|
||||||
AddressSpace iommu_as;
|
AddressSpace iommu_as;
|
||||||
|
@@ -13,6 +13,8 @@ struct sPAPRNVRAM;
|
|||||||
typedef struct sPAPREnvironment {
|
typedef struct sPAPREnvironment {
|
||||||
struct VIOsPAPRBus *vio_bus;
|
struct VIOsPAPRBus *vio_bus;
|
||||||
QLIST_HEAD(, sPAPRPHBState) phbs;
|
QLIST_HEAD(, sPAPRPHBState) phbs;
|
||||||
|
hwaddr msi_win_addr;
|
||||||
|
MemoryRegion msiwindow;
|
||||||
struct sPAPRNVRAM *nvram;
|
struct sPAPRNVRAM *nvram;
|
||||||
XICSState *icp;
|
XICSState *icp;
|
||||||
|
|
||||||
|
@@ -152,7 +152,7 @@ udp_input(register struct mbuf *m, int iphlen)
|
|||||||
* Locate pcb for datagram.
|
* Locate pcb for datagram.
|
||||||
*/
|
*/
|
||||||
so = slirp->udp_last_so;
|
so = slirp->udp_last_so;
|
||||||
if (so->so_lport != uh->uh_sport ||
|
if (so == &slirp->udb || so->so_lport != uh->uh_sport ||
|
||||||
so->so_laddr.s_addr != ip->ip_src.s_addr) {
|
so->so_laddr.s_addr != ip->ip_src.s_addr) {
|
||||||
struct socket *tmp;
|
struct socket *tmp;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user