Load ramfb vgabios on x86 only.
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEoDKM/7k6F6eZAf59TLbY7tPocTgFAmh6o80ACgkQTLbY7tPo cTjxPBAAktTXxFK6loSMSWC1ul8RCl/4F7G84J4eT+Ui8/KIG8do5KcebTnXb9zo keOG7n9HPk4fROWiAFgGnuBfw41DWmLDS34iuENrG3X26TQgSSgBveuwas67Pzqu HpaFSxjh7BRLlkUWaNoll57cDM3kKLmx+Onw6m/7kbcVXAsy1N4wxfCT1faUU7ID R1ggULG1WhB8q+YtQjac6EfOpdHe1BTBGLuxSwE3mNkce9ZP7C8uxZTCR5PXggZi IXzJzGpFRDCHqrilWksiE62yF20Kem4ZcpO/GgLWmF+X+DYBDEWcajihvF20TGUL n6dyT7MBxuvqFy0OtBPHNcnq2PZzOIKyxyMvBg9402xeD6goNbFKloAYeae4C9u0 QuqQUpb8D3lVagVu55N5XfpdMHR0P8yefPAjaFL4o3rf2JSjyI6MRX/+2eA7aXcX xiwHSx3iavEeNQNsPZsS3JhH5bKy/zkWRiBd+msGVAYMZGzhdEtLg/w8yUd6dQ5p /3Y3F4fL6T6QSwhsiihcbdPtjhfVCP09MYK/P4cIFbWOzjfbndt1/UIXHQ54s8Jo PShcE7QH7ttT2gK5nFPG5yeTqF70kKpSyhwF2pukf2fAgcU+0SNoj2zZNtHAvKeh 8EHqAy8m1J4AlQeO5nT9tJj/v1CM0q6cljzIfV8hWWgM/hL/vLc= =76m5 -----END PGP SIGNATURE----- Merge tag 'display-20250718-pull-request' of https://gitlab.com/kraxel/qemu into staging Load ramfb vgabios on x86 only. # -----BEGIN PGP SIGNATURE----- # # iQIzBAABCgAdFiEEoDKM/7k6F6eZAf59TLbY7tPocTgFAmh6o80ACgkQTLbY7tPo # cTjxPBAAktTXxFK6loSMSWC1ul8RCl/4F7G84J4eT+Ui8/KIG8do5KcebTnXb9zo # keOG7n9HPk4fROWiAFgGnuBfw41DWmLDS34iuENrG3X26TQgSSgBveuwas67Pzqu # HpaFSxjh7BRLlkUWaNoll57cDM3kKLmx+Onw6m/7kbcVXAsy1N4wxfCT1faUU7ID # R1ggULG1WhB8q+YtQjac6EfOpdHe1BTBGLuxSwE3mNkce9ZP7C8uxZTCR5PXggZi # IXzJzGpFRDCHqrilWksiE62yF20Kem4ZcpO/GgLWmF+X+DYBDEWcajihvF20TGUL # n6dyT7MBxuvqFy0OtBPHNcnq2PZzOIKyxyMvBg9402xeD6goNbFKloAYeae4C9u0 # QuqQUpb8D3lVagVu55N5XfpdMHR0P8yefPAjaFL4o3rf2JSjyI6MRX/+2eA7aXcX # xiwHSx3iavEeNQNsPZsS3JhH5bKy/zkWRiBd+msGVAYMZGzhdEtLg/w8yUd6dQ5p # /3Y3F4fL6T6QSwhsiihcbdPtjhfVCP09MYK/P4cIFbWOzjfbndt1/UIXHQ54s8Jo # PShcE7QH7ttT2gK5nFPG5yeTqF70kKpSyhwF2pukf2fAgcU+0SNoj2zZNtHAvKeh # 8EHqAy8m1J4AlQeO5nT9tJj/v1CM0q6cljzIfV8hWWgM/hL/vLc= # =76m5 # -----END PGP SIGNATURE----- # gpg: Signature made Fri 18 Jul 2025 15:43:09 EDT # gpg: using RSA key A0328CFFB93A17A79901FE7D4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full] # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" [full] # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full] # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * tag 'display-20250718-pull-request' of https://gitlab.com/kraxel/qemu: hw/i386: Add the ramfb romfile compatibility vfio: Move the TYPE_* to hw/vfio/types.h ramfb: Add property to control if load the romfile Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Conflicts: hw/core/machine.c Context conflict because the vfio-pci "x-migration-load-config-after-iter" was added recently.
This commit is contained in:
commit
ebcc602aae
12 changed files with 55 additions and 16 deletions
|
|
@ -40,6 +40,8 @@
|
|||
GlobalProperty hw_compat_10_0[] = {
|
||||
{ "scsi-hd", "dpofua", "off" },
|
||||
{ "vfio-pci", "x-migration-load-config-after-iter", "off" },
|
||||
{ "ramfb", "use-legacy-x86-rom", "true"},
|
||||
{ "vfio-pci", "use-legacy-x86-rom", "true" },
|
||||
};
|
||||
const size_t hw_compat_10_0_len = G_N_ELEMENTS(hw_compat_10_0);
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ struct RAMFBStandaloneState {
|
|||
QemuConsole *con;
|
||||
RAMFBState *state;
|
||||
bool migrate;
|
||||
bool use_legacy_x86_rom;
|
||||
};
|
||||
|
||||
static void display_update_wrapper(void *dev)
|
||||
|
|
@ -39,7 +40,7 @@ static void ramfb_realizefn(DeviceState *dev, Error **errp)
|
|||
RAMFBStandaloneState *ramfb = RAMFB(dev);
|
||||
|
||||
ramfb->con = graphic_console_init(dev, 0, &wrapper_ops, dev);
|
||||
ramfb->state = ramfb_setup(errp);
|
||||
ramfb->state = ramfb_setup(ramfb->use_legacy_x86_rom, errp);
|
||||
}
|
||||
|
||||
static bool migrate_needed(void *opaque)
|
||||
|
|
@ -62,6 +63,8 @@ static const VMStateDescription ramfb_dev_vmstate = {
|
|||
|
||||
static const Property ramfb_properties[] = {
|
||||
DEFINE_PROP_BOOL("x-migrate", RAMFBStandaloneState, migrate, true),
|
||||
DEFINE_PROP_BOOL("use-legacy-x86-rom", RAMFBStandaloneState,
|
||||
use_legacy_x86_rom, false),
|
||||
};
|
||||
|
||||
static void ramfb_class_initfn(ObjectClass *klass, const void *data)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ void ramfb_display_update(QemuConsole *con, RAMFBState *s)
|
|||
{
|
||||
}
|
||||
|
||||
RAMFBState *ramfb_setup(Error **errp)
|
||||
RAMFBState *ramfb_setup(bool romfile, Error **errp)
|
||||
{
|
||||
error_setg(errp, "ramfb support not available");
|
||||
return NULL;
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ const VMStateDescription ramfb_vmstate = {
|
|||
}
|
||||
};
|
||||
|
||||
RAMFBState *ramfb_setup(Error **errp)
|
||||
RAMFBState *ramfb_setup(bool romfile, Error **errp)
|
||||
{
|
||||
FWCfgState *fw_cfg = fw_cfg_find();
|
||||
RAMFBState *s;
|
||||
|
|
@ -147,7 +147,9 @@ RAMFBState *ramfb_setup(Error **errp)
|
|||
|
||||
s = g_new0(RAMFBState, 1);
|
||||
|
||||
rom_add_vga("vgabios-ramfb.bin");
|
||||
if (romfile) {
|
||||
rom_add_vga("vgabios-ramfb.bin");
|
||||
}
|
||||
fw_cfg_add_file_callback(fw_cfg, "etc/ramfb",
|
||||
NULL, ramfb_fw_cfg_write, s,
|
||||
&s->cfg, sizeof(s->cfg), false);
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@
|
|||
#include "hw/acpi/generic_event_device.h"
|
||||
#include "hw/pci-host/gpex.h"
|
||||
#include "hw/usb/xhci.h"
|
||||
#include "hw/vfio/types.h"
|
||||
|
||||
#include "elf.h"
|
||||
#include "kvm/kvm_i386.h"
|
||||
|
|
@ -633,6 +634,8 @@ GlobalProperty microvm_properties[] = {
|
|||
* so reserving io space is not going to work. Turn it off.
|
||||
*/
|
||||
{ "pcie-root-port", "io-reserve", "0" },
|
||||
{ TYPE_RAMFB_DEVICE, "use-legacy-x86-rom", "true" },
|
||||
{ TYPE_VFIO_PCI, "use-legacy-x86-rom", "true" },
|
||||
};
|
||||
|
||||
static void microvm_class_init(ObjectClass *oc, const void *data)
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@
|
|||
#include "hw/i2c/smbus_eeprom.h"
|
||||
#include "system/memory.h"
|
||||
#include "hw/acpi/acpi.h"
|
||||
#include "hw/vfio/types.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "system/xen.h"
|
||||
|
|
@ -77,6 +78,13 @@ static const int ide_iobase2[MAX_IDE_BUS] = { 0x3f6, 0x376 };
|
|||
static const int ide_irq[MAX_IDE_BUS] = { 14, 15 };
|
||||
#endif
|
||||
|
||||
static GlobalProperty pc_piix_compat_defaults[] = {
|
||||
{ TYPE_RAMFB_DEVICE, "use-legacy-x86-rom", "true" },
|
||||
{ TYPE_VFIO_PCI, "use-legacy-x86-rom", "true" },
|
||||
};
|
||||
static const size_t pc_piix_compat_defaults_len =
|
||||
G_N_ELEMENTS(pc_piix_compat_defaults);
|
||||
|
||||
/*
|
||||
* Return the global irq number corresponding to a given device irq
|
||||
* pin. We could also use the bus number to have a more precise mapping.
|
||||
|
|
@ -492,6 +500,8 @@ static void pc_i440fx_machine_options(MachineClass *m)
|
|||
pc_set_south_bridge);
|
||||
object_class_property_set_description(oc, "x-south-bridge",
|
||||
"Use a different south bridge than PIIX3");
|
||||
compat_props_add(m->compat_props,
|
||||
pc_piix_compat_defaults, pc_piix_compat_defaults_len);
|
||||
}
|
||||
|
||||
static void pc_i440fx_machine_10_1_options(MachineClass *m)
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@
|
|||
#include "hw/i386/pc.h"
|
||||
#include "hw/i386/amd_iommu.h"
|
||||
#include "hw/i386/intel_iommu.h"
|
||||
#include "hw/vfio/types.h"
|
||||
#include "hw/virtio/virtio-iommu.h"
|
||||
#include "hw/display/ramfb.h"
|
||||
#include "hw/ide/pci.h"
|
||||
|
|
@ -67,6 +68,8 @@
|
|||
|
||||
static GlobalProperty pc_q35_compat_defaults[] = {
|
||||
{ TYPE_VIRTIO_IOMMU_PCI, "aw-bits", "39" },
|
||||
{ TYPE_RAMFB_DEVICE, "use-legacy-x86-rom", "true" },
|
||||
{ TYPE_VFIO_PCI, "use-legacy-x86-rom", "true" },
|
||||
};
|
||||
static const size_t pc_q35_compat_defaults_len =
|
||||
G_N_ELEMENTS(pc_q35_compat_defaults);
|
||||
|
|
|
|||
|
|
@ -365,7 +365,7 @@ static bool vfio_display_dmabuf_init(VFIOPCIDevice *vdev, Error **errp)
|
|||
&vfio_display_dmabuf_ops,
|
||||
vdev);
|
||||
if (vdev->enable_ramfb) {
|
||||
vdev->dpy->ramfb = ramfb_setup(errp);
|
||||
vdev->dpy->ramfb = ramfb_setup(vdev->use_legacy_x86_rom, errp);
|
||||
if (!vdev->dpy->ramfb) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -494,7 +494,7 @@ static bool vfio_display_region_init(VFIOPCIDevice *vdev, Error **errp)
|
|||
&vfio_display_region_ops,
|
||||
vdev);
|
||||
if (vdev->enable_ramfb) {
|
||||
vdev->dpy->ramfb = ramfb_setup(errp);
|
||||
vdev->dpy->ramfb = ramfb_setup(vdev->use_legacy_x86_rom, errp);
|
||||
if (!vdev->dpy->ramfb) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3849,6 +3849,8 @@ static const TypeInfo vfio_pci_dev_info = {
|
|||
|
||||
static const Property vfio_pci_dev_nohotplug_properties[] = {
|
||||
DEFINE_PROP_BOOL("ramfb", VFIOPCIDevice, enable_ramfb, false),
|
||||
DEFINE_PROP_BOOL("use-legacy-x86-rom", VFIOPCIDevice,
|
||||
use_legacy_x86_rom, false),
|
||||
DEFINE_PROP_ON_OFF_AUTO("x-ramfb-migrate", VFIOPCIDevice, ramfb_migrate,
|
||||
ON_OFF_AUTO_AUTO),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
#include "system/memory.h"
|
||||
#include "hw/pci/pci_device.h"
|
||||
#include "hw/vfio/types.h"
|
||||
#include "hw/vfio/vfio-device.h"
|
||||
#include "hw/vfio/vfio-region.h"
|
||||
#include "qemu/event_notifier.h"
|
||||
|
|
@ -119,17 +120,8 @@ typedef struct VFIOMSIXInfo {
|
|||
MemoryRegion *pba_region;
|
||||
} VFIOMSIXInfo;
|
||||
|
||||
/*
|
||||
* TYPE_VFIO_PCI_BASE is an abstract type used to share code
|
||||
* between VFIO implementations that use a kernel driver
|
||||
* with those that use user sockets.
|
||||
*/
|
||||
#define TYPE_VFIO_PCI_BASE "vfio-pci-base"
|
||||
OBJECT_DECLARE_SIMPLE_TYPE(VFIOPCIDevice, VFIO_PCI_BASE)
|
||||
|
||||
#define TYPE_VFIO_PCI "vfio-pci"
|
||||
/* TYPE_VFIO_PCI shares struct VFIOPCIDevice. */
|
||||
|
||||
struct VFIOPCIDevice {
|
||||
PCIDevice pdev;
|
||||
VFIODevice vbasedev;
|
||||
|
|
@ -189,6 +181,7 @@ struct VFIOPCIDevice {
|
|||
bool no_kvm_ioeventfd;
|
||||
bool no_vfio_ioeventfd;
|
||||
bool enable_ramfb;
|
||||
bool use_legacy_x86_rom;
|
||||
OnOffAuto ramfb_migrate;
|
||||
bool defer_kvm_irq_routing;
|
||||
bool clear_parent_atomics_on_exit;
|
||||
|
|
|
|||
21
hw/vfio/types.h
Normal file
21
hw/vfio/types.h
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* VFIO types definition
|
||||
*
|
||||
* Copyright Red Hat, Inc. 2025
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
#ifndef HW_VFIO_VFIO_TYPES_H
|
||||
#define HW_VFIO_VFIO_TYPES_H
|
||||
|
||||
/*
|
||||
* TYPE_VFIO_PCI_BASE is an abstract type used to share code
|
||||
* between VFIO implementations that use a kernel driver
|
||||
* with those that use user sockets.
|
||||
*/
|
||||
#define TYPE_VFIO_PCI_BASE "vfio-pci-base"
|
||||
|
||||
#define TYPE_VFIO_PCI "vfio-pci"
|
||||
/* TYPE_VFIO_PCI shares struct VFIOPCIDevice. */
|
||||
|
||||
#endif /* HW_VFIO_VFIO_TYPES_H */
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
/* ramfb.c */
|
||||
typedef struct RAMFBState RAMFBState;
|
||||
void ramfb_display_update(QemuConsole *con, RAMFBState *s);
|
||||
RAMFBState *ramfb_setup(Error **errp);
|
||||
RAMFBState *ramfb_setup(bool romfile, Error **errp);
|
||||
|
||||
extern const VMStateDescription ramfb_vmstate;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue