]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/log
mirror_ubuntu-bionic-kernel.git
6 years agoUBUNTU: SAUCE: LSM stacking: add /proc/<pid>/attr/display_lsm
John Johansen [Thu, 28 Sep 2017 15:09:43 +0000 (11:09 -0400)]
UBUNTU: SAUCE: LSM stacking: add /proc/<pid>/attr/display_lsm

BugLink: http://bugs.launchpad.net/bugs/1763062
Add /proc/<pid>/attr/display_lsm so that scripts can easily introspect
the display lsm of a give task.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: make sure LSM blob align on 64 bit boundaries
John Johansen [Thu, 28 Sep 2017 17:47:13 +0000 (13:47 -0400)]
UBUNTU: SAUCE: LSM stacking: make sure LSM blob align on 64 bit boundaries

BugLink: http://bugs.launchpad.net/bugs/1763062
The security->task blob reserving the first 12 bytes means that LSM
blobs don't align on 64 byte boundaries. This is not a problem
for x86 but if an LSM stores a long or ptr in its blob, then some
architectures require it be aligned to the arch word size and
will through a fault.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: provide a way to specify the default display lsm
John Johansen [Wed, 27 Sep 2017 06:05:22 +0000 (02:05 -0400)]
UBUNTU: SAUCE: LSM stacking: provide a way to specify the default display lsm

BugLink: http://bugs.launchpad.net/bugs/1763062
When the system boots up the desired default display LSM maybe different
than the first LSM initialized. Allow it to be set by specifying an
LSM with
  security.display=apparmor

Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: verify display LSM
John Johansen [Wed, 27 Sep 2017 05:28:08 +0000 (01:28 -0400)]
UBUNTU: SAUCE: LSM stacking: verify display LSM

BugLink: http://bugs.launchpad.net/bugs/1763062
Make sure the display LSM is verified to be a registered LSM, to
avoid breakage when a bad name is passed.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: keep an index for each registered LSM
John Johansen [Wed, 27 Sep 2017 05:13:17 +0000 (01:13 -0400)]
UBUNTU: SAUCE: LSM stacking: keep an index for each registered LSM

BugLink: http://bugs.launchpad.net/bugs/1763062
Keep an index of the registered LSMs so that it can be used in table
lookups and ordering comparisons.

pulled from the full LSM stacking patch

Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: inherit current display LSM
John Johansen [Wed, 27 Sep 2017 04:45:16 +0000 (00:45 -0400)]
UBUNTU: SAUCE: LSM stacking: inherit current display LSM

BugLink: http://bugs.launchpad.net/bugs/1763062
If a current display LSM is set it should be inherited. As per 2017
LSS discussion.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: provide prctl interface for setting context
John Johansen [Tue, 26 Sep 2017 18:58:26 +0000 (14:58 -0400)]
UBUNTU: SAUCE: LSM stacking: provide prctl interface for setting context

BugLink: http://bugs.launchpad.net/bugs/1763062
Separate out the prctl interface added in the full LSM stacking patches
to allow tasks to set the display "LSM".

Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: allow selecting multiple LSMs using kernel boot params
John Johansen [Tue, 26 Sep 2017 15:06:30 +0000 (11:06 -0400)]
UBUNTU: SAUCE: LSM stacking: allow selecting multiple LSMs using kernel boot params

BugLink: http://bugs.launchpad.net/bugs/1763062
The base stacking code does not provide a way for users to specify the
desired stack using the kernel boot parameters. Enable specifying an
LSM stack on the command line by providing a comma separated list

ie.
  security=apparmor,selinux

Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: fixup stacking kconfig
John Johansen [Mon, 25 Sep 2017 16:03:19 +0000 (12:03 -0400)]
UBUNTU: SAUCE: LSM stacking: fixup stacking kconfig

BugLink: http://bugs.launchpad.net/bugs/1763062
The stack configs in the base stacking patches are confusing and
separate the selinux/smack stacking from the other LSMs with an
"extreme" stacking entry which is extremely confusing.

Switch the "extreme" stacking to a select for mutually exclusive
LSMs, which provides a better explanation of what is happening.

Fixes: 6c5100029055 ("LSM: general but not extreme module stacking")
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: fixup apparmor stacking enablement
John Johansen [Wed, 27 Sep 2017 06:10:17 +0000 (02:10 -0400)]
UBUNTU: SAUCE: LSM stacking: fixup apparmor stacking enablement

BugLink: http://bugs.launchpad.net/bugs/1763062
AppArmor doesn't need to register twice.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: add stacking support to apparmor network hooks
John Johansen [Wed, 27 Sep 2017 07:08:55 +0000 (03:08 -0400)]
UBUNTU: SAUCE: LSM stacking: add stacking support to apparmor network hooks

BugLink: http://bugs.launchpad.net/bugs/1763062
The stacking patches weren't developed against apparmor networking hooks.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: add support for stacking getpeersec_stream
John Johansen [Tue, 26 Sep 2017 19:12:35 +0000 (15:12 -0400)]
UBUNTU: SAUCE: LSM stacking: add support for stacking getpeersec_stream

BugLink: http://bugs.launchpad.net/bugs/1763062
getpeersec_stream needs to use the "current" display LSM set by the
prctl.

Split out the getpeersec_stream implementation from the full stacking
patch.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: fixup: alloc_task_ctx is dead code
John Johansen [Sun, 3 Sep 2017 19:10:20 +0000 (12:10 -0700)]
UBUNTU: SAUCE: LSM stacking: fixup: alloc_task_ctx is dead code

