Re: [PATCH 6/7] cxl/mem: Create a helper to setup device regs

2021-04-08 Thread Jonathan Cameron
On Wed, 7 Apr 2021 15:26:24 -0700 Ben Widawsky wrote: > Memory devices have a list of required register regions within the > register block, but this isn't required of all CXL components or > devices. To make things more tidy, and allow for easily setting up other > block types in this loop, the

Re: [PATCH v2] KVM: SVM: Make sure GHCB is mapped before updating

2021-04-08 Thread Tom Lendacky
On 4/8/21 12:37 PM, Sean Christopherson wrote: > On Thu, Apr 08, 2021, Tom Lendacky wrote: >> On 4/8/21 12:10 PM, Sean Christopherson wrote: >>> On Thu, Apr 08, 2021, Tom Lendacky wrote: diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c index 83e00e524513..7ac67615c070

Re: [PATCH 0/11 v2] Use local_lock for pcp protection and reduce stat overhead

2021-04-08 Thread Mel Gorman
On Thu, Apr 08, 2021 at 12:56:01PM +0200, Peter Zijlstra wrote: > On Wed, Apr 07, 2021 at 09:24:12PM +0100, Mel Gorman wrote: > > Why local_lock? PREEMPT_RT considers the following sequence to be unsafe > > as documented in Documentation/locking/locktypes.rst > > > >local_irq_disable(); > >

[PATCH 0/2] Fix for a bug and a kernel-doc warning in Xilinx DWC3

2021-04-08 Thread Manish Narani
This patch series resolves a kernel-doc warning and a clk freeing bug that was causing a crash. This patch series is on top of: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/usb/dwc3?id=84770f028fabab4cb66188d583ed12652f30576b Manish Narani (2): usb: dwc3:

[PATCH 1/2] usb: dwc3: Resolve kernel-doc warning for Xilinx DWC3 driver

2021-04-08 Thread Manish Narani
The kernel-doc run gave a warning for Xilinx DWC3 driver: drivers/usb/dwc3/dwc3-xilinx.c:27: warning: expecting prototype for dwc3(). Prototype was for XLNX_USB_PHY_RST_EN() instead Basically it was due to an extra '*' in line:2. This patch fixes the same. Signed-off-by: Manish Narani

[PATCH 2/2] usb: dwc3: xilinx: Remove the extra freeing of clocks

2021-04-08 Thread Manish Narani
The clocks are configured by devm_clk_bulk_get_all() in this driver. In case of any error the clocks freeing will be handled automatically. There is no need to explicitly free the clocks. Fix the same. Fixes: 84770f028fab ("usb: dwc3: Add driver for Xilinx platforms") Signed-off-by: Manish Narani

Re: [PATCH 04/10] mm/migrate: make migrate_pages() return nr_succeeded

2021-04-08 Thread Oscar Salvador
On Thu, Apr 08, 2021 at 10:26:54AM -0700, Yang Shi wrote: > Thanks, Oscar. Yes, kind of. But we have to remember to initialize > "nr_succedded" pointer properly for every migrate_pages() callsite, > right? And it doesn't prevent from returning wrong value if > migrate_pages() is called multiple

[PATCH v6 17/18] KVM: arm64: Disable CFI for nVHE

2021-04-08 Thread Sami Tolvanen
Disable CFI for the nVHE code to avoid address space confusion. Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook Tested-by: Nathan Chancellor --- arch/arm64/kvm/hyp/nvhe/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm64/kvm/hyp/nvhe/Makefile

[PATCH v6 16/18] arm64: ftrace: use function_nocfi for ftrace_call

2021-04-08 Thread Sami Tolvanen
With CONFIG_CFI_CLANG, the compiler replaces function pointers with jump table addresses, which breaks dynamic ftrace as the address of ftrace_call is replaced with the address of ftrace_call.cfi_jt. Use function_nocfi() to get the address of the actual function instead. Suggested-by: Ben Dai

[PATCH v6 15/18] arm64: add __nocfi to __apply_alternatives

2021-04-08 Thread Sami Tolvanen
__apply_alternatives makes indirect calls to functions whose address is taken in assembly code using the alternative_cb macro. With non-canonical CFI, the compiler won't replace these function references with the jump table addresses, which trips CFI. Disable CFI checking in the function to work

[PATCH v6 18/18] arm64: allow CONFIG_CFI_CLANG to be selected

2021-04-08 Thread Sami Tolvanen
Select ARCH_SUPPORTS_CFI_CLANG to allow CFI to be enabled. Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook Tested-by: Nathan Chancellor --- arch/arm64/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index e4e1b6550115..d7395772b6b8

[PATCH v6 14/18] arm64: add __nocfi to functions that jump to a physical address

2021-04-08 Thread Sami Tolvanen
Disable CFI checking for functions that switch to linear mapping and make an indirect call to a physical address, since the compiler only understands virtual addresses and the CFI check for such indirect calls would always fail. Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook Tested-by:

Re: [PATCH net v1] Revert "lan743x: trim all 4 bytes of the FCS; not just 2"

2021-04-08 Thread Sven Van Asbroeck
Hi George, On Thu, Apr 8, 2021 at 2:26 PM Sven Van Asbroeck wrote: > > George, I will send a patch for you to try shortly. Except if you're > already ahead :) Would this work for you? It does for me. diff --git a/drivers/net/ethernet/microchip/lan743x_main.c

RE: [PATCH net-next v3 2/2] misc: Add Renesas Synchronization Management Unit (SMU) support

