1. 11 5月, 2018 1 次提交
    • G
      PCI: Add "pci=noats" boot parameter · cef74409
      Gil Kupfer 提交于
      Adds a "pci=noats" boot parameter.  When supplied, all ATS related
      functions fail immediately and the IOMMU is configured to not use
      device-IOTLB.
      
      Any function that checks for ATS capabilities directly against the devices
      should also check this flag.  Currently, such functions exist only in IOMMU
      drivers, and they are covered by this patch.
      
      The motivation behind this patch is the existence of malicious devices.
      Lots of research has been done about how to use the IOMMU as protection
      from such devices.  When ATS is supported, any I/O device can access any
      physical address by faking device-IOTLB entries.  Adding the ability to
      ignore these entries lets sysadmins enhance system security.
      Signed-off-by: NGil Kupfer <gilkup@cs.technion.ac.il>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Acked-by: NJoerg Roedel <jroedel@suse.de>
      cef74409
  2. 06 4月, 2018 1 次提交
  3. 31 3月, 2018 2 次提交
    • B
      PCI/portdrv: Remove unnecessary "pcie_ports=auto" parameter · 4c0fd764
      Bjorn Helgaas 提交于
      The "pcie_ports=auto" parameter set pcie_ports_disabled and pcie_ports_auto
      to their compiled-in defaults, so specifying the parameter is the same as
      not using it at all.
      
      Remove the "pcie_ports=auto" parameter and update the documentation.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      4c0fd764
    • B
      PCI/portdrv: Remove "pcie_hp=nomsi" kernel parameter · 1e447c57
      Bjorn Helgaas 提交于
      7570a333 ("PCI: Add pcie_hp=nomsi to disable MSI/MSI-X for pciehp
      driver") added the "pcie_hp=nomsi" kernel parameter to work around this
      error on shutdown:
      
        irq 16: nobody cared (try booting with the "irqpoll" option)
        Pid: 1081, comm: reboot Not tainted 3.2.0 #1
        ...
        Disabling IRQ #16
      
      This happened on an unspecified system (possibly involving the Integrated
      Device Technology, Inc. Device 807f bridge) where "an un-wanted interrupt
      is generated when PCI driver switches from MSI/MSI-X to INTx while shutting
      down the device."
      
      The implication was that the device was buggy, but it is normal for a
      device to use INTx after MSI/MSI-X have been disabled.  The only problem
      was that the driver was still attached and it wasn't prepared for INTx
      interrupts.  Prarit Bhargava fixed this issue with fda78d7a ("PCI/MSI:
      Stop disabling MSI/MSI-X in pci_device_shutdown()").
      
      There is no automated way to set this parameter, so it's not very useful
      for distributions or end users.  It's really only useful for debugging, and
      we have "pci=nomsi" for that purpose.
      
      Revert 7570a333 to remove the "pcie_hp=nomsi" parameter.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      CC: MUNEDA Takahiro <muneda.takahiro@jp.fujitsu.com>
      CC: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      CC: Prarit Bhargava <prarit@redhat.com>
      1e447c57
  4. 25 3月, 2018 1 次提交
  5. 23 3月, 2018 2 次提交
  6. 20 3月, 2018 1 次提交
    • K
      usb: core: Add "quirks" parameter for usbcore · 027bd6ca
      Kai-Heng Feng 提交于
      Trying quirks in usbcore needs to rebuild the driver or the entire
      kernel if it's builtin. It can save a lot of time if usbcore has similar
      ability like "usbhid.quirks=" and "usb-storage.quirks=".
      
      Rename the original quirk detection function to "static" as we introduce
      this new "dynamic" function.
      
      Now users can use "usbcore.quirks=" as short term workaround before the
      next kernel release. Also, the quirk parameter can XOR the builtin
      quirks for debugging purpose.
      
      This is inspired by usbhid and usb-storage.
      Signed-off-by: NKai-Heng Feng <kai.heng.feng@canonical.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      027bd6ca
  7. 17 3月, 2018 1 次提交
  8. 16 3月, 2018 1 次提交
    • A
      arch: remove blackfin port · 4ba66a97
      Arnd Bergmann 提交于
      The Analog Devices Blackfin port was added in 2007 and was rather
      active for a while, but all work on it has come to a standstill
      over time, as Analog have changed their product line-up.
      
      Aaron Wu confirmed that the architecture port is no longer relevant,
      and multiple people suggested removing blackfin independently because
      of some of its oddities like a non-working SMP port, and the amount of
      duplication between the chip variants, which cause extra work when
      doing cross-architecture changes.
      
      Link: https://docs.blackfin.uclinux.org/Acked-by: NAaron Wu <Aaron.Wu@analog.com>
      Acked-by: NBryan Wu <cooloney@gmail.com>
      Cc: Steven Miao <realmz6@gmail.com>
      Cc: Mike Frysinger <vapier@chromium.org>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      4ba66a97
  9. 14 3月, 2018 1 次提交
    • M
      irqchip/gic-v3: Allow LPIs to be disabled from the command line · f736d65d
      Marc Zyngier 提交于
      For most GICv3 implementations, enabling LPIs is a one way switch.
      Once they're on, there is no turning back, which completely kills
      kexec (pending tables will always be live, and we can't tell the
      secondary kernel where they are).
      
      This is really annoying if you plan to use Linux as a bootloader,
      as it pretty much guarantees that the secondary kernel won't be
      able to use MSIs, and may even see some memory corruption. Bad.
      
      A workaround for this unfortunate situation is to allow the kernel
      not to enable LPIs, even if the feature is present in the HW. This
      would allow Linux-as-a-bootloader to leave LPIs alone, and let the
      secondary kernel to do whatever it wants with them.
      
      Let's introduce a boolean "irqchip.gicv3_nolpi" command line option
      that serves that purpose.
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      f736d65d
  10. 12 3月, 2018 1 次提交
    • G
      Revert "usb: core: Add "quirks" parameter for usbcore" · 95713fb8
      Greg Kroah-Hartman 提交于
      This reverts commit b27560e4 as it
      breaks the build for some arches :(
      Reported-by: Nkbuild test robot <fengguang.wu@intel.com>
      Cc: Kai-Heng Feng <kai.heng.feng@canonical.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
      index 1d1d53f85ddd..70a7398c20e2 100644
      --- a/Documentation/admin-guide/kernel-parameters.txt
      +++ b/Documentation/admin-guide/kernel-parameters.txt
      @@ -4368,6 +4368,61 @@
      
       	usbcore.nousb	[USB] Disable the USB subsystem
      
      +	usbcore.quirks=
      +			[USB] A list of quirks entries to supplement or
      +			override the built-in usb core quirk list.  List
      +			entries are separated by commas.  Each entry has
      +			the form VID:PID:Flags where VID and PID are Vendor
      +			and Product ID values (4-digit hex numbers) and
      +			Flags is a set of characters, each corresponding
      +			to a common usb core quirk flag as follows:
      +				a = USB_QUIRK_STRING_FETCH_255 (string
      +					descriptors must not be fetched using
      +					a 255-byte read);
      +				b = USB_QUIRK_RESET_RESUME (device can't resume
      +					correctly so reset it instead);
      +				c = USB_QUIRK_NO_SET_INTF (device can't handle
      +					Set-Interface requests);
      +				d = USB_QUIRK_CONFIG_INTF_STRINGS (device can't
      +					handle its Configuration or Interface
      +					strings);
      +				e = USB_QUIRK_RESET (device can't be reset
      +					(e.g morph devices), don't use reset);
      +				f = USB_QUIRK_HONOR_BNUMINTERFACES (device has
      +					more interface descriptions than the
      +					bNumInterfaces count, and can't handle
      +					talking to these interfaces);
      +				g = USB_QUIRK_DELAY_INIT (device needs a pause
      +					during initialization, after we read
      +					the device descriptor);
      +				h = USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL (For
      +					high speed and super speed interrupt
      +					endpoints, the USB 2.0 and USB 3.0 spec
      +					require the interval in microframes (1
      +					microframe = 125 microseconds) to be
      +					calculated as interval = 2 ^
      +					(bInterval-1).
      +					Devices with this quirk report their
      +					bInterval as the result of this
      +					calculation instead of the exponent
      +					variable used in the calculation);
      +				i = USB_QUIRK_DEVICE_QUALIFIER (device can't
      +					handle device_qualifier descriptor
      +					requests);
      +				j = USB_QUIRK_IGNORE_REMOTE_WAKEUP (device
      +					generates spurious wakeup, ignore
      +					remote wakeup capability);
      +				k = USB_QUIRK_NO_LPM (device can't handle Link
      +					Power Management);
      +				l = USB_QUIRK_LINEAR_FRAME_INTR_BINTERVAL
      +					(Device reports its bInterval as linear
      +					frames instead of the USB 2.0
      +					calculation);
      +				m = USB_QUIRK_DISCONNECT_SUSPEND (Device needs
      +					to be disconnected before suspend to
      +					prevent spurious wakeup)
      +			Example: quirks=0781:5580:bk,0a5c:5834:gij
      +
       	usbhid.mousepoll=
       			[USBHID] The interval which mice are to be polled at.
      
      diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
      index f4a548471f0f..42faaeead81b 100644
      --- a/drivers/usb/core/quirks.c
      +++ b/drivers/usb/core/quirks.c
      @@ -11,6 +11,143 @@
       #include <linux/usb/hcd.h>
       #include "usb.h"
      
      +struct quirk_entry {
      +	u16 vid;
      +	u16 pid;
      +	u32 flags;
      +};
      +
      +static DEFINE_MUTEX(quirk_mutex);
      +
      +static struct quirk_entry *quirk_list;
      +static unsigned int quirk_count;
      +
      +static char quirks_param[128];
      +
      +static int quirks_param_set(const char *val, const struct kernel_param *kp)
      +{
      +	char *p, *field;
      +	u16 vid, pid;
      +	u32 flags;
      +	size_t i;
      +
      +	mutex_lock(&quirk_mutex);
      +
      +	if (!val || !*val) {
      +		quirk_count = 0;
      +		kfree(quirk_list);
      +		quirk_list = NULL;
      +		goto unlock;
      +	}
      +
      +	for (quirk_count = 1, i = 0; val[i]; i++)
      +		if (val[i] == ',')
      +			quirk_count++;
      +
      +	if (quirk_list) {
      +		kfree(quirk_list);
      +		quirk_list = NULL;
      +	}
      +
      +	quirk_list = kcalloc(quirk_count, sizeof(struct quirk_entry),
      +			     GFP_KERNEL);
      +	if (!quirk_list) {
      +		mutex_unlock(&quirk_mutex);
      +		return -ENOMEM;
      +	}
      +
      +	for (i = 0, p = (char *)val; p && *p;) {
      +		/* Each entry consists of VID:PID:flags */
      +		field = strsep(&p, ":");
      +		if (!field)
      +			break;
      +
      +		if (kstrtou16(field, 16, &vid))
      +			break;
      +
      +		field = strsep(&p, ":");
      +		if (!field)
      +			break;
      +
      +		if (kstrtou16(field, 16, &pid))
      +			break;
      +
      +		field = strsep(&p, ",");
      +		if (!field || !*field)
      +			break;
      +
      +		/* Collect the flags */
      +		for (flags = 0; *field; field++) {
      +			switch (*field) {
      +			case 'a':
      +				flags |= USB_QUIRK_STRING_FETCH_255;
      +				break;
      +			case 'b':
      +				flags |= USB_QUIRK_RESET_RESUME;
      +				break;
      +			case 'c':
      +				flags |= USB_QUIRK_NO_SET_INTF;
      +				break;
      +			case 'd':
      +				flags |= USB_QUIRK_CONFIG_INTF_STRINGS;
      +				break;
      +			case 'e':
      +				flags |= USB_QUIRK_RESET;
      +				break;
      +			case 'f':
      +				flags |= USB_QUIRK_HONOR_BNUMINTERFACES;
      +				break;
      +			case 'g':
      +				flags |= USB_QUIRK_DELAY_INIT;
      +				break;
      +			case 'h':
      +				flags |= USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL;
      +				break;
      +			case 'i':
      +				flags |= USB_QUIRK_DEVICE_QUALIFIER;
      +				break;
      +			case 'j':
      +				flags |= USB_QUIRK_IGNORE_REMOTE_WAKEUP;
      +				break;
      +			case 'k':
      +				flags |= USB_QUIRK_NO_LPM;
      +				break;
      +			case 'l':
      +				flags |= USB_QUIRK_LINEAR_FRAME_INTR_BINTERVAL;
      +				break;
      +			case 'm':
      +				flags |= USB_QUIRK_DISCONNECT_SUSPEND;
      +				break;
      +			/* Ignore unrecognized flag characters */
      +			}
      +		}
      +
      +		quirk_list[i++] = (struct quirk_entry)
      +			{ .vid = vid, .pid = pid, .flags = flags };
      +	}
      +
      +	if (i < quirk_count)
      +		quirk_count = i;
      +
      +unlock:
      +	mutex_unlock(&quirk_mutex);
      +
      +	return param_set_copystring(val, kp);
      +}
      +
      +static const struct kernel_param_ops quirks_param_ops = {
      +	.set = quirks_param_set,
      +	.get = param_get_string,
      +};
      +
      +static struct kparam_string quirks_param_string = {
      +	.maxlen = sizeof(quirks_param),
      +	.string = quirks_param,
      +};
      +
      +module_param_cb(quirks, &quirks_param_ops, &quirks_param_string, 0644);
      +MODULE_PARM_DESC(quirks, "Add/modify USB quirks by specifying quirks=vendorID:productID:quirks");
      +
       /* Lists of quirky USB devices, split in device quirks and interface quirks.
        * Device quirks are applied at the very beginning of the enumeration process,
        * right after reading the device descriptor. They can thus only match on device
      @@ -320,8 +457,8 @@ static int usb_amd_resume_quirk(struct usb_device *udev)
       	return 0;
       }
      
      -static u32 __usb_detect_quirks(struct usb_device *udev,
      -			       const struct usb_device_id *id)
      +static u32 usb_detect_static_quirks(struct usb_device *udev,
      +				    const struct usb_device_id *id)
       {
       	u32 quirks = 0;
      
      @@ -339,21 +476,43 @@ static u32 __usb_detect_quirks(struct usb_device *udev,
       	return quirks;
       }
      
      +static u32 usb_detect_dynamic_quirks(struct usb_device *udev)
      +{
      +	u16 vid = le16_to_cpu(udev->descriptor.idVendor);
      +	u16 pid = le16_to_cpu(udev->descriptor.idProduct);
      +	int i, flags = 0;
      +
      +	mutex_lock(&quirk_mutex);
      +
      +	for (i = 0; i < quirk_count; i++) {
      +		if (vid == quirk_list[i].vid && pid == quirk_list[i].pid) {
      +			flags = quirk_list[i].flags;
      +			break;
      +		}
      +	}
      +
      +	mutex_unlock(&quirk_mutex);
      +
      +	return flags;
      +}
      +
       /*
        * Detect any quirks the device has, and do any housekeeping for it if needed.
        */
       void usb_detect_quirks(struct usb_device *udev)
       {
      -	udev->quirks = __usb_detect_quirks(udev, usb_quirk_list);
      +	udev->quirks = usb_detect_static_quirks(udev, usb_quirk_list);
      
       	/*
       	 * Pixart-based mice would trigger remote wakeup issue on AMD
       	 * Yangtze chipset, so set them as RESET_RESUME flag.
       	 */
       	if (usb_amd_resume_quirk(udev))
      -		udev->quirks |= __usb_detect_quirks(udev,
      +		udev->quirks |= usb_detect_static_quirks(udev,
       				usb_amd_resume_quirk_list);
      
      +	udev->quirks ^= usb_detect_dynamic_quirks(udev);
      +
       	if (udev->quirks)
       		dev_dbg(&udev->dev, "USB quirks for this device: %x\n",
       			udev->quirks);
      @@ -372,7 +531,7 @@ void usb_detect_interface_quirks(struct usb_device *udev)
       {
       	u32 quirks;
      
      -	quirks = __usb_detect_quirks(udev, usb_interface_quirk_list);
      +	quirks = usb_detect_static_quirks(udev, usb_interface_quirk_list);
       	if (quirks == 0)
       		return;
      
      @@ -380,3 +539,11 @@ void usb_detect_interface_quirks(struct usb_device *udev)
       		quirks);
       	udev->quirks |= quirks;
       }
      +
      +void usb_release_quirk_list(void)
      +{
      +	mutex_lock(&quirk_mutex);
      +	kfree(quirk_list);
      +	quirk_list = NULL;
      +	mutex_unlock(&quirk_mutex);
      +}
      diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
      index 2f5fbc56a9dd..0adb6345ff2e 100644
      --- a/drivers/usb/core/usb.c
      +++ b/drivers/usb/core/usb.c
      @@ -1259,6 +1259,7 @@ static void __exit usb_exit(void)
       	if (usb_disabled())
       		return;
      
      +	usb_release_quirk_list();
       	usb_deregister_device_driver(&usb_generic_driver);
       	usb_major_cleanup();
       	usb_deregister(&usbfs_driver);
      diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h
      index 149cc7480971..546a2219454b 100644
      --- a/drivers/usb/core/usb.h
      +++ b/drivers/usb/core/usb.h
      @@ -36,6 +36,7 @@ extern void usb_deauthorize_interface(struct usb_interface *);
       extern void usb_authorize_interface(struct usb_interface *);
       extern void usb_detect_quirks(struct usb_device *udev);
       extern void usb_detect_interface_quirks(struct usb_device *udev);
      +extern void usb_release_quirk_list(void);
       extern int usb_remove_device(struct usb_device *udev);
      
       extern int usb_get_device_descriptor(struct usb_device *dev,
      95713fb8
  11. 10 3月, 2018 1 次提交
    • K
      usb: core: Add "quirks" parameter for usbcore · b27560e4
      Kai-Heng Feng 提交于
      Trying quirks in usbcore needs to rebuild the driver or the entire
      kernel if it's builtin. It can save a lot of time if usbcore has similar
      ability like "usbhid.quirks=" and "usb-storage.quirks=".
      
      Rename the original quirk detection function to "static" as we introduce
      this new "dynamic" function.
      
      Now users can use "usbcore.quirks=" as short term workaround before the
      next kernel release. Also, the quirk parameter can XOR the builtin
      quirks for debugging purpose.
      
      This is inspired by usbhid and usb-storage.
      Signed-off-by: NKai-Heng Feng <kai.heng.feng@canonical.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b27560e4
  12. 07 3月, 2018 1 次提交
    • G
      audit: do not panic on invalid boot parameter · 11dd2666
      Greg Edwards 提交于
      If you pass in an invalid audit boot parameter value, e.g. "audit=off",
      the kernel panics very early in boot before the regular console is
      initialized.  Unless you have earlyprintk enabled, there is no
      indication of what the problem is on the console.
      
      Convert the panic() calls to pr_err(), and leave auditing enabled if an
      invalid parameter value was passed in.
      
      Modify the parameter to also accept "on" or "off" as valid values, and
      update the documentation accordingly.
      Signed-off-by: NGreg Edwards <gedwards@ddn.com>
      Signed-off-by: NPaul Moore <paul@paul-moore.com>
      11dd2666
  13. 26 2月, 2018 1 次提交
    • J
      x86/boot/e820: Implement a range manipulation operator · ef61f8a3
      Jan H. Schönherr 提交于
      Add a more versatile memmap= operator, which -- in addition to all the
      things that were possible before -- allows you to:
      
      - redeclare existing ranges -- before, you were limited to adding ranges;
      - drop any range -- like a mem= for any location;
      - use any e820 memory type -- not just some predefined ones.
      
      The syntax is:
      
        memmap=<size>%<offset>-<oldtype>+<newtype>
      
      Size and offset work as usual. The "-<oldtype>" and "+<newtype>" are
      optional and their existence determine the behavior: The command
      works on the specified range of memory limited to type <oldtype>
      (if specified). This memory is then configured to show up as <newtype>.
      If <newtype> is not specified, the memory is removed from the e820 map.
      Signed-off-by: NJan H. Schönherr <jschoenh@amazon.de>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/20180202231020.15608-1-jschoenh@amazon.deSigned-off-by: NIngo Molnar <mingo@kernel.org>
      ef61f8a3
  14. 22 2月, 2018 1 次提交
    • J
      docs: Remove metag docs · 29891061
      James Hogan 提交于
      Now that arch/metag/ has been removed, remove Meta architecture specific
      documentation from the Documentation/ directory.
      Signed-off-by: NJames Hogan <jhogan@kernel.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: linux-metag@vger.kernel.org
      Cc: linux-doc@vger.kernel.org
      29891061
  15. 21 2月, 2018 1 次提交
  16. 07 2月, 2018 1 次提交
  17. 31 1月, 2018 1 次提交
    • J
      x86/paravirt: Remove 'noreplace-paravirt' cmdline option · 12c69f1e
      Josh Poimboeuf 提交于
      The 'noreplace-paravirt' option disables paravirt patching, leaving the
      original pv indirect calls in place.
      
      That's highly incompatible with retpolines, unless we want to uglify
      paravirt even further and convert the paravirt calls to retpolines.
      
      As far as I can tell, the option doesn't seem to be useful for much
      other than introducing surprising corner cases and making the kernel
      vulnerable to Spectre v2.  It was probably a debug option from the early
      paravirt days.  So just remove it.
      Signed-off-by: NJosh Poimboeuf <jpoimboe@redhat.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: NJuergen Gross <jgross@suse.com>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Ashok Raj <ashok.raj@intel.com>
      Cc: Greg KH <gregkh@linuxfoundation.org>
      Cc: Jun Nakajima <jun.nakajima@intel.com>
      Cc: Tim Chen <tim.c.chen@linux.intel.com>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: Asit Mallick <asit.k.mallick@intel.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Jason Baron <jbaron@akamai.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Alok Kataria <akataria@vmware.com>
      Cc: Arjan Van De Ven <arjan.van.de.ven@intel.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Link: https://lkml.kernel.org/r/20180131041333.2x6blhxirc2kclrq@treble
      12c69f1e
  18. 18 1月, 2018 1 次提交
  19. 12 1月, 2018 2 次提交
    • D
      x86/spectre: Add boot time option to select Spectre v2 mitigation · da285121
      David Woodhouse 提交于
      Add a spectre_v2= option to select the mitigation used for the indirect
      branch speculation vulnerability.
      
      Currently, the only option available is retpoline, in its various forms.
      This will be expanded to cover the new IBRS/IBPB microcode features.
      
      The RETPOLINE_AMD feature relies on a serializing LFENCE for speculation
      control. For AMD hardware, only set RETPOLINE_AMD if LFENCE is a
      serializing instruction, which is indicated by the LFENCE_RDTSC feature.
      
      [ tglx: Folded back the LFENCE/AMD fixes and reworked it so IBRS
        	integration becomes simple ]
      Signed-off-by: NDavid Woodhouse <dwmw@amazon.co.uk>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: gnomes@lxorguk.ukuu.org.uk
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: thomas.lendacky@amd.com
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Jiri Kosina <jikos@kernel.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: Kees Cook <keescook@google.com>
      Cc: Tim Chen <tim.c.chen@linux.intel.com>
      Cc: Greg Kroah-Hartman <gregkh@linux-foundation.org>
      Cc: Paul Turner <pjt@google.com>
      Link: https://lkml.kernel.org/r/1515707194-20531-5-git-send-email-dwmw@amazon.co.uk
      da285121
    • =
      x86/PCI: Add "pci=big_root_window" option for AMD 64-bit windows · f32ab754
      =?UTF-8?q?Christian=20K=C3=B6nig?= 提交于
      Only try to enable a 64-bit window on AMD CPUs when "pci=big_root_window"
      is specified.
      
      This taints the kernel because the new 64-bit window uses address space we
      don't know anything about, and it may contain unreported devices or memory
      that would conflict with the window.
      
      The pci_amd_enable_64bit_bar() quirk that enables the window is specific to
      AMD CPUs.  The generic solution would be to have the firmware enable the
      window and describe it in the host bridge's _CRS method, or at least
      describe it in the _PRS method so the OS would have the option of enabling
      it.
      Signed-off-by: NChristian König <christian.koenig@amd.com>
      [bhelgaas: changelog, extend doc, mention taint in dmesg]
      Signed-off-by: NBjorn Helgaas <helgaas@kernel.org>
      f32ab754
  20. 09 1月, 2018 1 次提交
  21. 07 1月, 2018 1 次提交
  22. 04 1月, 2018 1 次提交
    • S
      printk: add console_msg_format command line option · cca10d58
      Sergey Senozhatsky 提交于
      0day and kernelCI automatically parse kernel log - basically some sort
      of grepping using the pre-defined text patterns - in order to detect
      and report regressions/errors. There are several sources they get the
      kernel logs from:
      
      a) dmesg or /proc/ksmg
      
         This is the preferred way. Because `dmesg --raw' (see later Note)
         and /proc/kmsg output contains facility and log level, which greatly
         simplifies grepping for EMERG/ALERT/CRIT/ERR messages.
      
      b) serial consoles
      
         This option is harder to maintain, because serial console messages
         don't contain facility and log level.
      
      This patch introduces a `console_msg_format=' command line option,
      to switch between different message formatting on serial consoles.
      For the time being we have just two options - default and syslog.
      The "default" option just keeps the existing format. While the
      "syslog" option makes serial console messages to appear in syslog
      format [syslog() syscall], matching the `dmesg -S --raw' and
      `cat /proc/kmsg' output formats:
      
      - facility and log level
      - time stamp (depends on printk_time/PRINTK_TIME)
      - message
      
      	<%u>[time stamp] text\n
      
      NOTE: while Kevin and Fengguang talk about "dmesg --raw", it's actually
      "dmesg -S --raw" that always prints messages in syslog format [per
      Petr Mladek]. Running "dmesg --raw" may produce output in non-syslog
      format sometimes. console_msg_format=syslog enables syslog format,
      thus in documentation we mention "dmesg -S --raw", not "dmesg --raw".
      
      Per Kevin Hilman:
      
      : Right now we can get this info from a "dmesg --raw" after bootup,
      : but it would be really nice in certain automation frameworks to
      : have a kernel command-line option to enable printing of loglevels
      : in default boot log.
      :
      : This is especially useful when ingesting kernel logs into advanced
      : search/analytics frameworks (I'm playing with and ELK stack: Elastic
      : Search, Logstash, Kibana).
      :
      : The other important reason for having this on the command line is that
      : for testing linux-next (and other bleeding edge developer branches),
      : it's common that we never make it to userspace, so can't even run
      : "dmesg --raw" (or equivalent.)  So we really want this on the primary
      : boot (serial) console.
      
      Per Fengguang Wu, 0day scripts should quickly benefit from that
      feature, because they will be able to switch to a more reliable
      parsing, based on messages' facility and log levels [1]:
      
      `#{grep} -a -E -e '^<[0123]>' -e '^kern  :(err   |crit  |alert |emerg )'
      
      instead of doing text pattern matching
      
      `#{grep} -a -F -f /lkp/printk-error-messages #{kmsg_file} |
            grep -a -v -E -f #{LKP_SRC}/etc/oops-pattern |
            grep -a -v -F -f #{LKP_SRC}/etc/kmsg-blacklist`
      
      [1] https://github.com/fengguang/lkp-tests/blob/master/lib/dmesg.rb
      
      Link: http://lkml.kernel.org/r/20171221054149.4398-1-sergey.senozhatsky@gmail.com
      To: Steven Rostedt <rostedt@goodmis.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Fengguang Wu <fengguang.wu@intel.com>
      Cc: Kevin Hilman <khilman@baylibre.com>
      Cc: Mark Brown <broonie@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: LKML <linux-kernel@vger.kernel.org>
      Signed-off-by: NSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Reviewed-by: NFengguang Wu <fengguang.wu@intel.com>
      Reviewed-by: NKevin Hilman <khilman@baylibre.com>
      Tested-by: NKevin Hilman <khilman@baylibre.com>
      Signed-off-by: NPetr Mladek <pmladek@suse.com>
      cca10d58
  23. 28 12月, 2017 1 次提交
  24. 24 12月, 2017 2 次提交
    • B
      x86/pti: Add the pti= cmdline option and documentation · 41f4c20b
      Borislav Petkov 提交于
      Keep the "nopti" optional for traditional reasons.
      
      [ tglx: Don't allow force on when running on XEN PV and made 'on'
      	printout conditional ]
      Requested-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Andy Lutomirsky <luto@kernel.org>
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Laight <David.Laight@aculab.com>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: Eduardo Valentin <eduval@amazon.com>
      Cc: Greg KH <gregkh@linuxfoundation.org>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: aliguori@amazon.com
      Cc: daniel.gruss@iaik.tugraz.at
      Cc: hughd@google.com
      Cc: keescook@google.com
      Link: https://lkml.kernel.org/r/20171212133952.10177-1-bp@alien8.deSigned-off-by: NIngo Molnar <mingo@kernel.org>
      41f4c20b
    • T
      x86/mm/pti: Add infrastructure for page table isolation · aa8c6248
      Thomas Gleixner 提交于
      Add the initial files for kernel page table isolation, with a minimal init
      function and the boot time detection for this misfeature.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: NBorislav Petkov <bp@suse.de>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Laight <David.Laight@aculab.com>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: Eduardo Valentin <eduval@amazon.com>
      Cc: Greg KH <gregkh@linuxfoundation.org>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: aliguori@amazon.com
      Cc: daniel.gruss@iaik.tugraz.at
      Cc: hughd@google.com
      Cc: keescook@google.com
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      aa8c6248
  25. 19 12月, 2017 1 次提交
  26. 18 12月, 2017 1 次提交
  27. 13 12月, 2017 1 次提交
  28. 12 12月, 2017 2 次提交
  29. 27 11月, 2017 1 次提交
    • R
      ACPI / PM: Make it possible to ignore the system sleep blacklist · 57044031
      Rafael J. Wysocki 提交于
      The ACPI code supporting system transitions to sleep states uses
      an internal blacklist to apply special handling to some machines
      reported to behave incorrectly in some ways.
      
      However, some entries of that blacklist cover problematic as well as
      non-problematic systems, so give the users of the latter a chance to
      ignore the blacklist and run their systems in the default way by
      adding acpi_sleep=nobl to the kernel command line.
      
      For example, that allows the users of Dell XPS13 9360 systems not
      affected by the issue that caused the blacklist entry for this
      machine to be added by commit 71630b7a (ACPI / PM: Blacklist Low
      Power S0 Idle _DSM for Dell XPS13 9360) to use suspend-to-idle with
      the Low Power S0 Idle _DSM interface which in principle should be
      more energy-efficient than S3 on them.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      57044031
  30. 21 11月, 2017 1 次提交
  31. 16 11月, 2017 1 次提交
  32. 10 11月, 2017 1 次提交
  33. 02 11月, 2017 1 次提交
    • M
      irqchip/gic: Deal with broken firmware exposing only 4kB of GICv2 CPU interface · 0962289b
      Marc Zyngier 提交于
      There is a lot of broken firmware out there that don't really
      expose the information the kernel requires when it comes with dealing
      with GICv2:
      
      (1) Firmware that only describes the first 4kB of GICv2
      (2) Firmware that describe 128kB of CPU interface, while
          the usable portion of the address space is between
          60 and 68kB
      
      So far, we only deal with (2). But we have platforms exhibiting
      behaviour (1), resulting in two sub-cases:
      (a) The GIC is occupying 8kB, as required by the GICv2 architecture
      (b) It is actually spread 128kB, and this is likely to be a version
          of (2)
      
      This patch tries to work around both (a) and (b) by poking at
      the outside of the described memory region, and try to work out
      what is actually there. This is of course unsafe, and should
      only be enabled if there is no way to otherwise fix the DT provided
      by the firmware (we provide a "irqchip.gicv2_force_probe" option
      to that effect).
      
      Note that for the time being, we restrict ourselves to GICv2
      implementations provided by ARM, since there I have no knowledge
      of an alternative implementations. This could be relaxed if such
      an implementation comes to light on a broken platform.
      Reviewed-by: NChristoffer Dall <cdall@linaro.org>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      0962289b
  34. 31 10月, 2017 1 次提交
  35. 25 10月, 2017 1 次提交
    • B
      locking/lockdep: Add a boot parameter allowing unwind in cross-release and disable it by default · d141babe
      Byungchul Park 提交于
      Johan Hovold reported a heavy performance regression caused by lockdep
      cross-release:
      
       > Boot time (from "Linux version" to login prompt) had in fact doubled
       > since 4.13 where it took 17 seconds (with my current config) compared to
       > the 35 seconds I now see with 4.14-rc4.
       >
       > I quick bisect pointed to lockdep and specifically the following commit:
       >
       >	28a903f6 ("locking/lockdep: Handle non(or multi)-acquisition
       >	               of a crosslock")
       >
       > which I've verified is the commit which doubled the boot time (compared
       > to 28a903f6^) (added by lockdep crossrelease series [1]).
      
      Currently cross-release performs unwind on every acquisition, but that
      is very expensive.
      
      This patch makes unwind optional and disables it by default and only
      records acquire_ip.
      
      Full stack traces are sometimes required for full analysis, in which
      case a boot paramter, crossrelease_fullstack, can be specified.
      
      On my qemu Ubuntu machine (x86_64, 4 cores, 512M), the regression was
      fixed. We measure boot times with 'perf stat --null --repeat 10 $QEMU',
      where $QEMU launches a kernel with init=/bin/true:
      
      1. No lockdep enabled:
      
       Performance counter stats for 'qemu_booting_time.sh bzImage' (10 runs):
      
             2.756558155 seconds time elapsed                    ( +-  0.09% )
      
      2. Lockdep enabled:
      
       Performance counter stats for 'qemu_booting_time.sh bzImage' (10 runs):
      
             2.968710420 seconds time elapsed                    ( +-  0.12% )
      
      3. Lockdep enabled + cross-release enabled:
      
       Performance counter stats for 'qemu_booting_time.sh bzImage' (10 runs):
      
             3.153839636 seconds time elapsed                    ( +-  0.31% )
      
      4. Lockdep enabled + cross-release enabled + this patch applied:
      
       Performance counter stats for 'qemu_booting_time.sh bzImage' (10 runs):
      
             2.963669551 seconds time elapsed                    ( +-  0.11% )
      
      I.e. lockdep cross-release performance is now indistinguishable from
      vanilla lockdep.
      Bisected-by: NJohan Hovold <johan@kernel.org>
      Analyzed-by: NThomas Gleixner <tglx@linutronix.de>
      Suggested-by: NThomas Gleixner <tglx@linutronix.de>
      Reported-by: NJohan Hovold <johan@kernel.org>
      Signed-off-by: NByungchul Park <byungchul.park@lge.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: amir73il@gmail.com
      Cc: axboe@kernel.dk
      Cc: darrick.wong@oracle.com
      Cc: david@fromorbit.com
      Cc: hch@infradead.org
      Cc: idryomov@gmail.com
      Cc: johannes.berg@intel.com
      Cc: kernel-team@lge.com
      Cc: linux-block@vger.kernel.org
      Cc: linux-fsdevel@vger.kernel.org
      Cc: linux-mm@kvack.org
      Cc: linux-xfs@vger.kernel.org
      Cc: oleg@redhat.com
      Cc: tj@kernel.org
      Link: http://lkml.kernel.org/r/1508921765-15396-5-git-send-email-byungchul.park@lge.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      d141babe