BugLink: http://bugs.launchpad.net/bugs/1763062
Fixes: 7b27ec622c90 ("LSM: manage credential security blobs)
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: fixup initialize task->security
John Johansen [Tue, 26 Sep 2017 19:03:19 +0000 (15:03 -0400)]
UBUNTU: SAUCE: LSM stacking: fixup initialize task->security

BugLink: http://bugs.launchpad.net/bugs/1763062
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: LSM: General stacking
Casey Schaufler [Wed, 7 Mar 2018 22:39:43 +0000 (14:39 -0800)]
UBUNTU: SAUCE: LSM stacking: LSM: General stacking

BugLink: http://bugs.launchpad.net/bugs/1763062
Leverage the infrastructure management of the security blobs
to allow stacking of security modules in all but the most
extreme case. Security modules are informed of the location
of their data within the blobs at module initialization.

Stacking is optional. If stacking is not configured the old
limit of one "major" security module applies. If stacking is
configured TOMOYO can be configured with an of the other
modules. SELinux, Smack and AppArmor use (or in the AppArmor
case, threaten to use) secids, which are not (yet) shareable.

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: LSM: Manage remaining security blobs
Casey Schaufler [Wed, 7 Mar 2018 22:38:28 +0000 (14:38 -0800)]
UBUNTU: SAUCE: LSM stacking: LSM: Manage remaining security blobs

BugLink: http://bugs.launchpad.net/bugs/1763062
Move management of the inode, ipc, key, msg_msg, sock and superblock
security blobs from the security modules to the infrastructure.
Use of the blob pointers is abstracted in the security modules.

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: LSM: Manage task security blobs
Casey Schaufler [Wed, 7 Mar 2018 22:37:29 +0000 (14:37 -0800)]
UBUNTU: SAUCE: LSM stacking: LSM: Manage task security blobs

BugLink: http://bugs.launchpad.net/bugs/1763062
Move management of task security blobs into the security
infrastructure. Modules are required to identify the space
they require. At this time there are no modules that use
task blobs.

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: LSM: Manage file security blobs
Casey Schaufler [Wed, 7 Mar 2018 22:36:23 +0000 (14:36 -0800)]
UBUNTU: SAUCE: LSM stacking: LSM: Manage file security blobs

BugLink: http://bugs.launchpad.net/bugs/1763062
Move the management of file security blobs from the individual
security modules to the security infrastructure. The security modules
using file blobs have been updated accordingly. Modules are required
to identify the space they need at module initialization. In some
cases a module no longer needs to supply a blob management hook, in
which case the hook has been removed.

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: LSM: Manage credential security blobs
Casey Schaufler [Wed, 7 Mar 2018 22:35:10 +0000 (14:35 -0800)]
UBUNTU: SAUCE: LSM stacking: LSM: Manage credential security blobs

BugLink: http://bugs.launchpad.net/bugs/1763062
Move the management of credential security blobs from the
individual security modules to the security infrastructure.
The security modules using credential blobs have been updated
accordingly. Modules are required to identify the space they
require at module initialization. In some cases a module no
longer needs to supply a blob management hook, in which case
the hook has been removed.

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: procfs: add smack subdir to attrs
Casey Schaufler [Wed, 7 Mar 2018 22:31:19 +0000 (14:31 -0800)]
UBUNTU: SAUCE: LSM stacking: procfs: add smack subdir to attrs

BugLink: http://bugs.launchpad.net/bugs/1763062
Back in 2007 I made what turned out to be a rather serious
mistake in the implementation of the Smack security module.
The SELinux module used an interface in /proc to manipulate
the security context on processes. Rather than use a similar
interface, I used the same interface. The AppArmor team did
likewise. Now /proc/.../attr/current will tell you the
security "context" of the process, but it will be different
depending on the security module you're using.

This patch provides a subdirectory in /proc/.../attr for
Smack. Smack user space can use the "current" file in
this subdirectory and never have to worry about getting
SELinux attributes by mistake. Programs that use the
old interface will continue to work (or fail, as the case
may be) as before.

The original implementation is by Kees Cook.

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
---
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoRDMA/hns: ensure for-loop actually iterates and free's buffers
Colin Ian King [Mon, 26 Mar 2018 15:10:18 +0000 (16:10 +0100)]
RDMA/hns: ensure for-loop actually iterates and free's buffers

BugLink: https://bugs.launchpad.net/bugs/1762757
The current for-loop zeros variable i and only loops once, hence
not all the buffers are free'd.  Fix this by setting i correctly.

Detected by CoverityScan, CID#1463415 ("Operands don't affect result")

Fixes: a5073d6054f7 ("RDMA/hns: Add eq support of hip08")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Yixian Liu <liuyixian@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
(cherry picked from commit 38759d6175d338fbf9282c8ea2b51f3b7ab9bc98)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoRDMA/hns: Fix cq record doorbell enable in kernel
Yixian Liu [Wed, 21 Mar 2018 06:11:18 +0000 (14:11 +0800)]
RDMA/hns: Fix cq record doorbell enable in kernel

BugLink: https://bugs.launchpad.net/bugs/1762755
Upon detecting both kernel and user space support record doorbell,
the kernel needs to enable this capability in hardware by db_en,
and it should take place before cq context configuration in
hns_roce_cq_alloc. Currently, db_en is configured after cq alloc
and db_map_user has similar problem.

Reported-by: Xiping Zhang <zhangxiping3@huawei.com>
Fixes: 9b44703d0a21 ("RDMA/hns: Support cq record doorbell for the user space")
Signed-off-by: Yixian Liu <liuyixian@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
(cherry picked from commit e95955773d4357a0b09a43128352047afce8f35b)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoRDMA/hns: Fix init resp when alloc ucontext
Yixian Liu [Mon, 19 Mar 2018 13:36:07 +0000 (21:36 +0800)]
RDMA/hns: Fix init resp when alloc ucontext

BugLink: https://bugs.launchpad.net/bugs/1762755
The data in resp will be copied from kernel to userspace, thus it needs to
be initialized to zeros to avoid copying uninited stack memory.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: e088a685eae9 ("RDMA/hns: Support rq record doorbell for the user space")
Signed-off-by: Yixian Liu <liuyixian@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
(cherry picked from commit df7e40425813c50cd252e6f5e348a81ef1acae56)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoRDMA/hns: Fix cqn type and init resp
Yixian Liu [Thu, 15 Mar 2018 07:23:14 +0000 (15:23 +0800)]
RDMA/hns: Fix cqn type and init resp

BugLink: https://bugs.launchpad.net/bugs/1762755
This patch changes the type of cqn from u32 to u64 to keep
userspace and kernel consistent, initializes resp both for
cq and qp to zeros, and also changes the condition judgment
of outlen considering future caps extension.

Suggested-by: Jason Gunthorpe <jgg@mellanox.com>
Fixes: e088a685eae9 (hns: Support rq record doorbell for the user space)
Fixes: 9b44703d0a21 (hns: Support cq record doorbell for the user space)
Signed-off-by: Yixian Liu <liuyixian@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Shaobo Xu <xushaobo2@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
(cherry picked from commit 7b48221cf41a90cf4bfc36e6d699b7fa4169c970)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoRDMA/hns: Support cq record doorbell for kernel space
Yixian Liu [Fri, 9 Mar 2018 10:36:32 +0000 (18:36 +0800)]
RDMA/hns: Support cq record doorbell for kernel space

BugLink: https://bugs.launchpad.net/bugs/1762755
This patch updates to support cq record doorbell for
the kernel space.

Signed-off-by: Yixian Liu <liuyixian@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Shaobo Xu <xushaobo2@huawei.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
(cherry picked from commit 86188a8810ed0b73ce6653daa3c4bc29e8a79a7c)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoRDMA/hns: Support rq record doorbell for kernel space
Yixian Liu [Fri, 9 Mar 2018 10:36:31 +0000 (18:36 +0800)]
RDMA/hns: Support rq record doorbell for kernel space

BugLink: https://bugs.launchpad.net/bugs/1762755
This patch updates to support rq record doorbell for
the kernel space.

Signed-off-by: Yixian Liu <liuyixian@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Shaobo Xu <xushaobo2@huawei.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
(cherry picked from commit 472bc0fbd47cb89f72607328b6b09b4a962ec200)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoRDMA/hns: Support cq record doorbell for the user space
Yixian Liu [Fri, 9 Mar 2018 10:36:30 +0000 (18:36 +0800)]
RDMA/hns: Support cq record doorbell for the user space

BugLink: https://bugs.launchpad.net/bugs/1762755
This patch updates to support cq record doorbell for
the user space.

Signed-off-by: Yixian Liu <liuyixian@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Shaobo Xu <xushaobo2@huawei.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
(cherry picked from commit 9b44703d0a21980441cb120ffe4c6880dd453191)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoRDMA/hns: Support rq record doorbell for the user space
Yixian Liu [Fri, 9 Mar 2018 10:36:29 +0000 (18:36 +0800)]
RDMA/hns: Support rq record doorbell for the user space

BugLink: https://bugs.launchpad.net/bugs/1762755
This patch adds interfaces and definitions to support the rq record
doorbell for the user space.

Signed-off-by: Yixian Liu <liuyixian@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Shaobo Xu <xushaobo2@huawei.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
(cherry picked from commit e088a685eae94a0607b8f7b99949a0e14d748813)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoRDMA/hns: Fix the endian problem for hns
oulijun [Mon, 5 Feb 2018 13:14:00 +0000 (21:14 +0800)]
RDMA/hns: Fix the endian problem for hns

BugLink: https://bugs.launchpad.net/bugs/1762755
The hip06 and hip08 run on a little endian ARM, it needs to
revise the annotations to indicate that the HW uses little
endian data in the various DMA buffers, and flow the necessary
swaps throughout.

The imm_data use big endian mode. The cpu_to_le32/le32_to_cpu
swaps are no-op for this, which makes the only substantive
change the handling of imm_data which is now mandatory swapped.

This also keep match with the userspace hns driver and resolve
the warning by sparse.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
(cherry picked from commit 8b9b8d143b467ec9c65f87b7c2596dc2aabe6737)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoMAINTAINERS: Add John Garry as maintainer for HiSilicon LPC driver
John Garry [Wed, 14 Mar 2018 18:15:59 +0000 (02:15 +0800)]
MAINTAINERS: Add John Garry as maintainer for HiSilicon LPC driver

BugLink: https://bugs.launchpad.net/bugs/1762758
Add John Garry as maintainer for drivers/bus/hisi_lpc.c, the HiSilicon LPC
driver.

Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
(cherry picked from commit 6183d9b3ce7979eda940e594a5c342171a5da998)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoHISI LPC: Add ACPI support
John Garry [Wed, 14 Mar 2018 18:15:58 +0000 (02:15 +0800)]
HISI LPC: Add ACPI support

BugLink: https://bugs.launchpad.net/bugs/1762758
Based on the previous patches, this patch supports the LPC host on
Hip06/Hip07 for ACPI FW.

It is the responsibility of the LPC host driver to enumerate the child
devices, as the ACPI scan code will not enumerate children of "indirect IO"
hosts.

The ACPI table for the LPC host controller and the child devices is in the
following format:

  Device (LPC0) {
    Name (_HID, "HISI0191")  // HiSi LPC
    Name (_CRS, ResourceTemplate () {
      Memory32Fixed (ReadWrite, 0xa01b0000, 0x1000)
    })
  }

  Device (LPC0.IPMI) {
    Name (_HID, "IPI0001")
    Name (LORS, ResourceTemplate() {
      QWordIO (
        ResourceConsumer,
        MinNotFixed,     // _MIF
        MaxNotFixed,     // _MAF
        PosDecode,
        EntireRange,
        0x0,             // _GRA
        0xe4,            // _MIN
        0x3fff,          // _MAX
        0x0,             // _TRA
        0x04,            // _LEN
        , ,
        BTIO
      )
    })

Since the IO resources of the child devices need to be translated from LPC
bus addresses to logical PIO addresses, and we shouldn't modify the
resources of the devices generated in the FW scan, a per-child MFD is
created as a substitute.  The MFD IO resources will be the translated bus
addresses of the ACPI child.

Tested-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Zhichang Yuan <yuanzhichang@hisilicon.com>
Signed-off-by: Gabriele Paoloni <gabriele.paoloni@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
(cherry picked from commit e0aa1563f8945d9b8f472426d100bed190a4308f)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoACPI / scan: Do not enumerate Indirect IO host children
John Garry [Wed, 14 Mar 2018 18:15:57 +0000 (02:15 +0800)]
ACPI / scan: Do not enumerate Indirect IO host children

BugLink: https://bugs.launchpad.net/bugs/1762758
Through the logical PIO framework, systems which otherwise have no IO space
access to legacy ISA/LPC devices may access these devices through so-called
"indirect IO" method.  In this, IO space accesses for non-PCI hosts are
redirected to a host LLDD to manually generate the IO space (bus) accesses.
Hosts are able to register a region in logical PIO space to map to its bus
address range.

Indirect IO child devices have an associated host-specific bus address.
Special translation is required to map between a logical PIO address for a
device and its host bus address.

Since in the ACPI tables the child device IO resources would be the
host-specific values, it is required the ACPI scan code should not
enumerate these devices, and that this should be the responsibility of the
host driver so that it can "fixup" the resources so that they map to the
appropriate logical PIO addresses.

To avoid enumerating these child devices, add a check from
acpi_device_enumeration_by_parent() as to whether the parent for a device
is a member of a known list of "indirect IO" hosts.  For now, the HiSilicon
LPC host controller ID is added.

Tested-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit dfda4492322ed0a1eb9c4d4715c4b90c9af57352)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoACPI / scan: Rename acpi_is_serial_bus_slave() for more general use
John Garry [Wed, 14 Mar 2018 18:15:56 +0000 (02:15 +0800)]
ACPI / scan: Rename acpi_is_serial_bus_slave() for more general use

BugLink: https://bugs.launchpad.net/bugs/1762758
Currently the ACPI scan has special handling for serial bus slaves, in that
it makes it the responsibility of the slave device's parent to enumerate
the device.

To support other types of slave devices which require the same special
handling but where the bus is not strictly a serial bus, such as devices on
the HiSilicon LPC controller bus, rename acpi_is_serial_bus_slave() to
acpi_device_enumeration_by_parent(), so that the name can fit the wider
purpose.

Also rename the associated device flag acpi_device_flags.serial_bus_slave
to .enumeration_by_parent.

Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit d87fb0917a073d71300b2b31b3773f6690bd1712)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoHISI LPC: Support the LPC host on Hip06/Hip07 with DT bindings
Zhichang Yuan [Wed, 21 Mar 2018 22:23:02 +0000 (17:23 -0500)]
HISI LPC: Support the LPC host on Hip06/Hip07 with DT bindings

