]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/log
mirror_ubuntu-zesty-kernel.git
8 years agonet: thunderx: Set recevie buffer page usage count in bulk
Sunil Goutham [Mon, 14 Mar 2016 11:06:14 +0000 (16:36 +0530)]
net: thunderx: Set recevie buffer page usage count in bulk

BugLink: http://bugs.launchpad.net/bugs/1567093
Instead of calling get_page() for every receive buffer carved out
of page, set page's usage count at the end, to reduce no of atomic
calls.

Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 5c2e26f6f674ee93719769d024cc72fad3ba9134)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet: thunderx: Fix receive packet stats
Sunil Goutham [Tue, 16 Feb 2016 10:59:51 +0000 (16:29 +0530)]
net: thunderx: Fix receive packet stats

BugLink: http://bugs.launchpad.net/bugs/1567091
Counting rx packets for every CQE_RX in CQ irq handler is incorrect.
Synchronization is missing when multiple queues are receiving packets
simultaneously. Like transmit packet stats use HW stats here.

Also removed unused 'cqe_type' parameter in nicvf_rcv_pkt_handler().

Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit ad2ecebd67d8a80fe5412d11df375a5ed2db7cd1)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet: thunderx: Fix for HW TSO not enabled for secondary qsets
Sunil Goutham [Tue, 16 Feb 2016 10:59:50 +0000 (16:29 +0530)]
net: thunderx: Fix for HW TSO not enabled for secondary qsets

BugLink: http://bugs.launchpad.net/bugs/1567091
For secondary Qsets 'hw_tso' is not getting set as probe() returns
much earlier. Fixed it by moving silicon revision check.

Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 8d210d54c5250c52b69266f299e64fe8356f9453)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet: thunderx: Fix for multiqset not configured upon interface toggle
Sunil Goutham [Tue, 16 Feb 2016 10:59:49 +0000 (16:29 +0530)]
net: thunderx: Fix for multiqset not configured upon interface toggle

BugLink: http://bugs.launchpad.net/bugs/1567091
When a interface is assigned morethan 8 queues and the logical interface
is toggled i.e down & up, additional queues or qsets are not initialized
as secondary qset count is being set to zero while tearing down.

Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 6a9bab79bb79bd9b2eda16f0aba1b4c43f677be9)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: Start new release
Tim Gardner [Thu, 7 Apr 2016 06:33:00 +0000 (07:33 +0100)]
UBUNTU: Start new release

Ignore: yes
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: Ubuntu-4.4.0-18.34
Tim Gardner [Wed, 6 Apr 2016 13:48:53 +0000 (14:48 +0100)]
UBUNTU: Ubuntu-4.4.0-18.34

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: SAUCE: i915_bpo: drm/i915/skl: Fix spurious gpu hang with gt3/gt4 revs
Mika Kuoppala [Wed, 6 Apr 2016 13:20:24 +0000 (16:20 +0300)]
UBUNTU: SAUCE: i915_bpo: drm/i915/skl: Fix spurious gpu hang with gt3/gt4 revs

BugLink: http://bugs.launchpad.net/bugs/1564759
Experiments with heaven 4.0 benchmark and skylake gt3e (rev 0xa)
suggest that WaForceContextSaveRestoreNonCoherent is needed for all
revs. Extending this to all revs cures a gpu hang with rev 0xa when
running heaven4.0 gpu benchmark.

We have been here before, with problems enabling gt4e and extending
up to revision F0 instead of false claims of bspec of E0 only. See
commit <e238659ddd88> ("drm/i915/skl: Default to noncoherent access
up to F0"). In retrospect we should have covered this with this big
blanket back then already, as E0 vs F0 discrepancy was suspicious
enough.

Previously the WaForceEnableNonCoherent has been tied to
context non-coherence, atleast in relevant hsds. So keep this tie
and extended this alongside.

Cc: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
Cc: Ben Widawsky <benjamin.widawsky@intel.com>
Cc: Timo Aaltonen <tjaalton@ubuntu.com>
Cc: stable@vger.kernel.org
Reported-by: Mike Lothian <mike@fireburn.co.uk>
References: https://bugs.freedesktop.org/show_bug.cgi?id=93491
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
(pulled from stable@ list)
Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: SAUCE: i915_bpo: drm/i915/skl: Fix rc6 based gpu/system hang
Mika Kuoppala [Wed, 6 Apr 2016 13:20:23 +0000 (16:20 +0300)]
UBUNTU: SAUCE: i915_bpo: drm/i915/skl: Fix rc6 based gpu/system hang

BugLink: http://bugs.launchpad.net/bugs/1564759
For all gt3 and gt4 skylake variants, extend the usage of
WaRsDisableCoarsePowerGating for all revisions. Without this
gt3 and gt4 skylakes up to atleast rev 0xa can gpu hang or
system hang.

Cc: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
Cc: Ben Widawsky <benjamin.widawsky@intel.com>
Cc: Timo Aaltonen <tjaalton@ubuntu.com>
Cc: <stable@vger.kernel.org>
Reported-by: Mikael Djurfeldt <mikael@djurfeldt.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=94161
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
(pulled from stable@ list)
Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: SAUCE: i915_bpo: Disable preliminary hw support
Timo Aaltonen [Fri, 1 Apr 2016 09:58:18 +0000 (12:58 +0300)]
UBUNTU: SAUCE: i915_bpo: Disable preliminary hw support

It was mistakenly enabled, the option should be left disabled and
instead enable KBL/BXT via the driver once they have been properly
tested.

Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: [Config] CONFIG_ARCH_ROCKCHIP=y
Tim Gardner [Wed, 6 Apr 2016 12:02:30 +0000 (13:02 +0100)]
UBUNTU: [Config] CONFIG_ARCH_ROCKCHIP=y

BugLink: http://bugs.launchpad.net/bugs/1566283
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoperf/x86/mbm: Add support for MBM counter overflow handling
Vikas Shivappa [Fri, 11 Mar 2016 19:26:17 +0000 (11:26 -0800)]
perf/x86/mbm: Add support for MBM counter overflow handling

BugLink: http://bugs.launchpad.net/bugs/1397880
This patch adds a per package timer which periodically updates the
memory bandwidth counters for the events that are currently active.

Current patch has a periodic timer every 1s since the SDM guarantees
that the counter will not overflow in 1s but this time can be definitely
improved by calibrating on the system. The overflow is really a function
of the max memory b/w that the socket can support, max counter value and
scaling factor.

Signed-off-by: Vikas Shivappa <vikas.shivappa@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Cc: fenghua.yu@intel.com
Cc: h.peter.anvin@intel.com
Cc: ravi.v.shankar@intel.com
Cc: vikas.shivappa@intel.com
Link: http://lkml.kernel.org/r/013b756c5006b1c4ca411f3ecf43ed52f19fbf87.1457723885.git.tony.luck@intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
(cherry picked from commit e7ee3e8cb550ce43752ae1d1b190d6b5c4150a43)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoperf/x86/mbm: Implement RMID recycling
Vikas Shivappa [Thu, 10 Mar 2016 23:32:11 +0000 (15:32 -0800)]
perf/x86/mbm: Implement RMID recycling

BugLink: http://bugs.launchpad.net/bugs/1397880
RMID could be allocated or deallocated as part of RMID recycling.

When an RMID is allocated for MBM event, the MBM counter needs to be
initialized because next time we read the counter we need the previous
value to account for total bytes that went to the memory controller.

Similarly, when RMID is deallocated we need to update the ->count
variable.

Signed-off-by: Vikas Shivappa <vikas.shivappa@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Cc: fenghua.yu@intel.com
Cc: h.peter.anvin@intel.com
Cc: ravi.v.shankar@intel.com
Cc: vikas.shivappa@intel.com
Link: http://lkml.kernel.org/r/1457652732-4499-6-git-send-email-vikas.shivappa@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
(cherry picked from commit 2d4de8376ff1d94a5070cfa9092c59bfdc4e693e)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoperf/x86/mbm: Add memory bandwidth monitoring event management
Tony Luck [Fri, 11 Mar 2016 19:26:11 +0000 (11:26 -0800)]
perf/x86/mbm: Add memory bandwidth monitoring event management

BugLink: http://bugs.launchpad.net/bugs/1397880
Includes all the core infrastructure to measure the total_bytes and
bandwidth.

We have per socket counters for both total system wide L3 external
bytes and local socket memory-controller bytes. The OS does MSR writes
to MSR_IA32_QM_EVTSEL and MSR_IA32_QM_CTR to read the counters and
uses the IA32_PQR_ASSOC_MSR to associate the RMID with the task. The
tasks have a common RMID for CQM (cache quality of service monitoring)
and MBM. Hence most of the scheduling code is reused from CQM.

Signed-off-by: Tony Luck <tony.luck@intel.com>
[ Restructured rmid_read to not have an obvious hole, removed MBM_CNTR_MAX as its unused. ]
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Vikas Shivappa <vikas.shivappa@linux.intel.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Cc: fenghua.yu@intel.com
Cc: h.peter.anvin@intel.com
Cc: ravi.v.shankar@intel.com
Cc: vikas.shivappa@intel.com
Link: http://lkml.kernel.org/r/abd7aac9a18d93b95b985b931cf258df0164746d.1457723885.git.tony.luck@intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
(cherry picked from commit 87f01cc2a2914b61ade5ec834377fa7819484173)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoperf/x86/mbm: Add Intel Memory B/W Monitoring enumeration and init
Vikas Shivappa [Thu, 10 Mar 2016 23:32:09 +0000 (15:32 -0800)]
perf/x86/mbm: Add Intel Memory B/W Monitoring enumeration and init

BugLink: http://bugs.launchpad.net/bugs/1397880
The MBM init patch enumerates the Intel MBM (Memory b/w monitoring)
and initializes the perf events and datastructures for monitoring the
memory b/w.

Its based on original patch series by Tony Luck and Kanaka Juvva.

Memory bandwidth monitoring (MBM) provides OS/VMM a way to monitor
bandwidth from one level of cache to another. The current patches
support L3 external bandwidth monitoring. It supports both 'local
bandwidth' and 'total bandwidth' monitoring for the socket. Local
bandwidth measures the amount of data sent through the memory controller
on the socket and total b/w measures the total system bandwidth.

Extending the cache quality of service monitoring (CQM) we add two
more events to the perf infrastructure:

  intel_cqm_llc/local_bytes - bytes sent through local socket memory controller
  intel_cqm_llc/total_bytes - total L3 external bytes sent

The tasks are associated with a Resouce Monitoring ID (RMID) just like
in CQM and OS uses a MSR write to indicate the RMID of the task during
scheduling.

Signed-off-by: Vikas Shivappa <vikas.shivappa@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Cc: fenghua.yu@intel.com
Cc: h.peter.anvin@intel.com
Cc: ravi.v.shankar@intel.com
Cc: vikas.shivappa@intel.com
Link: http://lkml.kernel.org/r/1457652732-4499-4-git-send-email-vikas.shivappa@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
(back ported from commit 33c3cc7acfd95968d74247f1a4e1b0727a07ed43)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
 Conflicts:
arch/x86/kernel/cpu/common.c

8 years agox86/topology: Create logical package id
Thomas Gleixner [Mon, 22 Feb 2016 22:19:15 +0000 (22:19 +0000)]
x86/topology: Create logical package id

BugLink: http://bugs.launchpad.net/bugs/1397880
For per package oriented services we must be able to rely on the number of CPU
packages to be within bounds. Create a tracking facility, which

- calculates the number of possible packages depending on nr_cpu_ids after boot

- makes sure that the package id is within the number of possible packages. If
  the apic id is outside we map it to a logical package id if there is enough
  space available.

Provide interfaces for drivers to query the mapping and do translations from
physcial to logical ids.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andi Kleen <andi.kleen@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Harish Chegondi <harish.chegondi@intel.com>
Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Luis R. Rodriguez <mcgrof@suse.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Toshi Kani <toshi.kani@hp.com>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Cc: linux-kernel@vger.kernel.org
Link: http://lkml.kernel.org/r/20160222221011.541071755@linutronix.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
(cherry picked from commit 1f12e32f4cd5243ae46d8b933181be0d022c6793)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoMerge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Tue, 15 Mar 2016 19:13:56 +0000 (12:13 -0700)]
Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

