thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone
586cba
From 51ec7495d69fe4b4d0b61642ca6c0e7fd7a1032d Mon Sep 17 00:00:00 2001
495e37
From: Miroslav Rezanina <mrezanin@redhat.com>
495e37
Date: Thu, 15 Jul 2021 03:22:36 -0400
495e37
Subject: Enable/disable devices for RHEL
495e37
495e37
This commit adds all changes related to changes in supported devices.
495e37
495e37
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
495e37
--
495e37
Rebase notes (6.1.0):
495e37
- Added CONFIG_TPM (except s390x)
495e37
- default-configs moved to configs
495e37
- Use --with-device-<ARCH> configure option to use rhel configs
495e37
586cba
Rebase notes (6.2.0):
495e37
- Add CONFIG_ISA_FDC
495e37
- Do not remove -no-hpet documentation
495e37
586cba
Rebase notes (7.0.0):
586cba
- Added CONFIG_ARM_GIC_TCG option for aarch64
586cba
- Fixes necessary for layout change fixes
586cba
- Renamed CONFIG_ARM_GIC_TCG to CONFIG_ARM_GICV3_TCG
586cba
- Removed upstream devices
586cba
495e37
Merged patches (6.1.0):
495e37
- c51bf45304 Remove SPICE and QXL from x86_64-rh-devices.mak
495e37
- 02fc745601 aarch64-rh-devices: add CONFIG_PVPANIC_PCI
495e37
- f2fe835153 aarch64-rh-devices: add CONFIG_PXB
495e37
- b5431733ad disable CONFIG_USB_STORAGE_BOT
495e37
- 478ba0cdf6 Disable TPM passthrough
495e37
- 2504d68a7c aarch64: Add USB storage devices
495e37
- 51c2a3253c disable ac97 audio
495e37
586cba
Merged patches (6.2.0):
495e37
- 9f2f9fa2ba disable sga device
586cba
586cba
Merged patches (7.0.0):
586cba
- fd7c45a5a8 redhat: Enable virtio-mem as tech-preview on x86-64
586cba
- c9e68ea451 Enable SGX -- RH Only
495e37
---
586cba
 .distro/qemu-kvm.spec.template                |  18 +--
586cba
 .../aarch64-softmmu/aarch64-rh-devices.mak    |  34 ++++++
495e37
 .../ppc64-softmmu/ppc64-rh-devices.mak        |  35 ++++++
495e37
 configs/devices/rh-virtio.mak                 |  10 ++
495e37
 .../s390x-softmmu/s390x-rh-devices.mak        |  15 +++
586cba
 .../x86_64-softmmu/x86_64-rh-devices.mak      | 103 ++++++++++++++++++
495e37
 hw/acpi/ich9.c                                |   4 +-
495e37
 hw/arm/meson.build                            |   2 +-
495e37
 hw/block/fdc.c                                |  10 ++
495e37
 hw/cpu/meson.build                            |   5 +-
586cba
 hw/display/cirrus_vga.c                       |   5 +-
495e37
 hw/ide/piix.c                                 |   5 +-
495e37
 hw/input/pckbd.c                              |   2 +
495e37
 hw/net/e1000.c                                |   2 +
495e37
 hw/ppc/spapr_cpu_core.c                       |   2 +
495e37
 hw/usb/meson.build                            |   2 +-
495e37
 target/arm/cpu_tcg.c                          |  10 ++
586cba
 target/ppc/cpu-models.c                       |   9 ++
495e37
 target/s390x/cpu_models_sysemu.c              |   3 +
495e37
 target/s390x/kvm/kvm.c                        |   8 ++
586cba
 20 files changed, 269 insertions(+), 15 deletions(-)
495e37
 create mode 100644 configs/devices/aarch64-softmmu/aarch64-rh-devices.mak
495e37
 create mode 100644 configs/devices/ppc64-softmmu/ppc64-rh-devices.mak
495e37
 create mode 100644 configs/devices/rh-virtio.mak
495e37
 create mode 100644 configs/devices/s390x-softmmu/s390x-rh-devices.mak
495e37
 create mode 100644 configs/devices/x86_64-softmmu/x86_64-rh-devices.mak
