Re: [PATCH] perf report: Provide libtraceevent with a kernel symbol resolver

2018-01-18 Thread Wang YanQing
On Thu, Jan 18, 2018 at 10:43:18AM +0100, Jiri Olsa wrote: > On Wed, Jan 17, 2018 at 12:48:12AM +0800, Wang YanQing wrote: > > On Mon, Jan 15, 2018 at 11:06:11AM +0100, Jiri Olsa wrote: > > > On Mon, Jan 15, 2018 at 12:47:32PM +0800, Wang YanQing wrote: > > > > So that beautifiers wanting to resolv

Re: [PATCH v6 85/99] btrfs: Remove unused spinlock

2018-01-18 Thread David Sterba
On Wed, Jan 17, 2018 at 12:21:49PM -0800, Matthew Wilcox wrote: > From: Matthew Wilcox > > The reada_lock in struct btrfs_device was only initialised, and not > actually used. That's good because there's another lock also called > reada_lock in the btrfs_fs_info that was quite heavily used. Rem

Re: [PATCH net-next 3/5] net: hns3: add ethtool -p support for phy device

2018-01-18 Thread Andrew Lunn
> +static int hclge_set_led_status_phy(struct phy_device *phydev, int value) > +{ > + int ret, cur_page; > + > + mutex_lock(&phydev->lock); > + > + ret = phy_read(phydev, HCLGE_PHY_PAGE_REG); > + if (ret < 0) > + goto out; > + else > + cur_page = ret; > +

Re: [PATCH v4 08/13] iommu/rockchip: Control clocks needed to access the IOMMU

2018-01-18 Thread JeffyChen
Hi Robin, On 01/18/2018 08:27 PM, Robin Murphy wrote: Is it worth using the clk_bulk_*() APIs for this? At a glance, most of the code being added here appears to duplicate what those functions already do (but I'm no clk API expert, for sure). right, i think it's doable, the clk_bulk APIs are

Re: [PATCH v2 0/2] arm64: Run enable method for errata work arounds on late CPUs

2018-01-18 Thread Suzuki K Poulose
On 18/01/18 14:21, Dave Martin wrote: On Thu, Jan 18, 2018 at 12:08:43PM +, Robin Murphy wrote: On 18/01/18 12:00, Robin Murphy wrote: [...] +struct enable_arg { +    int (*enable)(struct arm64_cpu_capabilities const *); +    struct arm64_cpu_capabilities const *cap; +}; + +static int __ena

Re: [PATCH v2 01/10] perf tools: Integrating the CoreSight decoding library

2018-01-18 Thread Jiri Olsa
On Thu, Jan 18, 2018 at 11:14:23AM -0300, Arnaldo Carvalho de Melo wrote: > Em Thu, Jan 18, 2018 at 02:59:48PM +0100, Jiri Olsa escreveu: > > On Thu, Jan 18, 2018 at 10:41:39AM -0300, Arnaldo Carvalho de Melo wrote: > > > Shouldn't libopencsd be treated like libbabeltrace was before > > > the req

Re: [PATCH 1/1] ARM: dts: sunxi: Add Olimex A20-SOM204-EVB board

2018-01-18 Thread Chen-Yu Tsai
On Thu, Jan 18, 2018 at 6:07 PM, Maxime Ripard wrote: > Hi! > > On Mon, Jan 15, 2018 at 12:07:34PM +0200, Stefan Mavrodiev wrote: >> > > +/dts-v1/; >> > > +#include "sun7i-a20.dtsi" >> > > +#include "sunxi-common-regulators.dtsi" >> > > + >> > > + >> > > +#include >> > > +#include >> > > +#inclu

Re: [PATCH] [net-next] net: sched: avoid uninitialized variable use

2018-01-18 Thread Jiri Pirko
Thu, Jan 18, 2018 at 03:19:14PM CET, a...@arndb.de wrote: >On Thu, Jan 18, 2018 at 2:49 PM, Jiri Pirko wrote: >> Thu, Jan 18, 2018 at 02:17:28PM CET, a...@arndb.de wrote: >>>gcc has identified a code path in which we pass uninitialized >>>data into tc_dump_tfilter(): >>> >>>net/sched/cls_api.c: In

Re: [mm 4.15-rc8] Random oopses under memory pressure.

2018-01-18 Thread Kirill A. Shutemov
On Thu, Jan 18, 2018 at 04:12:10PM +0300, Kirill A. Shutemov wrote: > On Thu, Jan 18, 2018 at 03:25:50PM +0300, Kirill A. Shutemov wrote: > > On Thu, Jan 18, 2018 at 05:12:45PM +0900, Tetsuo Handa wrote: > > > Tetsuo Handa wrote: > > > > OK. I missed the mark. I overlooked that 4.11 already has thi

[PATCH v3 06/14] ARM: dts: stm32: Add SDIO controller for stm32f746

2018-01-18 Thread patrice.chotard
From: Patrice Chotard stm32f746 embeds ARM_PL180 sdio IP, adds SDIO controller nodes to allow MMC support. Signed-off-by: Patrice Chotard --- v3: _ none v2: _ none arch/arm/boot/dts/stm32f746.dtsi | 22 ++ 1 file changed, 22 insertions(+) diff --git a/arch/arm/boot/dts/

[PATCH v3 03/14] mmc: mmci: Don't pretend all variants to have OPENDRAIN bit

2018-01-18 Thread patrice.chotard
From: Patrice Chotard This patch prepares for supporting STM32 variant which doesn't have opendrain bit in MMCIPOWER register. ST others variant (u300, nomadik and ux500) uses MCI_OD bit whereas others variants uses MCI_ROD bit. Signed-off-by: Patrice Chotard --- v3: _ use variant->opendrain i

[PATCH v3 14/14] clk: stm32: Add clk entry for SDMMC2 on stm32F769

2018-01-18 Thread patrice.chotard
From: Patrice Chotard STM32F769 has 2 SDMMC port, add clock entry for the second one. Signed-off-by: Alexandre TORGUE Signed-off-by: Patrice Chotard Acked-by: Stephen Boyd --- v3: _ none v2: _ Add Acked-by drivers/clk/clk-stm32f4.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)

[PATCH v3 02/14] mmc: mmci: Don't pretend all variants to have MCI_STARBITERR flag

2018-01-18 Thread patrice.chotard
From: Patrice Chotard This patch prepares for supporting the STM32 variant that has no such bit in the status register. Signed-off-by: Andrea Merello Signed-off-by: Patrice Chotard --- v3: _ none v2: _ replace start_err bool type by u32 drivers/mmc/host/mmci.c | 16 ++-- 1 fil

[PATCH v3 12/14] ARM: configs: stm32: Enable MMC_ARMMMCI support

2018-01-18 Thread patrice.chotard
From: Patrice Chotard Enable MMC_ARMMCI support to add SDIO support for STM32F4 and STM32F7 SoCs family Signed-off-by: Patrice Chotard --- v3: _ none v2: _ none arch/arm/configs/stm32_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/configs/stm32_defconfig b/arch/ar

[PATCH v3 13/14] ARM: configs: stm32: Enable EXT3_FS support

2018-01-18 Thread patrice.chotard
From: Patrice Chotard Enable EXT3_FS support to be able to read rootfs from MMC partition formatted in EXT2/3/4 . Signed-off-by: Patrice Chotard --- v3: _ none v2: _ none arch/arm/configs/stm32_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/configs/stm32_defconfig b

[PATCH v3 00/14] Add MMCI support for STM32F SoCs family

2018-01-18 Thread patrice.chotard
From: Patrice Chotard This series reworks patches submitted one year ago by Andrea Merello [1] but without succeed to merged it. STM32F4 and STM32F7 SoCs families embeds a variant of the ARM PrimeCell PL18x SD host controller, for which the mmci driver exists. This series adds support for the

Re: [mm 4.15-rc8] Random oopses under memory pressure.

2018-01-18 Thread Dave Hansen
On 01/18/2018 05:12 AM, Kirill A. Shutemov wrote: > - if (pte_page(*pvmw->pte) - pvmw->page >= > - hpage_nr_pages(pvmw->page)) { Is ->pte guaranteed to map a page which is within the same section as pvmw->page? Otherwise, with sparsemem (non-vmemmap), the p

[PATCH v3 04/14] mmc: mmci: Add support for setting pad type via pinctrl

2018-01-18 Thread patrice.chotard
From: Patrice Chotard If variant hasn't the control bit to switch pads in opendrain mode, we can achieve the same result by asking to the pinmux driver to configure pins for us. This patch make the mmci driver able to do this whenever needed. Signed-off-by: Andrea Merello Signed-off-by: Patric

RE: [PATCH] [RESEND] megaraid: use ktime_get_real for firmware time

2018-01-18 Thread Sumit Saxena
-Original Message- From: Arnd Bergmann [mailto:a...@arndb.de] Sent: Wednesday, January 17, 2018 8:19 PM To: Kashyap Desai; Sumit Saxena; Shivasharan S; James E.J. Bottomley; Martin K. Petersen Cc: Arnd Bergmann; Tomas Henzl; Hannes Reinecke; megaraidlinux@broadcom.com; linux-s...@vger.k

[PATCH v3 11/14] ARM: stm32: Add AMBA support for STM32F4 and STM32F7 SoCs

2018-01-18 Thread patrice.chotard
From: Patrice Chotard As both STM32F4 and STM32F7 SoCs embeds an AMBA PL180 mmci IP, we need to enable AMBA support in mach-stm32. Signed-off-by: Patrice Chotard --- v3: _ none v2: _ none arch/arm/mach-stm32/Kconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/mach-stm32/

[PATCH v3 01/14] mmc: mmci: Don't pretend all variants to have MMCIMASK1 register

2018-01-18 Thread patrice.chotard
From: Patrice Chotard Two mask registers are used in order to select which events have to actually generate an interrupt on each IRQ line. It seems that in the single-IRQ case it's assumed that the IRQs lines are simply OR-ed, while the two mask registers are still present. The driver still prog

[PATCH v3 08/14] ARM: dts: stm32: Add pin map for SDIO controller on stm32f4

2018-01-18 Thread patrice.chotard
From: Andrea Merello This patch adds the pin configuration for SDIO controller on stm32f4. Signed-off-by: Andrea Merello Signed-off-by: Patrice Chotard --- v3: _ none v2: _ none arch/arm/boot/dts/stm32f4-pinctrl.dtsi | 31 +++ 1 file changed, 31 insertions(+)

[PATCH v3 10/14] ARM: dts: stm32: Enable SDIO controller on stm32429i-eval board

2018-01-18 Thread patrice.chotard
From: Patrice Chotard This patch adds SDIO related DT nodes for stm32429i-eval board. Signed-off-by: Patrice Chotard --- v3: _ none v2: _ none arch/arm/boot/dts/stm32429i-eval.dts | 19 +++ 1 file changed, 19 insertions(+) diff --git a/arch/arm/boot/dts/stm32429i-eval.dts

[PATCH v3 07/14] ARM: dts: stm32: Add SDIO controller for stm32f429

2018-01-18 Thread patrice.chotard
From: Patrice Chotard stm32f429 embeds ARM_PL180 sdi IP, adds SDIO controller node to allow MMC support. Signed-off-by: Andrea Merello Signed-off-by: Patrice Chotard --- v3: _ none v2: _ none arch/arm/boot/dts/stm32f429.dtsi | 11 +++ 1 file changed, 11 insertions(+) diff --git a

[PATCH v3 05/14] mmc: mmci: Add STM32 variant

2018-01-18 Thread patrice.chotard
From: Patrice Chotard STM32F4 and STM32F7 MCUs has a SDIO controller that looks like an ARM PL810. This patch adds the STM32 variant so that mmci driver supports it. Signed-off-by: Andrea Merello Signed-off-by: Patrice Chotard Reviewed-by: Linus Walleij --- v3: _ none v2: _ Replace "pl180"

[PATCH v3 09/14] ARM: dts: stm32: Enable SDIO controller on stm32f469 disco board

2018-01-18 Thread patrice.chotard
From: Andrea Merello This patch adds SDIO-related DT nodes required by stm32f469 board There is a hardware issue on these boards, it misses a pullup on the GPIO line used as card detect to allow correct SD card detection. To allow correct card detection "broken-cd" property is used. Signed-off-

[PATCH] ARM: dts: at91: sama5d4: fix pinctrl compatible string

2018-01-18 Thread Ludovic Desroches
From: Santiago Esteban The compatible string is incorrect. Add atmel,sama5d3-pinctrl since it's the appropriate compatible string. Remove the atmel,at91rm9200-pinctrl compatible string, this fallback is useless, there are too many changes. Signed-off-by: Santiago Esteban Signed-off-by: Ludovic

Re: [PATCH] iommu/of: Only do IOMMU lookup for available ones

2018-01-18 Thread Will Deacon
On Wed, Jan 17, 2018 at 02:28:08PM +0100, Joerg Roedel wrote: > On Wed, Jan 03, 2018 at 02:09:20PM +0800, Jeffy Chen wrote: > > The for_each_matching_node_and_match() would return every matching > > nodes including unavailable ones. > > > > It's pointless to init unavailable IOMMUs, so add a sanit

Re: [mm 4.15-rc8] Random oopses under memory pressure.

2018-01-18 Thread Dave Hansen
On 01/18/2018 04:25 AM, Kirill A. Shutemov wrote: > [ 10.084024] diff: -858690919 > [ 10.084258] hpage_nr_pages: 1 > [ 10.084386] check1: 0 > [ 10.084478] check2: 0 ... > diff --git a/mm/page_vma_mapped.c b/mm/page_vma_mapped.c > index d22b84310f6d..57b4397f1ea5 100644 > --- a/mm/page_vma_m

Re: [mm 4.15-rc8] Random oopses under memory pressure.

2018-01-18 Thread Kirill A. Shutemov
On Thu, Jan 18, 2018 at 06:38:10AM -0800, Dave Hansen wrote: > On 01/18/2018 05:12 AM, Kirill A. Shutemov wrote: > > - if (pte_page(*pvmw->pte) - pvmw->page >= > > - hpage_nr_pages(pvmw->page)) { > > Is ->pte guaranteed to map a page which is within the same sec

Re: dangers of bots on the mailing lists was Re: divide error in ___bpf_prog_run

2018-01-18 Thread Daniel Borkmann
On 01/18/2018 02:10 PM, Dmitry Vyukov wrote: > On Wed, Jan 17, 2018 at 12:09 PM, Dmitry Vyukov wrote: >> On Wed, Jan 17, 2018 at 10:49 AM, Daniel Borkmann >> wrote: >>> Don't know if there's such a possibility, but it would be nice if we could >>> target fuzzing for specific subsystems in relate

Re: [PATCH] phy: brcm-sata: remove unused variable

2018-01-18 Thread Tejun Heo
On Thu, Jan 18, 2018 at 02:19:58PM +0100, Arnd Bergmann wrote: > The newly introduced calibrate function has a variable > that has never been used and needs to be removed to avoid > this harmless warning: > > drivers/phy/broadcom/phy-brcm-sata.c: In function 'brcm_stb_sata_calibrate': > drivers/ph

[PATCH 0/2] Add dsi clock for stm32f469 board

2018-01-18 Thread gabriel.fernandez
From: Gabriel Fernandez This patch-set adds the dsi clock for stm32f469 board. Gabriel Fernandez (2): clk: stm32: END_PRIMARY_CLK should be declare after CLK_SYSCLK clk: stm32: Add DSI clock for STM32F469 Board drivers/clk/clk-stm32f4.c | 11 ++- include/dt-bindings

[PATCH 2/2] clk: stm32: Add DSI clock for STM32F469 Board

2018-01-18 Thread gabriel.fernandez
From: Gabriel Fernandez This patch adds DSI clock for STM32F469 board Signed-off-by: Gabriel Fernandez --- drivers/clk/clk-stm32f4.c | 11 ++- include/dt-bindings/clock/stm32fx-clock.h | 3 ++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/clk

Re: [PATCH v2] r8152: disable RX aggregation on Dell TB16 dock

2018-01-18 Thread David Miller
From: Hayes Wang Date: Thu, 18 Jan 2018 03:04:08 + > [...] >> > r8153 on Dell TB15/16 dock corrupts rx packets. >> > >> > This change is suggested by Realtek. They guess that the XHCI >> > controller doesn't have enough buffer, and their guesswork is correct, >> > once the RX aggregation gets

[PATCH 1/2] clk: stm32: END_PRIMARY_CLK should be declare after CLK_SYSCLK

2018-01-18 Thread gabriel.fernandez
From: Gabriel Fernandez Update of END_PRIMARY_CLK was missed, it should be after CLK_SYSCLK hsi and sysclk are overwritten by gpioa and gpiob. Signed-off-by: Gabriel Fernandez --- include/dt-bindings/clock/stm32fx-clock.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git

Re: [PATCH v16 09/10] drm/panel: Use of_find_backlight helper

2018-01-18 Thread Noralf Trønnes
Den 18.01.2018 13.07, skrev Meghana Madhyastha: On Tue, Jan 16, 2018 at 06:08:53PM +0100, Noralf Trønnes wrote: Den 16.01.2018 11.36, skrev Meghana Madhyastha: Replace of_find_backlight_by_node and of the code around it with of_find_backlight helper to avoid repetition of code. Signed-off-by:

Re: [mm 4.15-rc8] Random oopses under memory pressure.

2018-01-18 Thread Dave Hansen
On 01/18/2018 06:45 AM, Kirill A. Shutemov wrote: > On Thu, Jan 18, 2018 at 06:38:10AM -0800, Dave Hansen wrote: >> On 01/18/2018 05:12 AM, Kirill A. Shutemov wrote: >>> - if (pte_page(*pvmw->pte) - pvmw->page >= >>> - hpage_nr_pages(pvmw->page)) { >> Is ->pte gu

[LTP] [ANNOUNCE] The Linux Test Project has been released for JANUARY 2018

2018-01-18 Thread Cyril Hrubis
ase Downloads and links: The latest version of the test-suite contains 3000+ tests for the Linux and can be downloaded at: https://github.com/linux-test-project/ltp/releases/tag/20180118 The project pages as well as GIT repository are hosted on GitHub: https://github.com/linux-t

Re: [PATCH -next] of: platform: fix OF node refcount leak

2018-01-18 Thread Rob Herring
On Thu, Jan 18, 2018 at 4:43 AM, Sudeep Holla wrote: > We need to call of_node_put() for device nodes obtained with > of_find_node_by_path(). > > Fixes: 3aa0582fdb82 ("of: platform: populate /firmware/ node from > of_platform_default_populate_init()") > Reported-by: Loys Ollivier > Cc: Rob Herri

[PATCH 24/35] x86/msr: Move native_*msr macros out of microcode.h

2018-01-18 Thread Peter Zijlstra
From: Thomas Gleixner [peterz: added native_rdmsrl] Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) --- arch/x86/include/asm/microcode.h | 14 -- arch/x86/include/asm/msr.h | 18 ++ 2 files changed, 18 insertions(+), 14 deletions(-)

Re: [mm 4.15-rc8] Random oopses under memory pressure.

2018-01-18 Thread Andrea Arcangeli
On Thu, Jan 18, 2018 at 06:45:00AM -0800, Dave Hansen wrote: > On 01/18/2018 04:25 AM, Kirill A. Shutemov wrote: > > [ 10.084024] diff: -858690919 > > [ 10.084258] hpage_nr_pages: 1 > > [ 10.084386] check1: 0 > > [ 10.084478] check2: 0 > ... > > diff --git a/mm/page_vma_mapped.c b/mm/page_v

[PATCH 09/35] objtool: Introduce special_type

2018-01-18 Thread Peter Zijlstra
Use an enum for the special_alt entries instead of a collection of booleans. Signed-off-by: Peter Zijlstra (Intel) --- tools/objtool/check.c | 14 +++--- tools/objtool/special.c | 14 +++--- tools/objtool/special.h | 10 -- 3 files changed, 26 insertions(+), 12 de

[PATCH 29/35] x86/speculation: Add IPBP support

2018-01-18 Thread Peter Zijlstra
From: Thomas Gleixner Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) --- arch/x86/include/asm/cpufeatures.h |4 +++- arch/x86/include/asm/msr-index.h |3 +++ arch/x86/include/asm/nospec-branch.h |9 + arch/x86/kernel/cpu/bugs.c |2 +

[PATCH 30/35] x86/speculation: Use Indirect Branch Prediction Barrier in context switch

2018-01-18 Thread Peter Zijlstra
From: Thomas Gleixner [peterz: comment] Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) --- arch/x86/mm/tlb.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) --- a/arch/x86/mm/tlb.c +++ b/arch/x86/mm/tlb.c @@ -6,13 +6,14 @@ #include #include #inclu

