~bladernr/ubuntu/+source/linux/+git/disco:1823037-amd_iommu-cherrypick

Last commit made on 2019-06-07
Get this branch:
git clone -b 1823037-amd_iommu-cherrypick https://git.launchpad.net/~bladernr/ubuntu/+source/linux/+git/disco
Only Jeff Lane  can upload to this branch. If you are Jeff Lane  please log in for upload directions.

Branch merges

Branch information

Name:
1823037-amd_iommu-cherrypick
Repository:
lp:~bladernr/ubuntu/+source/linux/+git/disco

Recent commits

bf9761b... by Joerg Roedel <email address hidden>

iommu/amd: Set exclusion range correctly

BugLink: https://bugs.launchpad.net/bugs/1823037

The exlcusion range limit register needs to contain the
base-address of the last page that is part of the range, as
bits 0-11 of this register are treated as 0xfff by the
hardware for comparisons.

So correctly set the exclusion range in the hardware to the
last page which is _in_ the range.

Fixes: b2026aa2dce44 ('x86, AMD IOMMU: add functions for programming IOMMU MMIO space')
Signed-off-by: Joerg Roedel <email address hidden>

(cherry picked from commit 3c677d206210f53a4be972211066c0f1cd47fe12 5.2-rc1)
Signed-off-by: Jeffrey Lane <email address hidden>

e09b101... by Geert Uytterhoeven <email address hidden>

spi: Add missing error handling for CS GPIOs

BugLink: https://bugs.launchpad.net/bugs/1826142

While devm_gpiod_get_index_optional() returns NULL if the GPIO is not
present (i.e. -ENOENT), it may still return other error codes, like
-EPROBE_DEFER. Currently these are not handled, leading to
unrecoverable failures later in case of probe deferral:

    gpiod_set_consumer_name: invalid GPIO (errorpointer)
    gpiod_direction_output: invalid GPIO (errorpointer)
    gpiod_set_value_cansleep: invalid GPIO (errorpointer)
    gpiod_set_value_cansleep: invalid GPIO (errorpointer)
    gpiod_set_value_cansleep: invalid GPIO (errorpointer)

Detect and propagate errors to fix this.

Fixes: f3186dd876697e69 ("spi: Optionally use GPIO descriptors for CS GPIOs")
Signed-off-by: Geert Uytterhoeven <email address hidden>
Signed-off-by: Mark Brown <email address hidden>
(cherry picked from commit 1723fdec5fcbc4de3d26bbb23a9e1704ee258955)
Signed-off-by: Ike Panhc <email address hidden>
Acked-by: Khalid Elmously <email address hidden>
Acked-by: Connor Kuehl <email address hidden>
Signed-off-by: Kleber Sacilotto de Souza <email address hidden>

82dc54d... by Linus Walleij

gpio: of: Fix logic inversion

BugLink: https://bugs.launchpad.net/bugs/1826142

The SPI chip selects were not properly inspected due to
a logic inversion. This made SPI GPIOs not work.

Cc: Jan Kotas <email address hidden>
Reported-by: Jan Kotas <email address hidden>
Tested-by: Jan Kotas <email address hidden>
Fixes: f3186dd87669 ("spi: Optionally use GPIO descriptors for CS GPIOs")
Signed-off-by: Linus Walleij <email address hidden>
Signed-off-by: Mark Brown <email address hidden>
(cherry picked from commit c1c04cea13dc234ce9a4504879ddd36ea524d880)
Signed-off-by: Ike Panhc <email address hidden>
Acked-by: Khalid Elmously <email address hidden>
Acked-by: Connor Kuehl <email address hidden>
Signed-off-by: Kleber Sacilotto de Souza <email address hidden>

919fd8f... by Linus Walleij

spi: dw: Fix default polarity of native chipselect

BugLink: https://bugs.launchpad.net/bugs/1826142

The DW controller also supports platforms specifying
native chipselects. When I enforce the use of high CS
for drivers opting in for using GPIO descriptors, I
inadvertedly switched the driver to also use active
high chip select for native chip selects.

As it turns out, the DW hardware driving chip selects
also thinks it is weird with active low chip selects
so all we need to do is remove an inversion in the
driver.