2021-04-08 Thread Min Li
> > But what does that have to do with the misc device? > Hi Greg, MFD driver is the start of everything. Once MFD driver is loading, it will spawn 2 devices, one is for phc driver, which is under /driver/ptp and the other one is for this misc driver. Both PHC and misc drivers are

Re: [PATCH net v1] Revert "lan743x: trim all 4 bytes of the FCS; not just 2"

2021-04-08 Thread Heiner Kallweit
On 08.04.2021 20:35, Sven Van Asbroeck wrote: > Hi George, > > On Thu, Apr 8, 2021 at 2:26 PM Sven Van Asbroeck wrote: >> >> George, I will send a patch for you to try shortly. Except if you're >> already ahead :) > > Would this work for you? It does for me. > > diff --git

[PATCH] mm/mapping_dirty_helpers: Guard hugepage pud's usage

2021-04-08 Thread Zack Rusin
Lets make sure we don't use pud hugepage helpers on architectures which do not support it. This fixes the code on arm64. Signed-off-by: Zack Rusin Cc: Andrew Morton Cc: Thomas Hellström (Intel) Cc: linux...@kvack.org Cc: linux-kernel@vger.kernel.org --- mm/mapping_dirty_helpers.c | 2 ++ 1

Re: [PATCH v7 5/8] pwm: core: Support new PWM_STAGGERING_ALLOWED flag

2021-04-08 Thread Clemens Gruber
On Thu, Apr 08, 2021 at 02:50:40PM +0200, Thierry Reding wrote: > On Wed, Apr 07, 2021 at 11:34:03PM +0200, Uwe Kleine-König wrote: > > On Wed, Apr 07, 2021 at 10:21:10PM +0200, Clemens Gruber wrote: > > > On Wed, Apr 07, 2021 at 07:46:58AM +0200, Uwe Kleine-König wrote: > > > > On Tue, Apr 06,

Re: [RFC PATCH] KVM: x86: Support write protect huge pages lazily

2021-04-08 Thread Sean Christopherson
On Thu, Apr 08, 2021, Keqian Zhu wrote: > Hi Ben, > > Do you have any similar idea that can share with us? Doh, Ben is out this week, he'll be back Monday. Sorry for gumming up the works :-/

Re: [PATCH] net: sched: sch_teql: fix null-pointer dereference

2021-04-08 Thread Pavel Tikhomirov
On 4/8/21 6:26 PM, Eric Dumazet wrote: On 4/8/21 5:14 PM, Pavel Tikhomirov wrote: Reproduce: modprobe sch_teql tc qdisc add dev teql0 root teql0 This leads to (for instance in Centos 7 VM) OOPS: Null pointer dereference happens on master->slaves dereference in teql_destroy() as

[PATCH] Use x2apic enabled bit as set by BIOS to indicate APIC mode

2021-04-08 Thread Mike Travis
BIOS now sets the x2apic enabled bit (and the ACPI table) for extended APIC modes. Use that bit to indicate if extended mode is set. Signed-off-by: Mike Travis --- arch/x86/kernel/apic/x2apic_uv_x.c | 31 ++ 1 file changed, 14 insertions(+), 17 deletions(-) diff

Re: [PATCH v5 4/4] dt-bindings: serial: 8250: add aspeed, lpc-io-reg and aspeed, lpc-interrupts

2021-04-08 Thread Rob Herring
On Wed, 07 Apr 2021 20:16:37 -0500, Zev Weiss wrote: > These correspond to the existing lpc_address, sirq, and sirq_polarity > sysfs attributes; the second element of aspeed,lpc-interrupts provides > a replacement for the deprecated aspeed,sirq-polarity-sense property. > > Signed-off-by: Zev

Re: [RFC bpf-next 0/1] bpf: Add page cache iterator

2021-04-08 Thread Daniel Xu
Hi Christian, thanks for taking a look. On Thu, Apr 08, 2021 at 09:51:17AM +0200, Christian Brauner wrote: > On Wed, Apr 07, 2021 at 02:46:10PM -0700, Daniel Xu wrote: > > There currently does not exist a way to answer the question: "What is in > > the page cache?". There are various heuristics

Re: linux-next: Signed-off-by missing for commit in the cifs tree

2021-04-08 Thread Steve French
fixed - (a tmp branch was accidentally pushed) On Thu, Apr 8, 2021 at 7:07 AM Stephen Rothwell wrote: > > Hi all, > > Commit > > e67fcb31fb0e ("stuff") > > is missing a Signed-off-by from its author and comitter. > > -- > Cheers, > Stephen Rothwell -- Thanks, Steve

[PATCH v1 1/1] gpio: sim: Initialize attribute allocated on the heap

2021-04-08 Thread Andy Shevchenko
The attributes on the heap must be initialized before use. Neglecting that will produce an Oops in some configurations: BUG: key 000800eba398 has not been registered! Initialize attribute allocated on the heap. Fixes: 3f0279eb9e37 ("gpio: sim: new testing module") Reported-by: Naresh

Re: [PATCH] mm: page_counter: mitigate consequences of a page_counter underflow

2021-04-08 Thread Shakeel Butt
On Thu, Apr 8, 2021 at 7:31 AM Johannes Weiner wrote: > > When the unsigned page_counter underflows, even just by a few pages, a > cgroup will not be able to run anything afterwards and trigger the OOM > killer in a loop. > > Underflows shouldn't happen, but when they do in practice, we may just

Re: [GIT PULL] KVM changes for 5.12-rc7