BugLink: https://bugs.launchpad.net/bugs/1762758
The low-pin-count (LPC) interface of Hip06/Hip07 accesses I/O port space of
peripherals.

Implement the LPC host controller driver which performs the I/O operations
on the underlying hardware.  We don't want to touch existing drivers such
as ipmi-bt, so this driver applies the indirect-IO introduced in the
previous patch after registering an indirect-IO node to the indirect-IO
devices list which will be searched by the I/O accessors to retrieve the
host-local I/O port.

The driver config is set as a bool instead of a tristate.  The reason here
is that, by the very nature of the driver providing a logical PIO range, it
does not make sense to have this driver as a loadable module.  Another more
specific reason is that the Huawei D03 board which includes Hip06 SoC
requires the LPC bus for UART console, so should be built in.

Tested-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Zou Rongrong <zourongrong@huawei.com>
Signed-off-by: Zhichang Yuan <yuanzhichang@hisilicon.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Rob Herring <robh@kernel.org> # dts part
(cherry picked from commit adf38bb0b5956ab5469acb1ca981a9287c7ad1d8)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoof: Add missing I/O range exception for indirect-IO devices
Zhichang Yuan [Wed, 14 Mar 2018 18:15:54 +0000 (02:15 +0800)]
of: Add missing I/O range exception for indirect-IO devices

BugLink: https://bugs.launchpad.net/bugs/1762758
There are some special ISA/LPC devices that work on a specific I/O range
where it is not correct to specify a 'ranges' property in the DTS parent
node as CPU addresses translated from DTS node are only for memory space on
some architectures, such as ARM64.  Without the parent 'ranges' property,
of_translate_address() returns an error.

Here we add special handling for this case.

During the OF address translation, some checking will be performed to
identify whether the device node is registered as indirect-IO.  If it is,
the I/O translation will be done in a different way from that one of PCI
MMIO.  In this way, the I/O 'reg' property of the special ISA/LPC devices
will be parsed correctly.

Tested-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Zhichang Yuan <yuanzhichang@hisilicon.com>
Signed-off-by: Gabriele Paoloni <gabriele.paoloni@huawei.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de> # earlier draft
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
(cherry picked from commit 65af618d2c559f8eb19d80d03a23029651a59de4)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoPCI: Apply the new generic I/O management on PCI IO hosts
Zhichang Yuan [Wed, 14 Mar 2018 18:15:53 +0000 (02:15 +0800)]
PCI: Apply the new generic I/O management on PCI IO hosts

BugLink: https://bugs.launchpad.net/bugs/1762758
After introducing the new generic I/O space management (Logical PIO), the
original PCI MMIO relevant helpers need to be updated based on the new
interfaces defined in logical PIO.

Adapt the corresponding code to match the changes introduced by logical
PIO.

Tested-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Zhichang Yuan <yuanzhichang@hisilicon.com>
Signed-off-by: Gabriele Paoloni <gabriele.paoloni@huawei.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de> # earlier draft
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
(cherry picked from commit 5745392e0c2b78e0d73203281d5c42cbd6993194)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoPCI: Add fwnode handler as input param of pci_register_io_range()
Gabriele Paoloni [Wed, 14 Mar 2018 18:15:52 +0000 (02:15 +0800)]
PCI: Add fwnode handler as input param of pci_register_io_range()

BugLink: https://bugs.launchpad.net/bugs/1762758
In preparation for having the PCI MMIO helpers use the new generic I/O
space management (logical PIO) we need to add the fwnode handler as an
extra input parameter.

Changes the signature of pci_register_io_range() and its callers as
needed.

Tested-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Gabriele Paoloni <gabriele.paoloni@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
(cherry picked from commit fcfaab30933bd151bd8cb4dd07b3f11d885bb611)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoPCI: Remove __weak tag from pci_register_io_range()
Gabriele Paoloni [Wed, 14 Mar 2018 18:15:51 +0000 (02:15 +0800)]
PCI: Remove __weak tag from pci_register_io_range()

BugLink: https://bugs.launchpad.net/bugs/1762758
pci_register_io_range() has only one definition, so there is no need for
the __weak attribute.  Remove it.

Tested-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Gabriele Paoloni <gabriele.paoloni@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
(cherry picked from commit e2515476ab3ca228369be14ac4792787c91d1804)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agolib: Add generic PIO mapping method
Zhichang Yuan [Wed, 14 Mar 2018 18:15:50 +0000 (02:15 +0800)]
lib: Add generic PIO mapping method