Re: [PATCH v5 00/11] FUSE mounts from non-init user namespaces

2018-01-18 Thread Alban Crequy
On Tue, Jan 9, 2018 at 4:05 PM, Dongsu Park wrote: > Hi, > > On Mon, Dec 25, 2017 at 8:05 AM, Eric W. Biederman > wrote: >> Dongsu Park writes: >> >>> This patchset v5 is based on work by Seth Forshee and Eric Biederman. >>> The latest patchset was v4: >>> https://www.mail-archive.com/linux-kern

Re: [PATCH] iommu/of: Only do IOMMU lookup for available ones

2018-01-18 Thread JeffyChen
Hi Will, Thanks for your reply. On 01/18/2018 10:41 PM, Will Deacon wrote: > >Makes sense to me, but I'd like to have an OK from Robin or Will (added >to Cc) before applying this. I don't think this patch makes a lot of sense in isolation: the SMMU drivers themselves will likely still probe, a

[PATCH 15/35] objtool: More complex static jump implementation

2018-01-18 Thread Peter Zijlstra
When using something like: -#define sched_feat(x) (static_branch_##x(&sched_feat_keys[__SCHED_FEAT_##x])) +#define sched_feat(x) (static_branch_##x(&sched_feat_keys[__SCHED_FEAT_##x]) && \ + (arch_static_assert(), true)) we get an objtool assertion fail like: kernel/sc