2021-04-08 Thread pr-tracker-bot
The pull request you sent on Thu, 8 Apr 2021 08:12:34 -0400: > https://git.kernel.org/pub/scm/virt/kvm/kvm.git tags/for-linus has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/d381b05e8605f8b11913831e7f3c00e700e97bbc Thank you! -- Deet-doot-dot, I am a bot.

Re: [GIT PULL] sound fixes for 5.12-rc7

2021-04-08 Thread pr-tracker-bot
The pull request you sent on Thu, 08 Apr 2021 14:59:50 +0200: > git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git > tags/sound-5.12-rc7 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/e0a472fffe435af52ea4e21e1e0001c5c8ffc6c7 Thank you! -- Deet-doot-dot,

Re: [PATCH v4 2/6] dt-bindings: PCI: Add bindings for Brcmstb endpoint device voltage regulators

2021-04-08 Thread Mark Brown
On Thu, Apr 08, 2021 at 11:20:16AM -0500, Rob Herring wrote: > On Tue, Apr 06, 2021 at 02:25:49PM -0400, Jim Quinlan wrote: > > On Tue, Apr 6, 2021 at 1:32 PM Mark Brown wrote: > > > > On Tue, Apr 6, 2021 at 12:47 PM Mark Brown wrote: > > > > > No great problem with having these in the

Re: [Intel-gfx] [PATCH v2] drm/i915: Fix invalid access to ACPI _DSM objects

2021-04-08 Thread Takashi Iwai
On Thu, 08 Apr 2021 09:51:18 +0200, Takashi Iwai wrote: > > On Wed, 07 Apr 2021 23:28:48 +0200, > Ville Syrjälä wrote: > > > > Oh, could you ask the bug reporter to attach an acpidump to the > > bug? Might be good to have that stuff on record somewhere if/when > > someone wants to actually

RE: [PATCH v2 net-next] net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)

2021-04-08 Thread Haiyang Zhang
> -Original Message- > From: Andrew Lunn > Sent: Thursday, April 8, 2021 12:45 PM > To: Haiyang Zhang > Cc: Randy Dunlap ; Dexuan Cui > ; da...@davemloft.net; k...@kernel.org; KY > Srinivasan ; Stephen Hemminger > ; wei@kernel.org; Wei Liu > ; net...@vger.kernel.org;

Re: [PATCH 3/4] sched/fair: Consider SMT in ASYM_PACKING load balance

2021-04-08 Thread Peter Zijlstra
On Tue, Apr 06, 2021 at 04:17:51PM -0700, Ricardo Neri wrote: > On Tue, Apr 06, 2021 at 01:18:09PM +0200, Peter Zijlstra wrote: > > On Mon, Apr 05, 2021 at 09:11:07PM -0700, Ricardo Neri wrote: > > > +static bool cpu_group_is_smt(int cpu, struct sched_group *sg) > > > +{ > > > +#ifdef

Re: [PATCH 0/9] sched: Core scheduling interfaces

2021-04-08 Thread Peter Zijlstra
On Thu, Apr 08, 2021 at 03:25:52PM +0200, Michal Koutný wrote: > On Wed, Apr 07, 2021 at 08:34:24PM +0200, Peter Zijlstra > wrote: > > IMO as long as cgroups have that tasks file, you get to support people > > using it. That means that tasks joining your cgroup need to 'inherit' > > cgroup

[PATCH] ARM: dts: at91: sama5d2/trivial: fix letter case for etm hex address

2021-04-08 Thread nicolas.ferre
From: Nicolas Ferre Fix the etm node hex address to lower case for matching regexp specification and removing the additional warning that looks like: arch/arm/boot/dts/at91-sama5d2_ptc_ek.dt.yaml: /: 'etm@73C000' does not match any of the regexes: '@(0|[1-9a-f][0-9a-f]*)$', '^[^@]+$',

Re: [PATCH 0/11 v2] Use local_lock for pcp protection and reduce stat overhead

2021-04-08 Thread Peter Zijlstra
On Wed, Apr 07, 2021 at 09:24:12PM +0100, Mel Gorman wrote: > Why local_lock? PREEMPT_RT considers the following sequence to be unsafe > as documented in Documentation/locking/locktypes.rst > >local_irq_disable(); >raw_spin_lock(); Almost, the above is actually OK on RT. The problematic

[PATCH 11/15] ARM: dts: qcom: sdx55: Add basic devicetree support for Telit FN980 TLB

2021-04-08 Thread Manivannan Sadhasivam
Telit FN980 TLB is the development platform based on the Qualcomm SDX55 chipset. This basic support includes support for debug serial, NAND flash, BAM DMA, USB and regulators support. Signed-off-by: Manivannan Sadhasivam --- arch/arm/boot/dts/Makefile| 3 +-

[PATCH 10/15] dt-bindings: arm: qcom: Add binding for Telit FN980 TLB board

2021-04-08 Thread Manivannan Sadhasivam
Add devicetree binding for Telit FN980 TLB board based on SDX55. Cc: Rob Herring Cc: devicet...@vger.kernel.org Signed-off-by: Manivannan Sadhasivam --- Documentation/devicetree/bindings/arm/qcom.yaml | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH 15/15] ARM: dts: qcom: sdx55: Add Modem remoteproc node

2021-04-08 Thread Manivannan Sadhasivam
Add modem support to SDX55 using the PAS remoteproc driver. Signed-off-by: Manivannan Sadhasivam --- .../boot/dts/qcom-sdx55-telit-fn980-tlb.dts | 5 +++ arch/arm/boot/dts/qcom-sdx55.dtsi | 33 +++ 2 files changed, 38 insertions(+) diff --git