495e37
495e37
diff --git a/configs/devices/aarch64-softmmu/aarch64-rh-devices.mak b/configs/devices/aarch64-softmmu/aarch64-rh-devices.mak
495e37
new file mode 100644
586cba
index 0000000000..5f6ee1de5b
495e37
--- /dev/null
495e37
+++ b/configs/devices/aarch64-softmmu/aarch64-rh-devices.mak
586cba
@@ -0,0 +1,34 @@
495e37
+include ../rh-virtio.mak
495e37
+
495e37
+CONFIG_ARM_GIC_KVM=y
586cba
+CONFIG_ARM_GICV3_TCG=y
495e37
+CONFIG_ARM_GIC=y
495e37
+CONFIG_ARM_SMMUV3=y
495e37
+CONFIG_ARM_V7M=y
495e37
+CONFIG_ARM_VIRT=y
495e37
+CONFIG_EDID=y
495e37
+CONFIG_PCIE_PORT=y
495e37
+CONFIG_PCI_DEVICES=y
495e37
+CONFIG_PCI_TESTDEV=y
495e37
+CONFIG_PFLASH_CFI01=y
495e37
+CONFIG_SCSI=y
495e37
+CONFIG_SEMIHOSTING=y
495e37
+CONFIG_USB=y
495e37
+CONFIG_USB_XHCI=y
495e37
+CONFIG_USB_XHCI_PCI=y
495e37
+CONFIG_USB_STORAGE_CORE=y
495e37
+CONFIG_USB_STORAGE_CLASSIC=y
495e37
+CONFIG_VFIO=y
495e37
+CONFIG_VFIO_PCI=y
495e37
+CONFIG_VIRTIO_MMIO=y
495e37
+CONFIG_VIRTIO_PCI=y
495e37
+CONFIG_XIO3130=y
495e37
+CONFIG_NVDIMM=y
495e37
+CONFIG_ACPI_APEI=y
495e37
+CONFIG_TPM=y
495e37
+CONFIG_TPM_EMULATOR=y
495e37
+CONFIG_TPM_TIS_SYSBUS=y
495e37
+CONFIG_PTIMER=y
495e37
+CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y
495e37
+CONFIG_PVPANIC_PCI=y
495e37
+CONFIG_PXB=y
495e37
diff --git a/configs/devices/ppc64-softmmu/ppc64-rh-devices.mak b/configs/devices/ppc64-softmmu/ppc64-rh-devices.mak
495e37
new file mode 100644
495e37
index 0000000000..6a3e3f0227
495e37
--- /dev/null
495e37
+++ b/configs/devices/ppc64-softmmu/ppc64-rh-devices.mak
495e37
@@ -0,0 +1,35 @@
495e37
+include ../rh-virtio.mak
495e37
+
495e37
+CONFIG_DIMM=y
495e37
+CONFIG_MEM_DEVICE=y
495e37
+CONFIG_NVDIMM=y
495e37
+CONFIG_PCI=y
495e37
+CONFIG_PCI_DEVICES=y
495e37
+CONFIG_PCI_TESTDEV=y
495e37
+CONFIG_PCI_EXPRESS=y
495e37
+CONFIG_PSERIES=y
495e37
+CONFIG_SCSI=y
495e37
+CONFIG_SPAPR_VSCSI=y
495e37
+CONFIG_TEST_DEVICES=y
495e37
+CONFIG_USB=y
495e37
+CONFIG_USB_OHCI=y
495e37
+CONFIG_USB_OHCI_PCI=y
495e37
+CONFIG_USB_SMARTCARD=y
495e37
+CONFIG_USB_STORAGE_CORE=y
495e37
+CONFIG_USB_STORAGE_CLASSIC=y
495e37
+CONFIG_USB_XHCI=y
495e37
+CONFIG_USB_XHCI_NEC=y
495e37
+CONFIG_USB_XHCI_PCI=y
495e37
+CONFIG_VFIO=y
495e37
+CONFIG_VFIO_PCI=y
495e37
+CONFIG_VGA=y
495e37
+CONFIG_VGA_PCI=y
495e37
+CONFIG_VHOST_USER=y
495e37
+CONFIG_VIRTIO_PCI=y
495e37
+CONFIG_VIRTIO_VGA=y
495e37
+CONFIG_WDT_IB6300ESB=y
495e37
+CONFIG_XICS=y
495e37
+CONFIG_XIVE=y
495e37
+CONFIG_TPM=y
495e37
+CONFIG_TPM_SPAPR=y
495e37
+CONFIG_TPM_EMULATOR=y
495e37
diff --git a/configs/devices/rh-virtio.mak b/configs/devices/rh-virtio.mak
495e37
new file mode 100644
495e37
index 0000000000..94ede1b5f6
495e37
--- /dev/null
495e37
+++ b/configs/devices/rh-virtio.mak
495e37
@@ -0,0 +1,10 @@
495e37
+CONFIG_VIRTIO=y
495e37
+CONFIG_VIRTIO_BALLOON=y
495e37
+CONFIG_VIRTIO_BLK=y
495e37
+CONFIG_VIRTIO_GPU=y
495e37
+CONFIG_VIRTIO_INPUT=y
495e37
+CONFIG_VIRTIO_INPUT_HOST=y
495e37
+CONFIG_VIRTIO_NET=y
495e37
+CONFIG_VIRTIO_RNG=y
495e37
+CONFIG_VIRTIO_SCSI=y
495e37
+CONFIG_VIRTIO_SERIAL=y
495e37
diff --git a/configs/devices/s390x-softmmu/s390x-rh-devices.mak b/configs/devices/s390x-softmmu/s390x-rh-devices.mak
495e37
new file mode 100644
495e37
index 0000000000..d3b38312e1
495e37
--- /dev/null
495e37
+++ b/configs/devices/s390x-softmmu/s390x-rh-devices.mak
495e37
@@ -0,0 +1,15 @@
495e37
+include ../rh-virtio.mak
495e37
+
495e37
+CONFIG_PCI=y
495e37
+CONFIG_S390_CCW_VIRTIO=y
495e37
+CONFIG_S390_FLIC=y
495e37
+CONFIG_S390_FLIC_KVM=y
495e37
+CONFIG_SCLPCONSOLE=y
495e37
+CONFIG_SCSI=y
495e37
+CONFIG_VFIO=y
495e37
+CONFIG_VFIO_AP=y
495e37
+CONFIG_VFIO_CCW=y
495e37
+CONFIG_VFIO_PCI=y
495e37
+CONFIG_VHOST_USER=y
495e37
+CONFIG_VIRTIO_CCW=y
495e37
+CONFIG_WDT_DIAG288=y
495e37
diff --git a/configs/devices/x86_64-softmmu/x86_64-rh-devices.mak b/configs/devices/x86_64-softmmu/x86_64-rh-devices.mak
495e37
new file mode 100644
586cba
index 0000000000..d0c9e66641
495e37
--- /dev/null
495e37
+++ b/configs/devices/x86_64-softmmu/x86_64-rh-devices.mak
586cba
@@ -0,0 +1,103 @@
495e37
+include ../rh-virtio.mak
495e37
+
495e37
+CONFIG_ACPI=y
495e37
+CONFIG_ACPI_PCI=y
495e37
+CONFIG_ACPI_CPU_HOTPLUG=y
495e37
+CONFIG_ACPI_MEMORY_HOTPLUG=y
495e37
+CONFIG_ACPI_NVDIMM=y
495e37
+CONFIG_ACPI_SMBUS=y
495e37
+CONFIG_ACPI_VMGENID=y
495e37
+CONFIG_ACPI_X86=y
495e37
+CONFIG_ACPI_X86_ICH=y
495e37
+CONFIG_AHCI=y
495e37
+CONFIG_APIC=y
495e37
+CONFIG_APM=y
495e37
+CONFIG_BOCHS_DISPLAY=y
495e37
+CONFIG_DIMM=y
495e37
+CONFIG_E1000E_PCI_EXPRESS=y
495e37
+CONFIG_E1000_PCI=y
495e37
+CONFIG_EDU=y
495e37
+CONFIG_FDC=y
495e37
+CONFIG_FDC_SYSBUS=y
495e37
+CONFIG_FDC_ISA=y
495e37
+CONFIG_FW_CFG_DMA=y
495e37
+CONFIG_HDA=y
495e37
+CONFIG_HYPERV=y
495e37
+CONFIG_HYPERV_TESTDEV=y
495e37
+CONFIG_I2C=y
495e37
+CONFIG_I440FX=y
495e37
+CONFIG_I8254=y
495e37
+CONFIG_I8257=y
495e37
+CONFIG_I8259=y
495e37
+CONFIG_I82801B11=y
495e37
+CONFIG_IDE_CORE=y
495e37
+CONFIG_IDE_PCI=y
495e37
+CONFIG_IDE_PIIX=y
495e37
+CONFIG_IDE_QDEV=y
495e37
+CONFIG_IOAPIC=y
495e37
+CONFIG_IOH3420=y
495e37
+CONFIG_ISA_BUS=y
495e37
+CONFIG_ISA_DEBUG=y
495e37
+CONFIG_ISA_TESTDEV=y
495e37
+CONFIG_LPC_ICH9=y
495e37
+CONFIG_MC146818RTC=y
495e37
+CONFIG_MEM_DEVICE=y
495e37
+CONFIG_NVDIMM=y
495e37
+CONFIG_OPENGL=y
495e37
+CONFIG_PAM=y
495e37
+CONFIG_PC=y
495e37
+CONFIG_PCI=y
495e37
+CONFIG_PCIE_PORT=y
495e37
+CONFIG_PCI_DEVICES=y
495e37
+CONFIG_PCI_EXPRESS=y
495e37
+CONFIG_PCI_EXPRESS_Q35=y
495e37
+CONFIG_PCI_I440FX=y
495e37
+CONFIG_PCI_TESTDEV=y
495e37
+CONFIG_PCKBD=y
495e37
+CONFIG_PCSPK=y
495e37
+CONFIG_PC_ACPI=y
495e37
+CONFIG_PC_PCI=y
495e37
+CONFIG_PFLASH_CFI01=y
495e37
+CONFIG_PVPANIC_ISA=y
495e37
+CONFIG_PXB=y
495e37
+CONFIG_Q35=y
495e37
+CONFIG_RTL8139_PCI=y
495e37
+CONFIG_SCSI=y
495e37
+CONFIG_SERIAL=y
495e37
+CONFIG_SERIAL_ISA=y
495e37
+CONFIG_SERIAL_PCI=y
495e37
+CONFIG_SEV=y
495e37
+CONFIG_SMBIOS=y
495e37
+CONFIG_SMBUS_EEPROM=y
495e37
+CONFIG_TEST_DEVICES=y
495e37
+CONFIG_USB=y
495e37
+CONFIG_USB_EHCI=y
495e37
+CONFIG_USB_EHCI_PCI=y
495e37
+CONFIG_USB_SMARTCARD=y
495e37
+CONFIG_USB_STORAGE_CORE=y
495e37
+CONFIG_USB_STORAGE_CLASSIC=y
495e37
+CONFIG_USB_UHCI=y
495e37
+CONFIG_USB_XHCI=y
495e37
+CONFIG_USB_XHCI_NEC=y
495e37
+CONFIG_USB_XHCI_PCI=y
495e37
+CONFIG_VFIO=y
495e37
+CONFIG_VFIO_PCI=y
495e37
+CONFIG_VGA=y
495e37
+CONFIG_VGA_CIRRUS=y
495e37
+CONFIG_VGA_PCI=y
495e37
+CONFIG_VHOST_USER=y
495e37
+CONFIG_VHOST_USER_BLK=y
586cba
+CONFIG_VIRTIO_MEM=y
495e37
+CONFIG_VIRTIO_PCI=y
495e37
+CONFIG_VIRTIO_VGA=y
495e37
+CONFIG_VMMOUSE=y
495e37
+CONFIG_VMPORT=y
495e37
+CONFIG_VTD=y
495e37
+CONFIG_WDT_IB6300ESB=y
495e37
+CONFIG_WDT_IB700=y
495e37
+CONFIG_XIO3130=y
495e37
+CONFIG_TPM=y
495e37
+CONFIG_TPM_CRB=y
495e37
+CONFIG_TPM_TIS_ISA=y
495e37
+CONFIG_TPM_EMULATOR=y
586cba
+CONFIG_SGX=y
495e37
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
586cba
index bd9bbade70..de1e401cdf 100644
495e37
--- a/hw/acpi/ich9.c
495e37
+++ b/hw/acpi/ich9.c
586cba
@@ -435,8 +435,8 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm)
495e37
     static const uint32_t gpe0_len = ICH9_PMIO_GPE0_LEN;
