yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
a83cc2
From f46ca4c7e719e0a70f8e0ffe3de882c017c216e7 Mon Sep 17 00:00:00 2001
a83cc2
From: Miroslav Rezanina <mrezanin@redhat.com>
a83cc2
Date: Wed, 2 Sep 2020 09:11:07 +0200
a83cc2
Subject: Enable/disable devices for RHEL
a83cc2
a83cc2
This commit adds all changes related to changes in supported devices.
a83cc2
a83cc2
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
a83cc2
---
a83cc2
 .../devices/aarch64-rh-devices.mak            |  28 +++++
a83cc2
 default-configs/devices/aarch64-softmmu.mak   |  10 +-
a83cc2
 default-configs/devices/ppc64-rh-devices.mak  |  36 ++++++
a83cc2
 default-configs/devices/ppc64-softmmu.mak     |  10 +-
a83cc2
 default-configs/devices/rh-virtio.mak         |  10 ++
a83cc2
 default-configs/devices/s390x-rh-devices.mak  |  16 +++
a83cc2
 default-configs/devices/s390x-softmmu.mak     |   4 +-
a83cc2
 default-configs/devices/x86_64-rh-devices.mak | 104 ++++++++++++++++++
a83cc2
 default-configs/devices/x86_64-softmmu.mak    |  10 +-
a83cc2
 .../devices/x86_64-upstream-devices.mak       |   4 +
a83cc2
 hw/acpi/ich9.c                                |   4 +-
a83cc2
 hw/arm/meson.build                            |   2 +-
a83cc2
 hw/block/fdc.c                                |  10 ++
a83cc2
 hw/char/parallel.c                            |   9 ++
a83cc2
 hw/cpu/meson.build                            |   5 +-
a83cc2
 hw/display/cirrus_vga.c                       |   3 +
a83cc2
 hw/ide/piix.c                                 |   5 +-
a83cc2
 hw/input/pckbd.c                              |   2 +
a83cc2
 hw/net/e1000.c                                |   2 +
a83cc2
 hw/ppc/spapr_cpu_core.c                       |   2 +
a83cc2
 hw/timer/hpet.c                               |   8 ++
a83cc2
 hw/usb/meson.build                            |   2 +-
a83cc2
 qemu-options.hx                               |   4 -
a83cc2
 redhat/qemu-kvm.spec.template                 |   5 +-
a83cc2
 target/arm/cpu_tcg.c                          |  10 ++
a83cc2
 target/ppc/cpu-models.c                       |  10 ++
a83cc2
 target/s390x/cpu_models.c                     |   3 +
a83cc2
 target/s390x/kvm.c                            |   8 ++
a83cc2
 28 files changed, 304 insertions(+), 22 deletions(-)
a83cc2
 create mode 100644 default-configs/devices/aarch64-rh-devices.mak
a83cc2
 create mode 100644 default-configs/devices/ppc64-rh-devices.mak
a83cc2
 create mode 100644 default-configs/devices/rh-virtio.mak
a83cc2
 create mode 100644 default-configs/devices/s390x-rh-devices.mak
a83cc2
 create mode 100644 default-configs/devices/x86_64-rh-devices.mak
a83cc2
 create mode 100644 default-configs/devices/x86_64-upstream-devices.mak
a83cc2
a83cc2
diff --git a/default-configs/devices/aarch64-rh-devices.mak b/default-configs/devices/aarch64-rh-devices.mak
a83cc2
new file mode 100644
a83cc2
index 0000000000..a4d67274c0
a83cc2
--- /dev/null
a83cc2
+++ b/default-configs/devices/aarch64-rh-devices.mak
a83cc2
@@ -0,0 +1,28 @@
a83cc2
+include rh-virtio.mak
a83cc2
+
a83cc2
+CONFIG_ARM_GIC_KVM=y
a83cc2
+CONFIG_ARM_GIC=y
a83cc2
+CONFIG_ARM_SMMUV3=y
a83cc2
+CONFIG_ARM_V7M=y
a83cc2
+CONFIG_ARM_VIRT=y
a83cc2
+CONFIG_EDID=y
a83cc2
+CONFIG_PCIE_PORT=y
a83cc2
+CONFIG_PCI_DEVICES=y
a83cc2
+CONFIG_PCI_TESTDEV=y
a83cc2
+CONFIG_PFLASH_CFI01=y
a83cc2
+CONFIG_SCSI=y
a83cc2
+CONFIG_SEMIHOSTING=y
a83cc2
+CONFIG_USB=y
a83cc2
+CONFIG_USB_XHCI=y
a83cc2
+CONFIG_USB_XHCI_PCI=y
a83cc2
+CONFIG_VFIO=y
a83cc2
+CONFIG_VFIO_PCI=y
a83cc2
+CONFIG_VIRTIO_MMIO=y
a83cc2
+CONFIG_VIRTIO_PCI=y
a83cc2
+CONFIG_XIO3130=y
a83cc2
+CONFIG_NVDIMM=y
a83cc2
+CONFIG_ACPI_APEI=y
a83cc2
+CONFIG_TPM_EMULATOR=y
a83cc2
+CONFIG_TPM_TIS_SYSBUS=y
a83cc2
+CONFIG_PTIMER=y
a83cc2
+CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y
a83cc2
diff --git a/default-configs/devices/aarch64-softmmu.mak b/default-configs/devices/aarch64-softmmu.mak
a83cc2
index 958b1e08e4..8f6867d48a 100644
a83cc2
--- a/default-configs/devices/aarch64-softmmu.mak
a83cc2
+++ b/default-configs/devices/aarch64-softmmu.mak
a83cc2
@@ -1,8 +1,10 @@
a83cc2
 # Default configuration for aarch64-softmmu
a83cc2
 
a83cc2
 # We support all the 32 bit boards so need all their config
a83cc2
-include arm-softmmu.mak
a83cc2
+#include arm-softmmu.mak
a83cc2
 
