Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package xen for openSUSE:Factory checked in 
at 2021-11-20 02:38:28
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/xen (Old)
 and      /work/SRC/openSUSE:Factory/.xen.new.1895 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "xen"

Sat Nov 20 02:38:28 2021 rev:306 rq:932003 version:4.16.0_01

Changes:
--------
--- /work/SRC/openSUSE:Factory/xen/xen.changes  2021-11-12 15:59:03.598559302 
+0100
+++ /work/SRC/openSUSE:Factory/.xen.new.1895/xen.changes        2021-11-20 
02:39:17.320750755 +0100
@@ -1,0 +2,14 @@
+Wed Nov 17 07:25:37 MST 2021 - carn...@suse.com
+
+- Update to Xen 4.16.0 RC3 release
+  xen-4.16.0-testing-src.tar.bz2
+- Drop iPXE sources and patches. iPXE is only used by QEMU
+  traditional which has never shipped with SLE15.
+  ipxe.tar.bz2
+  ipxe-enable-nics.patch
+  ipxe-no-error-logical-not-parentheses.patch
+  ipxe-use-rpm-opt-flags.patch
+- Drop building ocaml xenstored in the spec file. There are no
+  plans or need to support this version.
+
+-------------------------------------------------------------------

Old:
----
  ipxe-enable-nics.patch
  ipxe-no-error-logical-not-parentheses.patch
  ipxe-use-rpm-opt-flags.patch
  ipxe.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ xen.spec ++++++
--- /var/tmp/diff_new_pack.s1grCB/_old  2021-11-20 02:39:19.004745198 +0100
+++ /var/tmp/diff_new_pack.s1grCB/_new  2021-11-20 02:39:19.004745198 +0100
@@ -33,7 +33,6 @@
 #
 %define with_gdbsx 0
 %define with_dom0_support 0
-%bcond_with    xen_oxenstored
 %ifarch x86_64
 %bcond_without xen_debug
 %bcond_without xen_stubdom
@@ -97,17 +96,8 @@
 BuildRequires:  makeinfo
 %endif
 %endif
-BuildRequires:  ncurses-devel
-%if %{?with_dom0_support}0
-%if %{with xen_oxenstored}
-BuildRequires:  ocaml
-BuildRequires:  ocaml-compiler-libs
-BuildRequires:  ocaml-findlib
-BuildRequires:  ocaml-ocamldoc
-BuildRequires:  ocaml-runtime
-%endif
-%endif
 BuildRequires:  acpica
+BuildRequires:  ncurses-devel
 BuildRequires:  openssl-devel
 BuildRequires:  python3-devel
 BuildRequires:  xz-devel
@@ -137,9 +127,8 @@
 Group:          System/Kernel
 Source0:        xen-4.16.0-testing-src.tar.bz2
 Source1:        stubdom.tar.bz2
-Source2:        ipxe.tar.bz2
-Source3:        mini-os.tar.bz2
-Source4:        xen-utils-0.1.tar.bz2
+Source2:        mini-os.tar.bz2
+Source3:        xen-utils-0.1.tar.bz2
 Source9:        xen.changes
 Source10:       README.SUSE
 Source11:       boot.xen
@@ -218,11 +207,10 @@
 Patch451:       xenconsole-no-multiple-connections.patch
 Patch452:       hibernate.patch
 Patch453:       stdvga-cache.patch
-Patch454:       ipxe-enable-nics.patch
-Patch455:       xl-save-pc.patch
-Patch456:       pygrub-boot-legacy-sles.patch
-Patch457:       pygrub-handle-one-line-menu-entries.patch
-Patch458:       aarch64-rename-PSR_MODE_ELxx-to-match-linux-headers.patch
+Patch454:       xl-save-pc.patch
+Patch455:       pygrub-boot-legacy-sles.patch
+Patch456:       pygrub-handle-one-line-menu-entries.patch
+Patch457:       aarch64-rename-PSR_MODE_ELxx-to-match-linux-headers.patch
 Patch461:       libxl.max_event_channels.patch
 Patch463:       libxl.add-option-to-disable-disk-cache-flushes-in-qdisk.patch
 Patch464:       libxl.pvscsi.patch