495e37
     pm->acpi_memory_hotplug.is_enabled = true;
495e37
     pm->cpu_hotplug_legacy = true;
495e37
-    pm->disable_s3 = 0;
495e37
-    pm->disable_s4 = 0;
495e37
+    pm->disable_s3 = 1;
495e37
+    pm->disable_s4 = 1;
495e37
     pm->s4_val = 2;
495e37
     pm->use_acpi_hotplug_bridge = true;
495e37
     pm->keep_pci_slot_hpc = true;
495e37
diff --git a/hw/arm/meson.build b/hw/arm/meson.build
495e37
index 721a8eb8be..87ed4dd914 100644
495e37
--- a/hw/arm/meson.build
495e37
+++ b/hw/arm/meson.build
495e37
@@ -31,7 +31,7 @@ arm_ss.add(when: 'CONFIG_VEXPRESS', if_true: files('vexpress.c'))
495e37
 arm_ss.add(when: 'CONFIG_ZYNQ', if_true: files('xilinx_zynq.c'))
495e37
 arm_ss.add(when: 'CONFIG_SABRELITE', if_true: files('sabrelite.c'))
495e37
 
495e37
-arm_ss.add(when: 'CONFIG_ARM_V7M', if_true: files('armv7m.c'))
495e37
+#arm_ss.add(when: 'CONFIG_ARM_V7M', if_true: files('armv7m.c'))
495e37
 arm_ss.add(when: 'CONFIG_EXYNOS4', if_true: files('exynos4210.c'))