BugLink: http://bugs.launchpad.net/bugs/1397880
Pull timer updates from Thomas Gleixner:
 "The timer department delivers this time:

   - Support for cross clock domain timestamps in the core code plus a
     first user.  That allows more precise timestamping for PTP and
     later for audio and other peripherals.

     The ptp/e1000e patches have been acked by the relevant maintainers
     and are carried in the timer tree to avoid merge ordering issues.

   - Support for unregistering the current clocksource watchdog.  That
     lifts a limitation for switching clocksources which has been there
     from day 1

   - The usual pile of fixes and updates to the core and the drivers.
     Nothing outstanding and exciting"

* 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (26 commits)
  time/timekeeping: Work around false positive GCC warning
  e1000e: Adds hardware supported cross timestamp on e1000e nic
  ptp: Add PTP_SYS_OFFSET_PRECISE for driver crosstimestamping
  x86/tsc: Always Running Timer (ART) correlated clocksource
  hrtimer: Revert CLOCK_MONOTONIC_RAW support
  time: Add history to cross timestamp interface supporting slower devices
  time: Add driver cross timestamp interface for higher precision time synchronization
  time: Remove duplicated code in ktime_get_raw_and_real()
  time: Add timekeeping snapshot code capturing system time and counter
  time: Add cycles to nanoseconds translation
  jiffies: Use CLOCKSOURCE_MASK instead of constant
  clocksource: Introduce clocksource_freq2mult()
  clockevents/drivers/exynos_mct: Implement ->set_state_oneshot_stopped()
  clockevents/drivers/arm_global_timer: Implement ->set_state_oneshot_stopped()
  clockevents/drivers/arm_arch_timer: Implement ->set_state_oneshot_stopped()
  clocksource/drivers/arm_global_timer: Register delay timer
  clocksource/drivers/lpc32xx: Support timer-based ARM delay
  clocksource/drivers/lpc32xx: Support periodic mode
  clocksource/drivers/lpc32xx: Don't use the prescaler counter for clockevents
  clocksource/drivers/rockchip: Add err handle for rk_timer_init
  ...

(cherry picked from commit 8a284c062ec923c924c79e3b1b5199b8d72904fc)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agox86/cpufeature: Carve out X86_FEATURE_*
Borislav Petkov [Tue, 26 Jan 2016 21:12:04 +0000 (22:12 +0100)]
x86/cpufeature: Carve out X86_FEATURE_*

BugLink: http://bugs.launchpad.net/bugs/1397880
Move them to a separate header and have the following
dependency:

  x86/cpufeatures.h <- x86/processor.h <- x86/cpufeature.h

This makes it easier to use the header in asm code and not
include the whole cpufeature.h and add guards for asm.

Suggested-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1453842730-28463-5-git-send-email-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
(back ported from commit cd4d09ec6f6c12a2cc3db5b7d8876a325a53545b)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
 Conflicts:
arch/x86/include/asm/cpufeature.h
lib/atomic64_test.c

8 years agoperf/x86/cqm: Fix CQM memory leak and notifier leak
Vikas Shivappa [Thu, 10 Mar 2016 23:32:08 +0000 (15:32 -0800)]
perf/x86/cqm: Fix CQM memory leak and notifier leak

BugLink: http://bugs.launchpad.net/bugs/1397880
Fixes the hotcpu notifier leak and other global variable memory leaks
during CQM (cache quality of service monitoring) initialization.

Signed-off-by: Vikas Shivappa <vikas.shivappa@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Cc: fenghua.yu@intel.com
Cc: h.peter.anvin@intel.com
Cc: ravi.v.shankar@intel.com
Cc: vikas.shivappa@intel.com
Link: http://lkml.kernel.org/r/1457652732-4499-3-git-send-email-vikas.shivappa@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
(cherry picked from commit ada2f634cd50d050269b67b4e2966582387e7c27)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoperf/x86/cqm: Fix CQM handling of grouping events into a cache_group
Vikas Shivappa [Thu, 10 Mar 2016 23:32:07 +0000 (15:32 -0800)]
perf/x86/cqm: Fix CQM handling of grouping events into a cache_group

BugLink: http://bugs.launchpad.net/bugs/1397880
Currently CQM (cache quality of service monitoring) is grouping all
events belonging to same PID to use one RMID. However its not counting
all of these different events. Hence we end up with a count of zero
for all events other than the group leader.

The patch tries to address the issue by keeping a flag in the
perf_event.hw which has other CQM related fields. The field is updated
at event creation and during grouping.

Signed-off-by: Vikas Shivappa <vikas.shivappa@linux.intel.com>
[peterz: Changed hw_perf_event::is_group_event to an int]
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Cc: fenghua.yu@intel.com
Cc: h.peter.anvin@intel.com
Cc: ravi.v.shankar@intel.com
Cc: vikas.shivappa@intel.com
Link: http://lkml.kernel.org/r/1457652732-4499-2-git-send-email-vikas.shivappa@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
(cherry picked from commit a223c1c7ab4cc64537dc4b911f760d851683768a)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: SAUCE: fs: fix a posible leak of allocated superblock
Pavel Tikhomirov [Tue, 15 Mar 2016 12:08:50 +0000 (15:08 +0300)]
UBUNTU: SAUCE: fs: fix a posible leak of allocated superblock