@@ -239,8 +227,6 @@
 Patch601:       x86-ioapic-ack-default.patch
 Patch602:       xenwatchdogd-restart.patch
 Patch621:       xen.build-compare.doc_html.patch
-Patch623:       ipxe-no-error-logical-not-parentheses.patch
-Patch624:       ipxe-use-rpm-opt-flags.patch
 # Build patches
 Patch99996:     xen.stubdom.newlib.patch
 URL:            http://www.cl.cam.ac.uk/Research/SRG/netos/xen/
@@ -416,7 +402,7 @@
 %endif
 
 %prep
-%setup -q -n %xen_build_dir -a 1 -a 2 -a 3 -a 4
+%setup -q -n %xen_build_dir -a 1 -a 2 -a 3
 %autosetup -D -T -n %xen_build_dir -p1
 
 %build
@@ -497,7 +483,6 @@
         --disable-xen \
         --enable-tools \
         --enable-docs \
-        --disable-rombios \
         --prefix=/usr \
         --exec_prefix=/usr \
         --bindir=%{_bindir} \
@@ -511,11 +496,6 @@
         --docdir=%{_defaultdocdir}/xen \
        --with-initddir=%{_initddir} \
        --with-rundir=%{_rundir} \
-%if %{?with_dom0_support}0
-%if %{with xen_oxenstored}
-       --with-xenstored=oxenstored \
-%endif
-%endif
        --enable-systemd \
        --with-systemd=%{_unitdir} \
        --with-systemd-modules-load=%{with_systemd_modules_load} \
@@ -952,7 +932,6 @@
 rm -rf %{buildroot}/%{_datadir}/man
 rm -rf %{buildroot}/%{_libexecdir}/%{name}
 rm -rf %{buildroot}/%{_libdir}/python*
-rm -rf %{buildroot}/%{_libdir}/ocaml*
 rm -rf %{buildroot}/%{_unitdir}
 rm -rf %{buildroot}/%{_fillupdir}
 rm -rf %{buildroot}/%{with_systemd_modules_load}