[PATCH 22/35] x86/cpufeatures: Detect Speculation control feature

2018-01-18 Thread Peter Zijlstra
From: Tim Chen CPUs can expose a MSR to control speculation. The initial function of this MSR is to control Indirect Branch Speculation, which is required to mitigate the Spectre_V2 attack on certain CPU generations. If CPUID(7).RDX[26] is set then MSR_IA32_SPEC_CTRL (0x48) is available and bit

Re: [PATCH v1 1/1] usb: xhci: do not create and register shared_hcd when USB3.0 is disabled

2018-01-18 Thread Mathias Nyman
On 18.01.2018 09:27, Tung Vuong Nguyen wrote: On Tue, Jan 16, 2018 at 9:50 PM, Mathias Nyman wrote: Hi, Sorry about the delay On 04.01.2018 07:17, Thang Q. Nguyen wrote: Hi, On Sat, Dec 16, 2017 at 10:45 AM, Thang Q. Nguyen wrote: From: Tung Nguyen Currently, hcd->shared_hcd always c

[PATCH 21/35] x86: Remove FAST_FEATURE_TESTS

2018-01-18 Thread Peter Zijlstra
Since we want to rely on static branches to avoid speculation, remove any possible fallback code for static_cpu_has. Signed-off-by: Peter Zijlstra (Intel) --- arch/x86/Kconfig | 11 --- arch/x86/include/asm/cpufeature.h |8 2 files changed, 19 deletions(-)