BugLink: https://bugs.launchpad.net/bugs/1762758
41f8bba7f555 ("of/pci: Add pci_register_io_range() and
pci_pio_to_address()") added support for PCI I/O space mapped into CPU
physical memory space.  With that support, the I/O ranges configured for
PCI/PCIe hosts on some architectures can be mapped to logical PIO and
converted easily between CPU address and the corresponding logical PIO.
Based on this, PCI I/O port space can be accessed via in/out accessors that
use memory read/write.

But on some platforms, there are bus hosts that access I/O port space with
host-local I/O port addresses rather than memory addresses.

Add a more generic I/O mapping method to support those devices.  With this
patch, both the CPU addresses and the host-local port can be mapped into
the logical PIO space with different logical/fake PIOs.  After this, all
the I/O accesses to either PCI MMIO devices or host-local I/O peripherals
can be unified into the existing I/O accessors defined in asm-generic/io.h
and be redirected to the right device-specific hooks based on the input
logical PIO.

Tested-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Zhichang Yuan <yuanzhichang@hisilicon.com>
Signed-off-by: Gabriele Paoloni <gabriele.paoloni@huawei.com>
Signed-off-by: John Garry <john.garry@huawei.com>
[bhelgaas: remove -EFAULT return from logic_pio_register_range() per
https://lkml.kernel.org/r/20180403143909.GA21171@ulmo, fix NULL pointer
checking per https://lkml.kernel.org/r/20180403211505.GA29612@embeddedor.com]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
(cherry picked from commit 031e3601869c815582ca1d49d1ff73de58e446b0)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoRevert "UBUNTU: SAUCE: LIB: Introduce a generic PIO mapping method"
dann frazier [Mon, 9 Apr 2018 20:43:36 +0000 (14:43 -0600)]
Revert "UBUNTU: SAUCE: LIB: Introduce a generic PIO mapping method"

BugLink: https://bugs.launchpad.net/bugs/1762758
Replacing with the upstream version of this series.

This reverts commit 342c2a0ed90ec9813672a686a728604045719dcf.

Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoRevert "UBUNTU: SAUCE: PCI: Remove unused __weak attribute in pci_register_io_range()"
dann frazier [Mon, 9 Apr 2018 20:43:32 +0000 (14:43 -0600)]
Revert "UBUNTU: SAUCE: PCI: Remove unused __weak attribute in pci_register_io_range()"

BugLink: https://bugs.launchpad.net/bugs/1762758
Replacing with the upstream version of this series.

This reverts commit 5becbaba88cefcc733be221c92b015b54e5ae46a.

Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoRevert "UBUNTU: SAUCE: PCI: Add fwnode handler as input param of pci_register_io_range()"
dann frazier [Mon, 9 Apr 2018 20:43:28 +0000 (14:43 -0600)]
Revert "UBUNTU: SAUCE: PCI: Add fwnode handler as input param of pci_register_io_range()"

BugLink: https://bugs.launchpad.net/bugs/1762758
Replacing with the upstream version of this series.

This reverts commit 483e3a99b88fd85a8909c38df33d842bfd7bbe8e.

Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoRevert "UBUNTU: SAUCE: PCI: Apply the new generic I/O management on PCI IO hosts"
dann frazier [Mon, 9 Apr 2018 20:43:23 +0000 (14:43 -0600)]
Revert "UBUNTU: SAUCE: PCI: Apply the new generic I/O management on PCI IO hosts"

BugLink: https://bugs.launchpad.net/bugs/1762758
Replacing with the upstream version of this series.

This reverts commit d7662431c0c6259fe3d4d66b025fc2c1cff25c5e.

Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoRevert "UBUNTU: SAUCE: OF: Add missing I/O range exception for indirect-IO devices"
dann frazier [Mon, 9 Apr 2018 20:43:19 +0000 (14:43 -0600)]
Revert "UBUNTU: SAUCE: OF: Add missing I/O range exception for indirect-IO devices"

BugLink: https://bugs.launchpad.net/bugs/1762758
Replacing with the upstream version of this series.

This reverts commit e11d4d628aa63649948aac1487e49e6fc3b43c1e.

Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoRevert "UBUNTU: SAUCE: HISI LPC: Support the LPC host on Hip06/Hip07 with DT bindings"
dann frazier [Mon, 9 Apr 2018 20:43:16 +0000 (14:43 -0600)]
Revert "UBUNTU: SAUCE: HISI LPC: Support the LPC host on Hip06/Hip07 with DT bindings"

BugLink: https://bugs.launchpad.net/bugs/1762758
Replacing with the upstream version of this series.

This reverts commit 254d9c980c4922c61a229d0d06b12742a5dbfb64.

Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoRevert "UBUNTU: SAUCE: ACPI / scan: do not enumerate Indirect IO host children"
dann frazier [Mon, 9 Apr 2018 20:43:12 +0000 (14:43 -0600)]
Revert "UBUNTU: SAUCE: ACPI / scan: do not enumerate Indirect IO host children"

BugLink: https://bugs.launchpad.net/bugs/1762758
Replacing with the upstream version of this series.

This reverts commit 008cf8ab391e66c87cd6d1676404a5e5601979f9.

Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoRevert "UBUNTU: SAUCE: HISI LPC: Add ACPI support"
dann frazier [Mon, 9 Apr 2018 20:43:08 +0000 (14:43 -0600)]
Revert "UBUNTU: SAUCE: HISI LPC: Add ACPI support"

BugLink: https://bugs.launchpad.net/bugs/1762758
Replacing with the upstream version of this series.

This reverts commit 1cdbe5ee19e604b3eede973f6be021470ae622be.

Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoRevert "UBUNTU: SAUCE: MAINTAINERS: Add maintainer for HiSilicon LPC driver"
dann frazier [Mon, 9 Apr 2018 20:42:55 +0000 (14:42 -0600)]
Revert "UBUNTU: SAUCE: MAINTAINERS: Add maintainer for HiSilicon LPC driver"

BugLink: https://bugs.launchpad.net/bugs/1762758
Replacing with the upstream version of this series.

This reverts commit 6d1a0875bfbd96fed2d28f4492189628c15ab9b5.

Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agocxl: read PHB indications from the device tree
Philippe Bergheaud [Fri, 2 Mar 2018 09:56:12 +0000 (10:56 +0100)]
cxl: read PHB indications from the device tree

BugLink: http://bugs.launchpad.net/bugs/1762448
Configure the P9 XSL_DSNCTL register with PHB indications found
in the device tree, or else use legacy hard-coded values.

Signed-off-by: Philippe Bergheaud <felix@linux.vnet.ibm.com>
Reviewed-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Reviewed-by: Christophe Lombard <clombard@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit 9dbcbfa1fe0c3b556e889ea213a73eb80d74307b)
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agopowerpc/powernv: Enable tunneled operations
Philippe Bergheaud [Fri, 2 Mar 2018 09:56:11 +0000 (10:56 +0100)]
powerpc/powernv: Enable tunneled operations

BugLink: http://bugs.launchpad.net/bugs/1762448
P9 supports PCI tunneled operations (atomics and as_notify). This
patch adds support for tunneled operations on powernv, with a new
API, to be called by device drivers:

pnv_pci_enable_tunnel()
   Enable tunnel operations, tell driver the 16-bit ASN indication
   used by kernel.

pnv_pci_disable_tunnel()
   Disable tunnel operations.

pnv_pci_set_tunnel_bar()
   Tell kernel the Tunnel BAR Response address used by driver.
   This function uses two new OPAL calls, as the PBCQ Tunnel BAR
   register is configured by skiboot.

pnv_pci_get_as_notify_info()
   Return the ASN info of the thread to be woken up.

Signed-off-by: Philippe Bergheaud <felix@linux.vnet.ibm.com>
Reviewed-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Reviewed-by: Christophe Lombard <clombard@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit d6a90bb83b5084829558788ea5b8818c9be3da63)
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agocxl: Enable NORST bit in PSL_DEBUG register for PSL9
Vaibhav Jain [Fri, 9 Feb 2018 04:09:16 +0000 (09:39 +0530)]
cxl: Enable NORST bit in PSL_DEBUG register for PSL9

BugLink: http://bugs.launchpad.net/bugs/1762462
We enable the NORST bit by default for debug afu images to prevent
reset of AFU trace-data on a PCI link drop. For production AFU images
this bit is always ignored and PSL gets reconfigured anyways thereby
resetting the trace data. So setting this bit for non-debug images
doesn't have any impact.

Signed-off-by: Vaibhav Jain <vaibhav@linux.vnet.ibm.com>
Reviewed-by: Christophe Lombard <clombard@linux.vnet.ibm.com>
Acked-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Acked-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit 03ebb419b896e0fb2da3f34b57d45e62cafe4009)
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agosunrpc: remove incorrect HMAC request initialization
Eric Biggers [Wed, 28 Mar 2018 17:57:22 +0000 (10:57 -0700)]
sunrpc: remove incorrect HMAC request initialization

BugLink: http://bugs.launchpad.net/bugs/1759791
make_checksum_hmac_md5() is allocating an HMAC transform and doing
crypto API calls in the following order:

    crypto_ahash_init()
    crypto_ahash_setkey()
    crypto_ahash_digest()

This is wrong because it makes no sense to init() the request before a
key has been set, given that the initial state depends on the key.  And
digest() is short for init() + update() + final(), so in this case
there's no need to explicitly call init() at all.

Before commit 9fa68f620041 ("crypto: hash - prevent using keyed hashes
without setting key") the extra init() had no real effect, at least for
the software HMAC implementation.  (There are also hardware drivers that
implement HMAC-MD5, and it's not immediately obvious how gracefully they
handle init() before setkey().)  But now the crypto API detects this
incorrect initialization and returns -ENOKEY.  This is breaking NFS
mounts in some cases.

Fix it by removing the incorrect call to crypto_ahash_init().

Reported-by: Michael Young <m.a.young@durham.ac.uk>
Fixes: 9fa68f620041 ("crypto: hash - prevent using keyed hashes without setting key")
Fixes: fffdaef2eb4a ("gss_krb5: Add support for rc4-hmac encryption")
Cc: stable@vger.kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
(cherry picked from commit f3aefb6a7066e24bfea7fcf1b07907576de69d63)
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: d-i: add bcm2835 to block-modules
Paolo Pisati [Thu, 5 Apr 2018 13:37:08 +0000 (15:37 +0200)]
UBUNTU: d-i: add bcm2835 to block-modules

BugLink: http://bugs.launchpad.net/bugs/1729128
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agousb: core: Add USB_QUIRK_DELAY_CTRL_MSG to usbcore quirks
Kai-Heng Feng [Tue, 10 Apr 2018 09:49:31 +0000 (17:49 +0800)]
usb: core: Add USB_QUIRK_DELAY_CTRL_MSG to usbcore quirks

BugLink: https://bugs.launchpad.net/bugs/1762695
There's a new quirk, USB_QUIRK_DELAY_CTRL_MSG. Add it to usbcore quirks
for completeness.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 4d8d5a392ae110d9b5889afd2b4beef9a09e712d)
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agousb: core: Copy parameter string correctly and remove superfluous null check
Kai-Heng Feng [Tue, 10 Apr 2018 09:49:30 +0000 (17:49 +0800)]
usb: core: Copy parameter string correctly and remove superfluous null check