a83cc2
-CONFIG_XLNX_ZYNQMP_ARM=y
a83cc2
-CONFIG_XLNX_VERSAL=y
a83cc2
-CONFIG_SBSA_REF=y
a83cc2
+#CONFIG_XLNX_ZYNQMP_ARM=y
a83cc2
+#CONFIG_XLNX_VERSAL=y
a83cc2
+#CONFIG_SBSA_REF=y
a83cc2
+
a83cc2
+include aarch64-rh-devices.mak
a83cc2
diff --git a/default-configs/devices/ppc64-rh-devices.mak b/default-configs/devices/ppc64-rh-devices.mak
a83cc2
new file mode 100644
a83cc2
index 0000000000..5b01b7fac0
a83cc2
--- /dev/null
a83cc2
+++ b/default-configs/devices/ppc64-rh-devices.mak
a83cc2
@@ -0,0 +1,36 @@
a83cc2
+include rh-virtio.mak
a83cc2
+
a83cc2
+CONFIG_DIMM=y
a83cc2
+CONFIG_MEM_DEVICE=y
a83cc2
+CONFIG_NVDIMM=y
a83cc2
+CONFIG_PCI=y
a83cc2
+CONFIG_PCI_DEVICES=y
a83cc2
+CONFIG_PCI_TESTDEV=y
a83cc2
+CONFIG_PCI_EXPRESS=y
a83cc2
+CONFIG_PSERIES=y
a83cc2
+CONFIG_SCSI=y
a83cc2
+CONFIG_SPAPR_VSCSI=y
a83cc2
+CONFIG_TEST_DEVICES=y
a83cc2
+CONFIG_USB=y
a83cc2
+CONFIG_USB_OHCI=y
a83cc2
+CONFIG_USB_OHCI_PCI=y
a83cc2
+CONFIG_USB_SMARTCARD=y
a83cc2
+CONFIG_USB_STORAGE_BOT=y
a83cc2
+CONFIG_USB_STORAGE_CORE=y
a83cc2
+CONFIG_USB_STORAGE_CLASSIC=y
a83cc2
+CONFIG_USB_XHCI=y
a83cc2
+CONFIG_USB_XHCI_NEC=y
a83cc2
+CONFIG_USB_XHCI_PCI=y
a83cc2
+CONFIG_VFIO=y
a83cc2
+CONFIG_VFIO_PCI=y
a83cc2
+CONFIG_VGA=y
a83cc2
+CONFIG_VGA_PCI=y
a83cc2
+CONFIG_VHOST_USER=y
a83cc2
+CONFIG_VIRTIO_PCI=y
a83cc2
+CONFIG_VIRTIO_VGA=y
a83cc2
+CONFIG_WDT_IB6300ESB=y
a83cc2
+CONFIG_XICS=y
a83cc2
+CONFIG_XIVE=y
a83cc2
+CONFIG_TPM_SPAPR=y
a83cc2
+CONFIG_TPM_EMULATOR=y
a83cc2
+CONFIG_TPM_PASSTHROUGH=y
a83cc2
diff --git a/default-configs/devices/ppc64-softmmu.mak b/default-configs/devices/ppc64-softmmu.mak
a83cc2
index ae0841fa3a..040e5575e7 100644
a83cc2
--- a/default-configs/devices/ppc64-softmmu.mak
a83cc2
+++ b/default-configs/devices/ppc64-softmmu.mak
a83cc2
@@ -1,11 +1,13 @@
a83cc2
 # Default configuration for ppc64-softmmu
a83cc2
 
a83cc2
 # Include all 32-bit boards
a83cc2
-include ppc-softmmu.mak
a83cc2
+#include ppc-softmmu.mak
a83cc2
 
a83cc2
 # For PowerNV
a83cc2
-CONFIG_POWERNV=y
a83cc2
+#CONFIG_POWERNV=y
a83cc2
 
a83cc2
 # For pSeries
a83cc2
-CONFIG_PSERIES=y
a83cc2
-CONFIG_NVDIMM=y
a83cc2
+#CONFIG_PSERIES=y
a83cc2
+#CONFIG_NVDIMM=y
a83cc2
+
a83cc2
+include ppc64-rh-devices.mak
a83cc2
diff --git a/default-configs/devices/rh-virtio.mak b/default-configs/devices/rh-virtio.mak
a83cc2
new file mode 100644
a83cc2
index 0000000000..94ede1b5f6
a83cc2
--- /dev/null
a83cc2
+++ b/default-configs/devices/rh-virtio.mak
a83cc2
@@ -0,0 +1,10 @@
a83cc2
+CONFIG_VIRTIO=y
a83cc2
+CONFIG_VIRTIO_BALLOON=y
a83cc2
+CONFIG_VIRTIO_BLK=y
a83cc2
+CONFIG_VIRTIO_GPU=y
a83cc2
+CONFIG_VIRTIO_INPUT=y
a83cc2
+CONFIG_VIRTIO_INPUT_HOST=y
a83cc2
+CONFIG_VIRTIO_NET=y
a83cc2
+CONFIG_VIRTIO_RNG=y
a83cc2
+CONFIG_VIRTIO_SCSI=y
a83cc2
+CONFIG_VIRTIO_SERIAL=y
a83cc2
diff --git a/default-configs/devices/s390x-rh-devices.mak b/default-configs/devices/s390x-rh-devices.mak
a83cc2
new file mode 100644
a83cc2
index 0000000000..08a15f3e01
a83cc2
--- /dev/null
a83cc2
+++ b/default-configs/devices/s390x-rh-devices.mak
a83cc2
@@ -0,0 +1,16 @@
a83cc2
+include rh-virtio.mak
a83cc2
+
a83cc2
+CONFIG_PCI=y
a83cc2
+CONFIG_S390_CCW_VIRTIO=y
a83cc2
+CONFIG_S390_FLIC=y
a83cc2
+CONFIG_S390_FLIC_KVM=y
a83cc2
+CONFIG_SCLPCONSOLE=y
a83cc2
+CONFIG_SCSI=y
a83cc2
+CONFIG_TERMINAL3270=y
a83cc2
+CONFIG_VFIO=y
a83cc2
+CONFIG_VFIO_AP=y
a83cc2
+CONFIG_VFIO_CCW=y
a83cc2
+CONFIG_VFIO_PCI=y
a83cc2
+CONFIG_VHOST_USER=y
a83cc2
+CONFIG_VIRTIO_CCW=y
a83cc2
+CONFIG_WDT_DIAG288=y
a83cc2
diff --git a/default-configs/devices/s390x-softmmu.mak b/default-configs/devices/s390x-softmmu.mak
a83cc2
index f2287a133f..3e2e388e91 100644
a83cc2
--- a/default-configs/devices/s390x-softmmu.mak
a83cc2
+++ b/default-configs/devices/s390x-softmmu.mak
a83cc2
@@ -10,4 +10,6 @@
a83cc2
 