Cc: Jan Kotas <email address hidden>
Reported-by: Jan Kotas <email address hidden>
Tested-by: Jan Kotas <email address hidden>
Fixes: 9400c41e77b8 ("spi: dw: Convert to use CS GPIO descriptors")
Signed-off-by: Linus Walleij <email address hidden>
Signed-off-by: Mark Brown <email address hidden>
(cherry picked from commit 6e0a32d6f376ea22a34ae3a8df60adafbcdb0c86)
Signed-off-by: Ike Panhc <email address hidden>
Acked-by: Khalid Elmously <email address hidden>
Acked-by: Connor Kuehl <email address hidden>
Signed-off-by: Kleber Sacilotto de Souza <email address hidden>

fbdc858... by Linus Walleij

spi: Support high CS when using descriptors

BugLink: https://bugs.launchpad.net/bugs/1826142

All controllers using GPIO descriptors can by definition
support high CS connections, so just enforce this when
registering an SPI controller.

This fixes a regression where controllers were missing
SPI_CS_HIGH, the drivers would fail like this:

spi spi0.0: setup: unsupported mode bits 4
cdns-spi fd0b0000.spi: can't setup spi0.0, status -22

This is because as using descriptors moves the CS inversion
logic over to gpiolib, all such controllers are registered
with CS active high.

Cc: Jan Kotas <email address hidden>
Reported-by: Jan Kotas <email address hidden>
Tested-by: Jan Kotas <email address hidden>
Fixes: f3186dd87669 ("spi: Optionally use GPIO descriptors for CS GPIOs")
Signed-off-by: Linus Walleij <email address hidden>
Signed-off-by: Mark Brown <email address hidden>
(cherry picked from commit 2df201e0067d84db5955d07cc0d7ccc3b7295aef)
Signed-off-by: Ike Panhc <email address hidden>
Acked-by: Khalid Elmously <email address hidden>
Acked-by: Connor Kuehl <email address hidden>
Signed-off-by: Kleber Sacilotto de Souza <email address hidden>

f621635... by Anders Roxell

spi: dw: fix warning unused variable 'ret'

BugLink: https://bugs.launchpad.net/bugs/1826142

When CONFIG_SPI_DESIGNWARE are enabled we see the unused variable
warning in dw_spi_setup.

../drivers/spi/spi-dw.c: In function ‘dw_spi_setup’:
../drivers/spi/spi-dw.c:400:6: warning: unused variable ‘ret’ [-Wunused-variable]
  int ret;
      ^~~

Remove the unused varable.

Fixes: 9400c41e77b8 ("spi: dw: Convert to use CS GPIO descriptors")
Reported-by: Stephen Rothwell <email address hidden>
Signed-off-by: Anders Roxell <email address hidden>
Signed-off-by: Mark Brown <email address hidden>
(cherry picked from commit 4f0a0cd52d6c812fbf737e436b18f04eac2e312e)
Signed-off-by: Ike Panhc <email address hidden>
Acked-by: Khalid Elmously <email address hidden>
Acked-by: Connor Kuehl <email address hidden>
Signed-off-by: Kleber Sacilotto de Souza <email address hidden>

25ae772... by Linus Walleij

spi: dw: Convert to use CS GPIO descriptors

BugLink: https://bugs.launchpad.net/bugs/1826142

This converts the DesignWare (dw) SPI master driver to
use GPIO descriptors for chip select handling.

This driver has a duplicate DT parser in addition to the
one in the core, sets up the line as non-asserted and
relies on the core to drive the GPIOs.

It is a pretty straight-forward conversion.

Cc: Talel Shenhar <email address hidden>
Cc: Simon Goldschmidt <email address hidden>
Cc: Alexandre Belloni <email address hidden>
Cc: Linuxarm <email address hidden>
Tested-by: Jay Fang <email address hidden>
Reviewed-by: Alexandre Belloni <email address hidden>
Signed-off-by: Linus Walleij <email address hidden>
Signed-off-by: Mark Brown <email address hidden>
(cherry picked from commit 9400c41e77b8f1f9c711b08a6c79bdbc5681fb00)
Signed-off-by: Ike Panhc <email address hidden>
Acked-by: Khalid Elmously <email address hidden>
Acked-by: Connor Kuehl <email address hidden>
Signed-off-by: Kleber Sacilotto de Souza <email address hidden>