[PATCH 12/15] dt-bindings: arm: qcom: Add binding for Thundercomm T55 kit

2021-04-08 Thread Manivannan Sadhasivam
Add devicetree binding for Thundercomm T55 Dev kit based on SDX55. Cc: Rob Herring Cc: devicet...@vger.kernel.org Signed-off-by: Manivannan Sadhasivam --- Documentation/devicetree/bindings/arm/qcom.yaml | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH 13/15] ARM: dts: qcom: sdx55: Add basic devicetree support for Thundercomm T55

2021-04-08 Thread Manivannan Sadhasivam
Thundercomm T55 is the development platform based on the Qualcomm SDX55 chipset. This basic support includes support for debug serial, NAND flash, BAM DMA, USB and regulators support. https://www.thundercomm.com/app_en/product/1593506006365532 Signed-off-by: Manivannan Sadhasivam ---

[PATCH 14/15] dt-bindings: remoteproc: qcom: pas: Add binding for SDX55

2021-04-08 Thread Manivannan Sadhasivam
Add devicetree binding for SDX55 remoteproc. Cc: Rob Herring Cc: devicet...@vger.kernel.org Signed-off-by: Manivannan Sadhasivam --- Documentation/devicetree/bindings/remoteproc/qcom,adsp.txt | 4 1 file changed, 4 insertions(+) diff --git

Re: [PATCH 1/1] usb: typec: tcpm: remove unused static variable 'tcpm_altmode_ops'

2021-04-08 Thread Hans de Goede
Hi, On 4/8/21 3:55 PM, Guenter Roeck wrote: > On 4/8/21 1:28 AM, Heikki Krogerus wrote: >> On Wed, Apr 07, 2021 at 05:15:40PM +0800, Zhen Lei wrote: >>> Fixes the following W=1 kernel build warning: >>> >>> drivers/usb/typec/tcpm/tcpm.c:2107:39: warning: ‘tcpm_altmode_ops’ defined >>> but not

[RESEND PATCH] Revert "i3c master: fix missing destroy_workqueue() on error in i3c_master_register"

2021-04-08 Thread Jae Hyun Yoo
Adding the destroy_workqueue call in i3c_master_register introduced below kernel warning because it makes duplicate destroy_workqueue calls when i3c_master_register fails after allocating the workqueue. The workqueue will be destroyed by i3c_masterdev_release which is called by put_device at the

[PATCH v2 1/2] dt-bindings: pinctrl: qcom-pmic-gpio: Add pm8008 support

2021-04-08 Thread Guru Das Srinagesh
Add support for the 2 GPIOs present on Qualcomm Technologies, Inc. PM8008. Acked-by: Bjorn Andersson Signed-off-by: Guru Das Srinagesh --- Changes from last patchset: - Moved "pm8008" up a line to keep things sorted alphabetically Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.txt |

[PATCH v2 2/2] pinctrl: qcom-pmic-gpio: Add support for pm8008

2021-04-08 Thread Guru Das Srinagesh
Add support for the two GPIOs present on Qualcomm Technologies, Inc. PM8008. Reviewed-by: Bjorn Andersson Signed-off-by: Guru Das Srinagesh --- Changes from last patchset: - Moved "pm8008" up a line to keep things sorted alphabetically drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 1 + 1 file

Re: [PATCH] media: em28xx: Fix race condition between open and init function

2021-04-08 Thread Shuah Khan
On 4/8/21 6:10 AM, Igor Matheus Andrade Torrente wrote: Fixes a race condition - for lack of a more precise term - between em28xx_v4l2_open and em28xx_v4l2_init, by detaching the v4l2_dev, media_pad and vdev structs from the em28xx_v4l2, and managing the lifetime of those objects more

Re: [PATCH v7 5/8] pwm: core: Support new PWM_STAGGERING_ALLOWED flag

2021-04-08 Thread Uwe Kleine-König
On Thu, Apr 08, 2021 at 05:51:36PM +0200, Clemens Gruber wrote: > On Thu, Apr 08, 2021 at 02:50:40PM +0200, Thierry Reding wrote: > > Yes, I think that's basically what this is saying. I think we're perhaps > > getting hung up on the terminology here. PWM_STAGGERING_ALLOWED gives > > the

Re: [PATCH net v1] Revert "lan743x: trim all 4 bytes of the FCS; not just 2"

2021-04-08 Thread George McCollister
On Thu, Apr 8, 2021 at 12:23 PM Sven Van Asbroeck wrote: > > From: Sven Van Asbroeck > > This reverts commit 3e21a10fdea3c2e4e4d1b72cb9d720256461af40. > > The reverted patch completely breaks all network connectivity on the > lan7430. tcpdump indicates missing bytes when receiving ping > packets

[GIT PULL] s390 updates for 5.12-rc7

2021-04-08 Thread Heiko Carstens
Hi Linus, please pull a couple of s390 fixes for 5.12-rc7. Thank you, Heiko The following changes since commit 84d572e634e28827d105746c922d8ada425e2d8b: MAINTAINERS: add backups for s390 vfio drivers (2021-03-28 20:20:33 +0200) are available in the Git repository at:

Re: [PATCH net v1] Revert "lan743x: trim all 4 bytes of the FCS; not just 2"

2021-04-08 Thread Sven Van Asbroeck
Hi George, On Thu, Apr 8, 2021 at 1:36 PM George McCollister wrote: > > Can you explain the difference in behavior with what I was observing > on the LAN7431? I'm not using DSA in my application, so I cannot test or replicate what you were observing. It would be great if we could work together

Re: [GIT PULL] cpuidle for v5.13-rc1