[PATCH 10/35] x86/jump_label: Implement arch_static_assert()

2018-01-18 Thread Peter Zijlstra
Implement the static (branch) assertion. It simply emits the address of the next instruction into a special section which objtool will read and validate against either __jump_table or .altinstructions. Use like: if (static_branch_likely(_key)) { arch_static_assert();

[PATCH 23/35] x86/speculation: Add basic speculation control code

2018-01-18 Thread Peter Zijlstra
From: Thomas Gleixner Add the minimal infrastructure to control the speculation control feature. - Integrate it into the spectre_v2 coammand line parser and the mitigation selector function. The conditional selector function is a placeholder right now, which needs to be expanded with CPU

[PATCH 31/35] x86/ibrs: Add new helper macros to save/restore MSR_IA32_SPEC_CTRL

2018-01-18 Thread Peter Zijlstra
From: Ashok Raj Add some helper macros to save/restore MSR_IA32_SPEC_CTRL. stop_indirect_branch_speculation_and_save() - saves the current state and enables IBRS. restore_indirect_branch_speculation() - restores the previously saved IBRS state. [peterz: renaming and folding

[PATCH 34/35] x86/kvm: Add IBPB support

2018-01-18 Thread Peter Zijlstra
From: Ashok Raj Add MSR passthrough for MSR_IA32_PRED_CMD and place branch predictor barriers on switching between VMs to avoid inter VM specte-v2 attacks. [peterz: rebase and changelog rewrite] Cc: Asit Mallick Cc: Dave Hansen Cc: Arjan Van De Ven Cc: Tim Chen Cc: Linus Torvalds Cc: Andre

[PATCH 32/35] x86/vmx: Direct access to MSR_IA32_SPEC_CTRL

2018-01-18 Thread Peter Zijlstra
From: Ashok Raj Add direct access to MSR_IA32_SPEC_CTRL from a guest. Also save/restore IBRS values during exits and guest resume path. [peterz: rebased] Cc: Asit Mallick Cc: Arjan Van De Ven Cc: Dave Hansen Cc: Andi Kleen Cc: Andrea Arcangeli Cc: Linus Torvalds Cc: Tim Chen Cc: Thomas G

[PATCH 35/35] x86/nospec: Add static assertions

2018-01-18 Thread Peter Zijlstra
These sites must not end up under dynamic conditions because then it could be speculated across. Ensure objtools verifies this. Signed-off-by: Peter Zijlstra (Intel) --- arch/x86/include/asm/nospec-branch.h | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) --- a/arch/

[PATCH 14/35] x86: Annotate indirect jump in head_64.S

2018-01-18 Thread Peter Zijlstra
The objtool retpoline validation found this indirect jump. Seeing how its on CPU bringup before we run userspace it should be safe, annotate it. Signed-off-by: Peter Zijlstra (Intel) --- arch/x86/kernel/head_64.S |2 ++ 1 file changed, 2 insertions(+) --- a/arch/x86/kernel/head_64.S +++ b/a

[PATCH 08/35] objtool: Implement jump_assert for _static_cpu_has()

2018-01-18 Thread Peter Zijlstra
Unlike the jump_label bits, static_cpu_has is implemented with alternatives. We use the new type field to distinguish them from any other alternatives Like jump_labels, make static_cpu_has set static_jump_dest on the instructions after the static branch such that we can assert on it. Cc: Thomas G

Re: [PATCH] PCI: dwc: dra7xx: add back CONFIG_PCI dependency for endpoint

2018-01-18 Thread Niklas Cassel
On Thu, Jan 18, 2018 at 02:15:54PM +0100, Arnd Bergmann wrote: > It was a nice idea to split out the PCI host and endpoint mode configuration > into separate options. Unfortunately it doesn't build: > > drivers/pci/dwc/pci-dra7xx.c:229:11: error: 'pci_irqd_intx_xlate' undeclared > here (not in a

[PATCH 00/35] jump_label, objtool, IBRS and IBPB

2018-01-18 Thread Peter Zijlstra
Lots of patches.. They include: - objtool validation of jump_label/static_cpu_has Allows asserting that the code block following a jump_label/static_cpu_has is indeed unconditional. Ensures GCC doesn't generate particularly stupid code which would re-insert a dynamic test. - objtool

[PATCH 03/35] x86: Reindent _static_cpu_has

2018-01-18 Thread Peter Zijlstra
Because its daft.. Cc: Josh Poimboeuf Cc: Thomas Gleixner Reviewed-by: Borislav Petkov Signed-off-by: Peter Zijlstra (Intel) --- arch/x86/include/asm/cpufeature.h | 78 +++--- 1 file changed, 39 insertions(+), 39 deletions(-) --- a/arch/x86/include/asm/cpufe

[PATCH 17/35] objtool: Even more complex static block checks

2018-01-18 Thread Peter Zijlstra
I've observed GCC transform: f() { if (!static_branch_unlikely()) return; static_assert(); A; } g() { f(); } Into: f() { static_assert(); A; } g() { if (static_branch_unlikely())

[PATCH 06/35] objtool: Implement base jump_assert support

2018-01-18 Thread Peter Zijlstra
Implement a jump_label assertion that asserts that the code location is indeed only reachable through a static_branch. Because if GCC is absolutely retaded it could generate code like: xor rax,rax NOP/JMP 1f mov $1, rax 1: test rax,rax jz 2f 2: ins

[PATCH 16/35] objtool: Use existing global variables for options

2018-01-18 Thread Peter Zijlstra
Use the existing global variables instead of passing them around and creating duplicate global variables. Signed-off-by: Peter Zijlstra (Intel) --- tools/objtool/builtin-check.c |2 +- tools/objtool/builtin-orc.c |6 +- tools/objtool/builtin.h |5 + tools/objtool/chec

Re: [PATCH 2/2 v3] lib: debugobjects: touch watchdog to avoid softlockup when !CONFIG_PREEMPT

2018-01-18 Thread Peter Zijlstra
On Thu, Jan 18, 2018 at 10:02:25AM +0100, Thomas Gleixner wrote: > > > 2) We can do a cond_resched() if not in atomic context and interrupts > > > are > > > enabled. > > > > I did try this before I went with touching softlockup watchdog approach. The > > problem is in_atomic() can't tell i