BugLink: http://bugs.launchpad.net/bugs/1566505
We probably need to fix superblock leak in patch (v4 "fs: Add user
namesapace member to struct super_block"):

Imagine posible code path in sget_userns: we iterate through
type->fs_supers and do not find suitable sb, we drop sb_lock to
allocate s and go to retry. After we dropped sb_lock some other
task from different userns takes sb_lock, it is already in retry
stage and has s allocated, so it puts its s in type->fs_supers
list. So in retry we will find these sb in list and check it has
a different userns, and finally we will return without freeing s.

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: SAUCE: cgroup: Use a new super block when mounting in a cgroup namespace
Seth Forshee [Mon, 4 Apr 2016 20:06:39 +0000 (15:06 -0500)]
UBUNTU: SAUCE: cgroup: Use a new super block when mounting in a cgroup namespace

BugLink: http://bugs.launchpad.net/bugs/1566505
Currently a new mount of an existing hierarchy always reuses the
original super block, even when the new mount is in a cgroup
namespace. This sometimes conflicts with the user namespace mount
support, which requires a new mount of an existing super block to
be in the same user namespace as the original mount. When
mounting from non-init cgroup and user namespaces sget() will
fail.

To fix this we can pass a pointer to the cgroup ns to kernfs when
mounting, causing kernfs_test_super() to no longer match super
blocks from different cgroup namespaces.

However we do wish to continue sharing the cgroup_root between
mounts of the same heirarchy. The cgroup_root's lifetime is
governed by the reference count of its cgrp member, but this is
a percpu reference count and is not well suited to this new
situation. Instead a new reference count is added to the
cgroup_root structure to track the number of super blocks sharing
that root, and this refcnt is used to determine when to put the
cgroup reference.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: SAUCE: fuse: Don't initialize user_id or group_id in mount options
Seth Forshee [Thu, 31 Mar 2016 13:17:42 +0000 (08:17 -0500)]
UBUNTU: SAUCE: fuse: Don't initialize user_id or group_id in mount options

BugLink: http://bugs.launchpad.net/bugs/1566505
These are required mount options, thus there is no need to
initialize the values in struct fuse_mount_data.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: SAUCE: fs: Allow superblock owner to change ownership of inodes with unmappab...
Seth Forshee [Mon, 28 Mar 2016 20:09:47 +0000 (15:09 -0500)]
UBUNTU: SAUCE: fs: Allow superblock owner to change ownership of inodes with unmappable ids

BugLink: http://bugs.launchpad.net/bugs/1566505
In a userns mount some on-disk inodes may have ids which do not
map into s_user_ns, in which case the in-kernel inodes are owned
by invalid users. The superblock owner should be able to change
attributes of these inodes but cannot. However it is unsafe to
grant the superblock owner privileged access to all inodes in the
superblock since proc, sysfs, etc. use DAC to protect files which
may not belong to s_user_ns. The problem is restricted to only
inodes where the owner or group is an invalid user.

We can work around this by allowing users with CAP_CHOWN in
s_user_ns to change an invalid owner or group id, so long as the
other id is either invalid or mappable in s_user_ns. After
changing ownership the user will be privileged towards the inode
and thus able to change other attributes.

As an precaution, checks for invalid ids are added to the proc
and kernfs setattr interfaces. These filesystems are not expected
to have inodes with invalid ids, but if it does happen any
setattr operations will return -EPERM.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: SAUCE: quota: Require that qids passed to dqget() be valid and map into s_user_ns
Seth Forshee [Fri, 25 Mar 2016 16:11:46 +0000 (11:11 -0500)]
UBUNTU: SAUCE: quota: Require that qids passed to dqget() be valid and map into s_user_ns

BugLink: http://bugs.launchpad.net/bugs/1566505
This ensures that quotas that aren't valid on disk never make it
into the hash table. inodes with ids which don't map into
s_user_ns will now have no quota enforcement.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoarm64: Update PTE_RDONLY in set_pte_at() for PROT_NONE permission
Catalin Marinas [Wed, 9 Mar 2016 16:31:29 +0000 (16:31 +0000)]
arm64: Update PTE_RDONLY in set_pte_at() for PROT_NONE permission

BugLink: http://bugs.launchpad.net/bugs/1566518
The set_pte_at() function must update the hardware PTE_RDONLY bit
depending on the state of the PTE_WRITE and PTE_DIRTY bits of the given
entry value. However, it currently only performs this for pte_valid()
entries, ignoring PTE_PROT_NONE. The side-effect is that PROT_NONE
mappings would not have the PTE_RDONLY bit set. Without
CONFIG_ARM64_HW_AFDBM, this is not an issue since such PROT_NONE pages
are not accessible anyway.

With commit 2f4b829c625e ("arm64: Add support for hardware updates of
the access and dirty pte bits"), the ptep_set_wrprotect() function was
re-written to cope with automatic hardware updates of the dirty state.
As an optimisation, only PTE_RDONLY is checked to assess the "dirty"
status. Since set_pte_at() does not set this bit for PROT_NONE mappings,
such pages may be considered "dirty" as a result of
ptep_set_wrprotect().

This patch updates the pte_valid() check to pte_present() in
set_pte_at(). It also adds PTE_PROT_NONE to the swap entry bits comment.

Fixes: 2f4b829c625e ("arm64: Add support for hardware updates of the access and dirty pte bits")
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Reported-by: Ganapatrao Kulkarni <gkulkarni@caviumnetworks.com>
Tested-by: Ganapatrao Kulkarni <gkulkarni@cavium.com>
Cc: <stable@vger.kernel.org>
(cherry picked from commit fdc69e7df3cb24f18a93192641786e5b7ecd1dfe)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoarm64: Honour !PTE_WRITE in set_pte_at() for kernel mappings
Catalin Marinas [Thu, 7 Jan 2016 16:07:20 +0000 (16:07 +0000)]
arm64: Honour !PTE_WRITE in set_pte_at() for kernel mappings

BugLink: http://bugs.launchpad.net/bugs/1566518
Currently, set_pte_at() only checks the software PTE_WRITE bit for user
mappings when it sets or clears the hardware PTE_RDONLY accordingly. The
kernel ptes are written directly without any modification, relying
solely on the protection bits in macros like PAGE_KERNEL. However,
modifying kernel pte attributes via pte_wrprotect() would be ignored by
set_pte_at(). Since pte_wrprotect() does not set PTE_RDONLY (it only
clears PTE_WRITE), the new permission is not taken into account.

This patch changes set_pte_at() to adjust the read-only permission for
kernel ptes as well. As a side effect, existing PROT_* definitions used
for kernel ioremap*() need to include PTE_DIRTY | PTE_WRITE.

(additionally, white space fix for PTE_KERNEL_ROX)

Acked-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Reported-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
(cherry picked from commit ac15bd63bbb24238f763ec5b24ee175ec301e8cd)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: SAUCE: (noup) usb: fix regression in SuperSpeed endpoint descriptor parsing
Mathias Nyman [Tue, 29 Mar 2016 10:47:09 +0000 (13:47 +0300)]
UBUNTU: SAUCE: (noup) usb: fix regression in SuperSpeed endpoint descriptor parsing

BugLink: http://bugs.launchpad.net/bugs/1519623
https://git.kernel.org/cgit/linux/kernel/git/gregkh/usb.git/commit/?h=usb-linus&id=59b9023c356c54e5f468029fa504461d04c0f02b

commit b37d83a6a414 ("usb: Parse the new USB 3.1 SuperSpeedPlus Isoc
endpoint companion descriptor") caused a regression in 4.6-rc1 and fails
to parse SuperSpeed endpoint companion descriptors.

The new SuperSpeedPlus Isoc endpoint companion parsing code incorrectly
decreased the the remaining buffer size before comparing the size with the
expected length of the descriptor.

This lead to possible failure in reading the SuperSpeed endpoint companion
descriptor of the last endpoint, displaying a message like:

"No SuperSpeed endpoint companion for config 1 interface 0 altsetting 0
 ep 129: using minimum values"

Fix it by decreasing the size after comparing it.
Also finish all the SS endpoint companion parsing before calling SSP isoc
endpoint parsing function.

Fixes: b37d83a6a414
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoxhci: Support extended burst isoc TRB structure used by xhci 1.1 for USB 3.1
Mathias Nyman [Fri, 12 Feb 2016 14:40:18 +0000 (16:40 +0200)]
xhci: Support extended burst isoc TRB structure used by xhci 1.1 for USB 3.1

BugLink: http://bugs.launchpad.net/bugs/1519623
The transfer burst count (TBC) field in the Isoc TRB does not fit the new
larger burst count available for USB 3.1 SSP Isoc tranfers.
xhci 1.1 solved this by reusing the TD size field for transfer burst count.
The Mult field was outgrown as well. xhci 1.1  controllers can calculate
Mult itself and is not set if the new layout is used.

xhci 1.1 controllers that support the new Isoc TRB format expose a
Extended TBC Capability (ETC). To take the new format into use the xhci
host controller driver needs to set a Extended TBC Enable (ETE) bit.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 2f6d3b653777e68bbccfdcff3de2ea8165934531)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoxhci: cleanup isoc tranfers queuing code
Mathias Nyman [Fri, 12 Feb 2016 14:40:17 +0000 (16:40 +0200)]
xhci: cleanup isoc tranfers queuing code

BugLink: http://bugs.launchpad.net/bugs/1519623
Clean up xhci_queue_isoc_tx() and helpers to prepare them for USB 3.1 and
xhci 1.1 isoc TRB changes.

Only functional change is adding xhci version 1.1 to the BEI flag check
toghether with xhci version 1.0. Both versions behave the same.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 09c352ed671c156b7ce30c81a4f4424641859918)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoxhci: Add SuperSpeedPlus high bandwidth isoc support to xhci endpoints
Mathias Nyman [Fri, 12 Feb 2016 14:40:16 +0000 (16:40 +0200)]
xhci: Add SuperSpeedPlus high bandwidth isoc support to xhci endpoints

BugLink: http://bugs.launchpad.net/bugs/1519623
SuperSpeedPlus doubled the number of transactions per service interval
the isoc endpoints supports.

To support this, xhci 1.1 added Large ESIT Capability (LEC), which
takes into use new bits in the endpoint context to fit the parameters.

If xhci supports LEC, and the device has a SuperSpeedPlus Isoc companion
descriptor then take into use the high bits of max esit payload, and
skip calculating the Mult field as it wouldn't fit. LEC capable
host will calculate the Mult based on other paramenters.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 8ef8a9f5c148ae1dbeae926e5b6129e396faded2)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoxhci: refactor and cleanup endpoint initialization.
Mathias Nyman [Fri, 12 Feb 2016 14:40:15 +0000 (16:40 +0200)]
xhci: refactor and cleanup endpoint initialization.

BugLink: http://bugs.launchpad.net/bugs/1519623
xhci_endpoint_init() and helper functions were a bit messy.
Adding the higher bandwidth SuperSpeedPlus Isoc support on
top of it would make it even harder to read.

No functional changes.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit def4e6f7b419c4092c82222d0896d6c409692326)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agousb: Add USB 3.1 Precision time measurement capability descriptor support
Mathias Nyman [Fri, 12 Feb 2016 14:40:14 +0000 (16:40 +0200)]
usb: Add USB 3.1 Precision time measurement capability descriptor support

