2011-07-03 17:00:09 +04:00
|
|
|
/*
|
|
|
|
* Standard PCI Bridge Device
|
|
|
|
*
|
|
|
|
* Copyright (c) 2011 Red Hat Inc. Author: Michael S. Tsirkin <mst@redhat.com>
|
|
|
|
*
|
|
|
|
* http://www.pcisig.com/specifications/conventional/pci_to_pci_bridge_architecture/
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2016-01-26 21:17:15 +03:00
|
|
|
#include "qemu/osdep.h"
|
include/qemu/osdep.h: Don't include qapi/error.h
Commit 57cb38b included qapi/error.h into qemu/osdep.h to get the
Error typedef. Since then, we've moved to include qemu/osdep.h
everywhere. Its file comment explains: "To avoid getting into
possible circular include dependencies, this file should not include
any other QEMU headers, with the exceptions of config-host.h,
compiler.h, os-posix.h and os-win32.h, all of which are doing a
similar job to this file and are under similar constraints."
qapi/error.h doesn't do a similar job, and it doesn't adhere to
similar constraints: it includes qapi-types.h. That's in excess of
100KiB of crap most .c files don't actually need.
Add the typedef to qemu/typedefs.h, and include that instead of
qapi/error.h. Include qapi/error.h in .c files that need it and don't
get it now. Include qapi-types.h in qom/object.h for uint16List.
Update scripts/clean-includes accordingly. Update it further to match
reality: replace config.h by config-target.h, add sysemu/os-posix.h,
sysemu/os-win32.h. Update the list of includes in the qemu/osdep.h
comment quoted above similarly.
This reduces the number of objects depending on qapi/error.h from "all
of them" to less than a third. Unfortunately, the number depending on
qapi-types.h shrinks only a little. More work is needed for that one.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
[Fix compilation without the spice devel packages. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-03-14 11:01:28 +03:00
|
|
|
#include "qapi/error.h"
|
2019-05-23 17:35:07 +03:00
|
|
|
#include "qemu/module.h"
|
2013-02-04 18:40:22 +04:00
|
|
|
#include "hw/pci/pci_bridge.h"
|
|
|
|
#include "hw/pci/pci_ids.h"
|
|
|
|
#include "hw/pci/msi.h"
|
|
|
|
#include "hw/pci/shpc.h"
|
|
|
|
#include "hw/pci/slotid_cap.h"
|
2019-08-12 08:23:51 +03:00
|
|
|
#include "hw/qdev-properties.h"
|
2012-12-17 21:19:49 +04:00
|
|
|
#include "exec/memory.h"
|
2013-02-04 18:40:22 +04:00
|
|
|
#include "hw/pci/pci_bus.h"
|
2014-02-05 19:36:50 +04:00
|
|
|
#include "hw/hotplug.h"
|
2020-09-03 23:43:22 +03:00
|
|
|
#include "qom/object.h"
|
2011-07-03 17:00:09 +04:00
|
|
|
|
2015-06-18 13:17:29 +03:00
|
|
|
#define TYPE_PCI_BRIDGE_DEV "pci-bridge"
|
|
|
|
#define TYPE_PCI_BRIDGE_SEAT_DEV "pci-bridge-seat"
|
2020-09-03 23:43:22 +03:00
|
|
|
typedef struct PCIBridgeDev PCIBridgeDev;
|
2020-09-01 00:07:33 +03:00
|
|
|
DECLARE_INSTANCE_CHECKER(PCIBridgeDev, PCI_BRIDGE_DEV,
|
|
|
|
TYPE_PCI_BRIDGE_DEV)
|
2013-07-12 21:16:46 +04:00
|
|
|
|
2011-07-03 17:00:09 +04:00
|
|
|
struct PCIBridgeDev {
|
2013-07-12 21:16:46 +04:00
|
|
|
/*< private >*/
|
|
|
|
PCIBridge parent_obj;
|
|
|
|
/*< public >*/
|
|
|
|
|
2011-07-03 17:00:09 +04:00
|
|
|
MemoryRegion bar;
|
|
|
|
uint8_t chassis_nr;
|
2016-06-20 09:13:38 +03:00
|
|
|
#define PCI_BRIDGE_DEV_F_SHPC_REQ 0
|
2011-07-03 17:00:09 +04:00
|
|
|
uint32_t flags;
|
2016-06-20 09:13:38 +03:00
|
|
|
|
|
|
|
OnOffAuto msi;
|
2018-08-21 06:18:07 +03:00
|
|
|
|
|
|
|
/* additional resources to reserve */
|
|
|
|
PCIResReserve res_reserve;
|
2011-07-03 17:00:09 +04:00
|
|
|
};
|
|
|
|
|
2017-06-27 09:16:53 +03:00
|
|
|
static void pci_bridge_dev_realize(PCIDevice *dev, Error **errp)
|
2011-07-03 17:00:09 +04:00
|
|
|
{
|
2013-07-11 19:13:43 +04:00
|
|
|
PCIBridge *br = PCI_BRIDGE(dev);
|
2013-07-12 21:16:46 +04:00
|
|
|
PCIBridgeDev *bridge_dev = PCI_BRIDGE_DEV(dev);
|
2012-07-04 08:39:27 +04:00
|
|
|
int err;
|
2016-06-20 09:13:39 +03:00
|
|
|
Error *local_err = NULL;
|
2012-07-04 08:39:27 +04:00
|
|
|
|
2016-01-15 05:23:32 +03:00
|
|
|
pci_bridge_initfn(dev, TYPE_PCI_BUS);
|
|
|
|
|
2015-06-19 05:40:13 +03:00
|
|
|
if (bridge_dev->flags & (1 << PCI_BRIDGE_DEV_F_SHPC_REQ)) {
|
|
|
|
dev->config[PCI_INTERRUPT_PIN] = 0x1;
|
|
|
|
memory_region_init(&bridge_dev->bar, OBJECT(dev), "shpc-bar",
|
|
|
|
shpc_bar_size(dev));
|
2017-06-27 09:16:53 +03:00
|
|
|
err = shpc_init(dev, &br->sec_bus, &bridge_dev->bar, 0, errp);
|
2015-06-19 05:40:13 +03:00
|
|
|
if (err) {
|
|
|
|
goto shpc_error;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
/* MSI is not applicable without SHPC */
|
2016-06-20 09:13:38 +03:00
|
|
|
bridge_dev->msi = ON_OFF_AUTO_OFF;
|
2011-07-03 17:00:09 +04:00
|
|
|
}
|
2016-06-10 12:54:23 +03:00
|
|
|
|
2017-06-27 09:16:53 +03:00
|
|
|
err = slotid_cap_init(dev, 0, bridge_dev->chassis_nr, 0, errp);
|
2011-07-03 17:00:09 +04:00
|
|
|
if (err) {
|
|
|
|
goto slotid_error;
|
|
|
|
}
|
2016-06-10 12:54:23 +03:00
|
|
|
|
2016-06-20 09:13:39 +03:00
|
|
|
if (bridge_dev->msi != ON_OFF_AUTO_OFF) {
|
|
|
|
/* it means SHPC exists, because MSI is needed by SHPC */
|
|
|
|
|
|
|
|
err = msi_init(dev, 0, 1, true, true, &local_err);
|
|
|
|
/* Any error other than -ENOTSUP(board's MSI support is broken)
|
|
|
|
* is a programming error */
|
|
|
|
assert(!err || err == -ENOTSUP);
|
|
|
|
if (err && bridge_dev->msi == ON_OFF_AUTO_ON) {
|
|
|
|
/* Can't satisfy user's explicit msi=on request, fail */
|
|
|
|
error_append_hint(&local_err, "You have to use msi=auto (default) "
|
|
|
|
"or msi=off with this machine type.\n");
|
2017-06-27 09:16:53 +03:00
|
|
|
error_propagate(errp, local_err);
|
2011-07-03 17:00:09 +04:00
|
|
|
goto msi_error;
|
|
|
|
}
|
2016-06-20 09:13:39 +03:00
|
|
|
assert(!local_err || bridge_dev->msi == ON_OFF_AUTO_AUTO);
|
|
|
|
/* With msi=auto, we fall back to MSI off silently */
|
|
|
|
error_free(local_err);
|
2011-07-03 17:00:09 +04:00
|
|
|
}
|
2016-06-10 12:54:23 +03:00
|
|
|
|
2018-08-21 06:18:07 +03:00
|
|
|
err = pci_bridge_qemu_reserve_cap_init(dev, 0,
|
|
|
|
bridge_dev->res_reserve, errp);
|
|
|
|
if (err) {
|
|
|
|
goto cap_error;
|
|
|
|
}
|
|
|
|
|
2015-06-19 05:40:13 +03:00
|
|
|
if (shpc_present(dev)) {
|
|
|
|
/* TODO: spec recommends using 64 bit prefetcheable BAR.
|
|
|
|
* Check whether that works well. */
|
|
|
|
pci_register_bar(dev, 0, PCI_BASE_ADDRESS_SPACE_MEMORY |
|
|
|
|
PCI_BASE_ADDRESS_MEM_TYPE_64, &bridge_dev->bar);
|
|
|
|
}
|
2017-06-27 09:16:53 +03:00
|
|
|
return;
|
2016-06-10 12:54:23 +03:00
|
|
|
|
2018-08-21 06:18:07 +03:00
|
|
|
cap_error:
|
|
|
|
msi_uninit(dev);
|
2011-07-03 17:00:09 +04:00
|
|
|
msi_error:
|
|
|
|
slotid_cap_cleanup(dev);
|
|
|
|
slotid_error:
|
2015-06-19 05:40:13 +03:00
|
|
|
if (shpc_present(dev)) {
|
|
|
|
shpc_cleanup(dev, &bridge_dev->bar);
|
|
|
|
}
|
2011-07-03 17:00:09 +04:00
|
|
|
shpc_error:
|
2012-07-04 08:39:27 +04:00
|
|
|
pci_bridge_exitfn(dev);
|
2011-07-03 17:00:09 +04:00
|
|
|
}
|
|
|
|
|
2012-07-04 08:39:27 +04:00
|
|
|
static void pci_bridge_dev_exitfn(PCIDevice *dev)
|
2011-07-03 17:00:09 +04:00
|
|
|
{
|
2013-07-12 21:16:46 +04:00
|
|
|
PCIBridgeDev *bridge_dev = PCI_BRIDGE_DEV(dev);
|
2018-08-21 06:18:07 +03:00
|
|
|
|
|
|
|
pci_del_capability(dev, PCI_CAP_ID_VNDR, sizeof(PCIBridgeQemuCap));
|
2011-07-03 17:00:09 +04:00
|
|
|
if (msi_present(dev)) {
|
|
|
|
msi_uninit(dev);
|
|
|
|
}
|
|
|
|
slotid_cap_cleanup(dev);
|
2015-06-19 05:40:13 +03:00
|
|
|
if (shpc_present(dev)) {
|
|
|
|
shpc_cleanup(dev, &bridge_dev->bar);
|
|
|
|
}
|
2012-07-04 08:39:27 +04:00
|
|
|
pci_bridge_exitfn(dev);
|
2011-07-03 17:00:09 +04:00
|
|
|
}
|
|
|
|
|
2015-02-12 23:39:20 +03:00
|
|
|
static void pci_bridge_dev_instance_finalize(Object *obj)
|
|
|
|
{
|
2015-06-19 05:40:13 +03:00
|
|
|
/* this function is idempotent and handles (PCIDevice.shpc == NULL) */
|
2015-02-12 23:39:20 +03:00
|
|
|
shpc_free(PCI_DEVICE(obj));
|
|
|
|
}
|
|
|
|
|
2011-07-03 17:00:09 +04:00
|
|
|
static void pci_bridge_dev_write_config(PCIDevice *d,
|
|
|
|
uint32_t address, uint32_t val, int len)
|
|
|
|
{
|
|
|
|
pci_bridge_write_config(d, address, val, len);
|
|
|
|
if (msi_present(d)) {
|
|
|
|
msi_write_config(d, address, val, len);
|
|
|
|
}
|
2015-06-19 05:40:13 +03:00
|
|
|
if (shpc_present(d)) {
|
|
|
|
shpc_cap_write_config(d, address, val, len);
|
|
|
|
}
|
2011-07-03 17:00:09 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void qdev_pci_bridge_dev_reset(DeviceState *qdev)
|
|
|
|
{
|
2013-07-12 21:16:46 +04:00
|
|
|
PCIDevice *dev = PCI_DEVICE(qdev);
|
2012-05-16 03:09:56 +04:00
|
|
|
|
2011-07-03 17:00:09 +04:00
|
|
|
pci_bridge_reset(qdev);
|
2015-06-19 05:40:13 +03:00
|
|
|
if (shpc_present(dev)) {
|
|
|
|
shpc_reset(dev);
|
|
|
|
}
|
2011-07-03 17:00:09 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
static Property pci_bridge_dev_properties[] = {
|
|
|
|
/* Note: 0 is not a legal chassis number. */
|
2015-06-19 05:40:10 +03:00
|
|
|
DEFINE_PROP_UINT8(PCI_BRIDGE_DEV_PROP_CHASSIS_NR, PCIBridgeDev, chassis_nr,
|
|
|
|
0),
|
2016-06-20 09:13:38 +03:00
|
|
|
DEFINE_PROP_ON_OFF_AUTO(PCI_BRIDGE_DEV_PROP_MSI, PCIBridgeDev, msi,
|
|
|
|
ON_OFF_AUTO_AUTO),
|
2015-06-19 05:40:13 +03:00
|
|
|
DEFINE_PROP_BIT(PCI_BRIDGE_DEV_PROP_SHPC, PCIBridgeDev, flags,
|
2017-05-11 13:25:29 +03:00
|
|
|
PCI_BRIDGE_DEV_F_SHPC_REQ, true),
|
2018-08-21 06:18:07 +03:00
|
|
|
DEFINE_PROP_UINT32("bus-reserve", PCIBridgeDev,
|
|
|
|
res_reserve.bus, -1),
|
|
|
|
DEFINE_PROP_SIZE("io-reserve", PCIBridgeDev,
|
|
|
|
res_reserve.io, -1),
|
|
|
|
DEFINE_PROP_SIZE("mem-reserve", PCIBridgeDev,
|
|
|
|
res_reserve.mem_non_pref, -1),
|
|
|
|
DEFINE_PROP_SIZE("pref32-reserve", PCIBridgeDev,
|
|
|
|
res_reserve.mem_pref_32, -1),
|
|
|
|
DEFINE_PROP_SIZE("pref64-reserve", PCIBridgeDev,
|
|
|
|
res_reserve.mem_pref_64, -1),
|
|
|
|
|
2011-07-03 17:00:09 +04:00
|
|
|
DEFINE_PROP_END_OF_LIST(),
|
|
|
|
};
|
|
|
|
|
2015-06-19 05:40:13 +03:00
|
|
|
static bool pci_device_shpc_present(void *opaque, int version_id)
|
|
|
|
{
|
|
|
|
PCIDevice *dev = opaque;
|
|
|
|
|
|
|
|
return shpc_present(dev);
|
|
|
|
}
|
|
|
|
|
2011-07-03 17:00:09 +04:00
|
|
|
static const VMStateDescription pci_bridge_dev_vmstate = {
|
|
|
|
.name = "pci_bridge",
|
pci/bus: let it has higher migration priority
In the past, we prioritized IOMMU migration so that we have such a
priority order:
IOMMU > PCI Devices
When migrating a guest with both vIOMMU and a pcie-root-port, we'll
always migrate vIOMMU first, since pci buses will be seen to have the
same priority of general PCI devices.
That's problematic.
The thing is that PCI bus number information is stored in the root port,
and that is needed by vIOMMU during post_load(), e.g., to figure out
context entry for a device. If we don't have correct bus numbers for
devices, we won't be able to recover device state of the DMAR memory
regions, and things will be messed up.
So let's boost the PCIe root ports to be even with higher priority:
PCIe Root Port > IOMMU > PCI Devices
A smoke test shows that this patch fixes bug 1538953.
Also, apply this rule to all the PCI bus/bridge devices: ioh3420,
xio3130_downstream, xio3130_upstream, pcie_pci_bridge, pci-pci bridge,
i82801b11.
I noted that we set pcie_pci_bridge_dev_vmstate twice. Clean that up
together.
CC: Alex Williamson <alex.williamson@redhat.com>
CC: Marcel Apfelbaum <marcel@redhat.com>
CC: Michael S. Tsirkin <mst@redhat.com>
CC: Dr. David Alan Gilbert <dgilbert@redhat.com>
CC: Juan Quintela <quintela@redhat.com>
CC: Laurent Vivier <lvivier@redhat.com>
Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1538953
Reported-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2018-02-06 10:39:33 +03:00
|
|
|
.priority = MIG_PRI_PCI_BUS,
|
2011-07-03 17:00:09 +04:00
|
|
|
.fields = (VMStateField[]) {
|
2013-07-12 21:16:46 +04:00
|
|
|
VMSTATE_PCI_DEVICE(parent_obj, PCIBridge),
|
2015-06-19 05:40:13 +03:00
|
|
|
SHPC_VMSTATE(shpc, PCIDevice, pci_device_shpc_present),
|
2011-07-03 17:00:09 +04:00
|
|
|
VMSTATE_END_OF_LIST()
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2018-12-12 12:16:21 +03:00
|
|
|
void pci_bridge_dev_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev,
|
|
|
|
Error **errp)
|
2015-06-19 05:40:13 +03:00
|
|
|
{
|
|
|
|
PCIDevice *pci_hotplug_dev = PCI_DEVICE(hotplug_dev);
|
|
|
|
|
|
|
|
if (!shpc_present(pci_hotplug_dev)) {
|
|
|
|
error_setg(errp, "standard hotplug controller has been disabled for "
|
2018-12-12 12:16:21 +03:00
|
|
|
"this %s", object_get_typename(OBJECT(hotplug_dev)));
|
2015-06-19 05:40:13 +03:00
|
|
|
return;
|
|
|
|
}
|
2018-12-12 12:16:14 +03:00
|
|
|
shpc_device_plug_cb(hotplug_dev, dev, errp);
|
2015-06-19 05:40:13 +03:00
|
|
|
}
|
|
|
|
|
2018-12-12 12:16:22 +03:00
|
|
|
void pci_bridge_dev_unplug_cb(HotplugHandler *hotplug_dev, DeviceState *dev,
|
|
|
|
Error **errp)
|
|
|
|
{
|
|
|
|
PCIDevice *pci_hotplug_dev = PCI_DEVICE(hotplug_dev);
|
|
|
|
|
|
|
|
g_assert(shpc_present(pci_hotplug_dev));
|
|
|
|
shpc_device_unplug_cb(hotplug_dev, dev, errp);
|
|
|
|
}
|
|
|
|
|
2018-12-12 12:16:21 +03:00
|
|
|
void pci_bridge_dev_unplug_request_cb(HotplugHandler *hotplug_dev,
|
|
|
|
DeviceState *dev, Error **errp)
|
2015-06-19 05:40:13 +03:00
|
|
|
{
|
|
|
|
PCIDevice *pci_hotplug_dev = PCI_DEVICE(hotplug_dev);
|
|
|
|
|
|
|
|
if (!shpc_present(pci_hotplug_dev)) {
|
|
|
|
error_setg(errp, "standard hotplug controller has been disabled for "
|
2018-12-12 12:16:21 +03:00
|
|
|
"this %s", object_get_typename(OBJECT(hotplug_dev)));
|
2015-06-19 05:40:13 +03:00
|
|
|
return;
|
|
|
|
}
|
2018-12-12 12:16:14 +03:00
|
|
|
shpc_device_unplug_request_cb(hotplug_dev, dev, errp);
|
2015-06-19 05:40:13 +03:00
|
|
|
}
|
|
|
|
|
2011-07-03 17:00:09 +04:00
|
|
|
static void pci_bridge_dev_class_init(ObjectClass *klass, void *data)
|
|
|
|
{
|
|
|
|
DeviceClass *dc = DEVICE_CLASS(klass);
|
|
|
|
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
2014-02-05 19:36:50 +04:00
|
|
|
HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(klass);
|
|
|
|
|
2017-06-27 09:16:53 +03:00
|
|
|
k->realize = pci_bridge_dev_realize;
|
2011-07-03 17:00:09 +04:00
|
|
|
k->exit = pci_bridge_dev_exitfn;
|
|
|
|
k->config_write = pci_bridge_dev_write_config;
|
2012-12-13 13:19:38 +04:00
|
|
|
k->vendor_id = PCI_VENDOR_ID_REDHAT;
|
|
|
|
k->device_id = PCI_DEVICE_ID_REDHAT_BRIDGE;
|
2011-07-03 17:00:09 +04:00
|
|
|
k->class_id = PCI_CLASS_BRIDGE_PCI;
|
2019-05-13 09:19:38 +03:00
|
|
|
k->is_bridge = true;
|
2011-07-03 17:00:09 +04:00
|
|
|
dc->desc = "Standard PCI Bridge";
|
|
|
|
dc->reset = qdev_pci_bridge_dev_reset;
|
2020-01-10 18:30:32 +03:00
|
|
|
device_class_set_props(dc, pci_bridge_dev_properties);
|
2011-07-03 17:00:09 +04:00
|
|
|
dc->vmsd = &pci_bridge_dev_vmstate;
|
2013-07-29 18:17:45 +04:00
|
|
|
set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
|
2018-12-12 12:16:14 +03:00
|
|
|
hc->plug = pci_bridge_dev_plug_cb;
|
2018-12-12 12:16:22 +03:00
|
|
|
hc->unplug = pci_bridge_dev_unplug_cb;
|
2018-12-12 12:16:14 +03:00
|
|
|
hc->unplug_request = pci_bridge_dev_unplug_request_cb;
|
2011-07-03 17:00:09 +04:00
|
|
|
}
|
|
|
|
|
2013-01-10 19:19:07 +04:00
|
|
|
static const TypeInfo pci_bridge_dev_info = {
|
2015-02-12 23:39:20 +03:00
|
|
|
.name = TYPE_PCI_BRIDGE_DEV,
|
|
|
|
.parent = TYPE_PCI_BRIDGE,
|
|
|
|
.instance_size = sizeof(PCIBridgeDev),
|
|
|
|
.class_init = pci_bridge_dev_class_init,
|
|
|
|
.instance_finalize = pci_bridge_dev_instance_finalize,
|
2014-02-05 19:36:50 +04:00
|
|
|
.interfaces = (InterfaceInfo[]) {
|
|
|
|
{ TYPE_HOTPLUG_HANDLER },
|
2017-09-27 22:56:34 +03:00
|
|
|
{ INTERFACE_CONVENTIONAL_PCI_DEVICE },
|
2014-02-05 19:36:50 +04:00
|
|
|
{ }
|
|
|
|
}
|
2011-07-03 17:00:09 +04:00
|
|
|
};
|
|
|
|
|
2015-06-18 13:17:29 +03:00
|
|
|
/*
|
|
|
|
* Multiseat bridge. Same as the standard pci bridge, only with a
|
|
|
|
* different pci id, so we can match it easily in the guest for
|
|
|
|
* automagic multiseat configuration. See docs/multiseat.txt for more.
|
|
|
|
*/
|
|
|
|
static void pci_bridge_dev_seat_class_init(ObjectClass *klass, void *data)
|
|
|
|
{
|
|
|
|
DeviceClass *dc = DEVICE_CLASS(klass);
|
|
|
|
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
|
|
|
|
|
|
|
k->device_id = PCI_DEVICE_ID_REDHAT_BRIDGE_SEAT;
|
|
|
|
dc->desc = "Standard PCI Bridge (multiseat)";
|
|
|
|
}
|
|
|
|
|
|
|
|
static const TypeInfo pci_bridge_dev_seat_info = {
|
|
|
|
.name = TYPE_PCI_BRIDGE_SEAT_DEV,
|
|
|
|
.parent = TYPE_PCI_BRIDGE_DEV,
|
|
|
|
.instance_size = sizeof(PCIBridgeDev),
|
|
|
|
.class_init = pci_bridge_dev_seat_class_init,
|
|
|
|
};
|
|
|
|
|
2011-07-03 17:00:09 +04:00
|
|
|
static void pci_bridge_dev_register(void)
|
|
|
|
{
|
|
|
|
type_register_static(&pci_bridge_dev_info);
|
2015-06-18 13:17:29 +03:00
|
|
|
type_register_static(&pci_bridge_dev_seat_info);
|
2011-07-03 17:00:09 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
type_init(pci_bridge_dev_register);
|