@@ -1111,48 +1090,6 @@
 %{_defaultdocdir}/xen/boot.xen
 %{_mandir}/man*/*
 
-%if %{with xen_oxenstored}
-/usr/sbin/oxenstored
-/etc/xen/oxenstored.conf
-%dir %{_libdir}/ocaml
-%dir %{_libdir}/ocaml/xenbus
-%dir %{_libdir}/ocaml/xenctrl
-%dir %{_libdir}/ocaml/xeneventchn
-%dir %{_libdir}/ocaml/xenlight
-%dir %{_libdir}/ocaml/xenmmap
-%dir %{_libdir}/ocaml/xenstore
-%dir %{_libdir}/ocaml/xentoollog
-%{_libdir}/ocaml/xenbus/META
-%{_libdir}/ocaml/xenbus/*.so
-%{_libdir}/ocaml/xenbus/*.cma
-%{_libdir}/ocaml/xenbus/*.cmi
-%{_libdir}/ocaml/xenbus/*.cmo
-%{_libdir}/ocaml/xenctrl/META
-%{_libdir}/ocaml/xenctrl/*.so
-%{_libdir}/ocaml/xenctrl/*.cma
-%{_libdir}/ocaml/xenctrl/*.cmi
-%{_libdir}/ocaml/xeneventchn/META
-%{_libdir}/ocaml/xeneventchn/*.so
-%{_libdir}/ocaml/xeneventchn/*.cma
-%{_libdir}/ocaml/xeneventchn/*.cmi
-%{_libdir}/ocaml/xenlight/META
-%{_libdir}/ocaml/xenlight/*.so
-%{_libdir}/ocaml/xenlight/*.cma
-%{_libdir}/ocaml/xenlight/*.cmi
-%{_libdir}/ocaml/xenmmap/META
-%{_libdir}/ocaml/xenmmap/*.so
-%{_libdir}/ocaml/xenmmap/*.cma
-%{_libdir}/ocaml/xenmmap/*.cmi
-%{_libdir}/ocaml/xenstore/META
-%{_libdir}/ocaml/xenstore/*.cma
-%{_libdir}/ocaml/xenstore/*.cmi
-%{_libdir}/ocaml/xenstore/*.cmo
-%{_libdir}/ocaml/xentoollog/META
-%{_libdir}/ocaml/xentoollog/*.so
-%{_libdir}/ocaml/xentoollog/*.cma
-%{_libdir}/ocaml/xentoollog/*.cmi
-%endif
-
 %ifarch x86_64
 %files tools-xendomains-wait-disk
 %license xendomains-wait-disk/LICENSE
@@ -1184,24 +1121,6 @@
 %defattr(-,root,root)
 %{_libdir}/*.a
 %{_libdir}/*.so
-%if %{?with_dom0_support}0
-%if %{with xen_oxenstored}
-%{_libdir}/ocaml/xenbus/*.a
-%{_libdir}/ocaml/xenbus/*.cmx*
-%{_libdir}/ocaml/xenctrl/*.a
-%{_libdir}/ocaml/xenctrl/*.cmx*
-%{_libdir}/ocaml/xeneventchn/*.a
-%{_libdir}/ocaml/xeneventchn/*.cmx*
-%{_libdir}/ocaml/xenlight/*.a
-%{_libdir}/ocaml/xenlight/*.cmx*
-%{_libdir}/ocaml/xenmmap/*.a
-%{_libdir}/ocaml/xenmmap/*.cmx*
-%{_libdir}/ocaml/xenstore/*.a
-%{_libdir}/ocaml/xenstore/*.cmx*
-%{_libdir}/ocaml/xentoollog/*.a
-%{_libdir}/ocaml/xentoollog/*.cmx*
-%endif
-%endif
 /usr/include/*
 %{_libdir}/pkgconfig/xenlight.pc
 %{_libdir}/pkgconfig/xlutil.pc

++++++ xen-4.16.0-testing-src.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xen-4.16.0-testing/ChangeLog 
new/xen-4.16.0-testing/ChangeLog
--- old/xen-4.16.0-testing/ChangeLog    2021-11-09 15:18:21.000000000 +0100
+++ new/xen-4.16.0-testing/ChangeLog    2021-11-17 15:24:23.000000000 +0100
@@ -1,14 +1,12 @@
-commit 9d9cd0c6f5b16652f61e7f21233ec8dfd6cf7df2
-Author: Roger Pau Monne <roger....@citrix.com>
-Date:   Tue Nov 9 10:47:21 2021 +0100
+commit 2d72d2784eb71d8532bfbd6462d261739c9e82e4
+Author: Jan Beulich <jbeul...@suse.com>
+Date:   Tue Nov 16 17:34:06 2021 +0100
 
-    tools/configure: make iPXE dependent on QEMU traditional
+    public/gnttab: relax v2 recommendation
     
-    iPXE is only used by QEMU traditional, so make it off by default
-    unless QEMU traditional is enabled.
+    With there being a way to disable v2 support, telling new guests to use
+    v2 exclusively is not a good suggestion.
     
-    Reported-by: Andrew Cooper <andrew.coop...@citrix.com>
-    Fixes: bcf77ce510 ('configure: modify default of building rombios')
-    Signed-off-by: Roger Pau Monn?? <roger....@citrix.com>
+    Signed-off-by: Jan Beulich <jbeul...@suse.com>
+    Reviewed-by: Luca Fancellu <luca.fance...@arm.com>
     Release-Acked-by: Ian Jackson <i...@xenproject.org>
-    Reviewed-by: Ian Jackson <i...@xenproject.org>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xen-4.16.0-testing/MAINTAINERS 
new/xen-4.16.0-testing/MAINTAINERS
--- old/xen-4.16.0-testing/MAINTAINERS  2021-11-09 15:18:21.000000000 +0100
+++ new/xen-4.16.0-testing/MAINTAINERS  2021-11-17 15:24:23.000000000 +0100
@@ -232,6 +232,7 @@
 M:     Stefano Stabellini <sstabell...@kernel.org>
 M:     Julien Grall <jul...@xen.org>
 R:     Volodymyr Babchuk <volodymyr_babc...@epam.com>
+R:     Bertrand Marquis <bertrand.marq...@arm.com>
 S:     Supported
 L:     xen-de...@lists.xenproject.org
 F:     docs/misc/arm/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xen-4.16.0-testing/tools/libs/guest/xg_cpuid_x86.c 
new/xen-4.16.0-testing/tools/libs/guest/xg_cpuid_x86.c
--- old/xen-4.16.0-testing/tools/libs/guest/xg_cpuid_x86.c      2021-11-09 
15:18:21.000000000 +0100
+++ new/xen-4.16.0-testing/tools/libs/guest/xg_cpuid_x86.c      2021-11-17 
15:24:23.000000000 +0100
@@ -638,6 +638,13 @@
         }
     }
 
+    /*
+     * Do not try to shrink the policy if restoring, as that could cause
+     * guest visible changes in the maximum leaf fields.
+     */
+    if ( !restore )
+        x86_cpuid_policy_shrink_max_leaves(p);
+
     rc = x86_cpuid_copy_to_buffer(p, leaves, &nr_leaves);
     if ( rc )
     {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xen-4.16.0-testing/tools/tests/resource/Makefile 
new/xen-4.16.0-testing/tools/tests/resource/Makefile
--- old/xen-4.16.0-testing/tools/tests/resource/Makefile        2021-11-09 
15:18:21.000000000 +0100
+++ new/xen-4.16.0-testing/tools/tests/resource/Makefile        2021-11-17 
15:24:23.000000000 +0100
@@ -31,10 +31,12 @@
 CFLAGS += $(CFLAGS_xeninclude)
 CFLAGS += $(CFLAGS_libxenctrl)
 CFLAGS += $(CFLAGS_libxenforeginmemory)
+CFLAGS += $(CFLAGS_libxengnttab)
 CFLAGS += $(APPEND_CFLAGS)
 
 LDFLAGS += $(LDLIBS_libxenctrl)
 LDFLAGS += $(LDLIBS_libxenforeignmemory)
+LDFLAGS += $(LDLIBS_libxengnttab)
 LDFLAGS += $(APPEND_LDFLAGS)
 
 %.o: Makefile
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/xen-4.16.0-testing/tools/tests/resource/test-resource.c 
new/xen-4.16.0-testing/tools/tests/resource/test-resource.c
--- old/xen-4.16.0-testing/tools/tests/resource/test-resource.c 2021-11-09 
15:18:21.000000000 +0100
+++ new/xen-4.16.0-testing/tools/tests/resource/test-resource.c 2021-11-17 
15:24:23.000000000 +0100
@@ -6,6 +6,7 @@
 
 #include <xenctrl.h>
 #include <xenforeignmemory.h>
+#include <xengnttab.h>
 #include <xen-tools/libs.h>
 
 static unsigned int nr_failures;
@@ -17,13 +18,17 @@
 
 static xc_interface *xch;
 static xenforeignmemory_handle *fh;
+static xengnttab_handle *gh;
 
-static void test_gnttab(uint32_t domid, unsigned int nr_frames)
+static void test_gnttab(uint32_t domid, unsigned int nr_frames,
+                        unsigned long gfn)
 {
     xenforeignmemory_resource_handle *res;
-    void *addr = NULL;
+    grant_entry_v1_t *gnttab;
     size_t size;
     int rc;
+    uint32_t refs[nr_frames], domids[nr_frames];
+    void *grants;
 
     printf("  Test grant table\n");
 
@@ -51,18 +56,56 @@
     res = xenforeignmemory_map_resource(
         fh, domid, XENMEM_resource_grant_table,
         XENMEM_resource_grant_table_id_shared, 0, size >> XC_PAGE_SHIFT,
-        &addr, PROT_READ | PROT_WRITE, 0);
+        (void **)&gnttab, PROT_READ | PROT_WRITE, 0);
 
     /*
      * Failure here with E2BIG indicates Xen is missing the bugfix to map
      * resources larger than 32 frames.
      */
     if ( !res )
-        return fail("    Fail: Map %d - %s\n", errno, strerror(errno));
+        return fail("    Fail: Map grant table %d - %s\n",
+                    errno, strerror(errno));
 
+    /* Put each gref at a unique offset in its frame. */
+    for ( unsigned int i = 0; i < nr_frames; i++ )
+    {
+        unsigned int gref = i * (XC_PAGE_SIZE / sizeof(*gnttab)) + i;
+
+        refs[i] = gref;
+        domids[i] = domid;
+
+        gnttab[gref].domid = 0;
+        gnttab[gref].frame = gfn;
+        gnttab[gref].flags = GTF_permit_access;
+    }
+
+    /* Map grants. */
+    grants = xengnttab_map_grant_refs(gh, nr_frames, domids, refs,
+                                      PROT_READ | PROT_WRITE);
+
+    /*
+     * Failure here indicates either that the frames were not mapped
+     * in the correct order or xenforeignmemory_map_resource() didn't
+     * give us the frames we asked for to begin with.
+     */
+    if ( grants == NULL )
+    {
+        fail("    Fail: Map grants %d - %s\n", errno, strerror(errno));
+        goto out;
+    }
+
+    /* Unmap grants. */
+    rc = xengnttab_unmap(gh, grants, nr_frames);
+
+    if ( rc )
+        fail("    Fail: Unmap grants %d - %s\n", errno, strerror(errno));
+
+    /* Unmap grant table. */
+ out:
     rc = xenforeignmemory_unmap_resource(fh, res);
     if ( rc )
-        return fail("    Fail: Unmap %d - %s\n", errno, strerror(errno));
+        return fail("    Fail: Unmap grant table %d - %s\n",
+                    errno, strerror(errno));
 }
 
 static void test_domain_configurations(void)