[PATCH 01/35] jump_label: Add branch hints to static_branch_{un,}likely()

2018-01-18 Thread Peter Zijlstra
For some reason these were missing, I've not observed this patch making a difference in the few code locations I checked, but this makes sense. Cc: Jason Baron Signed-off-by: Peter Zijlstra (Intel) --- include/linux/jump_label.h |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---

[PATCH 18/35] objtool: Another static block fail

2018-01-18 Thread Peter Zijlstra
I've observed GCC generate: sym: NOP/JMP 1f (static_branch) JMP 2f 1: /* crud */ JMP 3f 2: /* other crud */ 3: RETQ This means we need to follow unconditional jumps; be conservative and only follow if its a unique jump. (I've not yet figured out which CONFIG option is re

[PATCH 12/35] x86/paravirt: Annotate indirect calls

2018-01-18 Thread Peter Zijlstra
Paravirt emits indirect calls which get flagged by objtool retpoline checks, annotate it away because all these indirect calls will be patched out before we start userspace. Signed-off-by: Peter Zijlstra (Intel) --- arch/x86/include/asm/paravirt.h | 22 ++ arch/x86/in

[PATCH 11/35] objtool: Add retpoline validation

2018-01-18 Thread Peter Zijlstra
David requested a objtool validation pass for RETPOLINE enabled builds, where it validates no unannotated indirect jumps or calls are left. Add an additional .discard.retpoline_safe section to allow annotating the few indirect sites that are required and safe. Requested-by: David Woodhouse Sign