2021-04-08 Thread Rafael J. Wysocki
On Thu, Apr 8, 2021 at 8:02 PM Daniel Lezcano wrote: > > On 08/04/2021 19:24, Rafael J. Wysocki wrote: > > On Thu, Apr 8, 2021 at 5:10 PM Daniel Lezcano > > wrote: > >> > >> > >> Hi Rafael, > >> > >> please consider pulling the following change for cpuidle on ARM for > >> v5.13-rc1 > >> > >>

Re: [PATCH v10 2/6] arm64: kvm: Introduce MTE VM feature

2021-04-08 Thread David Hildenbrand
On 08.04.21 16:18, Catalin Marinas wrote: On Wed, Apr 07, 2021 at 04:52:54PM +0100, Steven Price wrote: On 07/04/2021 16:14, Catalin Marinas wrote: On Wed, Apr 07, 2021 at 11:20:18AM +0100, Steven Price wrote: On 31/03/2021 19:43, Catalin Marinas wrote: When a slot is added by the VMM, if it

Re: [PATCH v4] lib/string: Introduce sysfs_streqcase

2021-04-08 Thread Nick Desaulniers
On Thu, Apr 8, 2021 at 7:52 AM Gioh Kim wrote: > > On Thu, Apr 8, 2021 at 3:14 PM Jinpu Wang wrote: > > > > On Thu, Apr 8, 2021 at 3:06 PM Gioh Kim wrote: > > > > > > As the name shows, it checks if strings are equal in case insensitive > > > manner. > > > > > > For example,

Re: [PATCH 1/1] nvme-pci: add the DISABLE_WRITE_ZEROES quirk for a Samsung PM1725a

2021-04-08 Thread Javier González
On 08.04.2021 14:15, Christoph Hellwig wrote: On Thu, Apr 08, 2021 at 12:30:16PM +0200, Javier González wrote: Aligning to MDTS is our current behavior, although all kernels up to 5.11 had a bug in the calculation. I see. Let me check internally and see what's going on with write-zeroes on

[PATCH v6 00/18] Add support for Clang CFI

2021-04-08 Thread Sami Tolvanen
This series adds support for Clang's Control-Flow Integrity (CFI) checking. With CFI, the compiler injects a runtime check before each indirect function call to ensure the target is a valid function with the correct static type. This restricts possible call targets and makes it more difficult for

[PATCH v6 01/18] add support for Clang CFI

2021-04-08 Thread Sami Tolvanen
This change adds support for Clang’s forward-edge Control Flow Integrity (CFI) checking. With CONFIG_CFI_CLANG, the compiler injects a runtime check before each indirect function call to ensure the target is a valid function with the correct static type. This restricts possible call targets and

[PATCH v6 04/18] module: ensure __cfi_check alignment

2021-04-08 Thread Sami Tolvanen
CONFIG_CFI_CLANG_SHADOW assumes the __cfi_check() function is page aligned and at the beginning of the .text section. While Clang would normally align the function correctly, it fails to do so for modules with no executable code. This change ensures the correct __cfi_check() location and

[PATCH v6 05/18] workqueue: use WARN_ON_FUNCTION_MISMATCH

2021-04-08 Thread Sami Tolvanen
With CONFIG_CFI_CLANG, a callback function passed to __queue_delayed_work from a module points to a jump table entry defined in the module instead of the one used in the core kernel, which breaks function address equality in this check: WARN_ON_ONCE(timer->function != delayed_work_timer_fn);

[PATCH v6 02/18] cfi: add __cficanonical

2021-04-08 Thread Sami Tolvanen
With CONFIG_CFI_CLANG, the compiler replaces a function address taken in C code with the address of a local jump table entry, which passes runtime indirect call checks. However, the compiler won't replace addresses taken in assembly code, which will result in a CFI failure if we later jump to such

[PATCH v6 06/18] kthread: use WARN_ON_FUNCTION_MISMATCH

