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-02-17 18:08:47
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/xen (Old)
 and      /work/SRC/openSUSE:Factory/.xen.new.28504 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "xen"

Wed Feb 17 18:08:47 2021 rev:298 rq:871003 version:4.14.1_11

Changes:
--------
--- /work/SRC/openSUSE:Factory/xen/xen.changes  2021-01-26 14:44:46.639257780 
+0100
+++ /work/SRC/openSUSE:Factory/.xen.new.28504/xen.changes       2021-02-17 
18:09:09.605823781 +0100
@@ -1,0 +2,22 @@
+Wed Feb 10 12:52:00 MST 2021 - carn...@suse.com
+
+- bsc#1181921 - GCC 11: xen package fails
+  gcc11-fixes.patch
+- Drop gcc10-fixes.patch
+
+-------------------------------------------------------------------
+Tue Feb  2 05:37:27 MST 2021 - carn...@suse.com
+
+- Upstream bug fixes (bsc#1027519)
+  5fedf9f4-x86-hpet_setup-fix-retval.patch
+  5ff458f2-x86-vPCI-tolerate-disabled-MSI-X-entry.patch
+  5ff71655-x86-dpci-EOI-regardless-of-masking.patch
+  5ffc58e8-x86-ACPI-dont-overwrite-FADT.patch
+  600999ad-x86-dpci-do-not-remove-pirqs-from.patch (Replaces xsa360.patch)
+  600ab341-x86-vioapic-EOI-check-IRR-before-inject.patch
+  6013e4bd-memory-bail-from-page-scrub-when-CPU-offline.patch
+  6013e546-x86-HVM-reorder-domain-init-error-path.patch
+- bsc#1180491 - "Panic on CPU 0: IO-APIC + timer doesn't work!"
+  6011bbc7-x86-timer-fix-boot-without-PIT.patch
+
+-------------------------------------------------------------------

Old:
----
  gcc10-fixes.patch
  xsa360.patch

New:
----
  5fedf9f4-x86-hpet_setup-fix-retval.patch
  5ff458f2-x86-vPCI-tolerate-disabled-MSI-X-entry.patch
  5ff71655-x86-dpci-EOI-regardless-of-masking.patch
  5ffc58e8-x86-ACPI-dont-overwrite-FADT.patch
  600999ad-x86-dpci-do-not-remove-pirqs-from.patch
  600ab341-x86-vioapic-EOI-check-IRR-before-inject.patch
  6011bbc7-x86-timer-fix-boot-without-PIT.patch
  6013e4bd-memory-bail-from-page-scrub-when-CPU-offline.patch
  6013e546-x86-HVM-reorder-domain-init-error-path.patch
  gcc11-fixes.patch

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

Other differences:
------------------
++++++ xen.spec ++++++
--- /var/tmp/diff_new_pack.h87FzB/_old  2021-02-17 18:09:11.277825149 +0100
+++ /var/tmp/diff_new_pack.h87FzB/_new  2021-02-17 18:09:11.281825152 +0100
@@ -130,7 +130,7 @@
 %endif
 Provides:       installhint(reboot-needed)
 
-Version:        4.14.1_08
+Version:        4.14.1_11
 Release:        0
 Summary:        Xen Virtualization: Hypervisor (aka VMM aka Microkernel)
 License:        GPL-2.0-only
@@ -169,7 +169,15 @@
 Source99:       baselibs.conf
 # Upstream patches
 Patch1:         5fca3b32-tools-libs-ctrl-fix-dumping-of-ballooned-guest.patch
-Patch36001:     xsa360.patch
+Patch2:         5fedf9f4-x86-hpet_setup-fix-retval.patch
+Patch3:         5ff458f2-x86-vPCI-tolerate-disabled-MSI-X-entry.patch
+Patch4:         5ff71655-x86-dpci-EOI-regardless-of-masking.patch
+Patch5:         5ffc58e8-x86-ACPI-dont-overwrite-FADT.patch
+Patch6:         600999ad-x86-dpci-do-not-remove-pirqs-from.patch
+Patch7:         600ab341-x86-vioapic-EOI-check-IRR-before-inject.patch
+Patch8:         6011bbc7-x86-timer-fix-boot-without-PIT.patch
+Patch9:         6013e4bd-memory-bail-from-page-scrub-when-CPU-offline.patch
+Patch10:        6013e546-x86-HVM-reorder-domain-init-error-path.patch
 # libxc
 Patch300:       libxc-sr-3cccdae45242dab27198b8e150be0c85acd5d3c9.patch
 Patch301:       libxc-sr-readv_exact.patch
@@ -214,7 +222,7 @@
 Patch420:       suspend_evtchn_lock.patch
 Patch422:       stubdom-have-iovec.patch
 Patch423:       vif-route.patch
-Patch424:       gcc10-fixes.patch
+Patch424:       gcc11-fixes.patch
 # Other bug fixes or features
 Patch451:       xenconsole-no-multiple-connections.patch
 Patch452:       hibernate.patch
@@ -427,7 +435,15 @@
 %setup -q -n %xen_build_dir -a 1 -a 5 -a 6 -a 57
 # Upstream patches
 %patch1 -p1
-%patch36001 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
+%patch9 -p1
+%patch10 -p1
 # libxc
 %patch300 -p1
 %patch301 -p1

++++++ 5fedf9f4-x86-hpet_setup-fix-retval.patch ++++++
# Commit 83736c567d6b64dbce98f251ca72e7870f556421
# Date 2020-12-31 16:19:00 +0000
# Author Andrew Cooper <andrew.coop...@citrix.com>
# Committer Andrew Cooper <andrew.coop...@citrix.com>
x86/hpet: Fix return value of hpet_setup()

hpet_setup() is idempotent if the rate has already been calculated, and
returns the cached value.  However, this only works correctly when the return
statements are identical.

Use a sensibly named local variable, rather than a dead one with a bad name.

Fixes: a60bb68219 ("x86/time: reduce rounding errors in calculations")
Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com>
Reviewed-by: Roger Pau Monn?? <roger....@citrix.com>

--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -769,7 +769,7 @@ u64 __init hpet_setup(void)
 {
     static u64 __initdata hpet_rate;
     u32 hpet_id, hpet_period;
-    unsigned int last;
+    unsigned int last, rem;
 
     if ( hpet_rate )
         return hpet_rate;
@@ -799,9 +799,11 @@ u64 __init hpet_setup(void)
     hpet_resume(hpet_boot_cfg);
 
     hpet_rate = 1000000000000000ULL; /* 10^15 */
-    last = do_div(hpet_rate, hpet_period);
+    rem = do_div(hpet_rate, hpet_period);
+    if ( (rem * 2) > hpet_period )
+        hpet_rate++;
 
-    return hpet_rate + (last * 2 > hpet_period);
+    return hpet_rate;
 }
 
 void hpet_resume(u32 *boot_cfg)
++++++ 5ff458f2-x86-vPCI-tolerate-disabled-MSI-X-entry.patch ++++++
# Commit 04b090366ca59e8a75837c822df261a8d0bd1a30
# Date 2021-01-05 13:17:54 +0100
# Author Jan Beulich <jbeul...@suse.com>
# Committer Jan Beulich <jbeul...@suse.com>
x86/vPCI: tolerate (un)masking a disabled MSI-X entry

None of the four reasons causing vpci_msix_arch_mask_entry() to get
called (there's just a single call site) are impossible or illegal prior
to an entry actually having got set up:
- the entry may remain masked (in this case, however, a prior masked ->
  unmasked transition would already not have worked),
- MSI-X may not be enabled,
- the global mask bit may be set,
- the entry may not otherwise have been updated.
Hence the function asserting that the entry was previously set up was
simply wrong. Since the caller tracks the masked state (and setting up
of an entry would only be effected when that software bit is clear),
it's okay to skip both masking and unmasking requests in this case.

Fixes: d6281be9d0145 ('vpci/msix: add MSI-X handlers')
Reported-by: Manuel Bouyer <bou...@antioche.eu.org>
Signed-off-by: Jan Beulich <jbeul...@suse.com>
Reviewed-by: Roger Pau Monn?? <roger....@citrix.com>
Tested-by: Manuel Bouyer <bou...@antioche.eu.org>

--- a/xen/arch/x86/hvm/vmsi.c
+++ b/xen/arch/x86/hvm/vmsi.c
@@ -844,8 +844,8 @@ void vpci_msi_arch_print(const struct vp
 void vpci_msix_arch_mask_entry(struct vpci_msix_entry *entry,
                                const struct pci_dev *pdev, bool mask)
 {
-    ASSERT(entry->arch.pirq != INVALID_PIRQ);
-    vpci_mask_pirq(pdev->domain, entry->arch.pirq, mask);
+    if ( entry->arch.pirq != INVALID_PIRQ )
+        vpci_mask_pirq(pdev->domain, entry->arch.pirq, mask);
 }
 
 int vpci_msix_arch_enable_entry(struct vpci_msix_entry *entry,
++++++ 5ff71655-x86-dpci-EOI-regardless-of-masking.patch ++++++
# Commit eb298f32fac5ac362eef30a66a9c9c42724d4ce6
# Date 2021-01-07 15:10:29 +0100
# Author Roger Pau Monn?? <roger....@citrix.com>
# Committer Jan Beulich <jbeul...@suse.com>
x86/dpci: EOI interrupt regardless of its masking status

Modify hvm_pirq_eoi to always EOI the interrupt if required, instead
of not doing such EOI if the interrupt is routed through the vIO-APIC
and the entry is masked at the time the EOI is performed.

Further unmask of the vIO-APIC pin won't EOI the interrupt, and thus
the guest OS has to wait for the timeout to expire and the automatic
EOI to be performed.

This allows to simplify the helpers and drop the vioapic_redir_entry
parameter from all of them.

Fixes: ccfe4e08455 ('Intel vt-d specific changes in arch/x86/hvm/vmx/vtd.')
Signed-off-by: Roger Pau Monn?? <roger....@citrix.com>
Reviewed-by: Jan Beulich <jbeul...@suse.com>

--- a/xen/arch/x86/hvm/vioapic.c
+++ b/xen/arch/x86/hvm/vioapic.c
@@ -539,7 +539,7 @@ void vioapic_update_EOI(struct domain *d
             if ( is_iommu_enabled(d) )
             {
                 spin_unlock(&d->arch.hvm.irq_lock);
-                hvm_dpci_eoi(d, vioapic->base_gsi + pin, ent);
+                hvm_dpci_eoi(d, vioapic->base_gsi + pin);
                 spin_lock(&d->arch.hvm.irq_lock);
             }
 
--- a/xen/arch/x86/hvm/vpic.c
+++ b/xen/arch/x86/hvm/vpic.c
@@ -261,8 +261,7 @@ static void vpic_ioport_write(
                 vpic_update_int_output(vpic);
                 vpic_unlock(vpic);
                 hvm_dpci_eoi(current->domain,
-                             hvm_isa_irq_to_gsi((addr >> 7) ? (irq|8) : irq),
-                             NULL);
+                             hvm_isa_irq_to_gsi((addr >> 7) ? (irq | 8) : 
irq));
                 return; /* bail immediately */
             case 6: /* Set Priority                */
                 vpic->priority_add = (val + 1) & 7;
--- a/xen/drivers/passthrough/io.c
+++ b/xen/drivers/passthrough/io.c
@@ -950,8 +950,7 @@ static void hvm_dirq_assist(struct domai
     spin_unlock(&d->event_lock);
 }
 
-static void hvm_pirq_eoi(struct pirq *pirq,
-                         const union vioapic_redir_entry *ent)
+static void hvm_pirq_eoi(struct pirq *pirq)
 {
     struct hvm_pirq_dpci *pirq_dpci;
 
@@ -968,7 +967,6 @@ static void hvm_pirq_eoi(struct pirq *pi
      * since interrupt is still not EOIed
      */
     if ( --pirq_dpci->pending ||
-         (ent && ent->fields.mask) ||
          !pt_irq_need_timer(pirq_dpci->flags) )
         return;
 
@@ -977,19 +975,17 @@ static void hvm_pirq_eoi(struct pirq *pi
 }
 
 static void __hvm_dpci_eoi(struct domain *d,
-                           const struct hvm_girq_dpci_mapping *girq,
-                           const union vioapic_redir_entry *ent)
+                           const struct hvm_girq_dpci_mapping *girq)
 {
     struct pirq *pirq = pirq_info(d, girq->machine_gsi);
 
     if ( !hvm_domain_use_pirq(d, pirq) )
         hvm_pci_intx_deassert(d, girq->device, girq->intx);
 
-    hvm_pirq_eoi(pirq, ent);
+    hvm_pirq_eoi(pirq);
 }
 
-static void hvm_gsi_eoi(struct domain *d, unsigned int gsi,
-                        const union vioapic_redir_entry *ent)
+static void hvm_gsi_eoi(struct domain *d, unsigned int gsi)
 {
     struct pirq *pirq = pirq_info(d, gsi);
 
@@ -998,11 +994,10 @@ static void hvm_gsi_eoi(struct domain *d
         return;
 
     hvm_gsi_deassert(d, gsi);
-    hvm_pirq_eoi(pirq, ent);
+    hvm_pirq_eoi(pirq);
 }
 
-void hvm_dpci_eoi(struct domain *d, unsigned int guest_gsi,
-                  const union vioapic_redir_entry *ent)
+void hvm_dpci_eoi(struct domain *d, unsigned int guest_gsi)
 {
     const struct hvm_irq_dpci *hvm_irq_dpci;
     const struct hvm_girq_dpci_mapping *girq;
@@ -1013,7 +1008,7 @@ void hvm_dpci_eoi(struct domain *d, unsi
     if ( is_hardware_domain(d) )
     {
         spin_lock(&d->event_lock);
-        hvm_gsi_eoi(d, guest_gsi, ent);
+        hvm_gsi_eoi(d, guest_gsi);
         goto unlock;
     }
 
@@ -1030,7 +1025,7 @@ void hvm_dpci_eoi(struct domain *d, unsi
         goto unlock;
 
     list_for_each_entry ( girq, &hvm_irq_dpci->girq[guest_gsi], list )
-        __hvm_dpci_eoi(d, girq, ent);
+        __hvm_dpci_eoi(d, girq);
 
 unlock:
     spin_unlock(&d->event_lock);
--- a/xen/include/asm-x86/hvm/io.h
+++ b/xen/include/asm-x86/hvm/io.h
@@ -118,8 +118,7 @@ bool handle_mmio_with_translation(unsign
                                   struct npfec);
 bool handle_pio(uint16_t port, unsigned int size, int dir);
 void hvm_interrupt_post(struct vcpu *v, int vector, int type);
-void hvm_dpci_eoi(struct domain *d, unsigned int guest_irq,
-                  const union vioapic_redir_entry *ent);
+void hvm_dpci_eoi(struct domain *d, unsigned int guest_irq);
 void msix_write_completion(struct vcpu *);
 
 #ifdef CONFIG_HVM
++++++ 5ffc58e8-x86-ACPI-dont-overwrite-FADT.patch ++++++
# Commit 654c917d94d24587bb6b4a8d862baf04b25cbe33
# Date 2021-01-11 14:55:52 +0100
# Author Jan Beulich <jbeul...@suse.com>
# Committer Jan Beulich <jbeul...@suse.com>
x86/ACPI: don't overwrite FADT

When marking fields invalid for our own purposes, we should do so in our
local copy (so we will notice later on), not in the firmware provided
one (which another entity may want to look at again, e.g. after kexec).
Also mark the function parameter const to notice such issues right away.

Instead use the pointer at the firmware copy for specifying an adjacent
printk()'s arguments. If nothing else this at least reduces the number
of relocations the assembler hasto emit and the linker has to process.

Fixes: 62d1a69a4e9f ("ACPI: support v5 (reduced HW) sleep interface")
Signed-off-by: Jan Beulich <jbeul...@suse.com>
Acked-by: Andrew Cooper <andrew.coop...@citrix.com>

--- a/xen/arch/x86/acpi/boot.c
+++ b/xen/arch/x86/acpi/boot.c
@@ -349,7 +349,7 @@ static int __init acpi_invalidate_bgrt(s
 
 /* Get pm1x_cnt and pm1x_evt information for ACPI sleep */
 static void __init
-acpi_fadt_parse_sleep_info(struct acpi_table_fadt *fadt)
+acpi_fadt_parse_sleep_info(const struct acpi_table_fadt *fadt)
 {
        struct acpi_table_facs *facs = NULL;
        uint64_t facs_pa;
@@ -362,10 +362,10 @@ acpi_fadt_parse_sleep_info(struct acpi_t
                printk(KERN_INFO PREFIX
                       "v5 SLEEP INFO: control[%d:%"PRIx64"],"
                       " status[%d:%"PRIx64"]\n",
-                      acpi_sinfo.sleep_control.space_id,
-                      acpi_sinfo.sleep_control.address,
-                      acpi_sinfo.sleep_status.space_id,
-                      acpi_sinfo.sleep_status.address);
+                      fadt->sleep_control.space_id,
+                      fadt->sleep_control.address,
+                      fadt->sleep_status.space_id,
+                      fadt->sleep_status.address);
 
                if ((fadt->sleep_control.address &&
                     (fadt->sleep_control.bit_offset ||
@@ -384,8 +384,8 @@ acpi_fadt_parse_sleep_info(struct acpi_t
                               fadt->sleep_status.bit_offset,
                               fadt->sleep_status.bit_width,
                               fadt->sleep_status.access_width);
-                       fadt->sleep_control.address = 0;
-                       fadt->sleep_status.address = 0;
+                       acpi_sinfo.sleep_control.address = 0;
+                       acpi_sinfo.sleep_status.address = 0;
                }
        }
 
++++++ 600999ad-x86-dpci-do-not-remove-pirqs-from.patch ++++++
# Commit 58427889f5a420cc5226f88524b3228f90b72a58
# Date 2021-01-21 16:11:41 +0100
# Author Roger Pau Monn?? <roger....@citrix.com>
# Committer Jan Beulich <jbeul...@suse.com>
x86/dpci: do not remove pirqs from domain tree on unbind

A fix for a previous issue removed the pirqs from the domain tree when
they are unbound in order to prevent shared pirqs from triggering a
BUG_ON in __pirq_guest_unbind if they are unbound multiple times. That
caused free_domain_pirqs to no longer unmap the pirqs because they
are gone from the domain pirq tree, thus leaving stale unbound pirqs
after domain destruction if the domain had mapped dpci pirqs after
shutdown.

Take a different approach to fix the original issue, instead of
removing the pirq from d->pirq_tree clear the flags of the dpci pirq
struct to signal that the pirq is now unbound. This prevents calling
pirq_guest_unbind multiple times for the same pirq without having to
remove it from the domain pirq tree.

This is XSA-360.

Fixes: 5b58dad089 ('x86/pass-through: avoid double IRQ unbind during domain 
cleanup')
Reported-by: Samuel Verschelde <samuel.versche...@vates.fr>
Signed-off-by: Roger Pau Monn?? <roger....@citrix.com>
Reviewed-by: Jan Beulich <jbeul...@suse.com>

--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -1331,7 +1331,7 @@ void (pirq_cleanup_check)(struct pirq *p
     }
 
     if ( radix_tree_delete(&d->pirq_tree, pirq->pirq) != pirq )
-        BUG_ON(!d->is_dying);
+        BUG();
 }
 
 /* Flush all ready EOIs from the top of this CPU's pending-EOI stack. */
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -862,6 +862,10 @@ static int pci_clean_dpci_irq(struct dom
 {
     struct dev_intx_gsi_link *digl, *tmp;
 
+    if ( !pirq_dpci->flags )
+        /* Already processed. */
+        return 0;
+
     pirq_guest_unbind(d, dpci_pirq(pirq_dpci));
 
     if ( pt_irq_need_timer(pirq_dpci->flags) )
@@ -872,15 +876,10 @@ static int pci_clean_dpci_irq(struct dom
         list_del(&digl->list);
         xfree(digl);
     }
+    /* Note the pirq is now unbound. */
+    pirq_dpci->flags = 0;
 
-    radix_tree_delete(&d->pirq_tree, dpci_pirq(pirq_dpci)->pirq);
-
-    if ( !pt_pirq_softirq_active(pirq_dpci) )
-        return 0;
-
-    domain_get_irq_dpci(d)->pending_pirq_dpci = pirq_dpci;
-
-    return -ERESTART;
+    return pt_pirq_softirq_active(pirq_dpci) ? -ERESTART : 0;
 }
 
 static int pci_clean_dpci_irqs(struct domain *d)
@@ -897,18 +896,8 @@ static int pci_clean_dpci_irqs(struct do
     hvm_irq_dpci = domain_get_irq_dpci(d);
     if ( hvm_irq_dpci != NULL )
     {
-        int ret = 0;
-
-        if ( hvm_irq_dpci->pending_pirq_dpci )
-        {
-            if ( pt_pirq_softirq_active(hvm_irq_dpci->pending_pirq_dpci) )
-                 ret = -ERESTART;
-            else
-                 hvm_irq_dpci->pending_pirq_dpci = NULL;
-        }
+        int ret = pt_pirq_iterate(d, pci_clean_dpci_irq, NULL);
 
-        if ( !ret )
-            ret = pt_pirq_iterate(d, pci_clean_dpci_irq, NULL);
         if ( ret )
         {
             spin_unlock(&d->event_lock);
--- a/xen/include/asm-x86/hvm/irq.h
+++ b/xen/include/asm-x86/hvm/irq.h
@@ -160,8 +160,6 @@ struct hvm_irq_dpci {
     DECLARE_BITMAP(isairq_map, NR_ISAIRQS);
     /* Record of mapped Links */
     uint8_t link_cnt[NR_LINK];
-    /* Clean up: Entry with a softirq invocation pending / in progress. */
-    struct hvm_pirq_dpci *pending_pirq_dpci;
 };
 
 /* Machine IRQ to guest device/intx mapping. */
++++++ 600ab341-x86-vioapic-EOI-check-IRR-before-inject.patch ++++++
# Commit ba584fb1a26c058ebd0e6a2779287b3e4400415c
# Date 2021-01-22 12:13:05 +0100
# Author Roger Pau Monn?? <roger....@citrix.com>
# Committer Jan Beulich <jbeul...@suse.com>
x86/vioapic: check IRR before attempting to inject interrupt after EOI

In vioapic_update_EOI the irq_lock will be dropped in order to forward
the EOI to the dpci handler, so there's a window between clearing IRR
and checking if the line is asserted where IRR can change behind our
back.

Fix this by checking whether IRR is set before attempting to inject a
new interrupt.

Fixes: 06e3f8f2766 ('vt-d: Do dpci eoi outside of irq_lock.')
Signed-off-by: Roger Pau Monn?? <roger....@citrix.com>
Reviewed-by: Jan Beulich <jbeul...@suse.com>

--- a/xen/arch/x86/hvm/vioapic.c
+++ b/xen/arch/x86/hvm/vioapic.c
@@ -544,7 +544,7 @@ void vioapic_update_EOI(struct domain *d
             }
 
             if ( (ent->fields.trig_mode == VIOAPIC_LEVEL_TRIG) &&
-                 !ent->fields.mask &&
+                 !ent->fields.mask && !ent->fields.remote_irr &&
                  hvm_irq->gsi_assert_count[vioapic->base_gsi + pin] )
             {
                 ent->fields.remote_irr = 1;
++++++ 6011bbc7-x86-timer-fix-boot-without-PIT.patch ++++++
References: bsc#1180491

# Commit e1de4c196a2eb4fd5063c30a2e115adf144bdeef
# Date 2021-01-27 19:15:19 +0000
# Author Andrew Cooper <andrew.coop...@citrix.com>
# Committer Andrew Cooper <andrew.coop...@citrix.com>
x86/timer: Fix boot on Intel systems using ITSSPRC static PIT clock gating

Recent Intel client devices have disabled the legacy PIT for powersaving
reasons, breaking compatibility with a traditional IBM PC.  Xen depends on a
legacy timer interrupt to check that the IO-APIC/PIC routing is configured
correctly, and fails to boot with:

  (XEN) *******************************
  (XEN) Panic on CPU 0:
  (XEN) IO-APIC + timer doesn't work!  Boot with apic_verbosity=debug and send 
report.  Then try booting with the `noapic` option
  (XEN) *******************************

While this setting can be undone by Xen, the details of how to differ by
chipset, and would be very short sighted for battery based devices.  See bit 2
"8254 Static Clock Gating Enable" in:

  
https://edc.intel.com/content/www/us/en/design/products-and-solutions/processors-and-chipsets/comet-lake-u/intel-400-series-chipset-on-package-platform-controller-hub-register-database/itss-power-reduction-control-itssprc-offset-3300/

All impacted systems have an HPET, but there is no indication of the absence
of PIT functionality, nor a suitable way to probe for its absence.  As a short
term fix, reconfigure the HPET into legacy replacement mode.  A better
longterm fix would be to avoid the reliance on the timer interrupt entirely.

Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com>
Tested-by: Jason Andryuk <jandr...@gmail.com>
Acked-by: Jan Beulich <jbeul...@suse.com>

--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -768,7 +768,7 @@ static u32 *hpet_boot_cfg;
 u64 __init hpet_setup(void)
 {
     static u64 __initdata hpet_rate;
-    u32 hpet_id, hpet_period;
+    unsigned int hpet_id, hpet_period, hpet_cfg;
     unsigned int last, rem;
 
     if ( hpet_rate )
@@ -803,6 +803,71 @@ u64 __init hpet_setup(void)
     if ( (rem * 2) > hpet_period )
         hpet_rate++;
 
+    /*
+     * Intel chipsets from Skylake/ApolloLake onwards can statically clock
+     * gate the 8259 PIT.  This option is enabled by default in slightly later
+     * systems, as turning the PIT off is a prerequisite to entering the C11
+     * power saving state.
+     *
+     * Xen currently depends on the legacy timer interrupt being active while
+     * IRQ routing is configured.
+     *
+     * Reconfigure the HPET into legacy mode to re-establish the timer
+     * interrupt.
+     */
+    if ( hpet_id & HPET_ID_LEGSUP &&
+         !((hpet_cfg = hpet_read32(HPET_CFG)) & HPET_CFG_LEGACY) )
+    {
+        unsigned int c0_cfg, ticks, count;
+
+        /* Stop the main counter. */
+        hpet_write32(hpet_cfg & ~HPET_CFG_ENABLE, HPET_CFG);
+
+        /* Reconfigure channel 0 to be 32bit periodic. */
+        c0_cfg = hpet_read32(HPET_Tn_CFG(0));
+        c0_cfg |= (HPET_TN_ENABLE | HPET_TN_PERIODIC | HPET_TN_SETVAL |
+                   HPET_TN_32BIT);
+        hpet_write32(c0_cfg, HPET_Tn_CFG(0));
+
+        /*
+         * The exact period doesn't have to match a legacy PIT.  All we need
+         * is an interrupt queued up via the IO-APIC to check routing.
+         *
+         * Use HZ as the frequency.
+         */
+        ticks = ((SECONDS(1) / HZ) * div_sc(hpet_rate, SECONDS(1), 32)) >> 32;
+
+        count = hpet_read32(HPET_COUNTER);
+
+        /*
+         * HPET_TN_SETVAL above is atrociously documented in the spec.
+         *
+         * Periodic HPET channels have a main comparator register, and
+         * separate "accumulator" register.  Despite being named accumulator
+         * in the spec, this is not an accurate description of its behaviour
+         * or purpose.
+         *
+         * Each time an interrupt is generated, the "accumulator" register is
+         * re-added to the comparator set up the new period.
+         *
+         * Normally, writes to the CMP register update both registers.
+         * However, under these semantics, it is impossible to set up a
+         * periodic timer correctly without the main HPET counter being at 0.
+         *
+         * Instead, HPET_TN_SETVAL is a self-clearing control bit which we can
+         * use for periodic timers to mean that the second write to CMP
+         * updates the accumulator only, and not the absolute comparator
+         * value.
+         *
+         * This lets us set a period when the main counter isn't at 0.
+         */
+        hpet_write32(count + ticks, HPET_Tn_CMP(0));
+        hpet_write32(ticks,         HPET_Tn_CMP(0));
+
+        /* Restart the main counter, and legacy mode. */
+        hpet_write32(hpet_cfg | HPET_CFG_ENABLE | HPET_CFG_LEGACY, HPET_CFG);
+    }
+
     return hpet_rate;
 }
 
++++++ 6013e4bd-memory-bail-from-page-scrub-when-CPU-offline.patch ++++++
# Commit 3c9fd69416f8ffc611705fb24dfb383203ddc84f
# Date 2021-01-29 11:34:37 +0100
# Author Jan Beulich <jbeul...@suse.com>
# Committer Jan Beulich <jbeul...@suse.com>
memory: bail from page scrubbing when CPU is no longer online

Scrubbing can significantly delay the offlining (parking) of a CPU (e.g.
because of booting into in smt=0 mode), to a degree that the "CPU <n>
still not dead..." messages logged on x86 in 1s intervals can be seen
multiple times. There are no softirqs involved in this process, so
extend the existing preemption check in the scrubbing logic to also exit
when the CPU is no longer observed online.

Signed-off-by: Jan Beulich <jbeul...@suse.com>
Acked-by: Andrew Cooper <andrew.coop...@citrix.com>

--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -1324,9 +1324,11 @@ bool scrub_free_pages(void)
                      * Scrub a few (8) pages before becoming eligible for
                      * preemption. But also count non-scrubbing loop iterations
                      * so that we don't get stuck here with an almost clean
-                     * heap.
+                     * heap. Consider the CPU no longer being seen as online as
+                     * a request to preempt immediately, to not unduly delay
+                     * its offlining.
                      */
-                    if ( cnt > 800 && softirq_pending(cpu) )
+                    if ( !cpu_online(cpu) || (cnt > 800 && 
softirq_pending(cpu)) )
                     {
                         preempt = true;
                         break;
++++++ 6013e546-x86-HVM-reorder-domain-init-error-path.patch ++++++
# Commit fbb3bf002b42803ef289ea2a649ebd5f25d22236
# Date 2021-01-29 11:36:54 +0100
# Author Jan Beulich <jbeul...@suse.com>
# Committer Jan Beulich <jbeul...@suse.com>
x86/HVM: re-order error path of hvm_domain_initialise()

hvm_destroy_all_ioreq_servers(), called from
hvm_domain_relinquish_resources(), invokes relocate_portio_handler(),
which uses d->arch.hvm.io_handler. Defer freeing of this array
accordingly on the error path of hvm_domain_initialise().

Similarly rtc_deinit() requires d->arch.hvm.pl_time to still be around,
or else an armed timer structure would get freed, and that timer never
get killed.

Signed-off-by: Jan Beulich <jbeul...@suse.com>
Acked-by: Andrew Cooper <andrew.coop...@citrix.com>

--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -714,15 +714,15 @@ int hvm_domain_initialise(struct domain
  fail1:
     if ( is_hardware_domain(d) )
         xfree(d->arch.hvm.io_bitmap);
-    XFREE(d->arch.hvm.io_handler);
     XFREE(d->arch.hvm.params);
-    XFREE(d->arch.hvm.pl_time);
     XFREE(d->arch.hvm.irq);
  fail0:
     hvm_destroy_cacheattr_region_list(d);
     destroy_perdomain_mapping(d, PERDOMAIN_VIRT_START, 0);
  fail:
     hvm_domain_relinquish_resources(d);
+    XFREE(d->arch.hvm.io_handler);
+    XFREE(d->arch.hvm.pl_time);
     return rc;
 }
 
++++++ gcc10-fixes.patch -> gcc11-fixes.patch ++++++
--- /work/SRC/openSUSE:Factory/xen/gcc10-fixes.patch    2020-08-06 
17:31:39.237087831 +0200
+++ /work/SRC/openSUSE:Factory/.xen.new.28504/gcc11-fixes.patch 2021-02-17 
18:09:09.537823726 +0100
@@ -1,170 +1,164 @@
-References: bsc#1158414
+References: bsc#1181921
 
-For libxlu_pci.c
-libxlu_pci.c: In function 'xlu_pci_parse_bdf':
-libxlu_pci.c:32:18: error: 'func' may be used uninitialized in this function 
[-Werror=maybe-uninitialized]
-   32 |     pcidev->func = func;
-      |     ~~~~~~~~~~~~~^~~~~~
-libxlu_pci.c:51:29: note: 'func' was declared here
-   51 |     unsigned dom, bus, dev, func, vslot = 0;
-      |                             ^~~~
-libxlu_pci.c:31:17: error: 'dev' may be used uninitialized in this function 
[-Werror=maybe-uninitialized]
-   31 |     pcidev->dev = dev;
-      |     ~~~~~~~~~~~~^~~~~
-libxlu_pci.c:51:24: note: 'dev' was declared here
-   51 |     unsigned dom, bus, dev, func, vslot = 0;
-      |                        ^~~
-libxlu_pci.c:30:17: error: 'bus' may be used uninitialized in this function 
[-Werror=maybe-uninitialized]
-   30 |     pcidev->bus = bus;
-      |     ~~~~~~~~~~~~^~~~~
-libxlu_pci.c:51:19: note: 'bus' was declared here
-   51 |     unsigned dom, bus, dev, func, vslot = 0;
-      |                   ^~~
-libxlu_pci.c:29:20: error: 'dom' may be used uninitialized in this function 
[-Werror=maybe-uninitialized]
-   29 |     pcidev->domain = domain;
-      |     ~~~~~~~~~~~~~~~^~~~~~~~
-libxlu_pci.c:51:14: note: 'dom' was declared here
-   51 |     unsigned dom, bus, dev, func, vslot = 0;
-      |              ^~~
-
-
-For kdd.c
-kdd.c: In function 'kdd_tx':
-kdd.c:408:30: error: array subscript 65534 is outside the bounds of an 
interior zero-length array 'uint8_t[0]' {aka 'unsigned char[0]'} 
[-Werror=zero-length-bounds]
-  408 |         sum += s->txp.payload[i];
-      |                ~~~~~~~~~~~~~~^~~
-In file included from kdd.c:52:
-kdd.h:326:17: note: while referencing 'payload'
-  326 |         uint8_t payload[0];
-      |                 ^~~~~~~
+For linux.c and private.h
+linux.c:165:50: error: argument 7 of type 'const xen_pfn_t[]' {aka 'const long 
unsigned int[]'} declared as an ordinary array [-Werror=vla-parameter]
+  165 |                                  const xen_pfn_t arr[/*num*/], int 
err[/*num*/])
+      |                                  ~~~~~~~~~~~~~~~~^~~~~~~~~~~~
+In file included from linux.c:29:
+private.h:35:50: note: previously declared as a variable length array 'const 
xen_pfn_t[num]' {aka 'const long unsigned int[num]'}
+   35 |                                  const xen_pfn_t arr[num], int 
err[num]);
+      |                                  ~~~~~~~~~~~~~~~~^~~~~~~~
+linux.c:165:68: error: argument 8 of type 'int[]' declared as an ordinary 
array [-Werror=vla-parameter]
+  165 |                                  const xen_pfn_t arr[/*num*/], int 
err[/*num*/])
+      |                                                                
~~~~^~~~~~~~~~~~
+In file included from linux.c:29:
+private.h:35:64: note: previously declared as a variable length array 
'int[num]'
+   35 |                                  const xen_pfn_t arr[num], int 
err[num]);
+      |                                                            ~~~~^~~~~~~~
 cc1: all warnings being treated as errors
 
 
-For ssl_tls.c
-ssl_tls.c: In function 'ssl_session_reset':
-ssl_tls.c:1778:5: warning: 'memset' used with length equal to number of 
elements without multiplication by element size [-Wmemset-elt-size]
- 1778 |     memset( ssl->ctx_enc, 0, 128 );
-      |     ^~~~~~
-ssl_tls.c:1779:5: warning: 'memset' used with length equal to number of 
elements without multiplication by element size [-Wmemset-elt-size]
- 1779 |     memset( ssl->ctx_dec, 0, 128 );
-      |     ^~~~~~
-ssl_tls.c: In function 'ssl_encrypt_buf':
-ssl_tls.c:633:68: warning: this statement may fall through 
[-Wimplicit-fallthrough=]
-  633 |              ssl->session->ciphersuite == SSL_RSA_CAMELLIA_256_SHA ||
-ssl_tls.c:643:13: note: here
-  643 |             default:
-      |             ^~~~~~~
-ssl_tls.c: In function 'ssl_decrypt_buf':
-ssl_tls.c:738:68: warning: this statement may fall through 
[-Wimplicit-fallthrough=]
-  738 |              ssl->session->ciphersuite == SSL_RSA_CAMELLIA_256_SHA ||
-ssl_tls.c:748:13: note: here
-  748 |             default:
-      |             ^~~~~~~
-
-For xenstored_core.h
-ld: 
/home/abuild/rpmbuild/BUILD/xen-4.13.0-testing/stubdom/xenstore/xenstored.a(xenstored_watch.o):/home/abuild/rpmbuild/BUILD/xen-4.13.0-testing/stubdom/xenstore/xenstored_core.h:207:
 multiple definition of `xgt_handle'; 
/home/abuild/rpmbuild/BUILD/xen-4.13.0-testing/stubdom/xenstore/xenstored.a(xenstored_core.o):/home/abuild/rpmbuild/BUILD/xen-4.13.0-testing/stubdom/xenstore/xenstored_core.h:207:
 first defined here
-
-
-For utils.h
-ld: 
/home/abuild/rpmbuild/BUILD/xen-4.13.0-testing/stubdom/xenstore/xenstored.a(xenstored_watch.o):/home/abuild/rpmbuild/BUILD/xen-4.13.0-testing/stubdom/xenstore/utils.h:27:
 multiple definition of `xprintf'; 
/home/abuild/rpmbuild/BUILD/xen-4.13.0-testing/stubdom/xenstore/xenstored.a(xenstored_core.o):/home/abuild/rpmbuild/BUILD/xen-4.13.0-testing/stubdom/xenstore/utils.h:27:
 first defined here
-
-
-for libxl_utils.h
-specified bound 108 equals destination size [-Werror=stringop-truncation]
-
-
-xenpmd.c: In function 'get_next_battery_file':
-xenpmd.c:92:37: error: '%s' directive output may be truncated writing between 
4 and 2147483645 bytes into a region of size 271 [-Werror=format-truncation=]
-   92 |     #define BATTERY_STATE_FILE_PATH "/tmp/battery/%s/state"
-      |                                     ^~~~~~~~~~~~~~~~~~~~~~~
-xenpmd.c:117:52: note: in expansion of macro 'BATTERY_STATE_FILE_PATH'
-  117 |             snprintf(file_name, sizeof(file_name), 
BATTERY_STATE_FILE_PATH,
-      |                                                    
^~~~~~~~~~~~~~~~~~~~~~~
-
-
-Index: xen-4.14.0-testing/tools/libxl/libxlu_pci.c
-===================================================================
---- xen-4.14.0-testing.orig/tools/libxl/libxlu_pci.c
-+++ xen-4.14.0-testing/tools/libxl/libxlu_pci.c
-@@ -22,6 +22,9 @@ static int hex_convert(const char *str,
-     return 0;
- }
+For mpparse.c
+/home/abuild/rpmbuild/BUILD/xen-4.14.1-testing/xen/include/xen/string.h:101:27:
 error: '__builtin_memcmp' specified bound 4 exceeds source size 0 
[-Werror=stringop-overread]
+  101 | #define memcmp(s1, s2, n) __builtin_memcmp(s1, s2, n)
+      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
+mpparse.c:722:13: note: in expansion of macro 'memcmp'
+  722 |         if (memcmp(mpf->mpf_signature, "_MP_", 4) == 0 &&
+      |             ^~~~~~
+
+
+For tboot.c
+In file included from tboot.c:16:
+tboot.c: In function 'tboot_gen_frametable_integrity':
+/home/abuild/rpmbuild/BUILD/xen-4.14.1-testing/xen/include/crypto/vmac.h:143:21:
 error: 'vhash_update' accessing 1 byte in a region of size 0 
[-Werror=stringop-overflow=]
+  143 | #define vmac_update vhash_update
+tboot.c:324:9: note: in expansion of macro 'vmac_update'
+  324 |         vmac_update((uint8_t *)pdx_to_page(sidx * PDX_GROUP_COUNT),
+      |         ^~~~~~~~~~~
+/home/abuild/rpmbuild/BUILD/xen-4.14.1-testing/xen/include/crypto/vmac.h:143:21:
 note: referencing argument 1 of type 'unsigned char *'
+  143 | #define vmac_update vhash_update
+tboot.c:324:9: note: in expansion of macro 'vmac_update'
+  324 |         vmac_update((uint8_t *)pdx_to_page(sidx * PDX_GROUP_COUNT),
+      |         ^~~~~~~~~~~
+/home/abuild/rpmbuild/BUILD/xen-4.14.1-testing/xen/include/crypto/vmac.h:145:6:
 note: in a call to function 'vhash_update'
+  145 | void vhash_update(unsigned char m[],
+      |      ^~~~~~~~~~~~
+/home/abuild/rpmbuild/BUILD/xen-4.14.1-testing/xen/include/crypto/vmac.h:143:21:
 error: 'vhash_update' accessing 1 byte in a region of size 0 
[-Werror=stringop-overflow=]
+  143 | #define vmac_update vhash_update
+tboot.c:328:5: note: in expansion of macro 'vmac_update'
+  328 |     vmac_update((uint8_t *)pdx_to_page(sidx * PDX_GROUP_COUNT),
+      |     ^~~~~~~~~~~
+/home/abuild/rpmbuild/BUILD/xen-4.14.1-testing/xen/include/crypto/vmac.h:143:21:
 note: referencing argument 1 of type 'unsigned char *'
+  143 | #define vmac_update vhash_update
+tboot.c:328:5: note: in expansion of macro 'vmac_update'
+  328 |     vmac_update((uint8_t *)pdx_to_page(sidx * PDX_GROUP_COUNT),
+      |     ^~~~~~~~~~~
+/home/abuild/rpmbuild/BUILD/xen-4.14.1-testing/xen/include/crypto/vmac.h:145:6:
 note: in a call to function 'vhash_update'
+  145 | void vhash_update(unsigned char m[],
+      |      ^~~~~~~~~~~~
+  INIT_O  bzimage.init.o
+In file included from 
/home/abuild/rpmbuild/BUILD/xen-4.14.1-testing/xen/include/xen/lib.h:22,
+                 from tboot.c:3:
+tboot.c: In function 'tboot_probe':
+/home/abuild/rpmbuild/BUILD/xen-4.14.1-testing/xen/include/xen/string.h:101:27:
 error: '__builtin_memcmp' specified bound 16 exceeds source size 0 
[-Werror=stringop-overread]
+  101 | #define memcmp(s1, s2, n) __builtin_memcmp(s1, s2, n)
+      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
+tboot.c:105:10: note: in expansion of macro 'memcmp'
+  105 |     if ( memcmp(&tboot_shared_uuid, (uuid_t *)tboot_shared, 
sizeof(uuid_t)) )
+      |          ^~~~~~
+
+
+For rijndael.c
+In file included from rijndael.c:33:
+/home/abuild/rpmbuild/BUILD/xen-4.14.1-testing/xen/include/crypto/rijndael.h:55:53:
 note: previously declared as 'const unsigned char[]'
+   55 | void    rijndaelEncrypt(const unsigned int [], int, const unsigned 
char [],
+      |                                                     
^~~~~~~~~~~~~~~~~~~~~~
+rijndael.c:865:8: error: argument 4 of type 'u8[16]' {aka 'unsigned char[16]'} 
with mismatched bound [-Werror=array-parameter=]
+  865 |     u8 ct[16])
+      |     ~~~^~~~~~
+In file included from rijndael.c:33:
+/home/abuild/rpmbuild/BUILD/xen-4.14.1-testing/xen/include/crypto/rijndael.h:56:13:
 note: previously declared as 'unsigned char[]'
+   56 |             unsigned char []);
+      |             ^~~~~~~~~~~~~~~~
+
+
+For x86_emulate/x86_emulate.c
+x86_emulate/x86_emulate.c:728:26: error: writing 1 byte into a region of size 
0 [-Werror=stringop-overflow=]
+  728 |     (ptr)[0 - PFX_BYTES] = ext < ext_8f08 ? 0xc4 : 0x8f; \
+      |     ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+x86_emulate/x86_emulate.c:736:9: note: in expansion of macro 'copy_VEX'
+  736 |         copy_VEX(ptr, vex); \
+      |         ^~~~~~~~
+
+
+
+--- xen-4.14.1-testing/tools/libs/foreignmemory/private.h.orig 2021-02-10 
11:04:05.230562677 -0700
++++ xen-4.14.1-testing/tools/libs/foreignmemory/private.h      2021-02-10 
11:04:36.138561926 -0700
+@@ -29,6 +29,9 @@ struct xenforeignmemory_handle {
+ int osdep_xenforeignmemory_open(xenforeignmemory_handle *fmem);
+ int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem);
  
-+#if __GNUC__ >= 10
-+#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
++#if __GNUC__ >= 11
++#pragma GCC diagnostic ignored "-Wvla-parameter"
 +#endif
- static int pcidev_struct_fill(libxl_device_pci *pcidev, unsigned int domain,
-                                unsigned int bus, unsigned int dev,
-                                unsigned int func, unsigned int vdevfn)
-Index: xen-4.14.0-testing/tools/debugger/kdd/kdd.c
-===================================================================
---- xen-4.14.0-testing.orig/tools/debugger/kdd/kdd.c
-+++ xen-4.14.0-testing/tools/debugger/kdd/kdd.c
-@@ -734,6 +734,9 @@ static void find_os(kdd_state *s)
-  */
+ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
+                                  uint32_t dom, void *addr,
+                                  int prot, int flags, size_t num,
+--- xen-4.14.1-testing/xen/arch/x86/mpparse.c.orig     2021-02-10 
11:18:01.174542374 -0700
++++ xen-4.14.1-testing/xen/arch/x86/mpparse.c  2021-02-10 11:19:17.822540512 
-0700
+@@ -709,6 +709,9 @@ static int __init smp_scan_config (unsig
+       return 0;
+ }
  
++#if __GNUC__ >= 11
++#pragma GCC diagnostic ignored "-Wstringop-overread"
++#endif
+ static void __init efi_check_config(void)
+ {
+       struct intel_mp_floating *mpf;
+--- xen-4.14.1-testing/xen/arch/x86/tboot.c.orig       2021-02-10 
11:27:38.882528343 -0700
++++ xen-4.14.1-testing/xen/arch/x86/tboot.c    2021-02-10 11:34:00.442519076 
-0700
+@@ -89,6 +89,9 @@ static void __init tboot_copy_memory(uns
+     }
+ }
  
-+#if __GNUC__ >= 10
-+#pragma GCC diagnostic ignored "-Wzero-length-bounds"
++#if __GNUC__ >= 11
++#pragma GCC diagnostic ignored "-Wstringop-overread"
 +#endif
- /* Send a serial packet */
- static void kdd_tx(kdd_state *s)
+ void __init tboot_probe(void)
  {
-Index: xen-4.14.0-testing/stubdom/polarssl.patch
-===================================================================
---- xen-4.14.0-testing.orig/stubdom/polarssl.patch
-+++ xen-4.14.0-testing/stubdom/polarssl.patch
-@@ -62,3 +62,25 @@ diff -Naur polarssl-1.1.4/library/bignum
-              t_udbl r;
- 
-              r  = (t_udbl) X.p[i] << biL;
-+--- polarssl-1.1.4/library/ssl_tls.c.orig     2012-05-30 01:39:36.000000000 
-0600
-++++ polarssl-1.1.4/library/ssl_tls.c  2020-03-10 10:17:26.270755351 -0600
-+@@ -487,6 +487,9 @@ static void ssl_mac_sha1( unsigned char
-+     sha1_finish( &sha1, buf + len );
-+ }
-+
-++#if __GNUC__ >= 10
-++#pragma GCC diagnostic ignored "-Wimplicit-fallthrough="
-++#endif
-+ /*
-+  * Encryption/decryption functions
-+  */
-+@@ -1739,6 +1742,9 @@ int ssl_init( ssl_context *ssl )
-+     return( 0 );
-+ }
-+
-++#if __GNUC__ >= 10
-++#pragma GCC diagnostic ignored "-Wmemset-elt-size"
-++#endif
-+ /*
-+  * Reset an initialized and used SSL context for re-use while retaining
-+  * all application-set variables, function pointers and data.
-Index: xen-4.14.0-testing/tools/libxl/libxl_utils.c
-===================================================================
---- xen-4.14.0-testing.orig/tools/libxl/libxl_utils.c
-+++ xen-4.14.0-testing/tools/libxl/libxl_utils.c
-@@ -1248,6 +1248,9 @@ int libxl__random_bytes(libxl__gc *gc, u
-     return ret;
+     tboot_shared_t *tboot_shared;
+@@ -306,6 +309,9 @@ static void tboot_gen_xenheap_integrity(
+     memset(&ctx, 0, sizeof(ctx));
  }
  
-+#if __GNUC__ >= 10
-+#pragma GCC diagnostic ignored "-Wstringop-truncation"
++#if __GNUC__ >= 11
++#pragma GCC diagnostic ignored "-Wstringop-overflow="
++#endif
+ static void tboot_gen_frametable_integrity(const uint8_t key[TB_KEY_SIZE],
+                                            vmac_t *mac)
+ {
+--- xen-4.14.1-testing/xen/crypto/rijndael.c.orig      2021-02-10 
11:41:50.018507672 -0700
++++ xen-4.14.1-testing/xen/crypto/rijndael.c   2021-02-10 11:42:42.206506404 
-0700
+@@ -860,6 +860,9 @@ rijndaelKeySetupDec(u32 rk[/*4*(Nr + 1)*
+ 
+ #endif /* NEED_RIJNDAEL_DECRYPT */
+ 
++#if __GNUC__ >= 11
++#pragma GCC diagnostic ignored "-Warray-parameter="
++#endif
+ void
+ rijndaelEncrypt(const u32 rk[/*4*(Nr + 1)*/], int Nr, const u8 pt[16],
+     u8 ct[16])
+--- xen-4.14.1-testing/xen/arch/x86/x86_emulate/x86_emulate.c.orig     
2021-02-10 11:56:52.302485758 -0700
++++ xen-4.14.1-testing/xen/arch/x86/x86_emulate/x86_emulate.c  2021-02-10 
11:57:58.338484154 -0700
+@@ -722,6 +722,9 @@ union vex {
+     buf_ + 3; \
+ })
+ 
++#if __GNUC__ >= 11
++#pragma GCC diagnostic ignored "-Wstringop-overflow="
 +#endif
- int libxl__prepare_sockaddr_un(libxl__gc *gc,
-                                struct sockaddr_un *un, const char *path,
-                                const char *what)
-Index: xen-4.14.0-testing/tools/xenpmd/xenpmd.c
-===================================================================
---- xen-4.14.0-testing.orig/tools/xenpmd/xenpmd.c
-+++ xen-4.14.0-testing/tools/xenpmd/xenpmd.c
-@@ -86,6 +86,9 @@ struct battery_status {
- 
- static struct xs_handle *xs;
- 
-+#if __GNUC__ >= 10
-+#pragma GCC diagnostic ignored "-Wformat-truncation"
-+#endif
- #ifdef RUN_IN_SIMULATE_MODE
-     #define BATTERY_DIR_PATH "/tmp/battery"
-     #define BATTERY_INFO_FILE_PATH "/tmp/battery/%s/info" 
+ #define copy_VEX(ptr, vex) ({ \
+     if ( !mode_64bit() ) \
+         (vex).reg |= 8; \

Reply via email to