[PATCH 2/3] KVM: PPC: Book3S HV: Stop using vc->dpdes for nested KVM guests

2024-11-08 Thread Gautam Menghani
commit 6398326b9ba1 ("KVM: PPC: Book3S HV P9: Stop using vc->dpdes") introduced an optimization to use only vcpu->doorbell_request for SMT emulation for Power9 and above guests, but the code for nested guests still relies on the old way of handling doorbells, due to which an L2 guest (see [1]) cann

[PATCH 3/3] KVM: PPC: Book3S HV: Avoid returning to nested hypervisor on pending doorbells

2024-11-08 Thread Gautam Menghani
Commit 6398326b9ba1 ("KVM: PPC: Book3S HV P9: Stop using vc->dpdes") dropped the use of vcore->dpdes for msgsndp / SMT emulation. Prior to that commit, the below code at L1 level (see [1] for terminology) was responsible for setting vc->dpdes for the respective L2 vCPU: if (!nested) { kvmp

[PATCH 1/3] Revert "KVM: PPC: Book3S HV Nested: Stop forwarding all HFUs to L1"

2024-11-08 Thread Gautam Menghani
This reverts commit 7c3ded5735141ff4d049747c9f76672a8b737c49. On PowerNV, when a nested guest tries to use a feature prohibited by HFSCR, the nested hypervisor (L1) should get a H_FAC_UNAVAILABLE trap so that L1 can emulate the feature. But with the change introduced by commit 7c3ded573514 ("KVM:

[PATCH 0/3] Fix doorbell emulation for nested KVM guests in V1 API

2024-11-08 Thread Gautam Menghani
Doorbell emulation for nested KVM guests in V1 API is broken because of 2 reasons: 1. L0 presenting H_EMUL_ASSIST to L1 instead of H_FAC_UNAVAIL 2. Broken plumbing for passing around doorbell state. Fix the trap passed to L1 and the plumbing for maintaining doorbell state. Gautam Menghani (3):

Re: [PATCH] powerpc: Add preempt lazy support

2024-11-08 Thread Ankur Arora
Shrikanth Hegde writes: > Define preempt lazy bit for Powerpc. Use bit 9 which is free and within > 16 bit range of NEED_RESCHED, so compiler can issue single andi. > > Since Powerpc doesn't use the generic entry/exit, add lazy check at exit > to user. CONFIG_PREEMPTION is defined for lazy/full

Re: [PATCH] kernel/irq/proc: performance: replace seq_printf with seq_put_decimal_ull_width

2024-11-08 Thread David Wang
Hi, At 2024-11-08 22:25:13, "Thomas Gleixner" wrote: >David! > >On Sun, Nov 03 2024 at 16:05, David Wang wrote: > >$Subject: [PATCH] kernel/irq/proc: performance: ... > >That's not a valid subsystem prefix. copy that~ > >> seq_printf is costy, when stress reading /proc/interrupts, profiling

[PATCH 11/13] powerpc/irq: use seq_put_decimal_ull_width() for decimal values

2024-11-08 Thread David Wang
Performance improvement for reading /proc/interrupts on arch powerpc Signed-off-by: David Wang <00107...@163.com> --- arch/powerpc/kernel/irq.c | 44 +++ 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/ke

Re: [PATCH v7 4/5] x86: perf: Refactor misc flag assignments

2024-11-08 Thread Peter Zijlstra
On Fri, Nov 08, 2024 at 08:20:44PM +0100, Peter Zijlstra wrote: > Isn't the below more or less what you want? > > static unsigned long misc_flags(struct pt_regs *regs) > { > unsigned long flags = 0; > > if (regs->flags & PERF_EFLAGS_EXACT) > flags |= PERF_RECORD_MISC_EX

Re: [PATCH v7 4/5] x86: perf: Refactor misc flag assignments

2024-11-08 Thread Peter Zijlstra
On Fri, Nov 08, 2024 at 07:01:16PM +, Colton Lewis wrote: > Peter Zijlstra writes: > > > On Thu, Nov 07, 2024 at 07:03:35PM +, Colton Lewis wrote: > > > Break the assignment logic for misc flags into their own respective > > > functions to reduce the complexity of the nested logic. > > >

Re: [PATCH v7 4/5] x86: perf: Refactor misc flag assignments

2024-11-08 Thread Colton Lewis
Peter Zijlstra writes: On Thu, Nov 07, 2024 at 07:03:35PM +, Colton Lewis wrote: Break the assignment logic for misc flags into their own respective functions to reduce the complexity of the nested logic. Signed-off-by: Colton Lewis Reviewed-by: Oliver Upton --- arch/x86/events/core

Re: [GIT PULL] Please pull powerpc/linux.git powerpc-6.12-6 tag

2024-11-08 Thread pr-tracker-bot
The pull request you sent on Fri, 8 Nov 2024 10:54:41 +0530: > https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git > tags/powerpc-6.12-6 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/51b47860ad8058ae54e4789b5f9b253fd555d2e9 Thank you! -- Deet-doot-do

Re: [PATCH v4 1/3] mm/pkey: Add PKEY_UNRESTRICTED macro

2024-11-08 Thread Dave Hansen
On 11/8/24 00:53, Yury Khrustalev wrote: > This patch adds PKEY_UNRESTRICTED macro defined as 0x0. Thanks for doing this and the follow-on selftests mods! Acked-by: Dave Hansen

Re: [PATCH v4 2/3] selftests/mm: Use PKEY_UNRESTRICTED macro

2024-11-08 Thread Dave Hansen
On 11/8/24 00:53, Yury Khrustalev wrote: > Replace literal 0 with macro PKEY_UNRESTRICTED where pkey_*() functions > are used in mm selftests for memory protection keys. Acked-by: Dave Hansen

RE: [PATCH v3 2/6] x86/uaccess: Avoid barrier_nospec() in 64-bit __get_user()

2024-11-08 Thread David Laight
From: Josh Poimboeuf > Sent: 29 October 2024 03:28 > > On Mon, Oct 28, 2024 at 06:56:15PM -0700, Josh Poimboeuf wrote: > > The barrier_nospec() in 64-bit __get_user() is slow. Instead use > > pointer masking to force the user pointer to all 1's if a previous > > access_ok() mispredicted true for

Re: [PATCH v7 4/5] x86: perf: Refactor misc flag assignments

2024-11-08 Thread Peter Zijlstra
On Thu, Nov 07, 2024 at 07:03:35PM +, Colton Lewis wrote: > Break the assignment logic for misc flags into their own respective > functions to reduce the complexity of the nested logic. > > Signed-off-by: Colton Lewis > Reviewed-by: Oliver Upton > --- > arch/x86/events/core.c| 3

Re: [PATCH v2] of: WARN on deprecated #address-cells/#size-cells handling

2024-11-08 Thread Steven Price
On 08/11/2024 14:58, Rob Herring wrote: > On Fri, Nov 8, 2024 at 8:33 AM Steven Price wrote: >> >> On 08/11/2024 14:04, Rob Herring wrote: >>> On Fri, Nov 8, 2024 at 7:26 AM Steven Price wrote: On 08/11/2024 11:04, Marek Szyprowski wrote: > Hi Rob, > > On 06.11.2024 18:10, R

Re: [PATCH v2] of: WARN on deprecated #address-cells/#size-cells handling

2024-11-08 Thread Marek Szyprowski
Hi Rob, On 08.11.2024 14:25, Rob Herring wrote: > On Fri, Nov 8, 2024 at 5:04 AM Marek Szyprowski > wrote: >> On 06.11.2024 18:10, Rob Herring (Arm) wrote: >>> While OpenFirmware originally allowed walking parent nodes and default >>> root values for #address-cells and #size-cells, FDT has long r

Re: [PATCH v2] of: WARN on deprecated #address-cells/#size-cells handling

2024-11-08 Thread Rob Herring
On Fri, Nov 8, 2024 at 8:33 AM Steven Price wrote: > > On 08/11/2024 14:04, Rob Herring wrote: > > On Fri, Nov 8, 2024 at 7:26 AM Steven Price wrote: > >> > >> On 08/11/2024 11:04, Marek Szyprowski wrote: > >>> Hi Rob, > >>> > >>> On 06.11.2024 18:10, Rob Herring (Arm) wrote: > While OpenFir

Re: [PATCH v2] of: WARN on deprecated #address-cells/#size-cells handling

2024-11-08 Thread Steven Price
On 08/11/2024 14:04, Rob Herring wrote: > On Fri, Nov 8, 2024 at 7:26 AM Steven Price wrote: >> >> On 08/11/2024 11:04, Marek Szyprowski wrote: >>> Hi Rob, >>> >>> On 06.11.2024 18:10, Rob Herring (Arm) wrote: While OpenFirmware originally allowed walking parent nodes and default root va

Re: [PATCH] kernel/irq/proc: performance: replace seq_printf with seq_put_decimal_ull_width

2024-11-08 Thread Thomas Gleixner
David! On Sun, Nov 03 2024 at 16:05, David Wang wrote: $Subject: [PATCH] kernel/irq/proc: performance: ... That's not a valid subsystem prefix. > seq_printf is costy, when stress reading /proc/interrupts, profiling indicates > seq_printf takes about ~47% of show_interrupts samples: Also please

Re: [PATCH v2] of: WARN on deprecated #address-cells/#size-cells handling

2024-11-08 Thread Rob Herring
On Fri, Nov 8, 2024 at 7:26 AM Steven Price wrote: > > On 08/11/2024 11:04, Marek Szyprowski wrote: > > Hi Rob, > > > > On 06.11.2024 18:10, Rob Herring (Arm) wrote: > >> While OpenFirmware originally allowed walking parent nodes and default > >> root values for #address-cells and #size-cells, FDT

Re: [PATCH v2] of: WARN on deprecated #address-cells/#size-cells handling

2024-11-08 Thread Steven Price
On 08/11/2024 11:04, Marek Szyprowski wrote: > Hi Rob, > > On 06.11.2024 18:10, Rob Herring (Arm) wrote: >> While OpenFirmware originally allowed walking parent nodes and default >> root values for #address-cells and #size-cells, FDT has long required >> explicit values. It's been a warning in dtc

Re: [PATCH v2] of: WARN on deprecated #address-cells/#size-cells handling

2024-11-08 Thread Rob Herring
ose others. > [ cut here ] > WARNING: CPU: 1 PID: 1 at drivers/of/base.c:107 > of_bus_n_addr_cells+0x98/0xcc > Missing '#address-cells' in /soc/system-controller@1002 > Modules linked in: > CPU: 1 UID: 0 PID: 1 Comm: swapper/0 Not

Re: drivers/net/ethernet/freescale/ucc_geth.c:2454:64: sparse: sparse: incorrect type in argument 1 (different address spaces)

2024-11-08 Thread Linus Walleij
On Fri, Nov 8, 2024 at 11:30 AM Christophe Leroy wrote: > The problem is the __be16 in the function prototype. > > set_mac_addr(&p_82xx_addr_filt->taddr.h, p_enet_addr); > > p_82xx_addr_filt->taddr.h is a u16 > and out_be16() expects a u16* > > So the following fixes the above warnings:

Re: drivers/net/ethernet/freescale/ucc_geth.c:2454:64: sparse: sparse: incorrect type in argument 1 (different address spaces)

2024-11-08 Thread Christophe Leroy
Le 08/11/2024 à 11:30, Christophe Leroy a écrit : Le 08/11/2024 à 09:18, Linus Walleij a écrit : On Wed, Oct 30, 2024 at 8:05 AM kernel test robot wrote: tree: https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.kernel.org%2Fpub%2Fscm%2Flinux%2Fkernel%2Fgit%2Ftorvalds

Re: [PATCH v2] of: WARN on deprecated #address-cells/#size-cells handling

2024-11-08 Thread Marek Szyprowski
- WARNING: CPU: 1 PID: 1 at drivers/of/base.c:107 of_bus_n_addr_cells+0x98/0xcc Missing '#address-cells' in /soc/system-controller@1002 Modules linked in: CPU: 1 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.12.0-rc6-next-20241108 #9360 Hardware name: Samsung Exynos (Flattened Device Tree)

Re: [PATCH] powerpc: Add preempt lazy support

2024-11-08 Thread Sebastian Andrzej Siewior
On 2024-11-08 15:48:53 [+0530], Shrikanth Hegde wrote: > Define preempt lazy bit for Powerpc. Use bit 9 which is free and within > 16 bit range of NEED_RESCHED, so compiler can issue single andi. > > Since Powerpc doesn't use the generic entry/exit, add lazy check at exit > to user. CONFIG_PREEMP

Re: drivers/net/ethernet/freescale/ucc_geth.c:2454:64: sparse: sparse: incorrect type in argument 1 (different address spaces)

2024-11-08 Thread Christophe Leroy
Le 08/11/2024 à 09:18, Linus Walleij a écrit : On Wed, Oct 30, 2024 at 8:05 AM kernel test robot wrote: tree: https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.kernel.org%2Fpub%2Fscm%2Flinux%2Fkernel%2Fgit%2Ftorvalds%2Flinux.git&data=05%7C02%7Cchristophe.leroy2%40cs-s

[PATCH] powerpc: Add preempt lazy support

2024-11-08 Thread Shrikanth Hegde
Define preempt lazy bit for Powerpc. Use bit 9 which is free and within 16 bit range of NEED_RESCHED, so compiler can issue single andi. Since Powerpc doesn't use the generic entry/exit, add lazy check at exit to user. CONFIG_PREEMPTION is defined for lazy/full/rt so use it for return to kernel.

Re: [PATCH v2 05/10] sysfs: treewide: constify attribute callback of bin_is_visible()

2024-11-08 Thread Srinivas Kandagatla
On 03/11/2024 17:03, Thomas Weißschuh wrote: The is_bin_visible() callbacks should not modify the struct bin_attribute passed as argument. Enforce this by marking the argument as const. As there are not many callback implementers perform this change throughout the tree at once. Signed-off-by

Re: [PATCH v2 04/10] nvmem: core: calculate bin_attribute size through bin_size()

2024-11-08 Thread Srinivas Kandagatla
On 03/11/2024 17:03, Thomas Weißschuh wrote: Stop abusing the is_bin_visible() callback to calculate the attribute size. Instead use the new, dedicated bin_size() one. Signed-off-by: Thomas Weißschuh --- Thanks for the patch, LGTM. Acked-by: Srinivas Kandagatla --srini drivers/nvmem

[PATCH v2] arch/powerpc/pseries: Fix KVM guest detection for disabling hardlockup detector

2024-11-08 Thread Gautam Menghani
As per the kernel documentation[1], hardlockup detector should be disabled in KVM guests as it may give false positives. On PPC, hardlockup detector is enabled inside KVM guests because disable_hardlockup_detector() is marked as early_initcall and it relies on kvm_guest static key (is_kvm_guest())

Re: [PATCH v3 1/3] mm/pkey: Add PKEY_UNRESTRICTED macro

2024-11-08 Thread Yury Khrustalev
Hi Michael, On Wed, Nov 06, 2024 at 12:00:42PM +1100, Michael Ellerman wrote: > Yury Khrustalev writes: > > Memory protection keys (pkeys) uapi has two macros for pkeys restrictions: > > > > - PKEY_DISABLE_ACCESS 0x1 > > - PKEY_DISABLE_WRITE 0x2 > > > > ... > > > > This patch adds PKEY_UNRESTR

[PATCH v4 3/3] selftests/powerpc: Use PKEY_UNRESTRICTED macro

2024-11-08 Thread Yury Khrustalev
Replace literal 0 with macro PKEY_UNRESTRICTED where pkey_*() functions are used in mm selftests for memory protection keys for ppc target. Signed-off-by: Yury Khrustalev Suggested-by: Kevin Brodsky --- Note that I couldn't build these tests so I would appreciate if someone could check this pat

[PATCH v4 1/3] mm/pkey: Add PKEY_UNRESTRICTED macro

2024-11-08 Thread Yury Khrustalev
Memory protection keys (pkeys) uapi has two macros for pkeys restrictions: - PKEY_DISABLE_ACCESS 0x1 - PKEY_DISABLE_WRITE 0x2 with implicit literal value of 0x0 that means "unrestricted". Code that works with pkeys has to use this literal value when implying that a pkey imposes no restrictions

[PATCH v4 2/3] selftests/mm: Use PKEY_UNRESTRICTED macro

2024-11-08 Thread Yury Khrustalev
Replace literal 0 with macro PKEY_UNRESTRICTED where pkey_*() functions are used in mm selftests for memory protection keys. Signed-off-by: Yury Khrustalev Suggested-by: Joey Gouly --- tools/testing/selftests/mm/mseal_test.c| 6 +++--- tools/testing/selftests/mm/pkey-helpers.h

[PATCH v4 0/3] mm/pkey: Add PKEY_UNRESTRICTED macro

2024-11-08 Thread Yury Khrustalev
Add PKEY_UNRESTRICTED macro to mman.h and use it in selftests. For context, this change will also allow for more consistent update of the Glibc manual [1] which in turn will help with introducing memory protection keys on AArch64 targets [2]. Applies to 819837584309 (tag: v6.12-rc5). Note that I

Re: [PATCH v2] of: WARN on deprecated #address-cells/#size-cells handling

2024-11-08 Thread Geert Uytterhoeven
On Thu, Nov 7, 2024 at 12:37 PM Michael Ellerman wrote: > "Rob Herring (Arm)" writes: > > While OpenFirmware originally allowed walking parent nodes and default > > root values for #address-cells and #size-cells, FDT has long required > > explicit values. It's been a warning in dtc for the root n

Re: drivers/net/ethernet/freescale/ucc_geth.c:2454:64: sparse: sparse: incorrect type in argument 1 (different address spaces)

2024-11-08 Thread Linus Walleij
On Wed, Oct 30, 2024 at 8:05 AM kernel test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git > master > head: c1e939a21eb111a6d6067b38e8e04b8809b64c4e > commit: b28d1ccf921a4333be14017d82066386d419e638 powerpc/io: Expect immutable > pointer in virt_to_

Re: [PATCH v7 3/4] arm64: topology: Support SMT control on ACPI based system

2024-11-08 Thread Yicong Yang
On 2024/11/8 1:20, Pierre Gondois wrote: > > > On 10/30/24 13:54, Yicong Yang wrote: >> From: Yicong Yang >> >> For ACPI we'll build the topology from PPTT and we cannot directly >> get the SMT number of each core. Instead using a temporary xarray >> to record the heterogeneous information (from