a83cc2
 # Boards:
a83cc2
 #
a83cc2
-CONFIG_S390_CCW_VIRTIO=y
a83cc2
+#CONFIG_S390_CCW_VIRTIO=y
a83cc2
+
a83cc2
+include s390x-rh-devices.mak
a83cc2
diff --git a/default-configs/devices/x86_64-rh-devices.mak b/default-configs/devices/x86_64-rh-devices.mak
a83cc2
new file mode 100644
a83cc2
index 0000000000..9f41400530
a83cc2
--- /dev/null
a83cc2
+++ b/default-configs/devices/x86_64-rh-devices.mak
a83cc2
@@ -0,0 +1,104 @@
a83cc2
+include rh-virtio.mak
a83cc2
+
a83cc2
+CONFIG_AC97=y
a83cc2
+CONFIG_ACPI=y
a83cc2
+CONFIG_ACPI_PCI=y
a83cc2
+CONFIG_ACPI_CPU_HOTPLUG=y
a83cc2
+CONFIG_ACPI_MEMORY_HOTPLUG=y
a83cc2
+CONFIG_ACPI_NVDIMM=y
a83cc2
+CONFIG_ACPI_SMBUS=y
a83cc2
+CONFIG_ACPI_VMGENID=y
a83cc2
+CONFIG_ACPI_X86=y
a83cc2
+CONFIG_ACPI_X86_ICH=y
a83cc2
+CONFIG_AHCI=y
a83cc2
+CONFIG_APIC=y
a83cc2
+CONFIG_APM=y
a83cc2
+CONFIG_BOCHS_DISPLAY=y
a83cc2
+CONFIG_DIMM=y
a83cc2
+CONFIG_E1000E_PCI_EXPRESS=y
a83cc2
+CONFIG_E1000_PCI=y
a83cc2
+CONFIG_EDU=y
a83cc2
+CONFIG_FDC=y
a83cc2
+CONFIG_FW_CFG_DMA=y
a83cc2
+CONFIG_HDA=y
a83cc2
+CONFIG_HYPERV=y
a83cc2
+CONFIG_HYPERV_TESTDEV=y
a83cc2
+CONFIG_I2C=y
a83cc2
+CONFIG_I440FX=y
a83cc2
+CONFIG_I8254=y
a83cc2
+CONFIG_I8257=y
a83cc2
+CONFIG_I8259=y
a83cc2
+CONFIG_I82801B11=y
a83cc2
+CONFIG_IDE_CORE=y
a83cc2
+CONFIG_IDE_PCI=y
a83cc2
+CONFIG_IDE_PIIX=y
a83cc2
+CONFIG_IDE_QDEV=y
a83cc2
+CONFIG_IOAPIC=y
a83cc2
+CONFIG_IOH3420=y
a83cc2
+CONFIG_ISA_BUS=y
a83cc2
+CONFIG_ISA_DEBUG=y
a83cc2
+CONFIG_ISA_TESTDEV=y
a83cc2
+CONFIG_LPC_ICH9=y
a83cc2
+CONFIG_MC146818RTC=y
a83cc2
+CONFIG_MEM_DEVICE=y
a83cc2
+CONFIG_NVDIMM=y
a83cc2
+CONFIG_OPENGL=y
a83cc2
+CONFIG_PAM=y
a83cc2
+CONFIG_PC=y
a83cc2
+CONFIG_PCI=y
a83cc2
+CONFIG_PCIE_PORT=y
a83cc2
+CONFIG_PCI_DEVICES=y
a83cc2
+CONFIG_PCI_EXPRESS=y
a83cc2
+CONFIG_PCI_EXPRESS_Q35=y
a83cc2
+CONFIG_PCI_I440FX=y
a83cc2
+CONFIG_PCI_TESTDEV=y
a83cc2
+CONFIG_PCKBD=y
a83cc2
+CONFIG_PCSPK=y
a83cc2
+CONFIG_PC_ACPI=y
a83cc2
+CONFIG_PC_PCI=y
a83cc2
+CONFIG_PFLASH_CFI01=y
a83cc2
+CONFIG_PVPANIC_ISA=y
a83cc2
+CONFIG_PXB=y
a83cc2
+CONFIG_Q35=y
a83cc2
+CONFIG_QXL=y
a83cc2
+CONFIG_RTL8139_PCI=y
a83cc2
+CONFIG_SCSI=y
a83cc2
+CONFIG_SERIAL=y
a83cc2
+CONFIG_SERIAL_ISA=y
a83cc2
+CONFIG_SERIAL_PCI=y
a83cc2
+CONFIG_SEV=y
a83cc2
+CONFIG_SGA=y
a83cc2
+CONFIG_SMBIOS=y
a83cc2
+CONFIG_SMBUS_EEPROM=y
a83cc2
+CONFIG_SPICE=y
a83cc2
+CONFIG_TEST_DEVICES=y
a83cc2
+CONFIG_USB=y
a83cc2
+CONFIG_USB_EHCI=y
a83cc2
+CONFIG_USB_EHCI_PCI=y
a83cc2
+CONFIG_USB_SMARTCARD=y
a83cc2
+CONFIG_USB_STORAGE_BOT=y
a83cc2
+CONFIG_USB_STORAGE_CORE=y
a83cc2
+CONFIG_USB_STORAGE_CLASSIC=y
a83cc2
+CONFIG_USB_UHCI=y
a83cc2
+CONFIG_USB_XHCI=y
a83cc2
+CONFIG_USB_XHCI_NEC=y
a83cc2
+CONFIG_USB_XHCI_PCI=y
a83cc2
+CONFIG_VFIO=y
a83cc2
+CONFIG_VFIO_PCI=y
a83cc2
+CONFIG_VGA=y
a83cc2
+CONFIG_VGA_CIRRUS=y
a83cc2
+CONFIG_VGA_PCI=y
a83cc2
+CONFIG_VHOST_USER=y
a83cc2
+CONFIG_VHOST_USER_BLK=y
a83cc2
+CONFIG_VIRTIO_PCI=y
a83cc2
+CONFIG_VIRTIO_VGA=y
a83cc2
+CONFIG_VMMOUSE=y
a83cc2
+CONFIG_VMPORT=y
a83cc2
+CONFIG_VTD=y
a83cc2
+CONFIG_WDT_IB6300ESB=y
a83cc2
+CONFIG_WDT_IB700=y
a83cc2
+CONFIG_XIO3130=y
a83cc2
+CONFIG_TPM_CRB=y
a83cc2
+CONFIG_TPM_TIS_ISA=y
a83cc2
+CONFIG_TPM_EMULATOR=y
a83cc2
+CONFIG_TPM_PASSTHROUGH=y
a83cc2
diff --git a/default-configs/devices/x86_64-softmmu.mak b/default-configs/devices/x86_64-softmmu.mak
a83cc2
index 64b2ee2960..e57bcff7d9 100644
a83cc2
--- a/default-configs/devices/x86_64-softmmu.mak
a83cc2
+++ b/default-configs/devices/x86_64-softmmu.mak
a83cc2
@@ -1,3 +1,11 @@
a83cc2
 # Default configuration for x86_64-softmmu