[PATCH 04/35] x86: Update _static_cpu_has to use all named variables

2018-01-18 Thread Peter Zijlstra
Requested-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) --- arch/x86/include/asm/cpufeature.h |9 + 1 file changed, 5 insertions(+), 4 deletions(-) --- a/arch/x86/include/asm/cpufeature.h +++ b/arch/x86/include/asm/cpufeature.h @@ -153,7 +153,7 @@ static __always_inline

[PATCH 13/35] x86,nospec: Annotate indirect calls/jumps

2018-01-18 Thread Peter Zijlstra
Annotate the indirect calls/jumps in the CALL_NOSPEC/JUMP_NOSPEC alternatives. Signed-off-by: Peter Zijlstra (Intel) --- arch/x86/include/asm/nospec-branch.h | 20 1 file changed, 16 insertions(+), 4 deletions(-) --- a/arch/x86/include/asm/nospec-branch.h +++ b/arch/x86/i

[PATCH 02/35] sched: Optimize ttwu_stat()

2018-01-18 Thread Peter Zijlstra
The whole of ttwu_stat() is guarded by a single schedstat_enabled(), there is absolutely no point in then issuing another static_branch for every single schedstat_inc() in there. Signed-off-by: Peter Zijlstra (Intel) --- kernel/sched/core.c | 16 kernel/sched/stats.h |2 +