BugLink: http://bugs.launchpad.net/bugs/1519623
USB 3.1 devices that support precision time measurement have an
additional PTM cabaility descriptor as part of the full BOS descriptor

Look for this descriptor while parsing the BOS descriptor, and store it in
struct usb_hub_bos if it exists.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit faee822c5a7ab99de25cd34fcde3f8d37b6b9923)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agousb: Parse the new USB 3.1 SuperSpeedPlus Isoc endpoint companion descriptor
Mathias Nyman [Fri, 12 Feb 2016 14:40:13 +0000 (16:40 +0200)]
usb: Parse the new USB 3.1 SuperSpeedPlus Isoc endpoint companion descriptor

BugLink: http://bugs.launchpad.net/bugs/1519623
USB 3.1 devices can return a new SuperSpeedPlus isoc endpoint companion
descriptor for a isochronous endpoint that requires more than 48K bytes
per Service Interval.

The new descriptor immediately follows the old USB 3.0 SuperSpeed Endpoint
Companion and will provide a new BytesPerInterval value.

It is parsed and stored in struct usb_host_endpoint with the other endpoint
related descriptors, and should be used by USB3.1 capable hosts to reserve
bus time in the schedule.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit b37d83a6a41499d582b8faedff1913ec75d9e70b)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agousb: Add USB3.1 SuperSpeedPlus Isoc Endpoint Companion descriptor
Mathias Nyman [Fri, 12 Feb 2016 14:40:12 +0000 (16:40 +0200)]
usb: Add USB3.1 SuperSpeedPlus Isoc Endpoint Companion descriptor

BugLink: http://bugs.launchpad.net/bugs/1519623
USB3.1 specifies a SuperSpeedPlus Isoc endpoint companion descriptor
which is returned as part of the devices complete configuration
descriptor.

It contains number of bytes per service interval which is needed when
reserving bus time in the schedule for transfers over 48K bytes per
service interval.

If bmAttributes bit 7 is set in the old SuperSpeed Endpoint Companion
descriptor, it will be ollowed by the new SuperSpeedPlus Isoc Endpoint
Companion descriptor.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit c8b1d8977eee3acc63a65811dd72ec4a93b74388)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoxhci: set slot context speed field to SuperSpeedPlus for USB 3.1 SSP devices
Mathias Nyman [Mon, 25 Jan 2016 13:30:47 +0000 (15:30 +0200)]
xhci: set slot context speed field to SuperSpeedPlus for USB 3.1 SSP devices

BugLink: http://bugs.launchpad.net/bugs/1519623
The speed field of the input slot context should represent the speed the
device is working at.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit d78540419866887345cec480016b0f87f6a5aca2)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoxhci: USB 3.1 add default Speed Attributes to SuperSpeedPlus device capability
Mathias Nyman [Mon, 25 Jan 2016 13:30:46 +0000 (15:30 +0200)]
xhci: USB 3.1 add default Speed Attributes to SuperSpeedPlus device capability

BugLink: http://bugs.launchpad.net/bugs/1519623
If a xhci controller does not provide a protocol speed ID (PSI) table, a
default one should be used instead. Add the default values to the
SuperSpeedPlus device capability. Overwrite the default ones if a PSI table
exists. See xHCI 1.1 sectio 7.2.2.1.1 for more info

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 5da665fcec1a308f5273aacb9da8e87b89da8b4f)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoxhci: set roothub speed to USB_SPEED_SUPER_PLUS for USB3.1 capable controllers
Mathias Nyman [Mon, 25 Jan 2016 13:30:45 +0000 (15:30 +0200)]
xhci: set roothub speed to USB_SPEED_SUPER_PLUS for USB3.1 capable controllers

BugLink: http://bugs.launchpad.net/bugs/1519623
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 2c0e06f8829a542e71b14ffcaa14b8fafa2223c3)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoxhci: Make sure xhci handles USB_SPEED_SUPER_PLUS devices.
Mathias Nyman [Mon, 25 Jan 2016 13:30:44 +0000 (15:30 +0200)]
xhci: Make sure xhci handles USB_SPEED_SUPER_PLUS devices.

BugLink: http://bugs.launchpad.net/bugs/1519623
In most cases the devices with the speed set to USB_SPEED_SUPER_PLUS
are handled like regular SuperSpeed devices.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 0caf6b33452112e5a1186c8c964e90310e49e6bd)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agousb: Support USB 3.1 extended port status request
Mathias Nyman [Thu, 10 Dec 2015 07:59:29 +0000 (09:59 +0200)]
usb: Support USB 3.1 extended port status request

BugLink: http://bugs.launchpad.net/bugs/1519623
usb 3.1 extend the hub get-port-status request by adding different
request types. the new request types return 4 additional bytes called
extended port status, these bytes are returned after the regular
portstatus and portchange values.

The extended port status contains a speed ID for the currently used
sublink speed. A table of supported Speed IDs with details about the link
is provided by the hub in the device descriptor BOS SuperSpeedPlus
device capability Sublink Speed Attributes.

Support this new request. Ask for the extended port status after port
reset if hub supports USB 3.1. If link is running at SuperSpeedPlus
set the device speed to USB_SPEED_SUPER_PLUS

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 0cdd49a1d1a483d80170d9e592f832274e8bce1b)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agousb: add device descriptor for usb 3.1 root hub
Mathias Nyman [Thu, 10 Dec 2015 07:59:28 +0000 (09:59 +0200)]
usb: add device descriptor for usb 3.1 root hub

BugLink: http://bugs.launchpad.net/bugs/1519623
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 9508e3b7a70c11370d70252147b75d3024754970)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agousb: show speed "10000" in sysfs for USB 3.1 SuperSpeedPlus devices
Mathias Nyman [Thu, 10 Dec 2015 07:59:27 +0000 (09:59 +0200)]
usb: show speed "10000" in sysfs for USB 3.1 SuperSpeedPlus devices

BugLink: http://bugs.launchpad.net/bugs/1519623
The same way as SuperSpeed devices show "5000" as device speed we wan't to
show "10000" as the default speed for SuperSpeedPlus devices in sysfs.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit b2316645ca5ea93eb8f637f57199fbbe88bee07d)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agousb: set USB 3.1 roothub device speed to USB_SPEED_SUPER_PLUS
Mathias Nyman [Thu, 10 Dec 2015 07:59:26 +0000 (09:59 +0200)]
usb: set USB 3.1 roothub device speed to USB_SPEED_SUPER_PLUS

BugLink: http://bugs.launchpad.net/bugs/1519623
A hcd roothub that supports HCD_USB31 is running at SuperSpeedPlus speed

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 5f9c3a668b3f75768aec686901d7a4c8782983df)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agousb: define USB_SPEED_SUPER_PLUS speed for SuperSpeedPlus USB3.1 devices
Mathias Nyman [Thu, 10 Dec 2015 07:59:25 +0000 (09:59 +0200)]
usb: define USB_SPEED_SUPER_PLUS speed for SuperSpeedPlus USB3.1 devices

BugLink: http://bugs.launchpad.net/bugs/1519623
Add a new USB_SPEED_SUPER_PLUS device speed, and make sure usb core can
handle the new speed.
In most cases the behaviour is the same as with USB_SPEED_SUPER SuperSpeed
devices. In a few places we add a "Plus" string to inform the user of the
new speed.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 8a1b2725a60d3267135c15e80984b4406054f650)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: SAUCE: apparmor: Fix FTBFS due to bad include path
Tyler Hicks [Tue, 5 Apr 2016 17:35:23 +0000 (12:35 -0500)]
UBUNTU: SAUCE: apparmor: Fix FTBFS due to bad include path

When header files in security/apparmor/includes/ pull in other header
files in that directory, they should only include the file name. This
fixes a build failure reported by Tycho when using `make bindeb-pkg` to
build the Ubuntu kernel tree but, confusingly, isn't seen when building
with `fakeroot debian/rules binary-generic`.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Reported-by: Tycho Andersen <tycho.andersen@canonical.com>
Cc: John Johansen <john.johansen@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agos390/crypto: provide correct file mode at device register.
Harald Freudenberger [Thu, 17 Mar 2016 13:52:17 +0000 (14:52 +0100)]
s390/crypto: provide correct file mode at device register.

BugLink: http://bugs.launchpad.net/bugs/1558275
When the prng device driver calls misc_register() there is the possibility
to also provide the recommented file permissions. This fix now gives
useful values (0644) where previously just the default was used (resulting
in 0600 for the device file).

Signed-off-by: Harald Freudenberger <freude@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
(cherry picked from commit 74b2375e6767935e6d9220bdbc6ed0db57f71a59)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoALSA: hda - fix front mic problem for a HP desktop
Hui Wang [Fri, 1 Apr 2016 03:00:15 +0000 (11:00 +0800)]
ALSA: hda - fix front mic problem for a HP desktop

BugLink: http://bugs.launchpad.net/bugs/1564712
The front mic jack (pink color) can't detect any plug or unplug. After
applying this fix, both detecting function and recording function
work well.

BugLink: https://bugs.launchpad.net/bugs/1564712
Cc: stable@vger.kernel.org
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(back ported from commit e549d190f7b5f94e9ab36bd965028112914d010d)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
 Conflicts:
sound/pci/hda/patch_realtek.c

8 years agoALSA: hda - Apply reboot D3 fix for CX20724 codec, too
Takashi Iwai [Thu, 10 Mar 2016 10:33:43 +0000 (11:33 +0100)]
ALSA: hda - Apply reboot D3 fix for CX20724 codec, too