a83cc2
 
a83cc2
-include i386-softmmu.mak
a83cc2
+#include i386-softmmu.mak
a83cc2
+
a83cc2
+include x86_64-rh-devices.mak
a83cc2
+
a83cc2
+#
a83cc2
+# RHEL: this is for the limited upstream machine type support, so to export
a83cc2
+# some more devices than what RHEL machines have.
a83cc2
+#
a83cc2
+include x86_64-upstream-devices.mak
a83cc2
diff --git a/default-configs/devices/x86_64-upstream-devices.mak b/default-configs/devices/x86_64-upstream-devices.mak
a83cc2
new file mode 100644
a83cc2
index 0000000000..2cd20f54d2
a83cc2
--- /dev/null
a83cc2
+++ b/default-configs/devices/x86_64-upstream-devices.mak
a83cc2
@@ -0,0 +1,4 @@
a83cc2
+# We need "isa-parallel"
a83cc2
+CONFIG_PARALLEL=y
a83cc2
+# We need "hpet"
a83cc2
+CONFIG_HPET=y
a83cc2
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
a83cc2
index 853447cf9d..7f01fad64c 100644
a83cc2
--- a/hw/acpi/ich9.c
a83cc2
+++ b/hw/acpi/ich9.c
a83cc2
@@ -374,8 +374,8 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm)
a83cc2
     static const uint32_t gpe0_len = ICH9_PMIO_GPE0_LEN;
a83cc2
     pm->acpi_memory_hotplug.is_enabled = true;
a83cc2
     pm->cpu_hotplug_legacy = true;
a83cc2
-    pm->disable_s3 = 0;
a83cc2
-    pm->disable_s4 = 0;
a83cc2
+    pm->disable_s3 = 1;
a83cc2
+    pm->disable_s4 = 1;
a83cc2
     pm->s4_val = 2;
a83cc2
 
