Merge tag 'for-linus-5.10b-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 14 Oct 2020 17:34:45 +0000 (10:34 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 14 Oct 2020 17:34:45 +0000 (10:34 -0700)
Pull xen updates from Juergen Gross:

 - two small cleanup patches

 - avoid error messages when initializing MCA banks in a Xen dom0

 - a small series for converting the Xen gntdev driver to use
   pin_user_pages*() instead of get_user_pages*()

 - intermediate fix for running as a Xen guest on Arm with KPTI enabled
   (the final solution will need new Xen functionality)

* tag 'for-linus-5.10b-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
  x86/xen: Fix typo in xen_pagetable_p2m_free()
  x86/xen: disable Firmware First mode for correctable memory errors
  xen/arm: do not setup the runstate info page if kpti is enabled
  xen: remove redundant initialization of variable ret
  xen/gntdev.c: Convert get_user_pages*() to pin_user_pages*()
  xen/gntdev.c: Mark pages as dirty

1  2 
arch/arm/xen/enlighten.c
arch/x86/xen/enlighten_pv.c
arch/x86/xen/mmu_pv.c

diff --combined arch/arm/xen/enlighten.c
@@@ -150,7 -150,7 +150,7 @@@ static int xen_starting_cpu(unsigned in
        pr_info("Xen: initializing cpu%d\n", cpu);
        vcpup = per_cpu_ptr(xen_vcpu_info, cpu);
  
 -      info.mfn = virt_to_gfn(vcpup);
 +      info.mfn = percpu_to_gfn(vcpup);
        info.offset = xen_offset_in_page(vcpup);
  
        err = HYPERVISOR_vcpu_op(VCPUOP_register_vcpu_info, xen_vcpu_nr(cpu),
        BUG_ON(err);
        per_cpu(xen_vcpu, cpu) = vcpup;
  
-       xen_setup_runstate_info(cpu);
+       if (!xen_kernel_unmapped_at_usr())
+               xen_setup_runstate_info(cpu);
  
  after_register_vcpu_info:
        enable_percpu_irq(xen_events_irq, 0);
@@@ -387,7 -388,8 +388,8 @@@ static int __init xen_guest_init(void
                return -EINVAL;
        }
  
-       xen_time_setup_guest();
+       if (!xen_kernel_unmapped_at_usr())
+               xen_time_setup_guest();
  
        if (xen_initial_domain())
                pvclock_gtod_register_notifier(&xen_pvclock_gtod_notifier);
@@@ -32,7 -32,7 +32,7 @@@
  #include <linux/pci.h>
  #include <linux/gfp.h>
  #include <linux/edd.h>
 -#include <linux/frame.h>
 +#include <linux/objtool.h>
  
  #include <xen/xen.h>
  #include <xen/events.h>
@@@ -1014,6 -1014,8 +1014,6 @@@ void __init xen_setup_vcpu_info_placeme
  }
  
  static const struct pv_info xen_info __initconst = {
 -      .shared_kernel_pmd = 0,
 -
        .extra_user_64bit_cs = FLAT_USER_CS64,
        .name = "Xen",
  };
@@@ -1300,7 -1302,7 +1300,7 @@@ asmlinkage __visible void __init xen_st
         * any NUMA information the kernel tries to get from ACPI will
         * be meaningless.  Prevent it from trying.
         */
 -      acpi_numa = -1;
 +      disable_srat();
  #endif
        WARN_ON(xen_cpuhp_setup(xen_cpu_up_prepare_pv, xen_cpu_dead_pv));
  
                                   xen_start_info->nr_pages);
        xen_reserve_special_pages();
  
 -      /* keep using Xen gdt for now; no urgent need to change it */
 -
 -      pv_info.kernel_rpl = 0;
 -
        /*
         * We used to do this in xen_arch_setup, but that is too late
         * on AMD were early_cpu_init (run before ->arch_setup()) calls
                x86_init.mpparse.get_smp_config = x86_init_uint_noop;
  
                xen_boot_params_init_edd();
+ #ifdef CONFIG_ACPI
+               /*
+                * Disable selecting "Firmware First mode" for correctable
+                * memory errors, as this is the duty of the hypervisor to
+                * decide.
+                */
+               acpi_disable_cmcff = 1;
+ #endif
        }
  
        if (!boot_params.screen_info.orig_video_isVGA)
diff --combined arch/x86/xen/mmu_pv.c
@@@ -285,6 -285,13 +285,6 @@@ static void xen_set_pte(pte_t *ptep, pt
        __xen_set_pte(ptep, pteval);
  }
  
 -static void xen_set_pte_at(struct mm_struct *mm, unsigned long addr,
 -                  pte_t *ptep, pte_t pteval)
 -{
 -      trace_xen_mmu_set_pte_at(mm, addr, ptep, pteval);
 -      __xen_set_pte(ptep, pteval);
 -}
 -
  pte_t xen_ptep_modify_prot_start(struct vm_area_struct *vma,
                                 unsigned long addr, pte_t *ptep)
  {
@@@ -1142,7 -1149,7 +1142,7 @@@ static void __init xen_pagetable_p2m_fr
         * We could be in __ka space.
         * We roundup to the PMD, which means that if anybody at this stage is
         * using the __ka address of xen_start_info or
-        * xen_start_info->shared_info they are in going to crash. Fortunatly
+        * xen_start_info->shared_info they are in going to crash. Fortunately
         * we have already revectored in xen_setup_kernel_pagetable.
         */
        size = roundup(size, PMD_SIZE);
@@@ -2098,6 -2105,7 +2098,6 @@@ static const struct pv_mmu_ops xen_mmu_
        .release_pmd = xen_release_pmd_init,
  
        .set_pte = xen_set_pte_init,
 -      .set_pte_at = xen_set_pte_at,
        .set_pmd = xen_set_pmd_hyper,
  
        .ptep_modify_prot_start = __ptep_modify_prot_start,