BugLink: http://bugs.launchpad.net/bugs/1556228
Just like CX20722, CX7024 codec also requires the power down at reboot
in order to reduce the noise at reboot/shutdown.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=113511
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit 56dc66ff1c6d71f9a38c4a7c000b72b921fe4c89)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: [Config] Add mmc block drivers to d-i
Tim Gardner [Tue, 5 Apr 2016 13:52:34 +0000 (14:52 +0100)]
UBUNTU: [Config] Add mmc block drivers to d-i

BugLink: http://bugs.launchpad.net/bugs/1565765
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agohibernate: Disable in a signed modules environment
Josh Boyer [Fri, 20 Jun 2014 12:53:24 +0000 (08:53 -0400)]
hibernate: Disable in a signed modules environment

BugLink: http://bugs.launchpad.net/bugs/1566221
There is currently no way to verify the resume image when returning
from hibernate.  This might compromise the signed modules trust model,
so until we can work with signed hibernate images we disable it in
a secure modules environment.

Signed-off-by: Josh Boyer <jwboyer@fedoraproject.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoefi: Add EFI_SECURE_BOOT bit
Josh Boyer [Tue, 27 Aug 2013 17:33:03 +0000 (13:33 -0400)]
efi: Add EFI_SECURE_BOOT bit

BugLink: http://bugs.launchpad.net/bugs/1566221
UEFI machines can be booted in Secure Boot mode.  Add a EFI_SECURE_BOOT bit
for use with efi_enabled.

Signed-off-by: Josh Boyer <jwboyer@fedoraproject.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoefi: Make EFI_SECURE_BOOT_SIG_ENFORCE depend on EFI
Josh Boyer [Tue, 27 Aug 2013 17:28:43 +0000 (13:28 -0400)]
efi: Make EFI_SECURE_BOOT_SIG_ENFORCE depend on EFI

BugLink: http://bugs.launchpad.net/bugs/1566221
The functionality of the config option is dependent upon the platform being
UEFI based.  Reflect this in the config deps.

Signed-off-by: Josh Boyer <jwboyer@fedoraproject.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoAdd option to automatically enforce module signatures when in Secure Boot mode
Matthew Garrett [Fri, 9 Aug 2013 22:36:30 +0000 (18:36 -0400)]
Add option to automatically enforce module signatures when in Secure Boot mode

BugLink: http://bugs.launchpad.net/bugs/1566221
UEFI Secure Boot provides a mechanism for ensuring that the firmware will
only load signed bootloaders and kernels. Certain use cases may also
require that all kernel modules also be signed. Add a configuration option
that enforces this automatically when enabled.

Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: [Config] CONFIG_EFI_SECURE_BOOT_SIG_ENFORCE=n
Tim Gardner [Tue, 29 Mar 2016 15:35:43 +0000 (09:35 -0600)]
UBUNTU: [Config] CONFIG_EFI_SECURE_BOOT_SIG_ENFORCE=n

BugLink: http://bugs.launchpad.net/bugs/1566221
Defer enforcing signed module loading, but other secure boot
checks are still valid.

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agox86: Restrict MSR access when module loading is restricted
Matthew Garrett [Fri, 8 Feb 2013 19:12:13 +0000 (11:12 -0800)]
x86: Restrict MSR access when module loading is restricted

BugLink: http://bugs.launchpad.net/bugs/1566221
Writing to MSRs should not be allowed if module loading is restricted,
since it could lead to execution of arbitrary code in kernel mode. Based
on a patch by Kees Cook.

Cc: Kees Cook <keescook@chromium.org>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agokexec: Disable at runtime if the kernel enforces module loading restrictions
Matthew Garrett [Fri, 20 Nov 2015 02:55:53 +0000 (18:55 -0800)]
kexec: Disable at runtime if the kernel enforces module loading restrictions

BugLink: http://bugs.launchpad.net/bugs/1566221
kexec permits the loading and execution of arbitrary code in ring 0, which
is something that module signing enforcement is meant to prevent. It makes
sense to disable kexec in this situation.

Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoacpi: Ignore acpi_rsdp kernel parameter when module loading is restricted
Josh Boyer [Mon, 25 Jun 2012 23:57:30 +0000 (19:57 -0400)]
acpi: Ignore acpi_rsdp kernel parameter when module loading is restricted

BugLink: http://bugs.launchpad.net/bugs/1566221
This option allows userspace to pass the RSDP address to the kernel, which
makes it possible for a user to circumvent any restrictions imposed on
loading modules. Disable it in that case.

Signed-off-by: Josh Boyer <jwboyer@redhat.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoRestrict /dev/mem and /dev/kmem when module loading is restricted
Matthew Garrett [Fri, 9 Mar 2012 14:28:15 +0000 (09:28 -0500)]
Restrict /dev/mem and /dev/kmem when module loading is restricted

BugLink: http://bugs.launchpad.net/bugs/1566221
Allowing users to write to address space makes it possible for the kernel
to be subverted, avoiding module loading restrictions. Prevent this when
any restrictions have been imposed on loading modules.

Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoasus-wmi: Restrict debugfs interface when module loading is restricted
Matthew Garrett [Fri, 9 Mar 2012 13:46:50 +0000 (08:46 -0500)]
asus-wmi: Restrict debugfs interface when module loading is restricted

BugLink: http://bugs.launchpad.net/bugs/1566221
We have no way of validating what all of the Asus WMI methods do on a
given machine, and there's a risk that some will allow hardware state to
be manipulated in such a way that arbitrary code can be executed in the
kernel, circumventing module loading restrictions. Prevent that if any of
these features are enabled.

Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoACPI: Limit access to custom_method
Matthew Garrett [Fri, 9 Mar 2012 13:39:37 +0000 (08:39 -0500)]
ACPI: Limit access to custom_method

BugLink: http://bugs.launchpad.net/bugs/1566221
custom_method effectively allows arbitrary access to system memory, making
it possible for an attacker to circumvent restrictions on module loading.
Disable it if any such restrictions have been enabled.

Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agox86: Lock down IO port access when module security is enabled
Matthew Garrett [Thu, 8 Mar 2012 15:35:59 +0000 (10:35 -0500)]
x86: Lock down IO port access when module security is enabled

BugLink: http://bugs.launchpad.net/bugs/1566221
IO port access would permit users to gain access to PCI configuration
registers, which in turn (on a lot of hardware) give access to MMIO register
space. This would potentially permit root to trigger arbitrary DMA, so lock
it down by default.

Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoPCI: Lock down BAR access when module security is enabled
Matthew Garrett [Thu, 8 Mar 2012 15:10:38 +0000 (10:10 -0500)]
PCI: Lock down BAR access when module security is enabled

BugLink: http://bugs.launchpad.net/bugs/1566221
Any hardware that can potentially generate DMA has to be locked down from
userspace in order to avoid it being possible for an attacker to modify
kernel code, allowing them to circumvent disabled module loading or module
signing. Default to paranoid - in future we can potentially relax this for
sufficiently IOMMU-isolated devices.

Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoAdd secure_modules() call
Matthew Garrett [Fri, 9 Aug 2013 21:58:15 +0000 (17:58 -0400)]
Add secure_modules() call

BugLink: http://bugs.launchpad.net/bugs/1566221
Provide a single call to allow kernel code to determine whether the system
has been configured to either disable module loading entirely or to load
only modules signed with a trusted key.

Bugzilla: N/A
Upstream-status: Fedora mustard.  Replaced by securelevels, but that was nak'd

Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: [Config] do_zfs_powerpc64-smp use default value
Andy Whitcroft [Tue, 5 Apr 2016 09:40:46 +0000 (10:40 +0100)]
UBUNTU: [Config] do_zfs_powerpc64-smp use default value

Signed-off-by: Andy Whitcroft <apw@canonical.com>
8 years agoPCI: hv: Add paravirtual PCI front-end for Microsoft Hyper-V VMs
Jake Oshins [Tue, 16 Feb 2016 21:56:23 +0000 (21:56 +0000)]
PCI: hv: Add paravirtual PCI front-end for Microsoft Hyper-V VMs

BugLink: http://bugs.launchpad.net/bugs/1565967
Add a new driver which exposes a root PCI bus whenever a PCI Express device
is passed through to a guest VM under Hyper-V.  The device can be single-
or multi-function.  The interrupts for the devices are managed by an IRQ
domain, implemented within the driver.