@@ -107,6 +150,7 @@
         struct test *t = &tests[i];
         uint32_t domid = 0;
         int rc;
+        xen_pfn_t ram[1] = { 0 };
 
         printf("Test %s\n", t->name);
 
@@ -123,8 +167,26 @@
 
         printf("  Created d%u\n", domid);
 
-        test_gnttab(domid, t->create.max_grant_frames);
+        rc = xc_domain_setmaxmem(xch, domid, -1);
+        if ( rc )
+        {
+            fail("  Failed to set max memory for domain: %d - %s\n",
+                 errno, strerror(errno));
+            goto test_done;
+        }
+
+        rc = xc_domain_populate_physmap_exact(
+            xch, domid, ARRAY_SIZE(ram), 0, 0, ram);
+        if ( rc )
+        {
+            fail("  Failed to populate physmap domain: %d - %s\n",
+                 errno, strerror(errno));
+            goto test_done;
+        }
+
+        test_gnttab(domid, t->create.max_grant_frames, ram[0]);
 
+    test_done:
         rc = xc_domain_destroy(xch, domid);
         if ( rc )
             fail("  Failed to destroy domain: %d - %s\n",
@@ -138,13 +200,26 @@
 
     xch = xc_interface_open(NULL, NULL, 0);
     fh = xenforeignmemory_open(NULL, 0);
+    gh = xengnttab_open(NULL, 0);
 
     if ( !xch )
         err(1, "xc_interface_open");
     if ( !fh )
         err(1, "xenforeignmemory_open");
+    if ( !gh )
+        err(1, "xengnttab_open");
 
     test_domain_configurations();
 
     return !!nr_failures;
 }
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xen-4.16.0-testing/xen/arch/arm/domain_build.c 
new/xen-4.16.0-testing/xen/arch/arm/domain_build.c
--- old/xen-4.16.0-testing/xen/arch/arm/domain_build.c  2021-11-09 
15:18:21.000000000 +0100
+++ new/xen-4.16.0-testing/xen/arch/arm/domain_build.c  2021-11-17 
15:24:23.000000000 +0100
@@ -395,6 +395,14 @@
     struct membank *bank;
     unsigned int max_order = ~0;
 