b3fbaa6... by Linus Walleij

spi: Optionally use GPIO descriptors for CS GPIOs

BugLink: https://bugs.launchpad.net/bugs/1826142

This augments the SPI core to optionally use GPIO descriptors
for chip select on a per-master-driver opt-in basis.

Drivers using this will rely on the SPI core to look up
GPIO descriptors associated with the device, such as
when using device tree or board files with GPIO descriptor
tables.

When getting descriptors from the device tree, this will in
turn activate the code in gpiolib that was
added in commit 6953c57ab172
("gpio: of: Handle SPI chipselect legacy bindings")
which means that these descriptors are aware of the active
low semantics that is the default for SPI CS GPIO lines
and we can assume that all of these are "active high" and
thus assign SPI_CS_HIGH to all CS lines on the DT path.

The previously used gpio_set_value() would call down into
gpiod_set_raw_value() and ignore the polarity inversion
semantics.

It seems like many drivers go to great lengths to set up the
CS GPIO line as non-asserted, respecting SPI_CS_HIGH. We pull
this out of the SPI drivers and into the core, and by simply
requesting the line as GPIOD_OUT_LOW when retrieveing it from
the device and relying on the gpiolib to handle any inversion
semantics. This way a lot of code can be simplified and
removed in each converted driver.

The end goal after dealing with each driver in turn, is to
delete the non-descriptor path (of_spi_register_master() for
example) and let the core deal with only descriptors.

The different SPI drivers have complex interactions with the
core so we cannot simply change them all over, we need to use
a stepwise, bisectable approach so that each driver can be
converted and fixed in isolation.

This patch has the intended side effect of adding support for
ACPI GPIOs as it starts relying on gpiod_get_*() to get
the GPIO handle associated with the device.

Cc: Linuxarm <email address hidden>
Acked-by: Jonathan Cameron <email address hidden>
Tested-by: Fangjian (Turing) <email address hidden>
Signed-off-by: Linus Walleij <email address hidden>
Signed-off-by: Mark Brown <email address hidden>
(cherry picked from commit f3186dd876697e696d07136623d5cf0a6fb0bc0f)
Signed-off-by: Ike Panhc <email address hidden>
Acked-by: Khalid Elmously <email address hidden>
Acked-by: Connor Kuehl <email address hidden>
Signed-off-by: Kleber Sacilotto de Souza <email address hidden>

7d77182... by Josh Poimboeuf

x86/speculation/mds: Fix documentation typo

Fix a minor typo in the MDS documentation: "eanbled" -> "enabled".

Reported-by: Jeff Bastian <email address hidden>
Signed-off-by: Josh Poimboeuf <email address hidden>
Signed-off-by: Thomas Gleixner <email address hidden>

CVE-2018-12126
CVE-2018-12127
CVE-2018-12130
CVE-2019-11091

(cherry picked from commit 95310e348a321b45fb746c176961d4da72344282)
Signed-off-by: Tyler Hicks <email address hidden>
Acked-by: Kleber Sacilotto de Souza <email address hidden>
Acked-by: Connor Kuehl <email address hidden>
Signed-off-by: Kleber Sacilotto de Souza <email address hidden>

b8d1fef... by Tyler Hicks

Documentation: Correct the possible MDS sysfs values

Adjust the last two rows in the table that display possible values when
MDS mitigation is enabled. They both were slightly innacurate.

In addition, convert the table of possible values and their descriptions
to a list-table. The simple table format uses the top border of equals
signs to determine cell width which resulted in the first column being
far too wide in comparison to the second column that contained the
majority of the text.

Signed-off-by: Tyler Hicks <email address hidden>
Signed-off-by: Thomas Gleixner <email address hidden>

CVE-2018-12126
CVE-2018-12127
CVE-2018-12130
CVE-2019-11091

(cherry picked from commit ea01668f9f43021b28b3f4d5ffad50106a1e1301)
Signed-off-by: Tyler Hicks <email address hidden>
Acked-by: Kleber Sacilotto de Souza <email address hidden>
Acked-by: Connor Kuehl <email address hidden>
Signed-off-by: Kleber Sacilotto de Souza <email address hidden>