[bhelgaas: fold in race condition fix (http://lkml.kernel.org/r/1456340196-13717-1-git-send-email-jakeo@microsoft.com)]
Signed-off-by: Jake Oshins <jakeo@microsoft.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
(cherry picked from commit 4daace0d8ce851f8f8f91563c835e3000c954d5e)

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: [Config] CONFIG_PCI_HYPERV=m
Tim Gardner [Tue, 5 Apr 2016 07:35:50 +0000 (08:35 +0100)]
UBUNTU: [Config] CONFIG_PCI_HYPERV=m

BugLink: http://bugs.launchpad.net/bugs/1565967
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoPCI: Look up IRQ domain by fwnode_handle
Jake Oshins [Tue, 16 Feb 2016 21:56:22 +0000 (21:56 +0000)]
PCI: Look up IRQ domain by fwnode_handle

BugLink: http://bugs.launchpad.net/bugs/1565967
If pci_host_bridge_msi_domain() can't find an IRQ domain through the OF
tree, try to look it up directly through the fwnode_handle.

[bhelgaas: changelog]
Signed-off-by: Jake Oshins <jakeo@microsoft.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
(cherry picked from commit 788858ebc49a07fe5f812778f245a51b0d800d82)

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoPCI: Add fwnode_handle to x86 pci_sysdata
Jake Oshins [Tue, 16 Feb 2016 21:56:21 +0000 (21:56 +0000)]
PCI: Add fwnode_handle to x86 pci_sysdata

BugLink: http://bugs.launchpad.net/bugs/1565967
Add an fwnode_handle to the x86 struct pci_sysdata, which will be used to
locate an IRQ domain associated with a root PCI bus.

[bhelgaas: changelog]
Signed-off-by: Jake Oshins <jakeo@microsoft.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
(cherry picked from commit 92016ba5c1d71fbe4e9952df518b5386f2a0556b)

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoACPI / processor: Request native thermal interrupt handling via _OSC
Srinivas Pandruvada [Thu, 24 Mar 2016 04:07:39 +0000 (21:07 -0700)]
ACPI / processor: Request native thermal interrupt handling via _OSC

BugLink: http://bugs.launchpad.net/bugs/1559923
There are several reports of freeze on enabling HWP (Hardware PStates)
feature on Skylake-based systems by the Intel P-states driver. The root
cause is identified as the HWP interrupts causing BIOS code to freeze.

HWP interrupts use the thermal LVT which can be handled by Linux
natively, but on the affected Skylake-based systems SMM will respond
to it by default.  This is a problem for several reasons:
 - On the affected systems the SMM thermal LVT handler is broken (it
   will crash when invoked) and a BIOS update is necessary to fix it.
 - With thermal interrupt handled in SMM we lose all of the reporting
   features of the arch/x86/kernel/cpu/mcheck/therm_throt driver.
 - Some thermal drivers like x86-package-temp depend on the thermal
   threshold interrupts signaled via the thermal LVT.
 - The HWP interrupts are useful for debugging and tuning
   performance (if the kernel can handle them).
The native handling of thermal interrupts needs to be enabled
because of that.

This requires some way to tell SMM that the OS can handle thermal
interrupts.  That can be done by using _OSC/_PDC in processor
scope very early during ACPI initialization.

The meaning of _OSC/_PDC bit 12 in processor scope is whether or
not the OS supports native handling of interrupts for Collaborative
Processor Performance Control (CPPC) notifications.  Since on
HWP-capable systems CPPC is a firmware interface to HWP, setting
this bit effectively tells the firmware that the OS will handle
thermal interrupts natively going forward.

For details on _OSC/_PDC refer to:
http://www.intel.com/content/www/us/en/standards/processor-vendor-specific-acpi-specification.html

To implement the _OSC/_PDC handshake as described, introduce a new
function, acpi_early_processor_osc(), that walks the ACPI
namespace looking for ACPI processor objects and invokes _OSC for
them with bit 12 in the capabilities buffer set and terminates the
namespace walk on the first success.

Also modify intel_thermal_interrupt() to clear HWP status bits in
the HWP_STATUS MSR to acknowledge HWP interrupts (which prevents
them from firing continuously).

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
[ rjw: Subject & changelog, function rename ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit a21211672c9a1d730a39aa65d4a5b3414700adfb)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: SAUCE: (noup) Update spl to 0.6.5.6-0ubuntu1, zfs to 0.6.5.6-0ubuntu3
Colin Ian King [Thu, 31 Mar 2016 19:07:47 +0000 (15:07 -0400)]
UBUNTU: SAUCE: (noup) Update spl to 0.6.5.6-0ubuntu1, zfs to 0.6.5.6-0ubuntu3

Fixes two issues:
 * Add support 32 bit FS_IOC32_{GET|SET}FLAGS compat ioctls
   for (powerpc64 big endian mode)
 * Fix aarch64 compilation, missing hrtime_t and timestruc_t types

BugLink: http://bugs.launchpad.net/bugs/1564591
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agopowerpc: atomic: Implement acquire/release/relaxed variants for cmpxchg
Boqun Feng [Tue, 15 Dec 2015 14:24:17 +0000 (22:24 +0800)]
powerpc: atomic: Implement acquire/release/relaxed variants for cmpxchg

BugLink: http://bugs.launchpad.net/bugs/1556096
Implement cmpxchg{,64}_relaxed and atomic{,64}_cmpxchg_relaxed, based on
which _release variants can be built.

To avoid superfluous barriers in _acquire variants, we implement these
operations with assembly code rather use __atomic_op_acquire() to build
them automatically.

For the same reason, we keep the assembly implementation of fully
ordered cmpxchg operations.

However, we don't do the similar for _release, because that will require
putting barriers in the middle of ll/sc loops, which is probably a bad
idea.

Note cmpxchg{,64}_relaxed and atomic{,64}_cmpxchg_relaxed are not
compiler barriers.

Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit 56c08e6d226c860ad097fa6ba109133228c56722)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agopowerpc: atomic: Implement acquire/release/relaxed variants for xchg
Boqun Feng [Tue, 15 Dec 2015 14:24:16 +0000 (22:24 +0800)]
powerpc: atomic: Implement acquire/release/relaxed variants for xchg

BugLink: http://bugs.launchpad.net/bugs/1556096
Implement xchg{,64}_relaxed and atomic{,64}_xchg_relaxed, based on these
_relaxed variants, release/acquire variants and fully ordered versions
can be built.

Note that xchg{,64}_relaxed and atomic_{,64}_xchg_relaxed are not
compiler barriers.

Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit 26760fc19a7e663e4f49d586aca6740fb21d887d)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agopowerpc: atomic: Implement atomic{, 64}_*_return_* variants
Boqun Feng [Wed, 6 Jan 2016 02:08:25 +0000 (10:08 +0800)]
powerpc: atomic: Implement atomic{, 64}_*_return_* variants

BugLink: http://bugs.launchpad.net/bugs/1556096
On powerpc, acquire and release semantics can be achieved with
lightweight barriers("lwsync" and "ctrl+isync"), which can be used to
implement __atomic_op_{acquire,release}.

For release semantics, since we only need to ensure all memory accesses
that issue before must take effects before the -store- part of the
atomics, "lwsync" is what we only need. On the platform without
"lwsync", "sync" should be used. Therefore in __atomic_op_release() we
use PPC_RELEASE_BARRIER.

For acquire semantics, "lwsync" is what we only need for the similar
reason.  However on the platform without "lwsync", we can use "isync"
rather than "sync" as an acquire barrier. Therefore in
__atomic_op_acquire() we use PPC_ACQUIRE_BARRIER, which is barrier() on
UP, "lwsync" if available and "isync" otherwise.

Implement atomic{,64}_{add,sub,inc,dec}_return_relaxed, and build other
variants with these helpers.

Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit dc53617c4a3f6ca35641dfd4279720365ce9f4da)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoatomics: Allow architectures to define their own __atomic_op_* helpers
Boqun Feng [Tue, 15 Dec 2015 14:24:14 +0000 (22:24 +0800)]
atomics: Allow architectures to define their own __atomic_op_* helpers

BugLink: http://bugs.launchpad.net/bugs/1556096
Some architectures may have their special barriers for acquire, release
and fence semantics, so that general memory barriers(smp_mb__*_atomic())
in the default __atomic_op_*() may be too strong, so allow architectures
to define their own helpers which can overwrite the default helpers.

Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit e1ab7f39d7e0dbfbdefe148be3ae4ee121e47ecc)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: [Debian] fix linux_tools when cross-compiling
David Leonard [Wed, 30 Mar 2016 01:38:21 +0000 (11:38 +1000)]
UBUNTU: [Debian] fix linux_tools when cross-compiling

Fixed invocation of dh_shlibdeps when cross-compiling with
do_linux_tools=true.
Without being told where to find the crossdev libs, dh_shlibdeps
will emit these warnings and fail the linux-tools package:

  Debug: binary-acm7xxx
  ...
  dh_shlibdeps -plinux-headers-4.4.0-15-generic
  arm-linux-gnueabihf-objdump: .../asn1_compiler: File format not recognized
  arm-linux-gnueabihf-objdump: .../extract-cert: File format not recognized
  ...

For example:

archtriple=arm-linux-gnueabihf
         flavour=generic
         dpkg-architecture -t $archtriple -c fakeroot \
                debian/rules \
                binary-$flavour binary-perarch \
                AUTOBUILD=true \
                abi_suffix= \
                do_linux_tools=true \
                do_tools=true \
                do_tools_usbip=false \
                do_tools_cpupower=false \
                do_tools_perf=true \
                do_tools_x86=false

Signed-off-by: David Leonard <david.leonard@opengear.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: [Debian] cpupower uses non-standard CROSS
Tim Gardner [Thu, 31 Mar 2016 12:43:53 +0000 (06:43 -0600)]
UBUNTU: [Debian] cpupower uses non-standard CROSS

BugLink: http://bugs.launchpad.net/bugs/1564206
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: SAUCE: block: partition: initialize percpuref before sending out KOBJ_ADD
Ming Lei [Tue, 29 Mar 2016 03:47:48 +0000 (11:47 +0800)]
UBUNTU: SAUCE: block: partition: initialize percpuref before sending out KOBJ_ADD

BugLink: http://bugs.launchpad.net/bugs/1546439
The initialization of partition's percpu_ref should have been done before
sending out KOBJ_ADD, which may cause userspace to read partition table.

This patch should fix this issue.

Reported-by: Naveen Kaje <nkaje@codeaurora.org>
Fixes: 6c71013ecb7e2(block: partition: convert percpu ref)
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: SAUCE: cgroup mount: ignore nsroot=
Serge Hallyn [Wed, 30 Mar 2016 18:19:32 +0000 (18:19 +0000)]
UBUNTU: SAUCE: cgroup mount: ignore nsroot=