+    /*
+     * allocate_bank_memory can be called with a tot_size of zero for
+     * the second memory bank. It is not an error and we can safely
+     * avoid creating a zero-size memory bank.
+     */
+    if ( tot_size == 0 )
+        return true;
+
     bank = &kinfo->mem.bank[kinfo->mem.nr_banks];
     bank->start = gfn_to_gaddr(sgfn);
     bank->size = tot_size;
@@ -862,21 +870,25 @@
 {
     int res, i;
     int reg_size = addrcells + sizecells;
-    int nr_cells = reg_size * mem->nr_banks;
+    int nr_cells = 0;
     /* Placeholder for memory@ + a 64-bit number + \0 */
     char buf[24];
     __be32 reg[NR_MEM_BANKS * 4 /* Worst case addrcells + sizecells */];
     __be32 *cells;
 
-    BUG_ON(nr_cells >= ARRAY_SIZE(reg));
     if ( mem->nr_banks == 0 )
         return -ENOENT;
 
-    dt_dprintk("Create memory node (reg size %d, nr cells %d)\n",
-               reg_size, nr_cells);
+    /* find first memory range not bound to a Xen domain */
+    for ( i = 0; i < mem->nr_banks && mem->bank[i].xen_domain; i++ )
+        ;
+    if ( i == mem->nr_banks )
+        return 0;
+
+    dt_dprintk("Create memory node\n");
 
     /* ePAPR 3.4 */
-    snprintf(buf, sizeof(buf), "memory@%"PRIx64, mem->bank[0].start);
+    snprintf(buf, sizeof(buf), "memory@%"PRIx64, mem->bank[i].start);
     res = fdt_begin_node(fdt, buf);
     if ( res )
         return res;
@@ -886,17 +898,24 @@
         return res;
 
     cells = &reg[0];
-    for ( i = 0 ; i < mem->nr_banks; i++ )
+    for ( ; i < mem->nr_banks; i++ )
     {
         u64 start = mem->bank[i].start;
         u64 size = mem->bank[i].size;
 
+        if ( mem->bank[i].xen_domain )
+            continue;
+
         dt_dprintk("  Bank %d: %#"PRIx64"->%#"PRIx64"\n",
                    i, start, start + size);
 
+        nr_cells += reg_size;
+        BUG_ON(nr_cells >= ARRAY_SIZE(reg));
         dt_child_set_range(&cells, addrcells, sizecells, start, size);
     }
 
+    dt_dprintk("(reg size %d, nr cells %d)\n", reg_size, nr_cells);
+
     res = fdt_property(fdt, "reg", reg, nr_cells * sizeof(*reg));
     if ( res )
         return res;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xen-4.16.0-testing/xen/arch/x86/cpuid.c 
new/xen-4.16.0-testing/xen/arch/x86/cpuid.c
--- old/xen-4.16.0-testing/xen/arch/x86/cpuid.c 2021-11-09 15:18:21.000000000 
+0100
+++ new/xen-4.16.0-testing/xen/arch/x86/cpuid.c 2021-11-17 15:24:23.000000000 
+0100
@@ -719,8 +719,6 @@
 
     if ( !p->extd.page1gb )
         p->extd.raw[0x19] = EMPTY_LEAF;
-
-    x86_cpuid_policy_shrink_max_leaves(p);
 }
 
 int init_domain_cpuid_policy(struct domain *d)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/xen-4.16.0-testing/xen/drivers/passthrough/vtd/iommu.c 