Re: net: r8169: a question of memory barrier in the r8169 driver

2018-01-18 Thread Peter Zijlstra
On Thu, Jan 18, 2018 at 10:06:17PM +0800, Jia-Ju Bai wrote: > In the rt8169 driver, the function "rtl_tx" uses "smp_mb" to sync the > writing operation with rtl8169_start_xmit: > if (tp->dirty_tx != dirty_tx) { > tp->dirty_tx = dirty_tx; > smp_mb(); > ... > } > The f

[PATCH 05/35] x86: Add a type field to alt_instr

2018-01-18 Thread Peter Zijlstra
Add a type field to the alternative description. For now this will be used to annotate static_cpu_has() but possible future uses include using it to implement alternative alignment and special NOP handling. Suggested-by: Borislav Petkov Signed-off-by: Peter Zijlstra (Intel) --- arch/x86/include

Re: [PATCH net-next v5 0/4] net: mvpp2: 1000BaseX and 2500BaseX support

2018-01-18 Thread Antoine Tenart
Hi Russell, On Tue, Jan 16, 2018 at 03:12:45PM +, Russell King - ARM Linux wrote: > > As I've already said, we need to make sure things are done in a similar > way for all netdev DT drivers that are hoping to switch to phylink. > The mvneta patches are now in net-next for this. > > What I ca

