diff options
| author | Ross Burton <ross@burtonini.com> | 2022-04-19 16:45:40 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-04-20 13:14:00 +0100 |
| commit | 42ed634570c6633e1bd2dd28c377a2c1fd1ba961 (patch) | |
| tree | 55007cece468cc45d2e7e25277cd8ce3dbd6f24f | |
| parent | 7a386594437686bdd3cae358a7c7a51326e0e843 (diff) | |
| download | poky-42ed634570c6633e1bd2dd28c377a2c1fd1ba961.tar.gz | |
qemu: backport a patch to optionally disable i8042 (AT and PS/2) hardware
Backport a patch from upstream (will be in qemu 7.0) to add an option to
disable the legacy i8042 support (AT keyboard, PS/2 mouse). These
devices are very historical and modern Linux environments use USB anyway.
(From OE-Core rev: d73e4fcfc9ca4aab25f7751ba17974a839d6340f)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-devtools/qemu/qemu.inc | 1 | ||||
| -rw-r--r-- | meta/recipes-devtools/qemu/qemu/no-ps2.patch | 123 |
2 files changed, 124 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc index 4e94c4b2bf..09a2d47005 100644 --- a/meta/recipes-devtools/qemu/qemu.inc +++ b/meta/recipes-devtools/qemu/qemu.inc | |||
| @@ -33,6 +33,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \ | |||
| 33 | file://0001-vhost-vsock-detach-the-virqueue-element-in-case-of-e.patch \ | 33 | file://0001-vhost-vsock-detach-the-virqueue-element-in-case-of-e.patch \ |
| 34 | file://0002-virtio-net-fix-map-leaking-on-error-during-receive.patch \ | 34 | file://0002-virtio-net-fix-map-leaking-on-error-during-receive.patch \ |
| 35 | file://pvrdma.patch \ | 35 | file://pvrdma.patch \ |
| 36 | file://no-ps2.patch \ | ||
| 36 | " | 37 | " |
| 37 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" | 38 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" |
| 38 | 39 | ||
diff --git a/meta/recipes-devtools/qemu/qemu/no-ps2.patch b/meta/recipes-devtools/qemu/qemu/no-ps2.patch new file mode 100644 index 0000000000..8c167521d7 --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/no-ps2.patch | |||
| @@ -0,0 +1,123 @@ | |||
| 1 | Upstream-Status: Backport [4ccd5fe22feb95137d325f422016a6473541fe9f] | ||
| 2 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
| 3 | |||
| 4 | From ec2d4aa7ca28127faa7ccdbf89d2bf5a4984b62f Mon Sep 17 00:00:00 2001 | ||
| 5 | From: Joelle van Dyne <j@getutm.app> | ||
| 6 | Date: Sun, 27 Feb 2022 13:06:55 -0800 | ||
| 7 | Subject: [PATCH] pc: add option to disable PS/2 mouse/keyboard | ||
| 8 | |||
| 9 | On some older software like Windows 7 installer, having both a PS/2 | ||
| 10 | mouse and USB mouse results in only one device working property (which | ||
| 11 | might be a different device each boot). While the workaround to not use | ||
| 12 | a USB mouse with such software is valid, it creates an inconsistent | ||
| 13 | experience if the user wishes to always use a USB mouse. | ||
| 14 | |||
| 15 | This introduces a new machine property to inhibit the creation of the | ||
| 16 | i8042 PS/2 controller. | ||
| 17 | |||
| 18 | Signed-off-by: Joelle van Dyne <j@getutm.app> | ||
| 19 | Message-Id: <20220227210655.45592-1-j@getutm.app> | ||
| 20 | Reviewed-by: Michael S. Tsirkin <mst@redhat.com> | ||
| 21 | Signed-off-by: Michael S. Tsirkin <mst@redhat.com> | ||
| 22 | --- | ||
| 23 | hw/i386/pc.c | 28 ++++++++++++++++++++++++++-- | ||
| 24 | include/hw/i386/pc.h | 2 ++ | ||
| 25 | 2 files changed, 28 insertions(+), 2 deletions(-) | ||
| 26 | |||
| 27 | diff --git a/hw/i386/pc.c b/hw/i386/pc.c | ||
| 28 | index a2ef40ecbc..8a6a089ee2 100644 | ||
| 29 | --- a/hw/i386/pc.c | ||
| 30 | +++ b/hw/i386/pc.c | ||
| 31 | @@ -1008,7 +1008,8 @@ static const MemoryRegionOps ioportF0_io_ops = { | ||
| 32 | }, | ||
| 33 | }; | ||
| 34 | |||
| 35 | -static void pc_superio_init(ISABus *isa_bus, bool create_fdctrl, bool no_vmport) | ||
| 36 | +static void pc_superio_init(ISABus *isa_bus, bool create_fdctrl, | ||
| 37 | + bool create_i8042, bool no_vmport) | ||
| 38 | { | ||
| 39 | int i; | ||
| 40 | DriveInfo *fd[MAX_FD]; | ||
| 41 | @@ -1030,6 +1031,10 @@ static void pc_superio_init(ISABus *isa_bus, bool create_fdctrl, bool no_vmport) | ||
| 42 | } | ||
| 43 | } | ||
| 44 | |||
| 45 | + if (!create_i8042) { | ||
| 46 | + return; | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | i8042 = isa_create_simple(isa_bus, "i8042"); | ||
| 50 | if (!no_vmport) { | ||
| 51 | isa_create_simple(isa_bus, TYPE_VMPORT); | ||
| 52 | @@ -1125,7 +1130,8 @@ void pc_basic_device_init(struct PCMachineState *pcms, | ||
| 53 | i8257_dma_init(isa_bus, 0); | ||
| 54 | |||
| 55 | /* Super I/O */ | ||
| 56 | - pc_superio_init(isa_bus, create_fdctrl, pcms->vmport != ON_OFF_AUTO_ON); | ||
| 57 | + pc_superio_init(isa_bus, create_fdctrl, pcms->i8042_enabled, | ||
| 58 | + pcms->vmport != ON_OFF_AUTO_ON); | ||
| 59 | } | ||
| 60 | |||
| 61 | void pc_nic_init(PCMachineClass *pcmc, ISABus *isa_bus, PCIBus *pci_bus) | ||
| 62 | @@ -1506,6 +1512,20 @@ static void pc_machine_set_hpet(Object *obj, bool value, Error **errp) | ||
| 63 | pcms->hpet_enabled = value; | ||
| 64 | } | ||
| 65 | |||
| 66 | +static bool pc_machine_get_i8042(Object *obj, Error **errp) | ||
| 67 | +{ | ||
| 68 | + PCMachineState *pcms = PC_MACHINE(obj); | ||
| 69 | + | ||
| 70 | + return pcms->i8042_enabled; | ||
| 71 | +} | ||
| 72 | + | ||
| 73 | +static void pc_machine_set_i8042(Object *obj, bool value, Error **errp) | ||
| 74 | +{ | ||
| 75 | + PCMachineState *pcms = PC_MACHINE(obj); | ||
| 76 | + | ||
| 77 | + pcms->i8042_enabled = value; | ||
| 78 | +} | ||
| 79 | + | ||
| 80 | static bool pc_machine_get_default_bus_bypass_iommu(Object *obj, Error **errp) | ||
| 81 | { | ||
| 82 | PCMachineState *pcms = PC_MACHINE(obj); | ||
| 83 | @@ -1616,6 +1636,7 @@ static void pc_machine_initfn(Object *obj) | ||
| 84 | pcms->smbus_enabled = true; | ||
| 85 | pcms->sata_enabled = true; | ||
| 86 | pcms->pit_enabled = true; | ||
| 87 | + pcms->i8042_enabled = true; | ||
| 88 | pcms->max_fw_size = 8 * MiB; | ||
| 89 | #ifdef CONFIG_HPET | ||
| 90 | pcms->hpet_enabled = true; | ||
| 91 | @@ -1744,6 +1765,9 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) | ||
| 92 | object_class_property_add_bool(oc, "hpet", | ||
| 93 | pc_machine_get_hpet, pc_machine_set_hpet); | ||
| 94 | |||
| 95 | + object_class_property_add_bool(oc, PC_MACHINE_I8042, | ||
| 96 | + pc_machine_get_i8042, pc_machine_set_i8042); | ||
| 97 | + | ||
| 98 | object_class_property_add_bool(oc, "default-bus-bypass-iommu", | ||
| 99 | pc_machine_get_default_bus_bypass_iommu, | ||
| 100 | pc_machine_set_default_bus_bypass_iommu); | ||
| 101 | diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h | ||
| 102 | index 9ab39e428f..642c915aa3 100644 | ||
| 103 | --- a/include/hw/i386/pc.h | ||
| 104 | +++ b/include/hw/i386/pc.h | ||
| 105 | @@ -46,6 +46,7 @@ typedef struct PCMachineState { | ||
| 106 | bool sata_enabled; | ||
| 107 | bool pit_enabled; | ||
| 108 | bool hpet_enabled; | ||
| 109 | + bool i8042_enabled; | ||
| 110 | bool default_bus_bypass_iommu; | ||
| 111 | uint64_t max_fw_size; | ||
| 112 | |||
| 113 | @@ -62,6 +63,7 @@ typedef struct PCMachineState { | ||
| 114 | #define PC_MACHINE_SMBUS "smbus" | ||
| 115 | #define PC_MACHINE_SATA "sata" | ||
| 116 | #define PC_MACHINE_PIT "pit" | ||
| 117 | +#define PC_MACHINE_I8042 "i8042" | ||
| 118 | #define PC_MACHINE_MAX_FW_SIZE "max-fw-size" | ||
| 119 | /** | ||
| 120 | * PCMachineClass: | ||
| 121 | -- | ||
| 122 | 2.25.1 | ||
| 123 | |||
