]> git.proxmox.com Git - pve-qemu.git/blob - debian/patches/extra/0019-intel-iommu-fail-MAP-notifier-without-caching-mode.patch
d/rules: drop virtiofsd switch
[pve-qemu.git] / debian / patches / extra / 0019-intel-iommu-fail-MAP-notifier-without-caching-mode.patch
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Jason Wang <jasowang@redhat.com>
3 Date: Thu, 23 Feb 2023 14:59:20 +0800
4 Subject: [PATCH] intel-iommu: fail MAP notifier without caching mode
5
6 Without caching mode, MAP notifier won't work correctly since guest
7 won't send IOTLB update event when it establishes new mappings in the
8 I/O page tables. Let's fail the IOMMU notifiers early instead of
9 misbehaving silently.
10
11 Reviewed-by: Eric Auger <eric.auger@redhat.com>
12 Tested-by: Viktor Prutyanov <viktor@daynix.com>
13 Signed-off-by: Jason Wang <jasowang@redhat.com>
14 Message-Id: <20230223065924.42503-2-jasowang@redhat.com>
15 Reviewed-by: Peter Xu <peterx@redhat.com>
16 Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
17 Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
18 (cherry-picked from commit b8d78277c091f26fdd64f239bc8bb7e55d74cecf)
19 Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
20 ---
21 hw/i386/intel_iommu.c | 7 +++++++
22 1 file changed, 7 insertions(+)
23
24 diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
25 index a08ee85edf..9143376677 100644
26 --- a/hw/i386/intel_iommu.c
27 +++ b/hw/i386/intel_iommu.c
28 @@ -3186,6 +3186,13 @@ static int vtd_iommu_notify_flag_changed(IOMMUMemoryRegion *iommu,
29 "Snoop Control with vhost or VFIO is not supported");
30 return -ENOTSUP;
31 }
32 + if (!s->caching_mode && (new & IOMMU_NOTIFIER_MAP)) {
33 + error_setg_errno(errp, ENOTSUP,
34 + "device %02x.%02x.%x requires caching mode",
35 + pci_bus_num(vtd_as->bus), PCI_SLOT(vtd_as->devfn),
36 + PCI_FUNC(vtd_as->devfn));
37 + return -ENOTSUP;
38 + }
39
40 /* Update per-address-space notifier flags */
41 vtd_as->notifier_flags = new;