BugLink: http://bugs.launchpad.net/bugs/1563921
our mountinfo output now shows 'nsroot='.  If userspace like
criu copy/pastes mount options from there into a new mount
command, we should ignore it.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Tested-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: [Config] do_zfs_powerpc64-smp = true
Tim Gardner [Wed, 30 Mar 2016 16:05:25 +0000 (10:05 -0600)]
UBUNTU: [Config] do_zfs_powerpc64-smp  = true

cking> so, all the ZFS tests on powerpc64 pass except one test, which is ioctl
FS_IOC_GETFLAGS where the cmd is being barfed up somewhere in the ioctl 32/64
thunking. I've filed a bug upstream. Since that ioctl is not frequently used,
I think we should enable powerpc64 and fix up the ioctl as a SRU later on.

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agohv_netvsc: Move subchannel waiting to rndis_filter_device_remove()
Haiyang Zhang [Fri, 4 Mar 2016 23:07:43 +0000 (15:07 -0800)]
hv_netvsc: Move subchannel waiting to rndis_filter_device_remove()

BugLink: http://bugs.launchpad.net/bugs/1563688
During hot add, vmbus_device_register() is called from vmbus_onoffer(), on
the same workqueue as the subchannel offer message work-queue, so
subchannel offer won't be processed until the vmbus_device_register()/...
/netvsc_probe() is done.
Also, vmbus_device_register() is called with channel_mutex locked, which
prevents subchannel processing too. So the "waiting for sub-channel
processing" will not success in hot add case. But, in usual module loading,
the netvsc_probe() is called from different code path, and doesn't fail.

This patch resolves the deadlock during NIC hot-add, and speeds up NIC
loading time.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit d66ab51442211158b677c2f12310c314d9587f74)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoproc: revert /proc/<pid>/maps [stack:TID] annotation
Johannes Weiner [Wed, 3 Feb 2016 00:57:29 +0000 (16:57 -0800)]
proc: revert /proc/<pid>/maps [stack:TID] annotation

BugLink: http://bugs.launchpad.net/bugs/1547231
Commit b76437579d13 ("procfs: mark thread stack correctly in
proc/<pid>/maps") added [stack:TID] annotation to /proc/<pid>/maps.

Finding the task of a stack VMA requires walking the entire thread list,
turning this into quadratic behavior: a thousand threads means a
thousand stacks, so the rendering of /proc/<pid>/maps needs to look at a
million combinations.

The cost is not in proportion to the usefulness as described in the
patch.

Drop the [stack:TID] annotation to make /proc/<pid>/maps (and
/proc/<pid>/numa_maps) usable again for higher thread counts.

The [stack] annotation inside /proc/<pid>/task/<tid>/maps is retained, as
identifying the stack VMA there is an O(1) operation.

Siddesh said:
 "The end users needed a way to identify thread stacks programmatically and
  there wasn't a way to do that.  I'm afraid I no longer remember (or have
  access to the resources that would aid my memory since I changed
  employers) the details of their requirement.  However, I did do this on my
  own time because I thought it was an interesting project for me and nobody
  really gave any feedback then as to its utility, so as far as I am
  concerned you could roll back the main thread maps information since the
  information is available in the thread-specific files"

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
Cc: Siddhesh Poyarekar <siddhesh.poyarekar@gmail.com>
Cc: Shaohua Li <shli@fb.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 65376df582174ffcec9e6471bf5b0dd79ba05e4a)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agotpm_tis: fix build warning with tpm_tis_resume
Jarkko Sakkinen [Mon, 22 Feb 2016 14:09:12 +0000 (16:09 +0200)]
tpm_tis: fix build warning with tpm_tis_resume

BugLink: http://bugs.launchpad.net/bugs/1398274
drivers/char/tpm/tpm_tis.c:838: warning: ‘tpm_tis_resume’ defined but
not used

Reported-by: James Morris <jmorris@namei.org>
Fixes: 00194826e6be ("tpm_tis: Clean up the force=1 module parameter")
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
cc: stable@vger.kernel.org
(cherry picked from commit 2cb6d6460f1a171c71c134e0efe3a94c2206d080)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agotpm_crb: tpm2_shutdown() must be called before tpm_chip_unregister()
Jarkko Sakkinen [Thu, 18 Feb 2016 20:11:29 +0000 (22:11 +0200)]
tpm_crb: tpm2_shutdown() must be called before tpm_chip_unregister()

BugLink: http://bugs.launchpad.net/bugs/1398274
Wrong call order.

Reported-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Fixes: 74d6b3ceaa17
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
cc: stable@vger.kernel.org
(cherry picked from commit 99cda8cb4639de81cde785b5bab9bc52e916e594)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agotpm_crb/tis: fix: use dev_name() for /proc/iomem
Jarkko Sakkinen [Wed, 17 Feb 2016 00:10:52 +0000 (02:10 +0200)]
tpm_crb/tis: fix: use dev_name() for /proc/iomem

BugLink: http://bugs.launchpad.net/bugs/1398274
In all cases use dev_name() for the mapped resources. This is both
for sake of consistency and also with some platforms resource name
given by ACPI object seems to return garbage.

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Fixes: 1bd047be37d9 ("tpm_crb: Use devm_ioremap_resource")
(cherry picked from commit 30f9c8c9e2ea37473a51354e9e492580a40661ce)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agotpm_eventlog.c: fix binary_bios_measurements
Harald Hoyer [Sat, 6 Feb 2016 14:44:42 +0000 (15:44 +0100)]
tpm_eventlog.c: fix binary_bios_measurements

BugLink: http://bugs.launchpad.net/bugs/1398274
The commit 0cc698af36ff ("vTPM: support little endian guests") copied
the event, but without the event data, did an endian conversion on the
size and tried to output the event data from the copied version, which
has only have one byte of the data, resulting in garbage event data.

[jarkko.sakkinen@linux.intel.com: fixed minor coding style issues and
 renamed the local variable tempPtr as temp_ptr now that there is an
 excuse to do this.]

Signed-off-by: Harald Hoyer <harald@redhat.com>
Fixes: 0cc698af36ff ("vTPM: support little endian guests")
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
cc: stable@vger.kernel.org
(cherry picked from commit 186d124f07da193a8f47e491af85cb695d415f2f)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agotpm: fix: return rc when devm_add_action() fails
Jarkko Sakkinen [Sat, 13 Feb 2016 09:58:16 +0000 (11:58 +0200)]
tpm: fix: return rc when devm_add_action() fails

BugLink: http://bugs.launchpad.net/bugs/1398274
Call put_device() and return error code if devm_add_action() fails.

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reported-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Fixes: 8e0ee3c9faed ("tpm: fix the cleanup of struct tpm_chip")
(cherry picked from commit 4f3b193dee4423d8c89c9a3e8e05f9197ea459a4)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agotpm: fix: set continueSession attribute for the unseal operation
Jarkko Sakkinen [Sat, 13 Feb 2016 09:51:23 +0000 (11:51 +0200)]
tpm: fix: set continueSession attribute for the unseal operation

BugLink: http://bugs.launchpad.net/bugs/1398274
It's better to set the continueSession attribute for the unseal
operation so that the session object is not removed as a side-effect
when the operation is successful. Since a user process created the
session, it should be also decide when the session is destroyed.

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Fixes: 5beb0c435b ("keys, trusted: seal with a TPM2 authorization policy")
(cherry picked from commit c0b5eed110dcf520aadafefbcc40658cbdd18b95)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agotpm: fix the cleanup of struct tpm_chip
Jarkko Sakkinen [Mon, 8 Feb 2016 20:31:08 +0000 (22:31 +0200)]
tpm: fix the cleanup of struct tpm_chip

BugLink: http://bugs.launchpad.net/bugs/1398274
If the initialization fails before tpm_chip_register(), put_device()
will be not called, which causes release callback not to be called.
This patch fixes the issue by adding put_device() to devres list of
the parent device.

Fixes: 313d21eeab ("tpm: device class for tpm")
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
cc: stable@vger.kernel.org
Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
(cherry picked from commit 8e0ee3c9faed7ca68807ea45141775856c438ac0)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agotpm: fix the rollback in tpm_chip_register()
Jarkko Sakkinen [Fri, 29 Jan 2016 17:47:22 +0000 (09:47 -0800)]
tpm: fix the rollback in tpm_chip_register()

BugLink: http://bugs.launchpad.net/bugs/1398274
Fixed the rollback and gave more self-documenting names for the
functions.

Fixes: d972b0523f ("tpm: fix call order in tpm-chip.c")
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
cc: stable@vger.kernel.org
Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
(cherry picked from commit 72c91ce8523ae5828fe5e4417ae0aaab53707a08)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agotpm_crb: Use devm_ioremap_resource
Jason Gunthorpe [Fri, 8 Jan 2016 00:36:26 +0000 (17:36 -0700)]
tpm_crb: Use devm_ioremap_resource

BugLink: http://bugs.launchpad.net/bugs/1398274
To support the force mode in tpm_tis we need to use resource locking
in tpm_crb as well, via devm_ioremap_resource.

The light restructuring better aligns crb and tis and makes it easier
to see the that new changes make sense.

The control area and its associated buffers do not always fall in the
range of the iomem resource given by the ACPI object. This patch fixes
the issue by mapping the buffers if this is the case.

[jarkko.sakkinen@linux.intel.com: squashed update described in the
 last paragraph.]

Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Acked-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
(cherry picked from commit 1bd047be37d95bf65a219f4931215f71878ac060)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agotpm_crb: Drop le32_to_cpu(ioread32(..))
Jason Gunthorpe [Fri, 8 Jan 2016 00:36:25 +0000 (17:36 -0700)]
tpm_crb: Drop le32_to_cpu(ioread32(..))