a83cc2
     object_property_add_uint32_ptr(obj, ACPI_PM_PROP_PM_IO_BASE,
a83cc2
diff --git a/hw/arm/meson.build b/hw/arm/meson.build
a83cc2
index be39117b9b..6fcc5ede50 100644
a83cc2
--- a/hw/arm/meson.build
a83cc2
+++ b/hw/arm/meson.build
a83cc2
@@ -30,7 +30,7 @@ arm_ss.add(when: 'CONFIG_VEXPRESS', if_true: files('vexpress.c'))
a83cc2
 arm_ss.add(when: 'CONFIG_ZYNQ', if_true: files('xilinx_zynq.c'))
a83cc2
 arm_ss.add(when: 'CONFIG_SABRELITE', if_true: files('sabrelite.c'))
a83cc2
 
a83cc2
-arm_ss.add(when: 'CONFIG_ARM_V7M', if_true: files('armv7m.c'))
a83cc2
+#arm_ss.add(when: 'CONFIG_ARM_V7M', if_true: files('armv7m.c'))
a83cc2
 arm_ss.add(when: 'CONFIG_EXYNOS4', if_true: files('exynos4210.c'))
a83cc2
 arm_ss.add(when: 'CONFIG_PXA2XX', if_true: files('pxa2xx.c', 'pxa2xx_gpio.c', 'pxa2xx_pic.c'))
a83cc2
 arm_ss.add(when: 'CONFIG_DIGIC', if_true: files('digic.c'))
a83cc2
diff --git a/hw/block/fdc.c b/hw/block/fdc.c
a83cc2
index a825c2acba..c62927bb3a 100644
a83cc2
--- a/hw/block/fdc.c
a83cc2
+++ b/hw/block/fdc.c
a83cc2
@@ -49,6 +49,8 @@
a83cc2
 #include "trace.h"
a83cc2
 #include "qom/object.h"
a83cc2
 
a83cc2
+#include "hw/boards.h"
a83cc2
+
a83cc2
 /********************************************************/
a83cc2
 /* debug Floppy devices */
a83cc2
 
a83cc2
@@ -2554,6 +2556,14 @@ static void fdctrl_realize_common(DeviceState *dev, FDCtrl *fdctrl,
a83cc2
     FDrive *drive;
a83cc2
     static int command_tables_inited = 0;
a83cc2
 
a83cc2
+    /* Restricted for Red Hat Enterprise Linux: */
a83cc2
+    MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine());
a83cc2
+    if (!strstr(mc->name, "-rhel7.")) {
a83cc2
+        error_setg(errp, "Device %s is not supported with machine type %s",
a83cc2
+                   object_get_typename(OBJECT(dev)), mc->name);
a83cc2
+        return;
a83cc2
+    }
a83cc2
+
a83cc2
     if (fdctrl->fallback == FLOPPY_DRIVE_TYPE_AUTO) {
a83cc2
         error_setg(errp, "Cannot choose a fallback FDrive type of 'auto'");
a83cc2
         return;
a83cc2
diff --git a/hw/char/parallel.c b/hw/char/parallel.c
a83cc2
index b45e67bfbb..e5f108211b 100644
a83cc2
--- a/hw/char/parallel.c
a83cc2
+++ b/hw/char/parallel.c
a83cc2
@@ -29,6 +29,7 @@
a83cc2
 #include "chardev/char-parallel.h"
a83cc2
 #include "chardev/char-fe.h"
a83cc2
 #include "hw/acpi/aml-build.h"
a83cc2
+#include "hw/boards.h"
a83cc2
 #include "hw/irq.h"
a83cc2
 #include "hw/isa/isa.h"
a83cc2
 #include "hw/qdev-properties.h"
a83cc2
@@ -534,6 +535,14 @@ static void parallel_isa_realizefn(DeviceState *dev, Error **errp)
a83cc2
     int base;
a83cc2
     uint8_t dummy;
a83cc2
 
a83cc2
+    /* Restricted for Red Hat Enterprise Linux */
a83cc2
+    MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine());
a83cc2
+    if (strstr(mc->name, "rhel")) {
a83cc2
+        error_setg(errp, "Device %s is not supported with machine type %s",
a83cc2
+                   object_get_typename(OBJECT(dev)), mc->name);
a83cc2
+        return;
a83cc2
+    }
a83cc2
+
a83cc2
     if (!qemu_chr_fe_backend_connected(&s->chr)) {
a83cc2
         error_setg(errp, "Can't create parallel device, empty char device");
a83cc2
         return;
a83cc2
diff --git a/hw/cpu/meson.build b/hw/cpu/meson.build
a83cc2
index 9e52fee9e7..bb71c9f3e7 100644
a83cc2
--- a/hw/cpu/meson.build
a83cc2
+++ b/hw/cpu/meson.build
a83cc2
@@ -1,6 +1,7 @@
a83cc2
-softmmu_ss.add(files('core.c', 'cluster.c'))
a83cc2
+#softmmu_ss.add(files('core.c', 'cluster.c'))
a83cc2
+softmmu_ss.add(files('core.c'))
a83cc2
 
a83cc2
 specific_ss.add(when: 'CONFIG_ARM11MPCORE', if_true: files('arm11mpcore.c'))
a83cc2
 specific_ss.add(when: 'CONFIG_REALVIEW', if_true: files('realview_mpcore.c'))
a83cc2
 specific_ss.add(when: 'CONFIG_A9MPCORE', if_true: files('a9mpcore.c'))
a83cc2
-specific_ss.add(when: 'CONFIG_A15MPCORE', if_true: files('a15mpcore.c'))
a83cc2
+#specific_ss.add(when: 'CONFIG_A15MPCORE', if_true: files('a15mpcore.c'))
a83cc2
diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
a83cc2
index fdca6ca659..fa1a7eee51 100644
a83cc2
--- a/hw/display/cirrus_vga.c
a83cc2
+++ b/hw/display/cirrus_vga.c
a83cc2
@@ -2945,6 +2945,9 @@ static void pci_cirrus_vga_realize(PCIDevice *dev, Error **errp)
a83cc2
      PCIDeviceClass *pc = PCI_DEVICE_GET_CLASS(dev);
a83cc2
      int16_t device_id = pc->device_id;
a83cc2
 
a83cc2
+     warn_report("'cirrus-vga' is deprecated, "
a83cc2
+                 "please use a different VGA card instead");
a83cc2
+
a83cc2
      /* follow real hardware, cirrus card emulated has 4 MB video memory.
a83cc2
        Also accept 8 MB/16 MB for backward compatibility. */
a83cc2
      if (s->vga.vram_size_mb != 4 && s->vga.vram_size_mb != 8 &&
a83cc2
diff --git a/hw/ide/piix.c b/hw/ide/piix.c
a83cc2
index b9860e35a5..beb1ea6c46 100644
a83cc2
--- a/hw/ide/piix.c
a83cc2
+++ b/hw/ide/piix.c
a83cc2
@@ -220,7 +220,8 @@ static void piix3_ide_class_init(ObjectClass *klass, void *data)
a83cc2
     k->device_id = PCI_DEVICE_ID_INTEL_82371SB_1;
a83cc2
     k->class_id = PCI_CLASS_STORAGE_IDE;
a83cc2
     set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
a83cc2
-    dc->hotpluggable = false;
a83cc2
+    /* Disabled for Red Hat Enterprise Linux: */
a83cc2
+    dc->user_creatable = false;
a83cc2
 }
a83cc2
 
a83cc2
 static const TypeInfo piix3_ide_info = {
a83cc2
@@ -249,6 +250,8 @@ static void piix4_ide_class_init(ObjectClass *klass, void *data)
a83cc2
     k->class_id = PCI_CLASS_STORAGE_IDE;
a83cc2
     set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
a83cc2
     dc->hotpluggable = false;
a83cc2
+    /* Disabled for Red Hat Enterprise Linux: */
a83cc2
+    dc->user_creatable = false;
a83cc2
 }
a83cc2
 
a83cc2
 static const TypeInfo piix4_ide_info = {
a83cc2
diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c
a83cc2
index dde85ba6c6..62cf60c9c9 100644
a83cc2
--- a/hw/input/pckbd.c
a83cc2
+++ b/hw/input/pckbd.c
a83cc2
@@ -597,6 +597,8 @@ static void i8042_class_initfn(ObjectClass *klass, void *data)
a83cc2
     dc->vmsd = &vmstate_kbd_isa;
a83cc2
     isa->build_aml = i8042_build_aml;
a83cc2
     set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
a83cc2
+    /* Disabled for Red Hat Enterprise Linux: */
a83cc2
+    dc->user_creatable = false;
a83cc2
 }
a83cc2
 
a83cc2
 static const TypeInfo i8042_info = {
a83cc2
diff --git a/hw/net/e1000.c b/hw/net/e1000.c
a83cc2
index 4f75b44cfc..6f075fe235 100644
a83cc2
--- a/hw/net/e1000.c
a83cc2
+++ b/hw/net/e1000.c
a83cc2
@@ -1797,6 +1797,7 @@ static const E1000Info e1000_devices[] = {
a83cc2
         .revision  = 0x03,
a83cc2
         .phy_id2   = E1000_PHY_ID2_8254xx_DEFAULT,
a83cc2
     },
a83cc2
+#if 0 /* Disabled for Red Hat Enterprise Linux 7 */
a83cc2
     {
a83cc2
         .name      = "e1000-82544gc",
a83cc2
         .device_id = E1000_DEV_ID_82544GC_COPPER,
a83cc2
@@ -1809,6 +1810,7 @@ static const E1000Info e1000_devices[] = {
a83cc2
         .revision  = 0x03,
a83cc2
         .phy_id2   = E1000_PHY_ID2_8254xx_DEFAULT,
a83cc2
     },
a83cc2
+#endif
a83cc2
 };
a83cc2
 
a83cc2
 static void e1000_register_types(void)
a83cc2
diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
a83cc2
index 4f316a6f9d..64178f0f9a 100644
a83cc2
--- a/hw/ppc/spapr_cpu_core.c
a83cc2
+++ b/hw/ppc/spapr_cpu_core.c
a83cc2
@@ -370,10 +370,12 @@ static const TypeInfo spapr_cpu_core_type_infos[] = {
a83cc2
         .instance_size = sizeof(SpaprCpuCore),
a83cc2
         .class_size = sizeof(SpaprCpuCoreClass),
a83cc2
     },
a83cc2
+#if 0  /* Disabled for Red Hat Enterprise Linux */
a83cc2
     DEFINE_SPAPR_CPU_CORE_TYPE("970_v2.2"),
a83cc2
     DEFINE_SPAPR_CPU_CORE_TYPE("970mp_v1.0"),
a83cc2
     DEFINE_SPAPR_CPU_CORE_TYPE("970mp_v1.1"),
a83cc2
     DEFINE_SPAPR_CPU_CORE_TYPE("power5+_v2.1"),
a83cc2
+#endif
a83cc2
     DEFINE_SPAPR_CPU_CORE_TYPE("power7_v2.3"),
a83cc2
     DEFINE_SPAPR_CPU_CORE_TYPE("power7+_v2.1"),
a83cc2
     DEFINE_SPAPR_CPU_CORE_TYPE("power8_v2.0"),
a83cc2
diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c
a83cc2
index 9520471be2..202e032524 100644
a83cc2
--- a/hw/timer/hpet.c
a83cc2
+++ b/hw/timer/hpet.c
a83cc2
@@ -733,6 +733,14 @@ static void hpet_realize(DeviceState *dev, Error **errp)
a83cc2
     int i;
a83cc2
     HPETTimer *timer;
a83cc2
 
a83cc2
+    /* Restricted for Red Hat Enterprise Linux */
a83cc2
+    MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine());
a83cc2
+    if (strstr(mc->name, "rhel")) {
a83cc2
+        error_setg(errp, "Device %s is not supported with machine type %s",
a83cc2
+                   object_get_typename(OBJECT(dev)), mc->name);
a83cc2
+        return;
a83cc2
+    }
a83cc2
+
a83cc2
     if (!s->intcap) {
a83cc2
         warn_report("Hpet's intcap not initialized");
a83cc2
     }
a83cc2
diff --git a/hw/usb/meson.build b/hw/usb/meson.build
a83cc2
index fb7a74e73a..674993aa4f 100644
a83cc2
--- a/hw/usb/meson.build
a83cc2
+++ b/hw/usb/meson.build
a83cc2
@@ -55,7 +55,7 @@ softmmu_ss.add(when: 'CONFIG_USB_SMARTCARD', if_true: files('dev-smartcard-reade
a83cc2
 if config_host.has_key('CONFIG_SMARTCARD')
a83cc2
   usbsmartcard_ss = ss.source_set()
a83cc2
   usbsmartcard_ss.add(when: 'CONFIG_USB_SMARTCARD',
a83cc2
-                      if_true: [cacard, files('ccid-card-emulated.c', 'ccid-card-passthru.c')])
a83cc2
+                      if_true: [cacard, files('ccid-card-passthru.c')])
a83cc2
   hw_usb_modules += {'smartcard': usbsmartcard_ss}
a83cc2
 endif
a83cc2
 
a83cc2
diff --git a/qemu-options.hx b/qemu-options.hx
a83cc2
index fd21002bd6..0d4fb61bf7 100644
a83cc2
--- a/qemu-options.hx
a83cc2
+++ b/qemu-options.hx
a83cc2
@@ -2327,10 +2327,6 @@ ERST
a83cc2
 
a83cc2
 DEF("no-hpet", 0, QEMU_OPTION_no_hpet,
a83cc2
     "-no-hpet        disable HPET\n", QEMU_ARCH_I386)
a83cc2
-SRST
a83cc2
-``-no-hpet``
a83cc2
-    Disable HPET support.
a83cc2
-ERST
a83cc2
 
a83cc2
 DEF("acpitable", HAS_ARG, QEMU_OPTION_acpitable,
a83cc2
     "-acpitable [sig=str][,rev=n][,oem_id=str][,oem_table_id=str][,oem_rev=n][,asl_compiler_id=str][,asl_compiler_rev=n][,{data|file}=file1[:file2]...]\n"
a83cc2
diff --git a/target/arm/cpu_tcg.c b/target/arm/cpu_tcg.c
a83cc2
index 046e476f65..c3cd0ca039 100644
a83cc2
--- a/target/arm/cpu_tcg.c
a83cc2
+++ b/target/arm/cpu_tcg.c
a83cc2
@@ -22,6 +22,7 @@
a83cc2
 /* CPU models. These are not needed for the AArch64 linux-user build. */
a83cc2
 #if !defined(CONFIG_USER_ONLY) || !defined(TARGET_AARCH64)
a83cc2
 
a83cc2
+#if 0 /* Disabled for Red Hat Enterprise Linux */
a83cc2
 #ifdef CONFIG_TCG
a83cc2
 static bool arm_v7m_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
a83cc2
 {
a83cc2
@@ -375,6 +376,7 @@ static void cortex_a9_initfn(Object *obj)
a83cc2
     cpu->ccsidr[1] = 0x200fe019; /* 16k L1 icache. */
a83cc2
     define_arm_cp_regs(cpu, cortexa9_cp_reginfo);
a83cc2
 }
a83cc2
+#endif /* disabled for RHEL */
a83cc2
 
a83cc2
 #ifndef CONFIG_USER_ONLY
a83cc2
 static uint64_t a15_l2ctlr_read(CPUARMState *env, const ARMCPRegInfo *ri)
a83cc2
@@ -400,6 +402,7 @@ static const ARMCPRegInfo cortexa15_cp_reginfo[] = {
a83cc2
     REGINFO_SENTINEL
a83cc2
 };
a83cc2
 
a83cc2
+#if 0 /* Disabled for Red Hat Enterprise Linux */
a83cc2
 static void cortex_a7_initfn(Object *obj)
a83cc2
 {
a83cc2
     ARMCPU *cpu = ARM_CPU(obj);
a83cc2
@@ -445,6 +448,7 @@ static void cortex_a7_initfn(Object *obj)
a83cc2
     cpu->ccsidr[2] = 0x711fe07a; /* 4096K L2 unified cache */
a83cc2
     define_arm_cp_regs(cpu, cortexa15_cp_reginfo); /* Same as A15 */
a83cc2
 }
a83cc2
+#endif /* disabled for RHEL */
a83cc2
 
a83cc2
 static void cortex_a15_initfn(Object *obj)
a83cc2
 {
a83cc2
@@ -488,6 +492,7 @@ static void cortex_a15_initfn(Object *obj)
a83cc2
     define_arm_cp_regs(cpu, cortexa15_cp_reginfo);
a83cc2
 }
a83cc2
 
a83cc2
+#if 0 /* Disabled for Red Hat Enterprise Linux */
a83cc2
 static void cortex_m0_initfn(Object *obj)
a83cc2
 {
a83cc2
     ARMCPU *cpu = ARM_CPU(obj);
a83cc2
@@ -927,6 +932,7 @@ static void arm_v7m_class_init(ObjectClass *oc, void *data)
a83cc2
 
a83cc2
     cc->gdb_core_xml_file = "arm-m-profile.xml";
a83cc2
 }
a83cc2
+#endif /* disabled for RHEL */
a83cc2
 
a83cc2
 #ifndef TARGET_AARCH64
a83cc2
 /*
a83cc2
@@ -1004,6 +1010,7 @@ static void arm_max_initfn(Object *obj)
a83cc2
 #endif /* !TARGET_AARCH64 */
a83cc2
 
a83cc2
 static const ARMCPUInfo arm_tcg_cpus[] = {
a83cc2
+#if 0 /* Disabled for Red Hat Enterprise Linux */
a83cc2
     { .name = "arm926",      .initfn = arm926_initfn },
a83cc2
     { .name = "arm946",      .initfn = arm946_initfn },
a83cc2
     { .name = "arm1026",     .initfn = arm1026_initfn },
a83cc2
@@ -1019,7 +1026,9 @@ static const ARMCPUInfo arm_tcg_cpus[] = {
a83cc2
     { .name = "cortex-a7",   .initfn = cortex_a7_initfn },
a83cc2
     { .name = "cortex-a8",   .initfn = cortex_a8_initfn },
a83cc2
     { .name = "cortex-a9",   .initfn = cortex_a9_initfn },
a83cc2
+#endif /* disabled for RHEL */
a83cc2
     { .name = "cortex-a15",  .initfn = cortex_a15_initfn },
a83cc2
+#if 0 /* Disabled for Red Hat Enterprise Linux */
a83cc2
     { .name = "cortex-m0",   .initfn = cortex_m0_initfn,
a83cc2
                              .class_init = arm_v7m_class_init },
a83cc2
     { .name = "cortex-m3",   .initfn = cortex_m3_initfn,
a83cc2
@@ -1050,6 +1059,7 @@ static const ARMCPUInfo arm_tcg_cpus[] = {
a83cc2
     { .name = "pxa270-b1",   .initfn = pxa270b1_initfn },
a83cc2
     { .name = "pxa270-c0",   .initfn = pxa270c0_initfn },
a83cc2
     { .name = "pxa270-c5",   .initfn = pxa270c5_initfn },
a83cc2
+#endif /* disabled for RHEL */
a83cc2
 #ifndef TARGET_AARCH64
a83cc2
     { .name = "max",         .initfn = arm_max_initfn },
a83cc2
 #endif
a83cc2
diff --git a/target/ppc/cpu-models.c b/target/ppc/cpu-models.c
a83cc2
index 87e4228614..6eaa65efff 100644
a83cc2
--- a/target/ppc/cpu-models.c
a83cc2
+++ b/target/ppc/cpu-models.c
a83cc2
@@ -66,6 +66,7 @@
a83cc2
 #define POWERPC_DEF(_name, _pvr, _type, _desc)                              \
a83cc2
     POWERPC_DEF_SVR(_name, _desc, _pvr, POWERPC_SVR_NONE, _type)
a83cc2
 
a83cc2
+#if 0  /* Embedded and 32-bit CPUs disabled for Red Hat Enterprise Linux */
a83cc2
     /* Embedded PowerPC                                                      */
a83cc2
     /* PowerPC 401 family                                                    */
a83cc2
     POWERPC_DEF("401",           CPU_POWERPC_401,                    401,
a83cc2
@@ -740,8 +741,10 @@
a83cc2
                 "PowerPC 7447A v1.2 (G4)")
a83cc2
     POWERPC_DEF("7457a_v1.2",    CPU_POWERPC_74x7A_v12,              7455,
a83cc2
                 "PowerPC 7457A v1.2 (G4)")
a83cc2
+#endif
a83cc2
     /* 64 bits PowerPC                                                       */
a83cc2
 #if defined(TARGET_PPC64)
a83cc2
+#if 0  /* Disabled for Red Hat Enterprise Linux */
a83cc2
     POWERPC_DEF("970_v2.2",      CPU_POWERPC_970_v22,                970,
a83cc2
                 "PowerPC 970 v2.2")
a83cc2
     POWERPC_DEF("970fx_v1.0",    CPU_POWERPC_970FX_v10,              970,
a83cc2
@@ -760,6 +763,7 @@
a83cc2
                 "PowerPC 970MP v1.1")
a83cc2
     POWERPC_DEF("power5+_v2.1",  CPU_POWERPC_POWER5P_v21,            POWER5P,
a83cc2
                 "POWER5+ v2.1")
a83cc2
+#endif
a83cc2
     POWERPC_DEF("power7_v2.3",   CPU_POWERPC_POWER7_v23,             POWER7,
a83cc2
                 "POWER7 v2.3")
a83cc2
     POWERPC_DEF("power7+_v2.1",  CPU_POWERPC_POWER7P_v21,            POWER7,
a83cc2
@@ -782,6 +786,7 @@
a83cc2
 /* PowerPC CPU aliases                                                     */
a83cc2
 
a83cc2
 PowerPCCPUAlias ppc_cpu_aliases[] = {
a83cc2
+#if 0  /* Embedded and 32-bit CPUs disabled for Red Hat Enterprise Linux */
a83cc2
     { "403", "403gc" },
a83cc2
     { "405", "405d4" },
a83cc2
     { "405cr", "405crc" },
a83cc2
@@ -940,12 +945,15 @@ PowerPCCPUAlias ppc_cpu_aliases[] = {
a83cc2
     { "7447a", "7447a_v1.2" },
a83cc2
     { "7457a", "7457a_v1.2" },
a83cc2
     { "apollo7pm", "7457a_v1.0" },
a83cc2
+#endif
a83cc2
 #if defined(TARGET_PPC64)
a83cc2
+#if 0  /* Disabled for Red Hat Enterprise Linux */
a83cc2
     { "970", "970_v2.2" },
a83cc2
     { "970fx", "970fx_v3.1" },
a83cc2
     { "970mp", "970mp_v1.1" },
a83cc2
     { "power5+", "power5+_v2.1" },
a83cc2
     { "power5gs", "power5+_v2.1" },
a83cc2
+#endif
a83cc2
     { "power7", "power7_v2.3" },
a83cc2
     { "power7+", "power7+_v2.1" },
a83cc2
     { "power8e", "power8e_v2.1" },
a83cc2
@@ -955,6 +963,7 @@ PowerPCCPUAlias ppc_cpu_aliases[] = {
a83cc2
     { "power10", "power10_v1.0" },
a83cc2
 #endif
a83cc2
 
a83cc2
+#if 0  /* Disabled for Red Hat Enterprise Linux */
a83cc2
     /* Generic PowerPCs */
a83cc2
 #if defined(TARGET_PPC64)
a83cc2
     { "ppc64", "970fx_v3.1" },
a83cc2
@@ -962,5 +971,6 @@ PowerPCCPUAlias ppc_cpu_aliases[] = {
a83cc2
     { "ppc32", "604" },
a83cc2
     { "ppc", "604" },
a83cc2
     { "default", "604" },
a83cc2
+#endif
a83cc2
     { NULL, NULL }
a83cc2
 };
a83cc2
diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
a83cc2
index 050dcf2d42..9254ff46bf 100644
a83cc2
--- a/target/s390x/cpu_models.c
a83cc2
+++ b/target/s390x/cpu_models.c
a83cc2
@@ -430,6 +430,9 @@ static void check_unavailable_features(const S390CPUModel *max_model,
a83cc2
         (max_model->def->gen == model->def->gen &&
a83cc2
          max_model->def->ec_ga < model->def->ec_ga)) {
a83cc2
         list_add_feat("type", unavailable);
a83cc2
+    } else if (model->def->gen < 11 && kvm_enabled()) {
a83cc2
+        /* Older CPU models are not supported on Red Hat Enterprise Linux */
a83cc2
+        list_add_feat("type", unavailable);
a83cc2
     }
a83cc2
 
a83cc2
     /* detect missing features if any to properly report them */
a83cc2
diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c
a83cc2
index 4fb3bbfef5..6c69d84b84 100644
a83cc2
--- a/target/s390x/kvm.c
a83cc2
+++ b/target/s390x/kvm.c
a83cc2
@@ -2516,6 +2516,14 @@ void kvm_s390_apply_cpu_model(const S390CPUModel *model, Error **errp)
a83cc2
         error_setg(errp, "KVM doesn't support CPU models");
a83cc2
         return;
a83cc2
     }
a83cc2
+
a83cc2
+    /* Older CPU models are not supported on Red Hat Enterprise Linux */
a83cc2
+    if (model->def->gen < 11) {
a83cc2
+        error_setg(errp, "KVM: Unsupported CPU type specified: %s",
a83cc2
+                   MACHINE(qdev_get_machine())->cpu_type);
a83cc2
+        return;
a83cc2
+    }
a83cc2
+
a83cc2
     prop.cpuid = s390_cpuid_from_cpu_model(model);
a83cc2
     prop.ibc = s390_ibc_from_cpu_model(model);
a83cc2
     /* configure cpu features indicated via STFL(e) */
a83cc2
-- 
a83cc2
2.27.0
a83cc2