BugLink: https://bugs.launchpad.net/bugs/1762695
strsep() slices string, so the string gets copied by
param_set_copystring() at the end of quirks_param_set() is not the
original value.
Fix that by calling param_set_copystring() earlier.

The null check for val is unnecessary, the caller of quirks_param_set()
does not pass null string.
Remove the superfluous null check. This is found by Smatch.

Fixes: 027bd6cafd9a ("usb: core: Add "quirks" parameter for usbcore")
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit a030501499b032bd218e1d01c07677bab6a0d53f)
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agousb: core: Add "quirks" parameter for usbcore
Kai-Heng Feng [Tue, 10 Apr 2018 09:49:29 +0000 (17:49 +0800)]
usb: core: Add "quirks" parameter for usbcore

BugLink: https://bugs.launchpad.net/bugs/1762695
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: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 027bd6cafd9a1e3a109b5e5682c85ac84e804a8d)
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: s390/crypto: Adjust s390 aes and paes cipher
Harald Freudenberger [Mon, 9 Apr 2018 15:41:06 +0000 (11:41 -0400)]
UBUNTU: SAUCE: s390/crypto: Adjust s390 aes and paes cipher

BugLink: http://bugs.launchpad.net/bugs/1762353
Tests with paes-xts and debugging investigations showed
that the ciphers are not always correctly resolved.
The rules for cipher priorities seem to be:
 - Ecb-aes should have a prio greater than the
   generic ecb-aes.
 - The mode specialized ciphers (like cbc-aes-s390)
   should have a prio greater than the sum of the
   more generic combinations (like cbs(aes)).

This patch adjusts the cipher priorities for the
s390 aes and paes in kernel crypto implementations.

Signed-off-by: Harald Freudenberger <freude@linux.vnet.ibm.com>
Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: [Config] CONFIG_EXPOLINE_AUTO=y, CONFIG_KERNEL_NOBP=n for s390
Seth Forshee [Tue, 10 Apr 2018 14:22:58 +0000 (09:22 -0500)]
UBUNTU: [Config] CONFIG_EXPOLINE_AUTO=y, CONFIG_KERNEL_NOBP=n for s390

BugLink: http://bugs.launchpad.net/bugs/1762719
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agos390: add sysfs attributes for spectre
Martin Schwidefsky [Wed, 21 Mar 2018 08:38:21 +0000 (09:38 +0100)]
s390: add sysfs attributes for spectre

BugLink: http://bugs.launchpad.net/bugs/1762719
Set CONFIG_GENERIC_CPU_VULNERABILITIES and provide the two functions
cpu_show_spectre_v1 and cpu_show_spectre_v2 to report the spectre
mitigations.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
(cherry picked from commit d424986f1d6b16079b3231db0314923f4f8deed1)
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agos390: report spectre mitigation via syslog
Martin Schwidefsky [Tue, 20 Mar 2018 15:33:43 +0000 (16:33 +0100)]
s390: report spectre mitigation via syslog

BugLink: http://bugs.launchpad.net/bugs/1762719
Add a boot message if either of the spectre defenses is active.
The message is
    "Spectre V2 mitigation: execute trampolines."
or  "Spectre V2 mitigation: limited branch prediction."

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
(cherry picked from commit bc035599718412cfba9249aa713f90ef13f13ee9)
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agos390: add automatic detection of the spectre defense
Martin Schwidefsky [Fri, 23 Mar 2018 12:04:49 +0000 (13:04 +0100)]
s390: add automatic detection of the spectre defense

BugLink: http://bugs.launchpad.net/bugs/1762719
Automatically decide between nobp vs. expolines if the spectre_v2=auto
kernel parameter is specified or CONFIG_EXPOLINE_AUTO=y is set.

The decision made at boot time due to CONFIG_EXPOLINE_AUTO=y being set
can be overruled with the nobp, nospec and spectre_v2 kernel parameters.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
(cherry picked from commit 6e179d64126b909f0b288fa63cdbf07c531e9b1d)
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agos390: move nobp parameter functions to nospec-branch.c
Martin Schwidefsky [Fri, 23 Mar 2018 16:09:39 +0000 (17:09 +0100)]
s390: move nobp parameter functions to nospec-branch.c

BugLink: http://bugs.launchpad.net/bugs/1762719
Keep the code for the nobp parameter handling with the code for
expolines. Both are related to the spectre v2 mitigation.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
(cherry picked from commit b2e2f43a01bace1a25bdbae04c9f9846882b727a)
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agopowerpc/64s: Wire up cpu_show_spectre_v2()
Michael Ellerman [Tue, 27 Mar 2018 12:01:53 +0000 (23:01 +1100)]
powerpc/64s: Wire up cpu_show_spectre_v2()

BugLink: https://bugs.launchpad.net/bugs/1760099
CVE-2017-5715

Add a definition for cpu_show_spectre_v2() to override the generic
version. This has several permuations, though in practice some may not
occur we cater for any combination.

The most verbose is:

  Mitigation: Indirect branch serialisation (kernel only), Indirect
  branch cache disabled, ori31 speculation barrier enabled

We don't treat the ori31 speculation barrier as a mitigation on its
own, because it has to be *used* by code in order to be a mitigation
and we don't know if userspace is doing that. So if that's all we see
we say:

  Vulnerable, ori31 speculation barrier enabled

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit d6fbe1c55c55c6937cbea3531af7da84ab7473c3 linux-next)
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agopowerpc/64s: Wire up cpu_show_spectre_v1()
Michael Ellerman [Tue, 27 Mar 2018 12:01:52 +0000 (23:01 +1100)]
powerpc/64s: Wire up cpu_show_spectre_v1()

BugLink: https://bugs.launchpad.net/bugs/1760099
CVE-2017-5753

Add a definition for cpu_show_spectre_v1() to override the generic
version. Currently this just prints "Not affected" or "Vulnerable"
based on the firmware flag.

Although the kernel does have array_index_nospec() in a few places, we
haven't yet audited all the powerpc code to see where it's necessary,
so for now we don't list that as a mitigation.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit 56986016cb8cd9050e601831fe89f332b4e3c46e linux-next)
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agopowerpc/pseries: Use the security flags in pseries_setup_rfi_flush()
Michael Ellerman [Tue, 27 Mar 2018 12:01:51 +0000 (23:01 +1100)]
powerpc/pseries: Use the security flags in pseries_setup_rfi_flush()

BugLink: https://bugs.launchpad.net/bugs/1760099
CVE-2017-5754

Now that we have the security flags we can simplify the code in
pseries_setup_rfi_flush() because the security flags have pessimistic
defaults.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit 2e4a16161fcd324b1f9bf6cb6856529f7eaf0689 linux-next)
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agopowerpc/powernv: Use the security flags in pnv_setup_rfi_flush()
Michael Ellerman [Tue, 27 Mar 2018 12:01:50 +0000 (23:01 +1100)]
powerpc/powernv: Use the security flags in pnv_setup_rfi_flush()

BugLink: https://bugs.launchpad.net/bugs/1760099
CVE-2017-5754

Now that we have the security flags we can significantly simplify the
code in pnv_setup_rfi_flush(), because we can use the flags instead of
checking device tree properties and because the security flags have
pessimistic defaults.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit 37c0bdd00d3ae83369ab60a6712c28e11e6458d5 linux-next)
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agopowerpc/64s: Enhance the information in cpu_show_meltdown()
Michael Ellerman [Tue, 27 Mar 2018 12:01:49 +0000 (23:01 +1100)]
powerpc/64s: Enhance the information in cpu_show_meltdown()

BugLink: https://bugs.launchpad.net/bugs/1760099
CVE-2017-5754

Now that we have the security feature flags we can make the
information displayed in the "meltdown" file more informative.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit ff348355e9c72493947be337bb4fae4fc1a41eba linux-next)
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agopowerpc/64s: Move cpu_show_meltdown()
Michael Ellerman [Tue, 27 Mar 2018 12:01:48 +0000 (23:01 +1100)]
powerpc/64s: Move cpu_show_meltdown()

BugLink: https://bugs.launchpad.net/bugs/1760099
CVE-2017-5754

This landed in setup_64.c for no good reason other than we had nowhere
else to put it. Now that we have a security-related file, that is a
better place for it so move it.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit 8ad33041563a10b34988800c682ada14b2612533 linux-next)
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agopowerpc/powernv: Set or clear security feature flags
Michael Ellerman [Tue, 27 Mar 2018 12:01:47 +0000 (23:01 +1100)]
powerpc/powernv: Set or clear security feature flags

BugLink: https://bugs.launchpad.net/bugs/1760099
CVE-2017-5753
CVE-2017-5715
CVE-2017-5754

Now that we have feature flags for security related things, set or
clear them based on what we see in the device tree provided by
firmware.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit 77addf6e95c8689e478d607176b399a6242a777e linux-next)
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agopowerpc/pseries: Set or clear security feature flags
Michael Ellerman [Tue, 27 Mar 2018 12:01:46 +0000 (23:01 +1100)]
powerpc/pseries: Set or clear security feature flags

BugLink: https://bugs.launchpad.net/bugs/1760099
CVE-2017-5753
CVE-2017-5715
CVE-2017-5754