new/xen-4.16.0-testing/xen/drivers/passthrough/vtd/iommu.c
--- old/xen-4.16.0-testing/xen/drivers/passthrough/vtd/iommu.c  2021-11-09 
15:18:21.000000000 +0100
+++ new/xen-4.16.0-testing/xen/drivers/passthrough/vtd/iommu.c  2021-11-17 
15:24:23.000000000 +0100
@@ -54,7 +54,7 @@
 bool __read_mostly iommu_snoop = true;
 #endif
 
-static unsigned int __initdata nr_iommus;
+static unsigned int __read_mostly nr_iommus;
 
 static struct iommu_ops vtd_ops;
 static struct tasklet vtd_fault_tasklet;
@@ -645,7 +645,7 @@
 
         iommu = drhd->iommu;
 
-        if ( !test_bit(iommu->index, &hd->arch.vtd.iommu_bitmap) )
+        if ( !test_bit(iommu->index, hd->arch.vtd.iommu_bitmap) )
             continue;
 
         flush_dev_iotlb = !!find_ats_dev_drhd(iommu);
@@ -1308,6 +1308,11 @@
 {
     struct domain_iommu *hd = dom_iommu(d);
 
+    hd->arch.vtd.iommu_bitmap = xzalloc_array(unsigned long,
+                                              BITS_TO_LONGS(nr_iommus));
+    if ( !hd->arch.vtd.iommu_bitmap )
+        return -ENOMEM;
+
     hd->arch.vtd.agaw = width_to_agaw(DEFAULT_DOMAIN_ADDRESS_WIDTH);
 
     return 0;
@@ -1457,7 +1462,7 @@
     if ( rc > 0 )
         rc = 0;
 
-    set_bit(iommu->index, &hd->arch.vtd.iommu_bitmap);
+    set_bit(iommu->index, hd->arch.vtd.iommu_bitmap);
 
     unmap_vtd_domain_page(context_entries);
 
@@ -1789,7 +1794,7 @@
 
     if ( !found )
     {
-        clear_bit(iommu->index, &dom_iommu(domain)->arch.vtd.iommu_bitmap);
+        clear_bit(iommu->index, dom_iommu(domain)->arch.vtd.iommu_bitmap);
         cleanup_domid_map(domain, iommu);
     }
 
@@ -1819,6 +1824,8 @@
 
     for_each_drhd_unit ( drhd )
         cleanup_domid_map(d, drhd->iommu);
+
+    XFREE(hd->arch.vtd.iommu_bitmap);
 }
 
 static int __must_check intel_iommu_map_page(struct domain *d, dfn_t dfn,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xen-4.16.0-testing/xen/include/asm-x86/iommu.h 
new/xen-4.16.0-testing/xen/include/asm-x86/iommu.h
--- old/xen-4.16.0-testing/xen/include/asm-x86/iommu.h  2021-11-09 
15:18:21.000000000 +0100
+++ new/xen-4.16.0-testing/xen/include/asm-x86/iommu.h  2021-11-17 
15:24:23.000000000 +0100
@@ -58,7 +58,7 @@
         struct {
             uint64_t pgd_maddr; /* io page directory machine address */
             unsigned int agaw; /* adjusted guest address width, 0 is level 2 
30-bit */
-            uint64_t iommu_bitmap; /* bitmap of iommu(s) that the domain uses 
*/
+            unsigned long *iommu_bitmap; /* bitmap of iommu(s) that the domain 
uses */
         } vtd;
         /* AMD IOMMU */
         struct {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xen-4.16.0-testing/xen/include/public/grant_table.h 
new/xen-4.16.0-testing/xen/include/public/grant_table.h
--- old/xen-4.16.0-testing/xen/include/public/grant_table.h     2021-11-09 
15:18:21.000000000 +0100
+++ new/xen-4.16.0-testing/xen/include/public/grant_table.h     2021-11-17 
15:24:23.000000000 +0100
@@ -121,8 +121,9 @@
  */
 
 /*
- * Version 1 of the grant table entry structure is maintained purely
- * for backwards compatibility.  New guests should use version 2.
+ * Version 1 of the grant table entry structure is maintained largely for
+ * backwards compatibility.  New guests are recommended to support using
+ * version 2 to overcome version 1 limitations, but to default to version 1.
  */
 #if __XEN_INTERFACE_VERSION__ < 0x0003020a
 #define grant_entry_v1 grant_entry

Reply via email to