[PATCH-next] MEMCG: memcontrol: make local symbol static

2018-01-18 Thread Christopher Díaz Riveros
Fixes the following sparse warning: mm/memcontrol.c:1097:14: warning: symbol 'memcg1_stats' was not declared. Should it be static? Signed-off-by: Christopher Díaz Riveros --- mm/memcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c

[PATCH 07/35] x86: Annotate static_cpu_has alternative

2018-01-18 Thread Peter Zijlstra
In order to recognise static_cpu_has() alternatives from any other alternative without dodgy heuristics, we need to explicitly mark them. Use the new type field for this. Signed-off-by: Peter Zijlstra (Intel) --- arch/x86/include/asm/alternative.h |1 + arch/x86/include/asm/cpufeature.h |

[PATCH 26/35] x86/enter: Create macros to stop/restart Indirect Branch Speculation

2018-01-18 Thread Peter Zijlstra
From: Tim Chen Create macros to control Indirect Branch Speculation. Name them so they reflect what they are actually doing. The Intel supplied names are suggesting that they 'enable' something while in reality they disable. [ tglx: Changed macro names and rewrote changelog ] Signed-off-by: Ti

[PATCH 25/35] x86/speculation: Add inlines to control Indirect Branch Speculation

2018-01-18 Thread Peter Zijlstra
From: Thomas Gleixner Signed-off-by: Thomas Gleixner --- arch/x86/include/asm/nospec-branch.h | 12 1 file changed, 12 insertions(+) --- a/arch/x86/include/asm/nospec-branch.h +++ b/arch/x86/include/asm/nospec-branch.h @@ -6,6 +6,7 @@ #include #include #include +#include

[PATCH 27/35] x86/enter: Use IBRS on syscall and interrupts

2018-01-18 Thread Peter Zijlstra
From: Tim Chen Stop Indirect Branch Speculation on every user space to kernel space transition and reenable it when returning to user space. The NMI interrupt save/restore of IBRS state was based on Andrea Arcangeli's implementation. Here's an explanation by Dave Hansen on why we save IBRS stat

<    5   6   7   8   9   10