2021-04-08 Thread Sami Tolvanen
With CONFIG_CFI_CLANG, a callback function passed to __kthread_queue_delayed_work from a module points to a jump table entry defined in the module instead of the one used in the core kernel, which breaks function address equality in this check: WARN_ON_ONCE(timer->function !=

[PATCH v6 03/18] mm: add generic function_nocfi macro

2021-04-08 Thread Sami Tolvanen
With CONFIG_CFI_CLANG, the compiler replaces function addresses in instrumented C code with jump table addresses. This means that __pa_symbol(function) returns the physical address of the jump table entry instead of the actual function, which may not work as the jump table code will immediately

Re: [PATCH] blk-mq: fix alignment mismatch.

2021-04-08 Thread Jian Cai
Sounds good! Thanks for the help and the link. On Thu, Apr 8, 2021 at 11:12 AM Nathan Chancellor wrote: > > Hi Jian, > > On Thu, Apr 08, 2021 at 10:57:54AM -0700, Jian Cai wrote: > > So this issue is blocking the LLVM upgrading on ChromeOS. Nathan, do > > you mind sending out the smaller patch

[tip:master] BUILD SUCCESS 1dabdd67370e1fec904b39f82401a16f678df565

2021-04-08 Thread kernel test robot
allnoconfig x86_64 randconfig-a004-20210408 x86_64 randconfig-a005-20210408 x86_64 randconfig-a003-20210408 x86_64 randconfig-a001-20210408 x86_64 randconfig-a002-20210408 x86_64 randconfig

Re: [PATCH v2] KVM: SVM: Make sure GHCB is mapped before updating

2021-04-08 Thread Sean Christopherson
On Thu, Apr 08, 2021, Tom Lendacky wrote: > > > On 4/8/21 12:37 PM, Sean Christopherson wrote: > > On Thu, Apr 08, 2021, Tom Lendacky wrote: > >> On 4/8/21 12:10 PM, Sean Christopherson wrote: > >>> On Thu, Apr 08, 2021, Tom Lendacky wrote: > diff --git a/arch/x86/kvm/svm/sev.c

[PATCH 07/12] staging: rtl8188eu: move static array from .h to .c

2021-04-08 Thread Martin Kaiser
Declaring a static array in a header file is likely to cause name conflicts if the declaration is pulled in multiple times. The rtl8188 driver protects the declaration of the wlancmds array in rtw_mlme_ext.h with ifdef _RTW_CMD_C_, which is defined only in rtw_cmd.c. It makes more sense to

[PATCH 08/12] staging: rtl8188eu: move another static array from .h to .c

2021-04-08 Thread Martin Kaiser
Move the declaration of the rtw_cmd_callback array from rtw_cmd.h to rtw_cmd.c. The _RTW_CMD_C_ symbol is now obsolete and can be removed. Signed-off-by: Martin Kaiser --- drivers/staging/rtl8188eu/core/rtw_cmd.c| 19 ++- drivers/staging/rtl8188eu/include/rtw_cmd.h | 20

[PATCH 03/12] staging: rtl8188eu: make ffaddr2pipehdl static

2021-04-08 Thread Martin Kaiser
This function is used only inside usb_ops_linux.c. Signed-off-by: Martin Kaiser --- drivers/staging/rtl8188eu/include/usb_ops_linux.h | 2 -- drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git

[PATCH 04/12] staging: rtl8188eu: replace switch-case with if

2021-04-08 Thread Martin Kaiser
This switch has only one case. Replace it with an if statement. Signed-off-by: Martin Kaiser --- drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c

[PATCH 05/12] staging: rtl8188eu: remove unused function parameter

2021-04-08 Thread Martin Kaiser
The struct adapter parameter of rtw_os_recvbuf_resource_alloc is not used. Remove it. While at it, use the same parameter name in the prototype and the function definition. Signed-off-by: Martin Kaiser --- drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c | 2 +-

[PATCH 06/12] staging: rtl8188eu: remove a constant variable

2021-04-08 Thread Martin Kaiser
enqueue is always 0. Signed-off-by: Martin Kaiser --- drivers/staging/rtl8188eu/core/rtw_pwrctrl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c b/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c index c3c1cf67cf7e..4d507d9faec2

[PATCH 09/12] staging: rtl8188eu: always free cmd_obj in the cmd thread

2021-04-08 Thread Martin Kaiser
The rtl8188 driver starts a command thread that reads commands from a queue and processes them. Each command consists of a struct cmd_obj. The command thread may call a function to process the current command and optionally a post-processing function. Eventually, the command's cmd_obj must be

[PATCH 10/12] staging: rtl8188eu: remove duplicate if statement

2021-04-08 Thread Martin Kaiser
There's two identical checks if the device was stopped or unplugged. Remove one of them. Signed-off-by: Martin Kaiser --- drivers/staging/rtl8188eu/core/rtw_cmd.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c

[PATCH 11/12] staging: rtl8188eu: remove a dead assignment

2021-04-08 Thread Martin Kaiser
There's no need to set cmd_hdl to NULL after it's used. It will be set again before the next command is processed. Signed-off-by: Martin Kaiser --- drivers/staging/rtl8188eu/core/rtw_cmd.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c

[PATCH 12/12] staging: rtl8188eu: simplify rtw_cmd_thread's main loop

2021-04-08 Thread Martin Kaiser
In rtw_cmd_thread's main loop, we wait until there's a command in the queue. To skip this wait statement in subsequent iterations, the driver uses a label and goto instead of the actual loop. We only get back to the initial wait if the queue is empty when we read it. Basically, all we want to do

Re: [PATCH v3 04/12] module: Add printk format to add module build ID to stacktraces

2021-04-08 Thread Stephen Boyd
Quoting Andy Shevchenko (2021-04-08 07:05:54) > On Thu, Apr 08, 2021 at 03:44:57PM +0200, Jessica Yu wrote: > > +++ Stephen Boyd [30/03/21 20:05 -0700]: > > ... > > > > +static void init_build_id(struct module *mod, const struct load_info > > > *info) > > > +{ > > > + const Elf_Shdr *sechdr;

[PATCH] spi: orion: set devdata properly as it is being used later

2021-04-08 Thread Muhammad Usama Anjum
If device_get_match_data returns NULL, devdata isn't being updated properly. It is being used later in the function. Both devdata and spi->devdata should be updated to avoid NULL pointer dereference. Addresses-Coverity: ("NULL pointer dereference") Fixes: 0e6521f13c2 ("spi: orion: Use

[PATCH 02/12] staging: rtl8188eu: remove prototype for non-existing function

2021-04-08 Thread Martin Kaiser
There's no usb_read_port_cancel function in this driver. Remove its prototype. Signed-off-by: Martin Kaiser --- drivers/staging/rtl8188eu/include/usb_ops_linux.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/include/usb_ops_linux.h

Re: [PATCH v5 1/1] use crc32 instead of md5 for hibernation e820 integrity check

2021-04-08 Thread Simo Sorce
On Thu, 2021-04-08 at 08:26 -0700, Eric Biggers wrote: > On Thu, Apr 08, 2021 at 03:32:38PM +0200, Rafael J. Wysocki wrote: > > On Thu, Apr 8, 2021 at 3:15 PM Chris von Recklinghausen > > wrote: > > > Suspend fails on a system in fips mode because md5 is used for the e820 > > > integrity check

[PATCH v2] gpio: gpio-104-dio-48e: Fixed coding style issues (revised)

2021-04-08 Thread Barney Goette
Fixed multiple bare uses of 'unsigned' without 'int'. Fixed space around "*" operator. Fixed function parameter alignment to opening parenthesis. Reported by checkpatch. Signed-off-by: Barney Goette Acked-by: William Breathitt Gray --- drivers/gpio/gpio-104-dio-48e.c | 50

Re: [PATCH v5 1/1] use crc32 instead of md5 for hibernation e820 integrity check

2021-04-08 Thread Chris von Recklinghausen
On 4/8/21 11:30 AM, Eric Biggers wrote: On Thu, Apr 08, 2021 at 09:15:06AM -0400, Chris von Recklinghausen wrote: Suspend fails on a system in fips mode because md5 is used for the e820 integrity check and is not available. Use crc32 instead. This patch changes the integrity check algorithm

Re: [RFC PATCH v3 1/2] KVM: arm64: Move CMOs from user_mem_abort to the fault handlers

2021-04-08 Thread Alexandru Elisei
Hi Yanan, On 4/8/21 10:23 AM, wangyanan (Y) wrote: > Hi Alex, > > On 2021/4/7 23:31, Alexandru Elisei wrote: >> Hi Yanan, >> >> On 3/26/21 3:16 AM, Yanan Wang wrote: >>> We currently uniformly permorm CMOs of D-cache and I-cache in function >>> user_mem_abort before calling the fault handlers. If

Re: [PATCH] selinux:Delete selinux_xfrm_policy_lookup() useless argument

2021-04-08 Thread Casey Schaufler
On 4/8/2021 1:49 AM, Zhongjun Tan wrote: > From: Zhongjun Tan > > Delete selinux selinux_xfrm_policy_lookup() useless argument. > > Signed-off-by: Zhongjun Tan > --- > include/linux/lsm_hook_defs.h | 3 +-- > include/linux/security.h| 4 ++-- > net/xfrm/xfrm_policy.c | 6

Re: [PATCH] mm: page_counter: mitigate consequences of a page_counter underflow

2021-04-08 Thread Chris Down
Johannes Weiner writes: When the unsigned page_counter underflows, even just by a few pages, a cgroup will not be able to run anything afterwards and trigger the OOM killer in a loop. Underflows shouldn't happen, but when they do in practice, we may just be off by a small amount that doesn't

Re: [PATCH] KVM: SVM: Make sure GHCB is mapped before updating

2021-04-08 Thread Tom Lendacky
On 4/8/21 11:14 AM, Paolo Bonzini wrote: > On 08/04/21 18:04, Tom Lendacky wrote: > +   if (!err || !sev_es_guest(vcpu->kvm) || > !WARN_ON_ONCE(svm->ghcb)) This should be WARN_ON_ONCE(!svm->ghcb), otherwise you'll get the right result, but get a stack trace immediately. >>>

Re: [PATCH v2 07/17] KVM: x86/mmu: Check PDPTRs before allocating PAE roots

2021-04-08 Thread Paolo Bonzini
On 08/04/21 18:27, Sean Christopherson wrote: For your approach, can we put the out label after the success path? Setting mmu->root_pgd isn't wrong per se, but doing so might mislead future readers into thinking that it's functionally necessary. Indeed, thanks for the speedy review. I'll get

Re: [PATCH 0/4] Add support for XMM fast hypercalls

2021-04-08 Thread Wei Liu
On Thu, Apr 08, 2021 at 05:54:43PM +0200, Siddharth Chandrasekaran wrote: > On Thu, Apr 08, 2021 at 05:48:19PM +0200, Paolo Bonzini wrote: > > On 08/04/21 17:40, Siddharth Chandrasekaran wrote: > > > > > > Although the Hyper-v TLFS mentions that a guest cannot use this > > > > > > feature > > > >

Re: [rcu:dev.2021.04.02a] BUILD REGRESSION 4bc4fd6b7e87ff0bdb1aa2493af85be2784717c0

2021-04-08 Thread Paul E. McKenney
On Thu, Apr 08, 2021 at 08:10:16PM +0800, kernel test robot wrote: > tree/branch: > https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git > dev.2021.04.02a > branch HEAD: 4bc4fd6b7e87ff0bdb1aa2493af85be2784717c0 rcu: Fix RCU priority > boosting and add more debug output Good

Re: [PATCH] arch/m68k/kernel/sys_m68k: Add missing mmap_read_lock() to sys_cacheflush()

2021-04-08 Thread Matthew Wilcox
On Thu, Apr 08, 2021 at 04:34:20PM +, Liam Howlett wrote: > When the superuser flushes the entire cache, the mmap_read_lock() is not > taken, but mmap_read_unlock() is called. Add the missing > mmap_read_lock() call. > > Fixes: cd2567b6850b (m68k: call find_vma with the mmap_sem held in >

Re: [PATCH V5 08/25] perf/x86: Hybrid PMU support for hardware cache event

2021-04-08 Thread Peter Zijlstra
On Mon, Apr 05, 2021 at 08:10:50AM -0700, kan.li...@linux.intel.com wrote: > diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c > index 0bd9554..d71ca69 100644 > --- a/arch/x86/events/core.c > +++ b/arch/x86/events/core.c > @@ -356,6 +356,7 @@ set_ext_hw_attr(struct hw_perf_event *hwc,

Re: [PATCH V5 04/25] perf/x86/intel: Hybrid PMU support for perf capabilities

2021-04-08 Thread Peter Zijlstra
On Thu, Apr 08, 2021 at 03:40:56PM +0200, Peter Zijlstra wrote: > On Mon, Apr 05, 2021 at 08:10:46AM -0700, kan.li...@linux.intel.com wrote: > > +static inline bool intel_pmu_has_cap(struct perf_event *event, int idx) > > +{ > > + union perf_capabilities *intel_cap; > > + > > + intel_cap =

Re: [PATCH V5 04/25] perf/x86/intel: Hybrid PMU support for perf capabilities

2021-04-08 Thread Peter Zijlstra
On Mon, Apr 05, 2021 at 08:10:46AM -0700, kan.li...@linux.intel.com wrote: > +static inline bool intel_pmu_has_cap(struct perf_event *event, int idx) > +{ > + union perf_capabilities *intel_cap; > + > + intel_cap = is_hybrid() ? _pmu(event->pmu)->intel_cap : > +

Re: [PATCH 02/11] mm/page_alloc: Convert per-cpu list protection to local_lock

2021-04-08 Thread Peter Zijlstra
On Wed, Apr 07, 2021 at 09:24:14PM +0100, Mel Gorman wrote: > There is a lack of clarity of what exactly local_irq_save/local_irq_restore > protects in page_alloc.c . It conflates the protection of per-cpu page > allocation structures with per-cpu vmstat deltas. > > This patch protects the PCP

Re: [PATCH 3/4] sched/fair: Consider SMT in ASYM_PACKING load balance

2021-04-08 Thread Peter Zijlstra
On Tue, Apr 06, 2021 at 04:17:10PM -0700, Ricardo Neri wrote: > On Tue, Apr 06, 2021 at 01:17:28PM +0200, Peter Zijlstra wrote: > > On Mon, Apr 05, 2021 at 09:11:07PM -0700, Ricardo Neri wrote: > > > @@ -8507,6 +8619,10 @@ static bool update_sd_pick_busiest(struct lb_env > > > *env, > > > if

Re: [RFC PATCH] Add split_lock

2021-04-08 Thread Peter Zijlstra
On Thu, Apr 08, 2021 at 06:23:38AM +0100, Matthew Wilcox (Oracle) wrote: > bit_spinlocks are horrible on RT because there's absolutely nowhere > to put the mutex to sleep on. They also do not participate in lockdep > because there's nowhere to put the map. > > Most (all?) bit spinlocks are

[PATCH] block: Fix sys_ioprio_set(.which=IOPRIO_WHO_PGRP) task iteration

2021-04-08 Thread Peter Zijlstra
do_each_pid_thread() { } while_each_pid_thread() is a double loop and thus break doesn't work as expected. Also, it should be used under tasklist_lock because otherwise we can race against change_pid() for PGID/SID. Signed-off-by: Peter Zijlstra (Intel) --- block/ioprio.c | 11 +--

[PATCH] io-wq: Fix io_wq_worker_affinity()

2021-04-08 Thread Peter Zijlstra
Do not include private headers and do not frob in internals. On top of that, while the previous code restores the affinity, it doesn't ensure the task actually moves there if it was running, leading to the fun situation that it can be observed running outside of its allowed mask for potentially

static_branch/jump_label vs branch merging

2021-04-08 Thread Peter Zijlstra
Hi! Given code like: DEFINE_STATIC_KEY_FALSE(sched_schedstats); #define schedstat_enabled() static_branch_unlikely(_schedstats) #define schedstat_set(var, val) do { if (schedstat_enabled()) { var = (val); } } while (0) #define __schedstat_set(var, val) do { var =

Re: [PATCH V5 04/25] perf/x86/intel: Hybrid PMU support for perf capabilities

2021-04-08 Thread Peter Zijlstra
On Mon, Apr 05, 2021 at 08:10:46AM -0700, kan.li...@linux.intel.com wrote: > +#define is_hybrid() (!!x86_pmu.num_hybrid_pmus) Given this is sprinkled all over the place, can you make this a static_key_false + static_branch_unlikely() such that the hybrid case is out-of-line?

[PATCH 04/16] PCI/P2PDMA: Refactor pci_p2pdma_map_type() to take pagmap and device

2021-04-08 Thread Logan Gunthorpe
All callers of pci_p2pdma_map_type() have a struct dev_pgmap and a struct device (of the client doing the DMA transfer). Thus move the conversion to struct pci_devs for the provider and client into this function. Signed-off-by: Logan Gunthorpe --- drivers/pci/p2pdma.c | 29

[PATCH 03/16] PCI/P2PDMA: Attempt to set map_type if it has not been set

2021-04-08 Thread Logan Gunthorpe
Attempt to find the mapping type for P2PDMA pages on the first DMA map attempt if it has not been done ahead of time. Previously, the mapping type was expected to be calculated ahead of time, but if pages are to come from userspace then there's no way to ensure the path was checked ahead of time.

Re: [PATCH v2 2/2] certs: Add support for using elliptic curve keys for signing modules

2021-04-08 Thread Mimi Zohar
On Thu, 2021-04-08 at 11:24 -0400, Stefan Berger wrote: > Add support for using elliptic curve keys for signing modules. It uses > a NIST P384 (secp384r1) key if the user chooses an elliptic curve key > and will have ECDSA support built into the kernel. > > Note: A developer choosing an ECDSA key

<    1   2   3   4   5   6   7   8   9   10   >