495e37
 arm_ss.add(when: 'CONFIG_PXA2XX', if_true: files('pxa2xx.c', 'pxa2xx_gpio.c', 'pxa2xx_pic.c'))
495e37
 arm_ss.add(when: 'CONFIG_DIGIC', if_true: files('digic.c'))
495e37
diff --git a/hw/block/fdc.c b/hw/block/fdc.c
586cba
index 347875a0cd..ca1776121f 100644
495e37
--- a/hw/block/fdc.c
495e37
+++ b/hw/block/fdc.c
586cba
@@ -49,6 +49,8 @@
495e37
 #include "qom/object.h"
495e37
 #include "fdc-internal.h"
495e37
 
495e37
+#include "hw/boards.h"
495e37
+
495e37
 /********************************************************/
495e37
 /* debug Floppy devices */
495e37
 
586cba
@@ -2338,6 +2340,14 @@ void fdctrl_realize_common(DeviceState *dev, FDCtrl *fdctrl, Error **errp)
495e37
     FDrive *drive;
495e37
     static int command_tables_inited = 0;
495e37
 
495e37
+    /* Restricted for Red Hat Enterprise Linux: */
495e37
+    MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine());
495e37
+    if (!strstr(mc->name, "-rhel7.")) {
495e37
+        error_setg(errp, "Device %s is not supported with machine type %s",
495e37
+                   object_get_typename(OBJECT(dev)), mc->name);
495e37
+        return;
495e37
+    }
495e37
+
495e37
     if (fdctrl->fallback == FLOPPY_DRIVE_TYPE_AUTO) {
495e37
         error_setg(errp, "Cannot choose a fallback FDrive type of 'auto'");
495e37
         return;
495e37
diff --git a/hw/cpu/meson.build b/hw/cpu/meson.build
495e37
index 9e52fee9e7..bb71c9f3e7 100644
495e37
--- a/hw/cpu/meson.build
495e37
+++ b/hw/cpu/meson.build
495e37
@@ -1,6 +1,7 @@
495e37
-softmmu_ss.add(files('core.c', 'cluster.c'))
495e37
+#softmmu_ss.add(files('core.c', 'cluster.c'))
495e37
+softmmu_ss.add(files('core.c'))
495e37
 
495e37
 specific_ss.add(when: 'CONFIG_ARM11MPCORE', if_true: files('arm11mpcore.c'))
495e37
 specific_ss.add(when: 'CONFIG_REALVIEW', if_true: files('realview_mpcore.c'))
495e37
 specific_ss.add(when: 'CONFIG_A9MPCORE', if_true: files('a9mpcore.c'))
495e37
-specific_ss.add(when: 'CONFIG_A15MPCORE', if_true: files('a15mpcore.c'))
495e37
+#specific_ss.add(when: 'CONFIG_A15MPCORE', if_true: files('a15mpcore.c'))
495e37
diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
586cba
index 3bb6a58698..6447fdb02e 100644
495e37
--- a/hw/display/cirrus_vga.c
495e37
+++ b/hw/display/cirrus_vga.c
586cba
@@ -2945,7 +2945,10 @@ static void pci_cirrus_vga_realize(PCIDevice *dev, Error **errp)
586cba
     PCIDeviceClass *pc = PCI_DEVICE_GET_CLASS(dev);
586cba
     int16_t device_id = pc->device_id;
495e37
 
586cba
-    /*
495e37
+     warn_report("'cirrus-vga' is deprecated, "
495e37
+                 "please use a different VGA card instead");
495e37
+
586cba
+     /*
586cba
      * Follow real hardware, cirrus card emulated has 4 MB video memory.
586cba
      * Also accept 8 MB/16 MB for backward compatibility.
586cba
      */
495e37
diff --git a/hw/ide/piix.c b/hw/ide/piix.c
495e37
index ce89fd0aa3..fbcf802b13 100644
495e37
--- a/hw/ide/piix.c
495e37
+++ b/hw/ide/piix.c
495e37
@@ -232,7 +232,8 @@ static void piix3_ide_class_init(ObjectClass *klass, void *data)
495e37
     k->device_id = PCI_DEVICE_ID_INTEL_82371SB_1;
495e37
     k->class_id = PCI_CLASS_STORAGE_IDE;
495e37
     set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
495e37
-    dc->hotpluggable = false;
495e37
+    /* Disabled for Red Hat Enterprise Linux: */
495e37
+    dc->user_creatable = false;
495e37
 }
