Jan Glauber [Thu, 18 Feb 2016 16:50:10 +0000 (17:50 +0100)]
arm64: perf: Rename Cortex A57 events
BugLink: http://bugs.launchpad.net/bugs/1559349
The implemented Cortex A57 events are strictly-speaking not
A57 specific. They are ARM recommended implementation defined events
and can be found on other ARMv8 SOCs like Cavium ThunderX too.
Therefore rename these events to allow using them in other
implementations too.
Signed-off-by: Jan Glauber <jglauber@cavium.com>
[will: capitalisation and ordering] Signed-off-by: Will Deacon <will.deacon@arm.com>
(cherry picked from linux-next commit 5f140ccef3e1f15873c8e2c47d15b03099623ec0)
[dannf: offset adjustments] Signed-off-by: dann frazier <dann.frazier@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Will Deacon [Tue, 22 Dec 2015 14:42:57 +0000 (14:42 +0000)]
arm64: perf: add format entry to describe event -> config mapping
BugLink: http://bugs.launchpad.net/bugs/1559350
It's all very well providing an events directory to userspace that
details our events in terms of "event=0xNN", but if we don't define how
to encode the "event" field in the perf attr.config, then it's a waste
of time.
This patch adds a single format entry to describe that the event field
occupies the bottom 10 bits of our config field on ARMv8 (PMUv3).
Signed-off-by: Will Deacon <will.deacon@arm.com>
(cherry picked from commit 57d74123954dfe70fad12724d19f743ed14cec90) Signed-off-by: dann frazier <dann.frazier@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Will Deacon [Tue, 22 Dec 2015 14:42:57 +0000 (14:42 +0000)]
ARM: perf: add format entry to describe event -> config mapping
BugLink: http://bugs.launchpad.net/bugs/1559350
It's all very well providing an events directory to userspace that
details our events in terms of "event=0xNN", but if we don't define how
to encode the "event" field in the perf attr.config, then it's a waste
of time.
This patch adds a single format entry to describe that the event field
occupies the bottom 8 bits of our config field on ARMv7.
Signed-off-by: Will Deacon <will.deacon@arm.com>
(cherry picked from commit abff083ce2046b4d55211c1db5992ec2dd391f3d) Signed-off-by: dann frazier <dann.frazier@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Drew Richardson [Thu, 22 Oct 2015 14:07:32 +0000 (07:07 -0700)]
arm64: perf: Add event descriptions
BugLink: http://bugs.launchpad.net/bugs/1559350
Add additional information about the ARM architected hardware events
to make counters self describing. This makes the hardware PMUs easier
to use as perf list contains possible events instead of users having
to refer to documentation like the ARM TRMs.
Signed-off-by: Drew Richardson <drew.richardson@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
(cherry picked from commit 9e9caa6a496174e53d7753baa4779717771da4a7) Signed-off-by: dann frazier <dann.frazier@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Drew Richardson [Thu, 22 Oct 2015 14:07:01 +0000 (07:07 -0700)]
arm64: perf: Convert event enums to #defines
BugLink: http://bugs.launchpad.net/bugs/1559350
The enums are not necessary and this allows the event values to be
used to construct static strings at compile time.
Signed-off-by: Drew Richardson <drew.richardson@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
(cherry picked from commit 90381cba64591e27d0e8bbfe71bf8a98bd2a3db3) Signed-off-by: dann frazier <dann.frazier@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Drew Richardson [Wed, 28 Oct 2015 15:20:41 +0000 (08:20 -0700)]
arm: perf: Add event descriptions
BugLink: http://bugs.launchpad.net/bugs/1559350
Add additional information about the ARM architected hardware events
to make counters self describing. This makes the hardware PMUs easier
to use as perf list contains possible events instead of users having
to refer to documentation like the ARM TRMs.
Signed-off-by: Drew Richardson <drew.richardson@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
(cherry picked from commit 3fbac6ccb6c3a8958239d9026c4d41db60c2f1cf) Signed-off-by: dann frazier <dann.frazier@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Drew Richardson [Wed, 28 Oct 2015 15:19:56 +0000 (08:19 -0700)]
arm: perf: Convert event enums to #defines
BugLink: http://bugs.launchpad.net/bugs/1559350
The enums are not necessary and this allows the event values to be
used to construct static strings at compile time.
Signed-off-by: Drew Richardson <drew.richardson@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
(cherry picked from commit f4ab36cb103a55d02ef83727880a14d9be9823f0) Signed-off-by: dann frazier <dann.frazier@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Mark Rutland [Wed, 28 Oct 2015 12:32:17 +0000 (12:32 +0000)]
drivers/perf: kill armpmu_register
BugLink: http://bugs.launchpad.net/bugs/1559350
Nothing outside of drivers/perf/arm_pmu.c should call armpmu_register
any more, so it no longer needs to be in include/linux/perf/arm_pmu.h.
Additionally, by folding it in to arm_pmu_device_probe we can allow
drivers to override struct pmu fields without getting blatted by the
armpmu code.
This patch folds armpmu_register into arm_pmu_device_probe. The logging
to the console is moved to after the PMU is successfully registered with
the core perf code.
Signed-off-by: Mark Rutland <mark.rutland@arm.com> Suggested-by: Will Deacon <will.deacon@arm.com> Cc: Drew Richardson <drew.richardson@arm.com> Cc: Pawel Moll <pawel.moll@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
(cherry picked from commit 86cb273b601488fb02d5706c61a09ee267474aad) Signed-off-by: dann frazier <dann.frazier@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Luck, Tony [Thu, 10 Mar 2016 00:40:48 +0000 (16:40 -0800)]
EDAC/sb_edac: Fix computation of channel address
BugLink: http://bugs.launchpad.net/bugs/1559904
Large memory Haswell-EX systems with multiple DIMMs per channel were
sometimes reporting the wrong DIMM.
Found three problems:
1) Debug printouts for socket and channel interleave were not interpreting
the register fields correctly. The socket interleave field is a 2^X
value (0=1, 1=2, 2=4, 3=8). The channel interleave is X+1 (0=1, 1=2,
2=3. 3=4).
2) Actual use of the socket interleave value didn't interpret as 2^X
3) Conversion of address to channel address was complicated, and wrong.
Signed-off-by: Tony Luck <tony.luck@intel.com> Acked-by: Aristeu Rozanski <arozansk@redhat.com> Cc: Borislav Petkov <bp@alien8.de> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-edac@vger.kernel.org Cc: stable@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
(cherry picked from commit eb1af3b71f9d83e45f2fd2fd649356e98e1c582c) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Andy Whitcroft [Sun, 20 Mar 2016 13:35:17 +0000 (13:35 +0000)]
UBUNTU: [Config] disable CONFIG_IP_PNP
This support is completely duplicated in the initramfs code. As things
stand we attempt this PNP when we do not have the devices we could use
loaded and will not be able to load until the initramfs is loaded.
Therefore disable this support in the kernel and rely on the
initramfs-tools code.
Failure to synchronize the PSL timebase currently prevents the
initialization of the cxl card, thus rendering the card useless. This
is too extreme for a feature which is rarely used, if at all. No
hardware AFUs or software is currently using PSL timebase.
This patch still tries to synchronize the PSL timebase when the card
is initialized, but ignores the error if it can't. Instead, it reports
a status via /sys.
Signed-off-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com> Acked-by: Michael Neuling <mikey@neuling.org> Acked-by: Ian Munsie <imunsie@au1.ibm.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Tyler Hicks [Thu, 17 Mar 2016 00:19:10 +0000 (19:19 -0500)]
UBUNTU: SAUCE: add a sysctl to enable unprivileged user ns AppArmor policy loading
BugLink: http://bugs.launchpad.net/bugs/1379535
Disabled by default until the AppArmor kernel code is deemed safe enough
to handle untrusted policy. Only developers of container technologies
should turn this on until that time.
If this sysctl is set to non-zero and a process with CAP_MAC_ADMIN in
the root namespace has created an AppArmor policy namespace,
unprivileged processes will be able to change to a profile in the
newly created AppArmor policy namespace and, if the profile allows
CAP_MAC_ADMIN and appropriate file permissions, will be able to load
policy in the respective policy namespace.
Signed-off-by: Tyler Hicks <tyhicks@canonical.com> Signed-off-by: John Johansen <john.johansen@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
John Johansen [Fri, 18 Mar 2016 13:09:27 +0000 (06:09 -0700)]
UBUNTU: SAUCE: (no-up) apparmor: sync of apparmor3.5-beta1 snapshot
BugLink: http://bugs.launchpad.net/bugs/1379535
This is a sync and squash of the apparmor 3.5-beta1 snapshot. The
set of patches in this squash are available in
git://kernel.ubuntu.com/jj/ubuntu-xenial.git
using the the tag
apparmor-3.5-beta1-presuash-snapshot
This fixes multiple bugs and adds the policy namespace stacking features. BugLink: http://bugs.launchpad.net/bugs/1379535 Signed-off-by: John Johansen <john.johansen@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
UBUNTU: SAUCE: (noup) arm64, mm, numa: Add NUMA balancing support for arm64.
BugLink: http://bugs.launchpad.net/bugs/1558765
Enable NUMA balancing for arm64 platforms.
Add pte, pmd protnone helpers for use by automatic NUMA balancing.
Reviewed-by: Robert Richter <rrichter@cavium.com> Signed-off-by: Ganapatrao Kulkarni <gkulkarni@caviumnetworks.com> Signed-off-by: David Daney <david.daney@cavium.com>
[ dannf: v15 submittal ]
Reference: http://www.spinics.net/lists/arm-kernel/msg489639.html Signed-off-by: dann frazier <dann.frazier@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
UBUNTU: SAUCE: (noup) arm64, numa: Add NUMA support for arm64 platforms.
BugLink: http://bugs.launchpad.net/bugs/1558765
Attempt to get the memory and CPU NUMA node via of_numa. If that
fails, default the dummy NUMA node and map all memory and CPUs to node
0.
Tested-by: Shannon Zhao <shannon.zhao@linaro.org> Reviewed-by: Robert Richter <rrichter@cavium.com> Signed-off-by: Ganapatrao Kulkarni <gkulkarni@caviumnetworks.com> Signed-off-by: David Daney <david.daney@cavium.com>
[ dannf: v15 submittal ]
Reference: http://www.spinics.net/lists/arm-kernel/msg489640.html Signed-off-by: dann frazier <dann.frazier@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
dann frazier [Fri, 22 Jan 2016 00:48:36 +0000 (17:48 -0700)]
UBUNTU: [Config] CONFIG_NUMA=y and CONFIG_NODES_SHIFT=2 on arm64
BugLink: http://bugs.launchpad.net/bugs/1558765 Signed-off-by: dann frazier <dann.frazier@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
BugLink: http://bugs.launchpad.net/bugs/1558765
In order to extract NUMA information from the device tree, we need to
have the tree in its unflattened form.
Split paging_init() into two pieces. The first piece maps memory so
that unflatten_device_tree(), can allocate memory. The second piece
containing the bootmem_init() call that will be patched in a follow-on
patch to add NUMA handling.
Move the unflatten_device_tree() call between the two new pieces.
Signed-off-by: David Daney <david.daney@cavium.com>
[ dannf: v15 submittal ]
Reference: http://www.spinics.net/lists/arm-kernel/msg489637.html Signed-off-by: dann frazier <dann.frazier@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
David Daney [Wed, 9 Mar 2016 21:42:17 +0000 (14:42 -0700)]
UBUNTU: SAUCE: (noup) of, numa: Add NUMA of binding implementation.
BugLink: http://bugs.launchpad.net/bugs/1558765
Add device tree parsing for NUMA topology using device
"numa-node-id" property in distance-map and cpu nodes.
This is a complete rewrite of a previous patch by:
Ganapatrao Kulkarni<gkulkarni@caviumnetworks.com>
Signed-off-by: David Daney <david.daney@cavium.com> Acked-by: Rob Herring <robh@kernel.org>
[ dannf: v15 submittal ]
Reference: http://www.spinics.net/lists/arm-kernel/msg489638.html Signed-off-by: dann frazier <dann.frazier@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
dann frazier [Fri, 22 Jan 2016 00:49:38 +0000 (17:49 -0700)]
UBUNTU: [Config] CONFIG_OF_NUMA=y
BugLink: http://bugs.launchpad.net/bugs/1558765 Signed-off-by: dann frazier <dann.frazier@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Ard Biesheuvel [Wed, 9 Mar 2016 21:39:58 +0000 (14:39 -0700)]
UBUNTU: SAUCE: (noup) efi: ARM/arm64: ignore DT memory nodes instead of removing them
BugLink: http://bugs.launchpad.net/bugs/1558765
There are two problems with the UEFI stub DT memory node removal
routine:
- it deletes nodes as it traverses the tree, which happens to work
but is not supported, as deletion invalidates the node iterator;
- deleting memory nodes entirely may discard annotations in the form
of additional properties on the nodes.
Since the discovery of DT memory nodes occurs strictly before the
UEFI init sequence, we can simply clear the memblock memory table
before parsing the UEFI memory map. This way, it is no longer
necessary to remove the nodes, so we can remove that logic from the
stub as well.
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: David Daney <david.daney@cavium.com>
[ dannf: v15 submittal; backported to v4.4 ]
Reference: http://www.spinics.net/lists/arm-kernel/msg489635.html Signed-off-by: dann frazier <dann.frazier@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Alex Ng [Fri, 26 Feb 2016 23:13:22 +0000 (15:13 -0800)]
Drivers: hv: vmbus: Support kexec on ws2012 r2 and above
BugLink: http://bugs.launchpad.net/bugs/1558720
WS2012 R2 and above hosts can support kexec in that thay can support
reconnecting to the host (as would be needed in the kexec path)
on any CPU. Enable this. Pre ws2012 r2 hosts don't have this ability
and consequently cannot support kexec.
Signed-off-by: Alex Ng <alexng@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from linux-next commit 7268644734f6a300353a4c4ff8bf3e013ba80f89) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
K. Y. Srinivasan [Fri, 26 Feb 2016 23:13:21 +0000 (15:13 -0800)]
Drivers: hv: vmbus: Support handling messages on multiple CPUs
BugLink: http://bugs.launchpad.net/bugs/1558720
Starting with Windows 2012 R2, message inteerupts can be delivered
on any VCPU in the guest. Support this functionality.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from linux-next commit d81274aae61c0a045cd0f34191c51fa64ba58bc4) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Sebastian Ott [Mon, 14 Mar 2016 14:47:23 +0000 (15:47 +0100)]
s390/pci: enforce fmb page boundary rule
BugLink: http://bugs.launchpad.net/bugs/1558625
The function measurement block must not cross a page boundary. Ensure
that by raising the alignment requirement to the smallest power of 2
larger than the size of the fmb.
Fixes: d0b088531 ("s390/pci: performance statistics and debug infrastructure") Cc: stable@vger.kernel.org # v3.8+ Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
(cherry picked from commit 80c544ded25ac14d7cc3e555abb8ed2c2da99b84) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
BugLink: http://bugs.launchpad.net/bugs/1558624
Provide a user space interface to issue call logical-processor instructions.
Only selected CLP commands are allowed, enough to get the full overview of
the installed PCI functions.
Reviewed-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
(cherry picked from commit 988b86e69ded17f0f1209fd3ef1c4c7f1567dcc1) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Sebastian Ott [Fri, 29 Jan 2016 14:13:30 +0000 (15:13 +0100)]
s390/pci: remove pdev pointer from arch data
BugLink: http://bugs.launchpad.net/bugs/1558624
For each PCI function we need to maintain arch specific data in
struct zpci_dev which also contains a pointer to struct pci_dev.
When a function is registered or deregistered (which is triggered by PCI
common code) we need to adjust that pointer which could interfere with
the machine check handler (triggered by FW) using zpci_dev->pdev.
Since multiple instances of the same pdev could exist at a time this can't
be solved with locking.
Fix that by ditching the pdev pointer and use a bus walk to reach
struct pci_dev (only one instance of a pdev can be registered at the bus
at a time).
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
(cherry picked from commit 9a99649f2a89fdfc9dde5d5401675561567bf99a) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Sebastian Ott [Fri, 22 Jan 2016 13:11:21 +0000 (14:11 +0100)]
s390/pci: remove iomap sanity checks
BugLink: http://bugs.launchpad.net/bugs/1558624
Since each iomap_entry handles only one bar of one pci function
(even when disjunct ranges of a bar are mapped) the sanity check
in pci_iomap_range is not needed and can be removed.
Also convert the remaining BUG_ONs to WARN_ONs.
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
(cherry picked from commit f5e44f82c1848d8e55fb0061308f14c0884e5483) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Sebastian Ott [Fri, 22 Jan 2016 13:04:18 +0000 (14:04 +0100)]
s390/pci: set error state for unusable functions
BugLink: http://bugs.launchpad.net/bugs/1558624
We receive special notifications from firmware when an error was detected
and a pci function became unusable. Set the error_state accordingly to give
device drivers a hint that they don't need to try error recovery.
Suggested-by: Alexander Schmidt <alexschm@de.ibm.com> Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
(cherry picked from commit 8ead7efb6379354d0d31efb39342f4399c87cb67) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
(cherry picked from commit c0cabaddeeeab13db8ef4e275ab5c7c0e8746324) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Sebastian Ott [Fri, 22 Jan 2016 13:01:44 +0000 (14:01 +0100)]
s390/pci: resize iomap
BugLink: http://bugs.launchpad.net/bugs/1558624
On s390 we need to maintain a mapping between iomem addresses
and arch specific function identifiers. Currently the mapping
table is created as such that we could span the whole iomem
address space. Since we can only map each bar space from each
possible function we have an upper bound for the number of
mapping entries.
This reduces the size of the iomap from 256K to less than 4K
(using the defconfig).
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
(cherry picked from commit c506fff3d3a8a632e8eb2270680548ec415f0357) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
(back ported from commit bf19c94d5caa100f22c20d756c57e3550c01cdb8) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Conflicts:
arch/s390/include/asm/pci_io.h
Sebastian Ott [Fri, 22 Jan 2016 12:58:42 +0000 (13:58 +0100)]
s390/pci: provide ZPCI_ADDR macro
BugLink: http://bugs.launchpad.net/bugs/1558624
Provide and use a ZPCI_ADDR macro as the complement of ZPCI_IDX
to get rid of some constants in the code.
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
(cherry picked from commit 9e00caaea14b90a788c17a2e0c32108a3d7008ec) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Gerald Schaefer [Mon, 16 Nov 2015 13:35:48 +0000 (14:35 +0100)]
s390/pci_dma: fix DMA table corruption with > 4 TB main memory
BugLink: http://bugs.launchpad.net/bugs/1558624
DMA addresses returned from map_page() are calculated by using an iommu
bitmap plus a start_dma offset. The size of this bitmap is based on the main
memory size. If we have more than (4 TB - start_dma) main memory, the DMA
address calculation will also produce addresses > 4 TB. Such addresses
cannot be inserted in the 3-level DMA page table, instead the entries
modulo 4 TB will be overwritten.
Fix this by restricting the iommu bitmap size to (4 TB - start_dma).
Also set zdev->end_dma to the actual end address of the usable
range, instead of the theoretical maximum as reported by the hardware,
which fixes a sanity check in dma_map() and also the IOMMU API domain
geometry aperture calculation.
Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com> Reviewed-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
(cherry picked from commit 69eea95c48857c9dfcac120d6acea43027627b28) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Mehmet Kayaalp [Thu, 10 Mar 2016 21:22:13 +0000 (16:22 -0500)]
UBUNTU: SAUCE: (noup) KEYS: Support for inserting a certificate into x86 bzImage
BugLink: http://bugs.launchpad.net/bugs/1558553
The config option SYSTEM_EXTRA_CERTIFICATE reserves space in vmlinux file,
which is compressed to create the self-extracting bzImage. This patch adds the
capability of extracting the vmlinux, inserting the certificate, and
repackaging the result into a bzImage.
It only works if the resulting compressed vmlinux is smaller than the original.
Otherwise re-linking would be required. To make the reserved space allocate
actual space in bzImage, a null key is inserted into vmlinux before creating
the bzImage:
make vmlinux
scripts/insert-sys-cert -b vmlinux -c /dev/null
make bzImage
After null key insertion, the script populates the rest of the reserved space
with random bytes, which have poor compression. After receiving a bzImage that
is created this way, actual certificate can be inserted into the bzImage:
Mehmet Kayaalp [Tue, 24 Nov 2015 21:18:05 +0000 (16:18 -0500)]
KEYS: Reserve an extra certificate symbol for inserting without recompiling
BugLink: http://bugs.launchpad.net/bugs/1558553
Place a system_extra_cert buffer of configurable size, right after the
system_certificate_list, so that inserted keys can be readily processed by
the existing mechanism. Added script takes a key file and a kernel image
and inserts its contents to the reserved area. The
system_certificate_list_size is also adjusted accordingly.
If vmlinux has no symbol table, supply System.map file with -s flag.
Subsequent runs replace the previously inserted key, instead of appending
the new one.
Signed-off-by: Mehmet Kayaalp <mkayaalp@linux.vnet.ibm.com> Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
(cherry picked from commit c4c36105958576fee87d2c75f4b69b6e5bbde772) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Mehmet Kayaalp [Tue, 24 Nov 2015 21:19:03 +0000 (16:19 -0500)]
KEYS: Use the symbol value for list size, updated by scripts/insert-sys-cert
BugLink: http://bugs.launchpad.net/bugs/1558553
When a certificate is inserted to the image using scripts/writekey, the
value of __cert_list_end does not change. The updated size can be found
out by reading the value pointed by the system_certificate_list_size
symbol.
Signed-off-by: Mehmet Kayaalp <mkayaalp@linux.vnet.ibm.com> Signed-off-by: David Howells <dhowells@redhat.com>
(cherry picked from commit 8e1678988897ebcc29b318ed78af4808202772df) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
ipv4: only create late gso-skb if skb is already set up with CHECKSUM_PARTIAL
BugLink: http://bugs.launchpad.net/bugs/1558025
Otherwise we break the contract with GSO to only pass CHECKSUM_PARTIAL
skbs down. This can easily happen with UDP+IPv4 sockets with the first
MSG_MORE write smaller than the MTU, second write is a sendfile.
Returning -EOPNOTSUPP lets the callers fall back into normal sendmsg path,
were we calculate the checksum manually during copying.
Commit d749c9cbffd6 ("ipv4: no CHECKSUM_PARTIAL on MSG_MORE corked
sockets") started to exposes this bug.
Fixes: d749c9cbffd6 ("ipv4: no CHECKSUM_PARTIAL on MSG_MORE corked sockets") Reported-by: Jiri Benc <jbenc@redhat.com> Cc: Jiri Benc <jbenc@redhat.com> Reported-by: Wakko Warner <wakko@animx.eu.org> Cc: Wakko Warner <wakko@animx.eu.org> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit a8c4a2522a0808c5c2143612909717d1115c40cf) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
David Daney [Fri, 4 Mar 2016 22:31:48 +0000 (14:31 -0800)]
PCI: thunder: Add driver for ThunderX-pass{1,2} on-chip devices
BugLink: http://bugs.launchpad.net/bugs/1558342
The cavium,pci-thunder-ecam devices are exactly ECAM-based PCI root
complexes. These root complexes (loosely referred to as ECAM units in the
hardware manuals) are used to access the Thunder on-chip devices. They
are special in that all the BARs on devices behind these root complexes are
at fixed addresses.
Add a driver for these devices that synthesizes Enhanced Allocation (EA)
capability entries for each BAR.
Since this EA synthesis is needed for exactly two chip models, we can hard-
code some assumptions about the device topology and the layout of the
config space of specific DEVFNs in the driver.
[bhelgaas: changelog, whitespace] Signed-off-by: David Daney <david.daney@cavium.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Rob Herring <robh@kernel.org>
(cherry picked from linux-next commit 7b6e7ba8e81a862e20d213d90aa5ba1e5a02aba6)
[dannf: offset fixups to apply to v4.4] Signed-off-by: dann frazier <dann.frazier@canonical.com>
David Daney [Fri, 4 Mar 2016 22:31:47 +0000 (14:31 -0800)]
PCI: thunder: Add PCIe host driver for ThunderX processors
BugLink: http://bugs.launchpad.net/bugs/1558342
The root complexes used to access off-chip PCIe devices (called PEM units
in the hardware manuals) on some Cavium ThunderX processors require quirky
access methods for the config space of the PCIe bridge.
Add a driver to provide these config space accessor functions. Use the
pci-host-common code to configure the PCI machinery.
Signed-off-by: David Daney <david.daney@cavium.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Rob Herring <robh@kernel.org> Acked-by: Arnd Bergmann <arnd@arndb.de>
(cherry picked from linux-next commit f12b76e56ada6e276a3d45b60c4e26e2dda7e547)
[dannf: offset fixups to apply to v4.4] Signed-off-by: dann frazier <dann.frazier@canonical.com>
David Daney [Fri, 11 Mar 2016 21:35:55 +0000 (15:35 -0600)]
PCI: generic: Expose pci_host_common_probe() for use by other drivers
BugLink: http://bugs.launchpad.net/bugs/1558342
Move pci_host_common_probe() and associated functions to pci-host-common.c,
where it can be shared with other drivers. Make it public (not static)
and update Kconfig and Makefile to build it. No functional change
intended.
[bhelgaas: split into separate patch, changelog] Signed-off-by: David Daney <david.daney@cavium.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Will Deacon <will.deacon@arm.com>
(cherry picked from linux-next commit 4e64dbe226e707b442d45c2096dde2090f34f84d) Signed-off-by: dann frazier <dann.frazier@canonical.com>
David Daney [Fri, 11 Mar 2016 21:25:13 +0000 (15:25 -0600)]
PCI: generic: Add pci_host_common_probe(), based on gen_pci_probe()
BugLink: http://bugs.launchpad.net/bugs/1558342
Factor gen_pci_probe(), moving most of it into pci_host_common_probe()
where it can be shared with other drivers that have slightly different
config accessors. No functional change intended.
[bhelgaas: split into separate patch, changelog] Signed-off-by: David Daney <david.daney@cavium.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Will Deacon <will.deacon@arm.com>
(cherry picked from linux-next commit d51b371087d7198c733d2ef3c4db8165aee4de4e) Signed-off-by: dann frazier <dann.frazier@canonical.com>
David Daney [Fri, 11 Mar 2016 21:18:38 +0000 (15:18 -0600)]
PCI: generic: Move structure definitions to separate header file
BugLink: http://bugs.launchpad.net/bugs/1558342
Move definitions for generic PCI host controller driver structures to a
separate header file so we can share them with other drivers. No
functional change intended.
[bhelgaas: split into separate patch, changelog] Signed-off-by: David Daney <david.daney@cavium.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Will Deacon <will.deacon@arm.com>
(cherry picked from linux-next commit 7149b9fdaa5e160a7ee2af9014d9af77e87d9689)
[dannf: modified to move the structures as they were in v4.4] Signed-off-by: dann frazier <dann.frazier@canonical.com>