BugLink: http://bugs.launchpad.net/bugs/1398274
ioread32 and readl are defined to read from PCI style memory, ie little
endian and return the result in host order. On platforms where a
swap is required ioread32/readl do the swap internally (eg see ppc).

Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Acked-by: Peter Huewe <peterhuewe@gmx.de>
(cherry picked from commit 1e3ed59d6200eb31b554dbdcfdde62d1e3d91f0c)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agotpm_tis: Clean up the force=1 module parameter
Jason Gunthorpe [Fri, 8 Jan 2016 00:36:24 +0000 (17:36 -0700)]
tpm_tis: Clean up the force=1 module parameter

BugLink: http://bugs.launchpad.net/bugs/1398274
The TPM core has long assumed that every device has a driver attached,
however the force path was attaching the TPM core outside of a driver
context. This isn't generally reliable as the user could detatch the
driver using sysfs or something, but commit b8b2c7d845d5 ("base/platform:
assert that dev_pm_domain callbacks are called unconditionally")
forced the issue by leaving the driver pointer NULL if there is
no probe.

Rework the TPM setup to create a platform device with resources and
then allow the driver core to naturally bind and probe it through the
normal mechanisms. All this structure is needed anyhow to enable TPM
for OF environments.

Finally, since the entire flow is changing convert the init/exit to use
the modern ifdef-less coding style when possible

Reported-by: "Wilck, Martin" <martin.wilck@ts.fujitsu.com>
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Tested-by: Wilck, Martin <martin.wilck@ts.fujitsu.com>
Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Acked-by: Peter Huewe <peterhuewe@gmx.de>
(cherry picked from commit 00194826e6be333083ba9ddbd6e83fb423206f8a)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agotpm_tis: Use devm_ioremap_resource
Jason Gunthorpe [Fri, 8 Jan 2016 00:36:23 +0000 (17:36 -0700)]
tpm_tis: Use devm_ioremap_resource

BugLink: http://bugs.launchpad.net/bugs/1398274
This does a request_resource under the covers which means tis holds a
lock on the memory range it is using so other drivers cannot grab it.
When doing probing it is important to ensure that other drivers are
not using the same range before tis starts touching it.

To do this flow the actual struct resource from the device right
through to devm_ioremap_resource. This ensures all the proper resource
meta-data is carried down.

Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Tested-by: Wilck, Martin <martin.wilck@ts.fujitsu.com>
Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Acked-by: Peter Huewe <peterhuewe@gmx.de>
(cherry picked from commit 51dd43dff74b0547ad844638f6910ca29c956819)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agotpm_tis: Do not fall back to a hardcoded address for TPM2
Jason Gunthorpe [Fri, 8 Jan 2016 00:36:22 +0000 (17:36 -0700)]
tpm_tis: Do not fall back to a hardcoded address for TPM2

BugLink: http://bugs.launchpad.net/bugs/1398274
If the ACPI tables do not declare a memory resource for the TPM2
then do not just fall back to the x86 default base address.

Also be stricter when checking the ancillary TPM2 ACPI data and error
out if any of this data is wrong rather than blindly assuming TPM1.

Fixes: 399235dc6e95 ("tpm, tpm_tis: fix tpm_tis ACPI detection issue with TPM 2.0")
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Tested-by: Wilck, Martin <martin.wilck@ts.fujitsu.com>
Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Acked-by: Peter Huewe <peterhuewe@gmx.de>
(cherry picked from commit 4d627e672bd0e8af4e734fef93e806499d1e1277)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agotpm_tis: Disable interrupt auto probing on a per-device basis
Jason Gunthorpe [Fri, 8 Jan 2016 00:36:21 +0000 (17:36 -0700)]
tpm_tis: Disable interrupt auto probing on a per-device basis

BugLink: http://bugs.launchpad.net/bugs/1398274
Instead of clearing the global interrupts flag when any device
does not have an interrupt just pass -1 through tpm_info.irq.

The only thing that asks for autoprobing is the force=1 path.

Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Tested-by: Wilck, Martin <martin.wilck@ts.fujitsu.com>
Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Acked-by: Peter Huewe <peterhuewe@gmx.de>
(cherry picked from commit ef7b81dc78642e1a33c890acf3214d1e04c90a8f)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agotpm_crb: Use the common ACPI definition of struct acpi_tpm2
Jason Gunthorpe [Fri, 8 Jan 2016 00:36:20 +0000 (17:36 -0700)]
tpm_crb: Use the common ACPI definition of struct acpi_tpm2

BugLink: http://bugs.launchpad.net/bugs/1398274
include/acpi/actbl2.h is the proper place for these definitions
and the needed TPM2 ones have been there since
commit 413d4a6defe0 ("ACPICA: Update TPM2 ACPI table")

This also drops a couple of le32_to_cpu's for members of this table,
the existing swapping was not done consistently, and the standard
used by other Linux callers of acpi_get_table is unswapped.

Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Tested-by: Wilck, Martin <martin.wilck@ts.fujitsu.com>
Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Acked-by: Peter Huewe <peterhuewe@gmx.de>
(cherry picked from commit 55a889c2cb138f8f10164539c6d290a1cefaa863)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agotpm: fix checks for policy digest existence in tpm2_seal_trusted()
Jarkko Sakkinen [Wed, 6 Jan 2016 14:43:30 +0000 (16:43 +0200)]
tpm: fix checks for policy digest existence in tpm2_seal_trusted()

BugLink: http://bugs.launchpad.net/bugs/1398274
In my original patch sealing with policy was done with dynamically
allocated buffer that I changed later into an array so the checks in
tpm2-cmd.c became invalid. This patch fixes the issue.

Fixes: 5beb0c435bdd ("keys, trusted: seal with a TPM2 authorization policy")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Acked-by: Peter Huewe <peterhuewe@gmx.de>
(cherry picked from commit f3c82ade7c59303167d56b0be3e0707751fc45e2)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agotpm: remove unneeded include of actbl2.h
Jerry Snitselaar [Mon, 4 Jan 2016 19:19:43 +0000 (12:19 -0700)]
tpm: remove unneeded include of actbl2.h

BugLink: http://bugs.launchpad.net/bugs/1398274
tpm_tis.c already gets actbl2.h via linux/acpi.h -> acpi/acpi.h ->
acpi/actbl.h -> acpi/actbl2.h, so the direct include in tpm_tis.c
is not needed.

Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>
Acked-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Acked-by: Peter Huewe <peterhuewe@gmx.de>
(cherry picked from commit e5be990c2fc3c2682ab7cfbc4f0e6c8cdad2b40d)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agointel_idle: Support for Intel Xeon Phi Processor x200 Product Family
Dasaratharaman Chandramouli [Fri, 5 Sep 2014 00:22:54 +0000 (17:22 -0700)]
intel_idle: Support for Intel Xeon Phi Processor x200 Product Family

BugLink: http://bugs.launchpad.net/bugs/1461365
Enables "Intel(R) Xeon Phi(TM) Processor x200 Product Family" support,
formerly code-named KNL. It is based on modified Intel Atom Silvermont
microarchitecture.

Signed-off-by: Dasaratharaman Chandramouli <dasaratharaman.chandramouli@intel.com>
[micah.barany@intel.com: adjusted values of residency and latency]
Signed-off-by: Micah Barany <micah.barany@intel.com>
[hubert.chrzaniuk@intel.com: removed deprecated CPUIDLE_FLAG_TIME_VALID flag]
Signed-off-by: Hubert Chrzaniuk <hubert.chrzaniuk@intel.com>
Signed-off-by: Pawel Karczewski <pawel.karczewski@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
(cherry picked from commit 281baf7a702693deaa45c98ef0c5161006b48257)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: SAUCE: (noup) cxlflash: Move to exponential back-off when cmd_room is not...
Manoj N. Kumar [Wed, 9 Mar 2016 02:19:49 +0000 (20:19 -0600)]
UBUNTU: SAUCE: (noup) cxlflash: Move to exponential back-off when cmd_room is not available

BugLink: http://bugs.launchpad.net/bugs/1563485
While profiling the cxlflash_queuecommand() path under a heavy load it
was found that number of retries to find cmd_room was fairly high.

There are two problems with the current back-off:
a) It starts with a udelay of 0
b) It backs-off linearly

Tried several approaches (a higher multiple 10*n, 100*n, as well as n^2,
2^n) and found that the exponential back-off(2^n) approach had the least
overall cost. Cost as being defined as overall time spent waiting.

The fix is to change the linear back-off to an exponential back-off.
This solution also takes care of the problem with the initial
delay (starts with 1 usec).

Signed-off-by: Manoj N. Kumar <manoj@linux.vnet.ibm.com>
Acked-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agocxlflash: Increase cmd_per_lun for better throughput
Manoj N. Kumar [Fri, 4 Mar 2016 21:55:20 +0000 (15:55 -0600)]
cxlflash: Increase cmd_per_lun for better throughput

BugLink: http://bugs.launchpad.net/bugs/1563485
With the current value of cmd_per_lun at 16, the throughput
over a single adapter is limited to around 150kIOPS.

Increase the value of cmd_per_lun to 256 to improve
throughput. With this change a single adapter is able to
attain close to the maximum throughput (380kIOPS).
Also change the number of RRQ entries that can be queued.

Signed-off-by: Manoj N. Kumar <manoj@linux.vnet.ibm.com>
Acked-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Reviewed-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 83430833b4d4a9c9b23964babbeb1f36450f8136)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>