Now that we have feature flags for security related things, set or
clear them based on what we receive from the hypercall.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit f636c14790ead6cc22cf62279b1f8d7e11a67116 linux-next)
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agopowerpc: Add security feature flags for Spectre/Meltdown
Michael Ellerman [Tue, 27 Mar 2018 12:01:44 +0000 (23:01 +1100)]
powerpc: Add security feature flags for Spectre/Meltdown

BugLink: https://bugs.launchpad.net/bugs/1760099
CVE-2017-5753
CVE-2017-5715
CVE-2017-5754

This commit adds security feature flags to reflect the settings we
receive from firmware regarding Spectre/Meltdown mitigations.

The feature names reflect the names we are given by firmware on bare
metal machines. See the hostboot source for details.

Arguably these could be firmware features, but that then requires them
to be read early in boot so they're available prior to asm feature
patching, but we don't actually want to use them for patching. We may
also want to dynamically update them in future, which would be
incompatible with the way firmware features work (at the moment at
least). So for now just make them separate flags.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit 9a868f634349e62922c226834aa23e3d1329ae7f linux-next)
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agopowerpc/pseries: Add new H_GET_CPU_CHARACTERISTICS flags
Michael Ellerman [Tue, 27 Mar 2018 12:01:45 +0000 (23:01 +1100)]
powerpc/pseries: Add new H_GET_CPU_CHARACTERISTICS flags

BugLink: https://bugs.launchpad.net/bugs/1760099
CVE-2017-5753
CVE-2017-5715
CVE-2017-5754

Add some additional values which have been defined for the
H_GET_CPU_CHARACTERISTICS hypercall.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit c4bc36628d7f8b664657d8bd6ad1c44c177880b7 linux-next)
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agopowerpc/rfi-flush: Call setup_rfi_flush() after LPM migration
Michael Ellerman [Wed, 14 Mar 2018 22:40:42 +0000 (19:40 -0300)]
powerpc/rfi-flush: Call setup_rfi_flush() after LPM migration

BugLink: https://bugs.launchpad.net/bugs/1760099
CVE-2017-5754

We might have migrated to a machine that uses a different flush type,
or doesn't need flushing at all.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit 921bc6cf807ceb2ab8005319cf39f33494d6b100 linux-next)
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agopowerpc/rfi-flush: Differentiate enabled and patched flush types
Mauricio Faria de Oliveira [Wed, 14 Mar 2018 22:40:41 +0000 (19:40 -0300)]
powerpc/rfi-flush: Differentiate enabled and patched flush types

BugLink: https://bugs.launchpad.net/bugs/1760099
CVE-2017-5754

Currently the rfi-flush messages print 'Using <type> flush' for all
enabled_flush_types, but that is not necessarily true -- as now the
fallback flush is always enabled on pseries, but the fixup function
overwrites its nop/branch slot with other flush types, if available.

So, replace the 'Using <type> flush' messages with '<type> flush is
available'.

Also, print the patched flush types in the fixup function, so users
can know what is (not) being used (e.g., the slower, fallback flush,
or no flush type at all if flush is disabled via the debugfs switch).

Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit 0063d61ccfc011f379a31acaeba6de7c926fed2c linux-next)
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agopowerpc/rfi-flush: Always enable fallback flush on pseries
Michael Ellerman [Wed, 14 Mar 2018 22:40:40 +0000 (19:40 -0300)]
powerpc/rfi-flush: Always enable fallback flush on pseries

BugLink: https://bugs.launchpad.net/bugs/1760099
CVE-2017-5754

This ensures the fallback flush area is always allocated on pseries,
so in case a LPAR is migrated from a patched to an unpatched system,
it is possible to enable the fallback flush in the target system.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit 84749a58b6e382f109abf1e734bc4dd43c2c25bb linux-next)
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agopowerpc/rfi-flush: Make it possible to call setup_rfi_flush() again
Michael Ellerman [Wed, 14 Mar 2018 22:40:39 +0000 (19:40 -0300)]
powerpc/rfi-flush: Make it possible to call setup_rfi_flush() again

BugLink: https://bugs.launchpad.net/bugs/1760099
CVE-2017-5754

For PowerVM migration we want to be able to call setup_rfi_flush()
again after we've migrated the partition.

To support that we need to check that we're not trying to allocate the
fallback flush area after memblock has gone away (i.e., boot-time only).

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit abf110f3e1cea40f5ea15e85f5d67c39c14568a7 linux-next)
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agopowerpc/rfi-flush: Move the logic to avoid a redo into the debugfs code
Michael Ellerman [Wed, 14 Mar 2018 22:40:38 +0000 (19:40 -0300)]
powerpc/rfi-flush: Move the logic to avoid a redo into the debugfs code

BugLink: https://bugs.launchpad.net/bugs/1760099
CVE-2017-5754

rfi_flush_enable() includes a check to see if we're already
enabled (or disabled), and in that case does nothing.

But that means calling setup_rfi_flush() a 2nd time doesn't actually
work, which is a bit confusing.

Move that check into the debugfs code, where it really belongs.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit 1e2a9fc7496955faacbbed49461d611b704a7505 linux-next)
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: d-i: Add hns3 drivers to nic-modules
dann frazier [Thu, 5 Apr 2018 22:00:40 +0000 (15:00 -0700)]
UBUNTU: d-i: Add hns3 drivers to nic-modules

BugLink: https://bugs.launchpad.net/bugs/1761610
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: export pci table of hclge and hclgevf to userspace
Yunsheng Lin [Thu, 5 Apr 2018 22:00:39 +0000 (15:00 -0700)]
net: hns3: export pci table of hclge and hclgevf to userspace

BugLink: https://bugs.launchpad.net/bugs/1761610
There is no module that is dependent on hclge or hclgevf's symbol,
but hns_enet need them to provide ops for it to run. When there is
a need to auto load the hns3 driver, the auto load will fail because
hclge or hclgevf is not loaded.

Hns_enet has already exported the pci table, so this patch exports
the pci table for hclge and hclgevf module too.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 2f550a467895b8715e17ae9bd6da048e8fce8c92)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agovirtio-net: Fix operstate for virtio when no VIRTIO_NET_F_STATUS
Jay Vosburgh [Thu, 5 Apr 2018 18:12:22 +0000 (14:12 -0400)]
virtio-net: Fix operstate for virtio when no VIRTIO_NET_F_STATUS

BugLink: https://bugs.launchpad.net/bugs/1761534
The operstate update logic will leave an interface in the
default UNKNOWN operstate if the interface carrier state never changes
from the default carrier up state set at creation.  This includes the
case of an explicit call to netif_carrier_on, as the carrier on to on
transition has no effect on operstate.

This affects virtio-net for the case that the virtio peer does
not support VIRTIO_NET_F_STATUS (the feature that provides carrier state
updates).  Without this feature, the virtio specification states that
"the link should be assumed active," so, logically, the operstate should
be UP instead of UNKNOWN.  This has impact on user space applications
that use the operstate to make availability decisions for the interface.

Resolve this by changing the virtio probe logic slightly to call
netif_carrier_off for both the "with" and "without" VIRTIO_NET_F_STATUS
cases, and then the existing call to netif_carrier_on for the "without"
case will cause an operstate transition.

Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Jay Vosburgh <jay.vosburgh@canonical.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry-picked from commit bda7fab54828bbef2164bb23c0f6b1a7d05cc718)
Signed-off-by: Eric Desrochers <eric.desrochers@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoperf vendor events arm64: Enable JSON events for ThunderX2 B0
Ganapatrao Kulkarni [Wed, 7 Mar 2018 11:08:03 +0000 (16:38 +0530)]
perf vendor events arm64: Enable JSON events for ThunderX2 B0

BugLink: https://bugs.launchpad.net/bugs/1760712
There is MIDR change on ThunderX2 B0, adding an entry to mapfile to
enable JSON events for B0.

