]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
Merge branch 'x86/boot' into x86/mm, to pick up interacting changes
authorIngo Molnar <mingo@kernel.org>
Tue, 18 Jul 2017 09:36:53 +0000 (11:36 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 18 Jul 2017 09:36:53 +0000 (11:36 +0200)
The SME patches we are about to apply add some E820 logic, so merge in
pending E820 code changes first, to have a single code base.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
1  2 
Documentation/admin-guide/kernel-parameters.txt
arch/x86/xen/enlighten_pv.c
arch/x86/xen/mmu_pv.c
drivers/idle/intel_idle.c

index 7037a0f86d03e53183cee1521be38c1aec39ece9,d9c171ce4190845950e7c14e362265b4d26adc74..f701430f4894c05d86a2154d47435fc596b070f0
                        /proc/<pid>/coredump_filter.
                        See also Documentation/filesystems/proc.txt.
  
+       coresight_cpu_debug.enable
+                       [ARM,ARM64]
+                       Format: <bool>
+                       Enable/disable the CPU sampling based debugging.
+                       0: default value, disable debugging
+                       1: enable debugging at boot time
        cpuidle.off=1   [CPU_IDLE]
                        disable the cpuidle sub-system
  
                        See also Documentation/input/joystick-parport.txt
  
        ddebug_query=   [KNL,DYNAMIC_DEBUG] Enable debug messages at early boot
-                       time. See Documentation/dynamic-debug-howto.txt for
+                       time. See
+                       Documentation/admin-guide/dynamic-debug-howto.rst for
                        details.  Deprecated, see dyndbg.
  
        debug           [KNL] Enable kernel debugging (events log level).
        dyndbg[="val"]          [KNL,DYNAMIC_DEBUG]
        module.dyndbg[="val"]
                        Enable debug messages at boot time.  See
-                       Documentation/dynamic-debug-howto.txt for details.
+                       Documentation/admin-guide/dynamic-debug-howto.rst
+                       for details.
  
        nompx           [X86] Disables Intel Memory Protection Extensions.
                        See Documentation/x86/intel_mpx.txt for more
                        must already be setup and configured. Options are not
                        yet supported.
  
+               owl,<addr>
+                       Start an early, polled-mode console on a serial port
+                       of an Actions Semi SoC, such as S500 or S900, at the
+                       specified address. The serial port must already be
+                       setup and configured. Options are not yet supported.
                smh     Use ARM semihosting calls for early console.
  
                s3c2410,<addr>
                        in crypto/hash_info.h.
  
        ima_policy=     [IMA]
-                       The builtin measurement policy to load during IMA
-                       setup.  Specyfing "tcb" as the value, measures all
-                       programs exec'd, files mmap'd for exec, and all files
-                       opened with the read mode bit set by either the
-                       effective uid (euid=0) or uid=0.
-                       Format: "tcb"
+                       The builtin policies to load during IMA setup.
+                       Format: "tcb | appraise_tcb | secure_boot"
+                       The "tcb" policy measures all programs exec'd, files
+                       mmap'd for exec, and all files opened with the read
+                       mode bit set by either the effective uid (euid=0) or
+                       uid=0.
+                       The "appraise_tcb" policy appraises the integrity of
+                       all files owned by root. (This is the equivalent
+                       of ima_appraise_tcb.)
+                       The "secure_boot" policy appraises the integrity
+                       of files (eg. kexec kernel image, kernel modules,
+                       firmware, policy, etc) based on file signatures.
  
        ima_tcb         [IMA] Deprecated.  Use ima_policy= instead.
                        Load a policy which meets the needs of the Trusted
                        for all guests.
                        Default is 1 (enabled) if in 64-bit or 32-bit PAE mode.
  
+       kvm-arm.vgic_v3_group0_trap=
+                       [KVM,ARM] Trap guest accesses to GICv3 group-0
+                       system registers
+       kvm-arm.vgic_v3_group1_trap=
+                       [KVM,ARM] Trap guest accesses to GICv3 group-1
+                       system registers
+       kvm-arm.vgic_v3_common_trap=
+                       [KVM,ARM] Trap guest accesses to GICv3 common
+                       system registers
        kvm-intel.ept=  [KVM,Intel] Disable extended page tables
                        (virtualized MMU) support on capable Intel chips.
                        Default is 1 (enabled)
                        that the amount of memory usable for all allocations
                        is not too small.
  
-       movable_node    [KNL] Boot-time switch to enable the effects
-                       of CONFIG_MOVABLE_NODE=y. See mm/Kconfig for details.
+       movable_node    [KNL] Boot-time switch to make hotplugable memory
+                       NUMA nodes to be movable. This means that the memory
+                       of such nodes will be usable only for movable
+                       allocations which rules out almost all kernel
+                       allocations. Use with caution!
  
        MTD_Partition=  [MTD]
                        Format: <name>,<region-number>,<size>,<offset>
        nopat           [X86] Disable PAT (page attribute table extension of
                        pagetables) support.
  
 +      nopcid          [X86-64] Disable the PCID cpu feature.
 +
        norandmaps      Don't use address space randomization.  Equivalent to
                        echo 0 > /proc/sys/kernel/randomize_va_space
  
        slab_nomerge    [MM]
                        Disable merging of slabs with similar size. May be
                        necessary if there is some reason to distinguish
-                       allocs to different slabs. Debug options disable
-                       merging on their own.
+                       allocs to different slabs, especially in hardened
+                       environments where the risk of heap overflows and
+                       layout control by attackers can usually be
+                       frustrated by disabling merging. This will reduce
+                       most of the exposure of a heap attack to a single
+                       cache (risks via metadata attacks are mostly
+                       unchanged). Debug options disable merging on their
+                       own.
                        For more information see Documentation/vm/slub.txt.
  
        slab_max_order= [MM, SLAB]
index a136aac543c30779f8b3d12f52db55a38d66914d,811e4ddb3f37484180c0099e92b4eb351515d5bc..290bc5ac98524450b3d8a92168341355dc5c6a3a
@@@ -89,8 -89,6 +89,6 @@@
  
  void *xen_initial_gdt;
  
- RESERVE_BRK(shared_info_page_brk, PAGE_SIZE);
  static int xen_cpu_up_prepare_pv(unsigned int cpu);
  static int xen_cpu_dead_pv(unsigned int cpu);
  
@@@ -107,35 -105,6 +105,6 @@@ struct tls_descs 
   */
  static DEFINE_PER_CPU(struct tls_descs, shadow_tls_desc);
  
- /*
-  * On restore, set the vcpu placement up again.
-  * If it fails, then we're in a bad state, since
-  * we can't back out from using it...
-  */
- void xen_vcpu_restore(void)
- {
-       int cpu;
-       for_each_possible_cpu(cpu) {
-               bool other_cpu = (cpu != smp_processor_id());
-               bool is_up = HYPERVISOR_vcpu_op(VCPUOP_is_up, xen_vcpu_nr(cpu),
-                                               NULL);
-               if (other_cpu && is_up &&
-                   HYPERVISOR_vcpu_op(VCPUOP_down, xen_vcpu_nr(cpu), NULL))
-                       BUG();
-               xen_setup_runstate_info(cpu);
-               if (xen_have_vcpu_info_placement)
-                       xen_vcpu_setup(cpu);
-               if (other_cpu && is_up &&
-                   HYPERVISOR_vcpu_op(VCPUOP_up, xen_vcpu_nr(cpu), NULL))
-                       BUG();
-       }
- }
  static void __init xen_banner(void)
  {
        unsigned version = HYPERVISOR_xen_version(XENVER_version, NULL);
@@@ -295,12 -264,6 +264,12 @@@ static void __init xen_init_capabilitie
        setup_clear_cpu_cap(X86_FEATURE_ACC);
        setup_clear_cpu_cap(X86_FEATURE_X2APIC);
  
 +      /*
 +       * Xen PV would need some work to support PCID: CR3 handling as well
 +       * as xen_flush_tlb_others() would need updating.
 +       */
 +      setup_clear_cpu_cap(X86_FEATURE_PCID);
 +
        if (!xen_initial_domain())
                setup_clear_cpu_cap(X86_FEATURE_ACPI);
  
@@@ -966,30 -929,43 +935,43 @@@ void xen_setup_shared_info(void
        HYPERVISOR_shared_info =
                (struct shared_info *)fix_to_virt(FIX_PARAVIRT_BOOTMAP);
  
- #ifndef CONFIG_SMP
-       /* In UP this is as good a place as any to set up shared info */
-       xen_setup_vcpu_info_placement();
- #endif
        xen_setup_mfn_list_list();
  
-       /*
-        * Now that shared info is set up we can start using routines that
-        * point to pvclock area.
-        */
-       if (system_state == SYSTEM_BOOTING)
+       if (system_state == SYSTEM_BOOTING) {
+ #ifndef CONFIG_SMP
+               /*
+                * In UP this is as good a place as any to set up shared info.
+                * Limit this to boot only, at restore vcpu setup is done via
+                * xen_vcpu_restore().
+                */
+               xen_setup_vcpu_info_placement();
+ #endif
+               /*
+                * Now that shared info is set up we can start using routines
+                * that point to pvclock area.
+                */
                xen_init_time_ops();
+       }
  }
  
  /* This is called once we have the cpu_possible_mask */
- void xen_setup_vcpu_info_placement(void)
+ void __ref xen_setup_vcpu_info_placement(void)
  {
        int cpu;
  
        for_each_possible_cpu(cpu) {
                /* Set up direct vCPU id mapping for PV guests. */
                per_cpu(xen_vcpu_id, cpu) = cpu;
-               xen_vcpu_setup(cpu);
+               /*
+                * xen_vcpu_setup(cpu) can fail  -- in which case it
+                * falls back to the shared_info version for cpus
+                * where xen_vcpu_nr(cpu) < MAX_VIRT_CPUS.
+                *
+                * xen_cpu_up_prepare_pv() handles the rest by failing
+                * them in hotplug.
+                */
+               (void) xen_vcpu_setup(cpu);
        }
  
        /*
@@@ -1338,9 -1314,17 +1320,17 @@@ asmlinkage __visible void __init xen_st
         */
        acpi_numa = -1;
  #endif
-       /* Don't do the full vcpu_info placement stuff until we have a
-          possible map and a non-dummy shared_info. */
-       per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0];
+       /* Let's presume PV guests always boot on vCPU with id 0. */
+       per_cpu(xen_vcpu_id, 0) = 0;
+       /*
+        * Setup xen_vcpu early because start_kernel needs it for
+        * local_irq_disable(), irqs_disabled().
+        *
+        * Don't do the full vcpu_info placement stuff until we have
+        * the cpu_possible_mask and a non-dummy shared_info.
+        */
+       xen_vcpu_info_reset(0);
  
        WARN_ON(xen_cpuhp_setup(xen_cpu_up_prepare_pv, xen_cpu_dead_pv));
  
  #endif
        xen_raw_console_write("about to get started...\n");
  
-       /* Let's presume PV guests always boot on vCPU with id 0. */
-       per_cpu(xen_vcpu_id, 0) = 0;
+       /* We need this for printk timestamps */
        xen_setup_runstate_info(0);
  
        xen_efi_init();
@@@ -1457,6 -1439,9 +1445,9 @@@ static int xen_cpu_up_prepare_pv(unsign
  {
        int rc;
  
+       if (per_cpu(xen_vcpu, cpu) == NULL)
+               return -ENODEV;
        xen_setup_timer(cpu);
  
        rc = xen_smp_intr_init(cpu);
diff --combined arch/x86/xen/mmu_pv.c
index 0472790ec20b9ab6b7c1a90ff7124d3c9ba01ab9,cab28cf2cffbb78d09325c46413f65381ec6c5e3..e437714750f8fccbaa424cfc03a1e46a5053a010
@@@ -1005,12 -1005,14 +1005,12 @@@ static void xen_drop_mm_ref(struct mm_s
        /* Get the "official" set of cpus referring to our pagetable. */
        if (!alloc_cpumask_var(&mask, GFP_ATOMIC)) {
                for_each_online_cpu(cpu) {
 -                      if (!cpumask_test_cpu(cpu, mm_cpumask(mm))
 -                          && per_cpu(xen_current_cr3, cpu) != __pa(mm->pgd))
 +                      if (per_cpu(xen_current_cr3, cpu) != __pa(mm->pgd))
                                continue;
                        smp_call_function_single(cpu, drop_mm_ref_this_cpu, mm, 1);
                }
                return;
        }
 -      cpumask_copy(mask, mm_cpumask(mm));
  
        /*
         * It's possible that a vcpu may have a stale reference to our
         * look at its actual current cr3 value, and force it to flush
         * if needed.
         */
 +      cpumask_clear(mask);
        for_each_online_cpu(cpu) {
                if (per_cpu(xen_current_cr3, cpu) == __pa(mm->pgd))
                        cpumask_set_cpu(cpu, mask);
@@@ -2692,8 -2693,8 +2692,8 @@@ EXPORT_SYMBOL_GPL(xen_destroy_contiguou
  phys_addr_t paddr_vmcoreinfo_note(void)
  {
        if (xen_pv_domain())
-               return virt_to_machine(&vmcoreinfo_note).maddr;
+               return virt_to_machine(vmcoreinfo_note).maddr;
        else
-               return __pa_symbol(&vmcoreinfo_note);
+               return __pa(vmcoreinfo_note);
  }
  #endif /* CONFIG_KEXEC_CORE */
index 2ae43f59091df5760d638d8f8d94f121cea6696c,c2ae819a871cb6d8f09412702e46463397f9fc0f..e87ffb3c31a92faeb29ca07b47397f2ad5504120
@@@ -51,6 -51,8 +51,8 @@@
  /* un-comment DEBUG to enable pr_debug() statements */
  #define DEBUG
  
+ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
  #include <linux/kernel.h>
  #include <linux/cpuidle.h>
  #include <linux/tick.h>
@@@ -65,7 -67,6 +67,6 @@@
  #include <asm/msr.h>
  
  #define INTEL_IDLE_VERSION "0.4.1"
- #define PREFIX "intel_idle: "
  
  static struct cpuidle_driver intel_idle_driver = {
        .name = "intel_idle",
@@@ -912,15 -913,16 +913,15 @@@ static __cpuidle int intel_idle(struct 
        struct cpuidle_state *state = &drv->states[index];
        unsigned long eax = flg2MWAIT(state->flags);
        unsigned int cstate;
 -      int cpu = smp_processor_id();
  
        cstate = (((eax) >> MWAIT_SUBSTATE_SIZE) & MWAIT_CSTATE_MASK) + 1;
  
        /*
 -       * leave_mm() to avoid costly and often unnecessary wakeups
 -       * for flushing the user TLB's associated with the active mm.
 +       * NB: if CPUIDLE_FLAG_TLB_FLUSHED is set, this idle transition
 +       * will probably flush the TLB.  It's not guaranteed to flush
 +       * the TLB, though, so it's not clear that we can do anything
 +       * useful with this knowledge.
         */
 -      if (state->flags & CPUIDLE_FLAG_TLB_FLUSHED)
 -              leave_mm(cpu);
  
        if (!(lapic_timer_reliable_states & (1 << (cstate))))
                tick_broadcast_enter();
@@@ -1110,7 -1112,7 +1111,7 @@@ static int __init intel_idle_probe(void
        const struct x86_cpu_id *id;
  
        if (max_cstate == 0) {
-               pr_debug(PREFIX "disabled\n");
+               pr_debug("disabled\n");
                return -EPERM;
        }
  
        if (!id) {
                if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
                    boot_cpu_data.x86 == 6)
-                       pr_debug(PREFIX "does not run on family %d model %d\n",
-                               boot_cpu_data.x86, boot_cpu_data.x86_model);
+                       pr_debug("does not run on family %d model %d\n",
+                                boot_cpu_data.x86, boot_cpu_data.x86_model);
                return -ENODEV;
        }
  
            !mwait_substates)
                        return -ENODEV;
  
-       pr_debug(PREFIX "MWAIT substates: 0x%x\n", mwait_substates);
+       pr_debug("MWAIT substates: 0x%x\n", mwait_substates);
  
        icpu = (const struct idle_cpu *)id->driver_data;
        cpuidle_state_table = icpu->state_table;
  
-       pr_debug(PREFIX "v" INTEL_IDLE_VERSION
-               " model 0x%X\n", boot_cpu_data.x86_model);
+       pr_debug("v" INTEL_IDLE_VERSION " model 0x%X\n",
+                boot_cpu_data.x86_model);
  
        return 0;
  }
@@@ -1339,8 -1341,7 +1340,7 @@@ static void __init intel_idle_cpuidle_d
                        break;
  
                if (cstate + 1 > max_cstate) {
-                       printk(PREFIX "max_cstate %d reached\n",
-                               max_cstate);
+                       pr_info("max_cstate %d reached\n", max_cstate);
                        break;
                }
  
  
                /* if state marked as disabled, skip it */
                if (cpuidle_state_table[cstate].disabled != 0) {
-                       pr_debug(PREFIX "state %s is disabled",
-                               cpuidle_state_table[cstate].name);
+                       pr_debug("state %s is disabled\n",
+                                cpuidle_state_table[cstate].name);
                        continue;
                }
  
@@@ -1394,7 -1395,7 +1394,7 @@@ static int intel_idle_cpu_init(unsigne
        dev->cpu = cpu;
  
        if (cpuidle_register_device(dev)) {
-               pr_debug(PREFIX "cpuidle_register_device %d failed!\n", cpu);
+               pr_debug("cpuidle_register_device %d failed!\n", cpu);
                return -EIO;
        }
  
@@@ -1446,8 -1447,8 +1446,8 @@@ static int __init intel_idle_init(void
        retval = cpuidle_register_driver(&intel_idle_driver);
        if (retval) {
                struct cpuidle_driver *drv = cpuidle_get_driver();
-               printk(KERN_DEBUG PREFIX "intel_idle yielding to %s",
-                       drv ? drv->name : "none");
+               printk(KERN_DEBUG pr_fmt("intel_idle yielding to %s\n"),
+                      drv ? drv->name : "none");
                goto init_driver_fail;
        }
  
        if (retval < 0)
                goto hp_setup_fail;
  
-       pr_debug(PREFIX "lapic_timer_reliable_states 0x%x\n",
-               lapic_timer_reliable_states);
+       pr_debug("lapic_timer_reliable_states 0x%x\n",
+                lapic_timer_reliable_states);
  
        return 0;