495e37
 
495e37
 static const TypeInfo piix3_ide_info = {
495e37
@@ -261,6 +262,8 @@ static void piix4_ide_class_init(ObjectClass *klass, void *data)
495e37
     k->class_id = PCI_CLASS_STORAGE_IDE;
495e37
     set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
495e37
     dc->hotpluggable = false;
495e37
+    /* Disabled for Red Hat Enterprise Linux: */
495e37
+    dc->user_creatable = false;
495e37
 }
495e37
 
495e37
 static const TypeInfo piix4_ide_info = {
495e37
diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c
586cba
index 4efdf75620..5143ebaa27 100644
495e37
--- a/hw/input/pckbd.c
495e37
+++ b/hw/input/pckbd.c
586cba
@@ -814,6 +814,8 @@ static void i8042_class_initfn(ObjectClass *klass, void *data)
495e37
     dc->vmsd = &vmstate_kbd_isa;
495e37
     isa->build_aml = i8042_build_aml;
495e37
     set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
495e37
+    /* Disabled for Red Hat Enterprise Linux: */
495e37
+    dc->user_creatable = false;
495e37
 }
495e37
 
495e37
 static const TypeInfo i8042_info = {
495e37
diff --git a/hw/net/e1000.c b/hw/net/e1000.c
495e37
index f5bc81296d..282d01e374 100644
495e37
--- a/hw/net/e1000.c
495e37
+++ b/hw/net/e1000.c
495e37
@@ -1821,6 +1821,7 @@ static const E1000Info e1000_devices[] = {
495e37
         .revision  = 0x03,
495e37
         .phy_id2   = E1000_PHY_ID2_8254xx_DEFAULT,
495e37
     },
495e37
+#if 0 /* Disabled for Red Hat Enterprise Linux 7 */
495e37
     {
495e37
         .name      = "e1000-82544gc",
495e37
         .device_id = E1000_DEV_ID_82544GC_COPPER,
495e37
@@ -1833,6 +1834,7 @@ static const E1000Info e1000_devices[] = {
495e37
         .revision  = 0x03,
495e37
         .phy_id2   = E1000_PHY_ID2_8254xx_DEFAULT,
495e37
     },
495e37
+#endif
495e37
 };
495e37
 
495e37
 static void e1000_register_types(void)
495e37
diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
586cba
index 8a4861f45a..fcb5dfe792 100644
495e37
--- a/hw/ppc/spapr_cpu_core.c
495e37
+++ b/hw/ppc/spapr_cpu_core.c
586cba
@@ -379,10 +379,12 @@ static const TypeInfo spapr_cpu_core_type_infos[] = {
495e37
         .instance_size = sizeof(SpaprCpuCore),
495e37
         .class_size = sizeof(SpaprCpuCoreClass),
495e37
     },
495e37
+#if 0  /* Disabled for Red Hat Enterprise Linux */
495e37
     DEFINE_SPAPR_CPU_CORE_TYPE("970_v2.2"),
495e37
     DEFINE_SPAPR_CPU_CORE_TYPE("970mp_v1.0"),
495e37
     DEFINE_SPAPR_CPU_CORE_TYPE("970mp_v1.1"),
495e37
     DEFINE_SPAPR_CPU_CORE_TYPE("power5+_v2.1"),
495e37
+#endif
495e37
     DEFINE_SPAPR_CPU_CORE_TYPE("power7_v2.3"),
495e37
     DEFINE_SPAPR_CPU_CORE_TYPE("power7+_v2.1"),
495e37
     DEFINE_SPAPR_CPU_CORE_TYPE("power8_v2.0"),
495e37
diff --git a/hw/usb/meson.build b/hw/usb/meson.build
495e37
index de853d780d..0776ae6a20 100644
495e37
--- a/hw/usb/meson.build
495e37
+++ b/hw/usb/meson.build
495e37
@@ -52,7 +52,7 @@ softmmu_ss.add(when: 'CONFIG_USB_SMARTCARD', if_true: files('dev-smartcard-reade
495e37
 if cacard.found()
495e37
   usbsmartcard_ss = ss.source_set()
495e37
   usbsmartcard_ss.add(when: 'CONFIG_USB_SMARTCARD',
495e37
-                      if_true: [cacard, files('ccid-card-emulated.c', 'ccid-card-passthru.c')])
495e37
+                      if_true: [cacard, files('ccid-card-passthru.c')])
495e37
   hw_usb_modules += {'smartcard': usbsmartcard_ss}
495e37
 endif
495e37
 
495e37
diff --git a/target/arm/cpu_tcg.c b/target/arm/cpu_tcg.c
495e37
index 13d0e9b195..3826fa5122 100644
495e37
--- a/target/arm/cpu_tcg.c
495e37
+++ b/target/arm/cpu_tcg.c
495e37
@@ -22,6 +22,7 @@
495e37
 /* CPU models. These are not needed for the AArch64 linux-user build. */
495e37
 #if !defined(CONFIG_USER_ONLY) || !defined(TARGET_AARCH64)
495e37
 
495e37
+#if 0 /* Disabled for Red Hat Enterprise Linux */
495e37
 #if !defined(CONFIG_USER_ONLY) && defined(CONFIG_TCG)
495e37
 static bool arm_v7m_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
495e37
 {
495e37
@@ -375,6 +376,7 @@ static void cortex_a9_initfn(Object *obj)
495e37
     cpu->ccsidr[1] = 0x200fe019; /* 16k L1 icache. */
495e37
     define_arm_cp_regs(cpu, cortexa9_cp_reginfo);
495e37
 }
495e37
+#endif /* disabled for RHEL */
495e37
 
495e37
 #ifndef CONFIG_USER_ONLY
495e37
 static uint64_t a15_l2ctlr_read(CPUARMState *env, const ARMCPRegInfo *ri)
495e37
@@ -400,6 +402,7 @@ static const ARMCPRegInfo cortexa15_cp_reginfo[] = {
495e37
     REGINFO_SENTINEL
495e37
 };
495e37
 
495e37
+#if 0 /* Disabled for Red Hat Enterprise Linux */
495e37
 static void cortex_a7_initfn(Object *obj)
495e37
 {
495e37
     ARMCPU *cpu = ARM_CPU(obj);
495e37
@@ -445,6 +448,7 @@ static void cortex_a7_initfn(Object *obj)
495e37
     cpu->ccsidr[2] = 0x711fe07a; /* 4096K L2 unified cache */
495e37
     define_arm_cp_regs(cpu, cortexa15_cp_reginfo); /* Same as A15 */
495e37
 }
495e37
+#endif /* disabled for RHEL */
495e37
 
495e37
 static void cortex_a15_initfn(Object *obj)
495e37
 {
495e37
@@ -488,6 +492,7 @@ static void cortex_a15_initfn(Object *obj)
495e37
     define_arm_cp_regs(cpu, cortexa15_cp_reginfo);
495e37
 }
495e37
 
495e37
+#if 0 /* Disabled for Red Hat Enterprise Linux */
495e37
 static void cortex_m0_initfn(Object *obj)
495e37
 {
495e37
     ARMCPU *cpu = ARM_CPU(obj);
495e37
@@ -928,6 +933,7 @@ static void arm_v7m_class_init(ObjectClass *oc, void *data)
495e37
 
495e37
     cc->gdb_core_xml_file = "arm-m-profile.xml";
495e37
 }
495e37
+#endif /* disabled for RHEL */
495e37
 
495e37
 #ifndef TARGET_AARCH64
495e37
 /*
495e37
@@ -1007,6 +1013,7 @@ static void arm_max_initfn(Object *obj)
495e37
 #endif /* !TARGET_AARCH64 */
495e37
 
495e37
 static const ARMCPUInfo arm_tcg_cpus[] = {
495e37
+#if 0 /* Disabled for Red Hat Enterprise Linux */
495e37
     { .name = "arm926",      .initfn = arm926_initfn },
495e37
     { .name = "arm946",      .initfn = arm946_initfn },
495e37
     { .name = "arm1026",     .initfn = arm1026_initfn },
495e37
@@ -1022,7 +1029,9 @@ static const ARMCPUInfo arm_tcg_cpus[] = {
495e37
     { .name = "cortex-a7",   .initfn = cortex_a7_initfn },
495e37
     { .name = "cortex-a8",   .initfn = cortex_a8_initfn },
495e37
     { .name = "cortex-a9",   .initfn = cortex_a9_initfn },
495e37
+#endif /* disabled for RHEL */
495e37
     { .name = "cortex-a15",  .initfn = cortex_a15_initfn },
495e37
+#if 0 /* Disabled for Red Hat Enterprise Linux */
495e37
     { .name = "cortex-m0",   .initfn = cortex_m0_initfn,
495e37
                              .class_init = arm_v7m_class_init },
495e37
     { .name = "cortex-m3",   .initfn = cortex_m3_initfn,
495e37
@@ -1053,6 +1062,7 @@ static const ARMCPUInfo arm_tcg_cpus[] = {
495e37
     { .name = "pxa270-b1",   .initfn = pxa270b1_initfn },
495e37
     { .name = "pxa270-c0",   .initfn = pxa270c0_initfn },
495e37
     { .name = "pxa270-c5",   .initfn = pxa270c5_initfn },
495e37
+#endif /* disabled for RHEL */
495e37
 #ifndef TARGET_AARCH64
495e37
     { .name = "max",         .initfn = arm_max_initfn },
495e37
 #endif
495e37
diff --git a/target/ppc/cpu-models.c b/target/ppc/cpu-models.c
586cba
index 976be5e0d1..dd78883410 100644
495e37
--- a/target/ppc/cpu-models.c
495e37
+++ b/target/ppc/cpu-models.c
495e37
@@ -66,6 +66,7 @@
495e37
 #define POWERPC_DEF(_name, _pvr, _type, _desc)                              \
495e37
     POWERPC_DEF_SVR(_name, _desc, _pvr, POWERPC_SVR_NONE, _type)
495e37
 
495e37
+#if 0  /* Embedded and 32-bit CPUs disabled for Red Hat Enterprise Linux */
495e37
     /* Embedded PowerPC                                                      */
586cba
     /* PowerPC 405 family                                                    */
586cba
     /* PowerPC 405 cores                                                     */
586cba
@@ -698,8 +699,10 @@
495e37
                 "PowerPC 7447A v1.2 (G4)")
495e37
     POWERPC_DEF("7457a_v1.2",    CPU_POWERPC_74x7A_v12,              7455,
495e37
                 "PowerPC 7457A v1.2 (G4)")
495e37
+#endif
495e37
     /* 64 bits PowerPC                                                       */
495e37
 #if defined(TARGET_PPC64)
495e37
+#if 0  /* Disabled for Red Hat Enterprise Linux */
495e37
     POWERPC_DEF("970_v2.2",      CPU_POWERPC_970_v22,                970,
495e37
                 "PowerPC 970 v2.2")
495e37
     POWERPC_DEF("970fx_v1.0",    CPU_POWERPC_970FX_v10,              970,
586cba
@@ -718,6 +721,7 @@
495e37
                 "PowerPC 970MP v1.1")
495e37
     POWERPC_DEF("power5+_v2.1",  CPU_POWERPC_POWER5P_v21,            POWER5P,
495e37
                 "POWER5+ v2.1")
495e37
+#endif
495e37
     POWERPC_DEF("power7_v2.3",   CPU_POWERPC_POWER7_v23,             POWER7,
495e37
                 "POWER7 v2.3")
495e37
     POWERPC_DEF("power7+_v2.1",  CPU_POWERPC_POWER7P_v21,            POWER7,
586cba
@@ -897,12 +901,15 @@ PowerPCCPUAlias ppc_cpu_aliases[] = {
495e37
     { "7447a", "7447a_v1.2" },
495e37
     { "7457a", "7457a_v1.2" },
495e37
     { "apollo7pm", "7457a_v1.0" },
495e37
+#endif
495e37
 #if defined(TARGET_PPC64)
495e37
+#if 0  /* Disabled for Red Hat Enterprise Linux */
495e37
     { "970", "970_v2.2" },
495e37
     { "970fx", "970fx_v3.1" },
495e37
     { "970mp", "970mp_v1.1" },
495e37
     { "power5+", "power5+_v2.1" },
495e37
     { "power5gs", "power5+_v2.1" },
495e37
+#endif
495e37
     { "power7", "power7_v2.3" },
495e37
     { "power7+", "power7+_v2.1" },
495e37
     { "power8e", "power8e_v2.1" },
586cba
@@ -912,6 +919,7 @@ PowerPCCPUAlias ppc_cpu_aliases[] = {
495e37
     { "power10", "power10_v2.0" },
495e37
 #endif
495e37
 
495e37
+#if 0  /* Disabled for Red Hat Enterprise Linux */
495e37
     /* Generic PowerPCs */
495e37
 #if defined(TARGET_PPC64)
495e37
     { "ppc64", "970fx_v3.1" },
586cba
@@ -919,5 +927,6 @@ PowerPCCPUAlias ppc_cpu_aliases[] = {
495e37
     { "ppc32", "604" },
495e37
     { "ppc", "604" },
495e37
     { "default", "604" },
495e37
+#endif
495e37
     { NULL, NULL }
495e37
 };
495e37
diff --git a/target/s390x/cpu_models_sysemu.c b/target/s390x/cpu_models_sysemu.c
495e37
index 05c3ccaaff..6a04ccab1b 100644
495e37
--- a/target/s390x/cpu_models_sysemu.c
495e37
+++ b/target/s390x/cpu_models_sysemu.c
495e37
@@ -36,6 +36,9 @@ static void check_unavailable_features(const S390CPUModel *max_model,
495e37
         (max_model->def->gen == model->def->gen &&
495e37
          max_model->def->ec_ga < model->def->ec_ga)) {
495e37
         list_add_feat("type", unavailable);
495e37
+    } else if (model->def->gen < 11 && kvm_enabled()) {
495e37
+        /* Older CPU models are not supported on Red Hat Enterprise Linux */
495e37
+        list_add_feat("type", unavailable);
495e37
     }
495e37
 
495e37
     /* detect missing features if any to properly report them */
495e37
diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c
586cba
index 6acf14d5ec..74f089d87f 100644
495e37
--- a/target/s390x/kvm/kvm.c
495e37
+++ b/target/s390x/kvm/kvm.c
586cba
@@ -2512,6 +2512,14 @@ void kvm_s390_apply_cpu_model(const S390CPUModel *model, Error **errp)
495e37
         error_setg(errp, "KVM doesn't support CPU models");
495e37
         return;
495e37
     }
495e37
+
495e37
+    /* Older CPU models are not supported on Red Hat Enterprise Linux */
495e37
+    if (model->def->gen < 11) {
495e37
+        error_setg(errp, "KVM: Unsupported CPU type specified: %s",
495e37
+                   MACHINE(qdev_get_machine())->cpu_type);
495e37
+        return;
495e37
+    }
495e37
+
495e37
     prop.cpuid = s390_cpuid_from_cpu_model(model);
495e37
     prop.ibc = s390_ibc_from_cpu_model(model);
495e37
     /* configure cpu features indicated via STFL(e) */
495e37
-- 
586cba
2.31.1
495e37