Signed-off-by: Ganapatrao Kulkarni <ganapatrao.kulkarni@cavium.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ganapatrao Kulkarni <gpkulkarni@gklkml16.com>
Cc: Jayachandran C <jnair@caviumnetworks.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: John Garry <john.garry@huawei.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Robert Richter <robert.richter@cavium.com>
Cc: William Cohen <wcohen@redhat.com>
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/20180307110803.32418-1-ganapatrao.kulkarni@cavium.com
[ Fixup wrt recent patchset by John Garry ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
(cherry picked from commit a8685f088819d21cd5aea5de4c184de427c3625d)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoperf vendor events arm64: add HiSilicon hip08 JSON file
John Garry [Thu, 8 Mar 2018 10:58:36 +0000 (18:58 +0800)]
perf vendor events arm64: add HiSilicon hip08 JSON file

BugLink: https://bugs.launchpad.net/bugs/1760712
This patch adds the HiSilicon hip08 JSON file. This platform follows the
ARMv8 recommended IMPLEMENTATION DEFINED events, where applicable.

Signed-off-by: John Garry <john.garry@huawei.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ganapatrao Kulkarni <ganapatrao.kulkarni@cavium.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Shaokun Zhang <zhangshaokun@hisilicon.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: William Cohen <wcohen@redhat.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linuxarm@huawei.com
Link: http://lkml.kernel.org/r/1520506716-197429-12-git-send-email-john.garry@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
(cherry picked from commit 3d4caec1600e0bf34600a7b700599a20df03629e)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoperf vendor events arm64: fixup A53 to use recommended events
John Garry [Thu, 8 Mar 2018 10:58:35 +0000 (18:58 +0800)]
perf vendor events arm64: fixup A53 to use recommended events

BugLink: https://bugs.launchpad.net/bugs/1760712
This patch fixes the ARM Cortex-A53 json to use event definition from
the ARMv8 recommended events.

In addition to this change, other changes were made:

- remove stray ','
- remove mirrored events in memory.json and bus.json
- fixed indentation to be consistent with other ARM
  JSONs

Signed-off-by: John Garry <john.garry@huawei.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ganapatrao Kulkarni <ganapatrao.kulkarni@cavium.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Shaokun Zhang <zhangshaokun@hisilicon.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: William Cohen <wcohen@redhat.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linuxarm@huawei.com
Link: http://lkml.kernel.org/r/1520506716-197429-11-git-send-email-john.garry@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
(cherry picked from commit afe4d089621d4d90ac0e089b83752ea4515325ac)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoperf vendor events arm64: Fixup ThunderX2 to use recommended events
John Garry [Thu, 8 Mar 2018 10:58:34 +0000 (18:58 +0800)]
perf vendor events arm64: Fixup ThunderX2 to use recommended events

BugLink: https://bugs.launchpad.net/bugs/1760712
This patch fixes the Cavium ThunderX2 JSON to use event definitions from
the ARMv8 recommended events.

Signed-off-by: John Garry <john.garry@huawei.com>
Tested-by: Ganapatrao Kulkarni <ganapatrao.kulkarni@cavium.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Shaokun Zhang <zhangshaokun@hisilicon.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: William Cohen <wcohen@redhat.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linuxarm@huawei.com
Link: http://lkml.kernel.org/r/1520506716-197429-10-git-send-email-john.garry@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
(cherry picked from commit ae43053bd2595dc98f0909505dc1d7e1ed8bd239)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoperf vendor events arm64: Add armv8-recommended.json
John Garry [Thu, 8 Mar 2018 10:58:33 +0000 (18:58 +0800)]
perf vendor events arm64: Add armv8-recommended.json

BugLink: https://bugs.launchpad.net/bugs/1760712
Add JSON for ARMv8 IMPLEMENTATION DEFINED recommended events.

The JSON is copied from ARMv8 architecture reference manual, available
here:

https://static.docs.arm.com/ddi0487/ca/DDI0487C_a_armv8_arm.pdf

Originally-from: Shaokun Zhang <zhangshaokun@hisilicon.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ganapatrao Kulkarni <ganapatrao.kulkarni@cavium.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Will Deacon <will.deacon@arm.com>
Cc: William Cohen <wcohen@redhat.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linuxarm@huawei.com
Link: http://lkml.kernel.org/r/1520506716-197429-9-git-send-email-john.garry@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
(cherry picked from commit 360b7b03afee042d71ab54ba6ea55daf53edf538)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoperf vendor events: Add support for arch standard events
John Garry [Thu, 8 Mar 2018 10:58:32 +0000 (18:58 +0800)]
perf vendor events: Add support for arch standard events

BugLink: https://bugs.launchpad.net/bugs/1760712
For some architectures (like arm), there are architecture- defined
events. Sometimes these events may be "recommended" according to the
architecture standard, in that the implementer is free ignore the
"recommendation" and create its custom event.

This patch adds support for parsing standard events from arch-defined
JSONs, and fixing up vendor events when they have implemented these
events as standard.

Support is also ensured that the vendor may implement their own custom
events.

A new step is added to the pmu events parsing to fix up the vendor
events with the arch-standard events.

The arch-defined JSONs must be placed in the arch root folder for
preprocessing prior to tree JSON processing.

In the vendor JSON, to specify that the arch event is supported, the
keyword "ArchStdEvent" should be used, like this:

[
    {
        "ArchStdEvent": "L1D_CACHE_WR",
    },
]

Matching is based on the "EventName" field in the architecture JSON.

No other JSON objects are strictly required. However, for other objects
added, these take precedence over architecture defined standard events,
thus supporting separate events which have the same event code.

Signed-off-by: John Garry <john.garry@huawei.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ganapatrao Kulkarni <ganapatrao.kulkarni@cavium.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Shaokun Zhang <zhangshaokun@hisilicon.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: William Cohen <wcohen@redhat.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linuxarm@huawei.com
Link: http://lkml.kernel.org/r/1520506716-197429-8-git-send-email-john.garry@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
(cherry picked from commit e9d32c1bf0cd7a98358ec4aa1625bf2b3459b9ac)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoperf vendor events arm64: Relocate Cortex A53 JSONs to arm subdirectory
John Garry [Thu, 8 Mar 2018 10:58:31 +0000 (18:58 +0800)]
perf vendor events arm64: Relocate Cortex A53 JSONs to arm subdirectory

BugLink: https://bugs.launchpad.net/bugs/1760712
Since jevents now supports vendor subdirectory, relocate the Cortex-A53
JSONs to arm subdirectory.

Signed-off-by: John Garry <john.garry@huawei.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ganapatrao Kulkarni <ganapatrao.kulkarni@cavium.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Shaokun Zhang <zhangshaokun@hisilicon.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: William Cohen <wcohen@redhat.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linuxarm@huawei.com
Link: http://lkml.kernel.org/r/1520506716-197429-7-git-send-email-john.garry@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
(cherry picked from commit 82e6fdd6c01257d64009defbbea19d12ba667670)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoperf vendor events arm64: Relocate ThunderX2 JSON to cavium subdirectory
John Garry [Thu, 8 Mar 2018 10:58:30 +0000 (18:58 +0800)]
perf vendor events arm64: Relocate ThunderX2 JSON to cavium subdirectory

BugLink: https://bugs.launchpad.net/bugs/1760712
Since jevents now supports vendor subdirectory, relocate
the ThunderX2 JSON to Cavium subdirectory.

Signed-off-by: John Garry <john.garry@huawei.com>
Tested-by: Ganapatrao Kulkarni <ganapatrao.kulkarni@cavium.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Shaokun Zhang <zhangshaokun@hisilicon.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: William Cohen <wcohen@redhat.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linuxarm@huawei.com
Link: http://lkml.kernel.org/r/1520506716-197429-6-git-send-email-john.garry@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
(cherry picked from commit e3b9f1e81de2083f359bacd2a94bf1c024f2ede0)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoperf vendor events: Add support for pmu events vendor subdirectory
John Garry [Thu, 8 Mar 2018 10:58:29 +0000 (18:58 +0800)]
perf vendor events: Add support for pmu events vendor subdirectory

BugLink: https://bugs.launchpad.net/bugs/1760712
For some architectures (like arm), it is required to support a vendor
subdirectory and not locate all the JSONs for a specific vendor in the
same folder.

This is because all the events for the same vendor will be placed in the
same pmu events table, which may cause conflict.  This conflict would be
in the instance that a vendor's custom implemented events do have the
same meaning on different platforms, so events in the pmu table would
conflict. In addition, per list command may show events which are not
even supported for a given platform.

This patch adds support for a arch/vendor/platform directory hierarchy,
while maintaining backwards-compatibility for existing arch/platform
structure. In this, each platform would always have its own pmu events
table.

In generated file pmu_events.c, each platform table name is in the
format pme{_vendor}_platform, like this:

struct pmu_events_map pmu_events_map[] = {
{
.cpuid = "0x00000000420f5160",
.version = "v1",
.type = "core",
.table = pme_cavium_thunderx2
},
{
.cpuid = 0,
.version = 0,
.type = 0,
.table = 0,
},
};

Signed-off-by: John Garry <john.garry@huawei.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ganapatrao Kulkarni <ganapatrao.kulkarni@cavium.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Shaokun Zhang <zhangshaokun@hisilicon.com>
Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: William Cohen <wcohen@redhat.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linuxarm@huawei.com
Link: http://lkml.kernel.org/r/1520506716-197429-5-git-send-email-john.garry@huawei.com
Link: http://lkml.kernel.org/r/1521047452-28565-1-git-send-email-john.garry@huawei.com
[ Add missing limits.h include, fixing the build on at least all Alpine Linux versions tested (3.4 to 3.7 + edge), ]
[ Applied a patch to fix reading ./.. directories in XFS, see second Link tag ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
(cherry picked from commit 51ce1dcc5d0d3e40e26893a7fa9e30538960ee7e)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoperf vendor events: Drop support for unused topic directories
John Garry [Thu, 8 Mar 2018 10:58:28 +0000 (18:58 +0800)]
perf vendor events: Drop support for unused topic directories

BugLink: https://bugs.launchpad.net/bugs/1760712
Currently a topic subdirectory is supported in the pmu-events dir, in
the following sample structure: /arch/platform/subtopic/mysubtopic.json

Upto 256 levels of topic subdirectories are supported. So this means
that JSONs may be located in a topic dir as well as the platform dir.

This topic subdirectory causes problems if we want to add support for a
vendor dir in the pmu-events structure (in the form
arch/platform/vendor), in that we cannot differentiate between a vendor
dir and a topic dir.

Since the topic dir feature is not used, drop it so it does not block
adding vendor subdirectory support.

Signed-off-by: John Garry <john.garry@huawei.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ganapatrao Kulkarni <ganapatrao.kulkarni@cavium.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Shaokun Zhang <zhangshaokun@hisilicon.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: William Cohen <wcohen@redhat.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linuxarm@huawei.com
Link: http://lkml.kernel.org/r/1520506716-197429-4-git-send-email-john.garry@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
(cherry picked from commit 6f2f2ca3454ec4fa03fcd4507bdd7fe97303065b)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoperf vendor events: Fix error code in json_events()
John Garry [Thu, 8 Mar 2018 10:58:27 +0000 (18:58 +0800)]
perf vendor events: Fix error code in json_events()

BugLink: https://bugs.launchpad.net/bugs/1760712
When EXPECT macro fails an assertion, the error code is not properly set
after the first loop of tokens in function json_events().

This is because err is set to the return value from func function
pointer call, which must be 0 to continue to loop, yet it is not reset
for for each loop. I assume that this was not the intention, so change
the code so err is set appropriately in EXPECT macro itself.

In addition to this, the indention in EXPECT macro is tidied. The
current indention alludes that the 2 statements following the if
statement are in the body, which is not true.

Signed-off-by: John Garry <john.garry@huawei.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ganapatrao Kulkarni <ganapatrao.kulkarni@cavium.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Shaokun Zhang <zhangshaokun@hisilicon.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: William Cohen <wcohen@redhat.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linuxarm@huawei.com
Link: http://lkml.kernel.org/r/1520506716-197429-3-git-send-email-john.garry@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
(cherry picked from commit 931ef5dc5c18717d24e5b8d8a968e35638508051)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoperf vendor events: Drop incomplete multiple mapfile support
John Garry [Thu, 8 Mar 2018 10:58:26 +0000 (18:58 +0800)]
perf vendor events: Drop incomplete multiple mapfile support

BugLink: https://bugs.launchpad.net/bugs/1760712
Currently jevents supports multiple mapfiles, but this is only in the
form where mapfile basename starts with 'mapfile.csv'

At the moment, no architectures actually use multiple mapfiles, so drop
the support for now.

This patch also solves a nuisance where, when the mapfile is edited and
the text editor may create a backup, jevents may use the backup, as
shown:

  jevents: Many mapfiles? Using pmu-events/arch/arm64/mapfile.csv~, ignoring pmu-events/arch/arm64/mapfile.csv

Signed-off-by: John Garry <john.garry@huawei.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ganapatrao Kulkarni <ganapatrao.kulkarni@cavium.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Shaokun Zhang <zhangshaokun@hisilicon.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: William Cohen <wcohen@redhat.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linuxarm@huawei.com
Link: http://lkml.kernel.org/r/1520506716-197429-2-git-send-email-john.garry@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
(cherry picked from commit 4c0ab16052054946b7b28f8b0ceee57c10d64cc7)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoperf vendor events aarch64: Add JSON metrics for ARM Cortex-A53 Processor
William Cohen [Wed, 31 Jan 2018 03:28:13 +0000 (22:28 -0500)]
perf vendor events aarch64: Add JSON metrics for ARM Cortex-A53 Processor

BugLink: https://bugs.launchpad.net/bugs/1760712
Add JSON metrics for ARM Cortex-A53 Processor.

Unlike the Intel processors there isn't a script that automatically
generated these files. The patch was manually generated from the
documentation and the previous oprofile ARM Cortex ac53 event file patch
I made.

The relevant documentation is in the "12.9 Events" section of the ARM
Cortex A53 MPCore Processor Revision: r0p4 Technical Reference Manual.

The ARM Cortex A53 manual is available at:

  http://infocenter.arm.com/help/topic/com.arm.doc.ddi0500g/DDI0500G_cortex_a53_trm.pdf

Use that to look for additional information about the events.

Signed-off-by: William Cohen <wcohen@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20180131032813.9564-1-wcohen@redhat.com
[ Added references provided by William Cohen ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
(cherry picked from commit 0b7c1528fb741803396da68a9d8d285ff7db731c)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agocxl: Check if PSL data-cache is available before issue flush request
Vaibhav Jain [Thu, 15 Feb 2018 15:49:24 +0000 (21:19 +0530)]
cxl: Check if PSL data-cache is available before issue flush request

BugLink: http://bugs.launchpad.net/bugs/1762367
PSL9D doesn't have a data-cache that needs to be flushed before
resetting the card. However when cxl tries to flush data-cache on such
a card, it times-out as PSL_Control register never indicates flush
operation complete due to missing data-cache. This is usually
indicated in the kernel logs with this message:

"WARNING: cache flush timed out"

To fix this the patch checks PSL_Debug register CDC-Field(BIT:27)
which indicates the absence of a data-cache and sets a flag
'no_data_cache' in 'struct cxl_native' to indicate this. When
cxl_data_cache_flush() is called it checks the flag and if set bails
out early without requesting a data-cache flush operation to the PSL.

Signed-off-by: Vaibhav Jain <vaibhav@linux.vnet.ibm.com>
Acked-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Acked-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit 94322ed8e857e3b2a33cf75118051af9baaa110f)
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoLinux 4.15.16
Greg Kroah-Hartman [Sun, 8 Apr 2018 12:27:40 +0000 (14:27 +0200)]
Linux 4.15.16

BugLink: http://bugs.launchpad.net/bugs/1762370
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoRevert "ip6_vti: adjust vti mtu according to mtu of lower device"
Greg Kroah-Hartman [Fri, 6 Apr 2018 07:46:28 +0000 (09:46 +0200)]
Revert "ip6_vti: adjust vti mtu according to mtu of lower device"

BugLink: http://bugs.launchpad.net/bugs/1762370
This reverts commit 813b2dad2cb59d2759f1538e65d56dcccdb18a94 which is
commit 53c81e95df1793933f87748d36070a721f6cb287 upstream.

Ben writes that there are a number of follow-on patches needed to fix
this up, but they get complex to backport, and some custom fixes are
needed, so let's just revert this and wait for a "real" set of patches
to resolve this to be submitted if it is really needed.

Reported-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Cc: Petr Vorel <pvorel@suse.cz>
Cc: Alexey Kodanev <alexey.kodanev@oracle.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoRevert "cpufreq: Fix governor module removal race"
Greg Kroah-Hartman [Fri, 6 Apr 2018 07:06:53 +0000 (09:06 +0200)]
Revert "cpufreq: Fix governor module removal race"

BugLink: http://bugs.launchpad.net/bugs/1762370
This reverts commit a853301f77b5c4feb5e17aebfd92018269525523 which was
commit a8b149d32b663c1a4105273295184b78f53d33cf upstream.

The backport was not correct, so just drop it entirely.

Reported-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoRevert "ARM: dts: omap3-n900: Fix the audio CODEC's reset pin"
Greg Kroah-Hartman [Fri, 6 Apr 2018 06:54:26 +0000 (08:54 +0200)]
Revert "ARM: dts: omap3-n900: Fix the audio CODEC's reset pin"

BugLink: http://bugs.launchpad.net/bugs/1762370
This reverts commit c91a501768717f449acd1c2cff1a8531e486c441 which was
commit 7be4b5dc7ffa9499ac6ef33a5ffa9ff43f9b7057 upstream.

It requires a driver that was not merged until 4.16, so remove it from
this stable tree as it is pointless.

Reported-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Cc: Andrew F. Davis <afd@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoRevert "ARM: dts: am335x-pepper: Fix the audio CODEC's reset pin"
Greg Kroah-Hartman [Fri, 6 Apr 2018 06:49:19 +0000 (08:49 +0200)]
Revert "ARM: dts: am335x-pepper: Fix the audio CODEC's reset pin"

BugLink: http://bugs.launchpad.net/bugs/1762370
This reverts commit cc578825b46e984c19b4a4630d3191d60ff83642 which was
comit e153db03c6b7a035c797bcdf35262586f003ee93 upstream.

It requires a driver that was not merged until 4.16, so remove it from
this stable tree as it is pointless.

Reported-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Cc: Andrew F. Davis <afd@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoFix slab name "biovec-(1<<(21-12))"
Mikulas Patocka [Wed, 21 Mar 2018 16:49:29 +0000 (12:49 -0400)]
Fix slab name "biovec-(1<<(21-12))"

BugLink: http://bugs.launchpad.net/bugs/1762370
commit bd5c4facf59648581d2f1692dad7b107bf429954 upstream.

I'm getting a slab named "biovec-(1<<(21-12))". It is caused by unintended
expansion of the macro BIO_MAX_PAGES. This patch renames it to biovec-max.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org # v4.14+
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>