Re: [PATCH v1 02/10] powerpc: Rename 'funcaddr' to 'addr' in 'struct ppc64_opd_entry'

2021-10-13 Thread Kees Cook
On Mon, Oct 11, 2021 at 05:25:29PM +0200, Christophe Leroy wrote: > There are three architectures with function descriptors, try to > have common names for the address they contain in order to > refactor some functions into generic functions later. > > powerpc has 'funcaddr' > ia64 has 'ip' > pari

Re: [PATCH v1 03/10] ia64: Rename 'ip' to 'addr' in 'struct fdesc'

2021-10-13 Thread Kees Cook
On Mon, Oct 11, 2021 at 05:25:30PM +0200, Christophe Leroy wrote: > There are three architectures with function descriptors, try to > have common names for the address they contain in order to > refactor some functions into generic functions later. > > powerpc has 'funcaddr' > ia64 has 'ip' > pari

Re: [PATCH v1 04/10] asm-generic: Use HAVE_DEREFERENCE_FUNCTION_DESCRIPTOR to define associated stubs

2021-10-13 Thread Kees Cook
On Mon, Oct 11, 2021 at 05:25:31PM +0200, Christophe Leroy wrote: > Use HAVE_DEREFERENCE_FUNCTION_DESCRIPTOR instead of > 'dereference_function_descriptor' > to know whether arch has function descriptors. > > Signed-off-by: Christophe Leroy I'd mention the intentionally-empty #if/#else in the c

Re: [PATCH v1 05/10] asm-generic: Define 'funct_descr_t' to commonly describe function descriptors

2021-10-13 Thread Kees Cook
On Mon, Oct 11, 2021 at 05:25:32PM +0200, Christophe Leroy wrote: > We have three architectures using function descriptors, each with its > own name. > > Add a common typedef that can be used in generic code. > > Also add a stub typedef for architecture without function descriptors, nit: funct_d

Re: [PATCH v1 06/10] asm-generic: Refactor dereference_[kernel]_function_descriptor()

2021-10-13 Thread Kees Cook
On Mon, Oct 11, 2021 at 05:25:33PM +0200, Christophe Leroy wrote: > dereference_function_descriptor() and > dereference_kernel_function_descriptor() are identical on the > three architectures implementing them. > > Make it common. > > Signed-off-by: Christophe Leroy > --- > arch/ia64/include/as

Re: [PATCH v1 07/10] lkdtm: Force do_nothing() out of line

2021-10-13 Thread Kees Cook
On Mon, Oct 11, 2021 at 05:25:34PM +0200, Christophe Leroy wrote: > LKDTM tests display that the run do_nothing() at a given > address, but in reality do_nothing() is inlined into the > caller. > > Force it out of line so that it really runs text at the > displayed address. > > Signed-off-by: Chr

Re: [PATCH v1 08/10] lkdtm: Really write into kernel text in WRITE_KERN

2021-10-13 Thread Kees Cook
On Mon, Oct 11, 2021 at 05:25:35PM +0200, Christophe Leroy wrote: > WRITE_KERN is supposed to overwrite some kernel text, namely > do_overwritten() function. > > But at the time being it overwrites do_overwritten() function > descriptor, not function text. > > Fix it by dereferencing the function

Re: [PATCH v1 09/10] lkdtm: Fix lkdtm_EXEC_RODATA()

2021-10-13 Thread Kees Cook
On Mon, Oct 11, 2021 at 05:25:36PM +0200, Christophe Leroy wrote: > Behind a location, lkdtm_EXEC_RODATA() executes a real function, > not a copy of do_nothing(). > > So do it directly instead of using execute_location(). I don't understand this. Why does the next patch not fix this? -Kees > >

Re: [PATCH v1 10/10] lkdtm: Fix execute_[user]_location()

2021-10-13 Thread Kees Cook
On Mon, Oct 11, 2021 at 05:25:37PM +0200, Christophe Leroy wrote: > execute_location() and execute_user_location() intent > to copy do_nothing() text and execute it at a new location. > However, at the time being it doesn't copy do_nothing() function > but do_nothing() function descriptor which sti

Re: [PATCH v1 09/10] lkdtm: Fix lkdtm_EXEC_RODATA()

2021-10-13 Thread Kees Cook
On Mon, Oct 11, 2021 at 05:25:36PM +0200, Christophe Leroy wrote: > Behind a location, lkdtm_EXEC_RODATA() executes a real function, > not a copy of do_nothing(). > > So do it directly instead of using execute_location(). > > And fix displayed addresses by dereferencing the function descriptors. >

Re: [PATCH v1 05/10] asm-generic: Define 'funct_descr_t' to commonly describe function descriptors

2021-10-13 Thread Christophe Leroy
Le 13/10/2021 à 09:01, Kees Cook a écrit : On Mon, Oct 11, 2021 at 05:25:32PM +0200, Christophe Leroy wrote: We have three architectures using function descriptors, each with its own name. Add a common typedef that can be used in generic code. Also add a stub typedef for architecture withou

Re: [PATCH v1 05/10] asm-generic: Define 'funct_descr_t' to commonly describe function descriptors

2021-10-13 Thread Kees Cook
On Wed, Oct 13, 2021 at 09:23:56AM +0200, Christophe Leroy wrote: > > > Le 13/10/2021 à 09:01, Kees Cook a écrit : > > On Mon, Oct 11, 2021 at 05:25:32PM +0200, Christophe Leroy wrote: > > > We have three architectures using function descriptors, each with its > > > own name. > > > > > > Add a c

Re: [PATCH v1 08/10] lkdtm: Really write into kernel text in WRITE_KERN

2021-10-13 Thread Christophe Leroy
Le 13/10/2021 à 09:05, Kees Cook a écrit : On Mon, Oct 11, 2021 at 05:25:35PM +0200, Christophe Leroy wrote: WRITE_KERN is supposed to overwrite some kernel text, namely do_overwritten() function. But at the time being it overwrites do_overwritten() function descriptor, not function text. F

Re: [PATCH v1 09/10] lkdtm: Fix lkdtm_EXEC_RODATA()

2021-10-13 Thread Christophe Leroy
Le 13/10/2021 à 09:09, Kees Cook a écrit : On Mon, Oct 11, 2021 at 05:25:36PM +0200, Christophe Leroy wrote: Behind a location, lkdtm_EXEC_RODATA() executes a real function, not a copy of do_nothing(). So do it directly instead of using execute_location(). I don't understand this. Why does

Re: [PATCH v1 09/10] lkdtm: Fix lkdtm_EXEC_RODATA()

2021-10-13 Thread Christophe Leroy
Le 13/10/2021 à 09:23, Kees Cook a écrit : On Mon, Oct 11, 2021 at 05:25:36PM +0200, Christophe Leroy wrote: Behind a location, lkdtm_EXEC_RODATA() executes a real function, not a copy of do_nothing(). So do it directly instead of using execute_location(). And fix displayed addresses by der

Re: [PATCH v1 09/10] lkdtm: Fix lkdtm_EXEC_RODATA()

2021-10-13 Thread Christophe Leroy
Le 13/10/2021 à 09:39, Christophe Leroy a écrit : Le 13/10/2021 à 09:23, Kees Cook a écrit : On Mon, Oct 11, 2021 at 05:25:36PM +0200, Christophe Leroy wrote: Behind a location, lkdtm_EXEC_RODATA() executes a real function, not a copy of do_nothing(). So do it directly instead of using ex

Re: [RESEND PATCH v2 1/2] ftrace: disable preemption between ftrace_test_recursion_trylock/unlock()

2021-10-13 Thread Miroslav Benes
> diff --git a/include/linux/trace_recursion.h b/include/linux/trace_recursion.h > index a9f9c57..101e1fb 100644 > --- a/include/linux/trace_recursion.h > +++ b/include/linux/trace_recursion.h > @@ -208,13 +208,29 @@ static __always_inline void trace_clear_recursion(int > bit) > * Use this for f

Re: [PATCH v2 00/11] Add Apple M1 support to PASemi i2c driver

2021-10-13 Thread Christian Zigotzky
On 09 October 2021 at 03:57 pm, Christian Zigotzky wrote: > On 09 October 2021 at 12:10 pm, Wolfram Sang wrote: >>> I still don't have access to any old PASemi hardware but the changes from >>> v1 are pretty small and I expect them to still work. Would still be nice >>> if someone with access t

Re: [RESEND PATCH v2 1/2] ftrace: disable preemption between ftrace_test_recursion_trylock/unlock()

2021-10-13 Thread 王贇
On 2021/10/13 下午3:55, Miroslav Benes wrote: >> diff --git a/include/linux/trace_recursion.h >> b/include/linux/trace_recursion.h >> index a9f9c57..101e1fb 100644 >> --- a/include/linux/trace_recursion.h >> +++ b/include/linux/trace_recursion.h >> @@ -208,13 +208,29 @@ static __always_inline voi

Re: [PATCH] powerpc: don't select KFENCE on platform PPC_FSL_BOOK3E

2021-10-13 Thread Christophe Leroy
Le 13/10/2021 à 02:48, Michael Ellerman a écrit : Christophe Leroy writes: Le 12/10/2021 à 08:24, Michael Ellerman a écrit : Liu Shixin writes: kindly ping. I was under the impression you were trying to debug why it wasn't working with Christophe. The investigation was a bit dormant t

Re: [RESEND PATCH v2 1/2] ftrace: disable preemption between ftrace_test_recursion_trylock/unlock()

2021-10-13 Thread Miroslav Benes
> > Side note... the comment will eventually conflict with peterz's > > https://lore.kernel.org/all/20210929152429.125997...@infradead.org/. > > Steven, would you like to share your opinion on this patch? > > If klp_synchronize_transition() will be removed anyway, the comments > will be meaningl

Re: [RESEND PATCH v2 1/2] ftrace: disable preemption between ftrace_test_recursion_trylock/unlock()

2021-10-13 Thread 王贇
On 2021/10/13 下午4:25, Miroslav Benes wrote: >>> Side note... the comment will eventually conflict with peterz's >>> https://lore.kernel.org/all/20210929152429.125997...@infradead.org/. >> >> Steven, would you like to share your opinion on this patch? >> >> If klp_synchronize_transition() will b

[PATCH v3 0/2] fix & prevent the missing preemption disabling

2021-10-13 Thread 王贇
The testing show that perf_ftrace_function_call() are using smp_processor_id() with preemption enabled, all the checking on CPU could be wrong after preemption. As Peter point out, the section between ftrace_test_recursion_trylock/unlock() pair require the preemption to be disabled as 'Documenta

[PATCH v3 1/2] ftrace: disable preemption between ftrace_test_recursion_trylock/unlock()

2021-10-13 Thread 王贇
As the documentation explained, ftrace_test_recursion_trylock() and ftrace_test_recursion_unlock() were supposed to disable and enable preemption properly, however currently this work is done outside of the function, which could be missing by mistake. This path will make sure the preemption was di

[PATCH v3 2/2] ftrace: do CPU checking after preemption disabled

2021-10-13 Thread 王贇
With CONFIG_DEBUG_PREEMPT we observed reports like: BUG: using smp_processor_id() in preemptible caller is perf_ftrace_function_call+0x6f/0x2e0 CPU: 1 PID: 680 Comm: a.out Not tainted Call Trace: dump_stack_lvl+0x8d/0xcf check_preemption_disabled+0x104/0x110 ? optimize_nops.is

Re: [PATCH v2] KVM: PPC: Defer vtime accounting 'til after IRQ handling

2021-10-13 Thread Laurent Vivier
On 13/10/2021 01:18, Michael Ellerman wrote: Laurent Vivier writes: Commit 112665286d08 moved guest_exit() in the interrupt protected area to avoid wrong context warning (or worse), but the tick counter cannot be updated and the guest time is accounted to the system time. To fix the problem po

Re: [PATCH 2/2] kbuild: use more subdir- for visiting subdirectories while cleaning

2021-10-13 Thread Kees Cook
On Wed, Oct 13, 2021 at 03:36:22PM +0900, Masahiro Yamada wrote: > Documentation/kbuild/makefiles.rst suggests to use "archclean" for > cleaning arch/$(SRCARCH)/boot/. > > Since commit d92cc4d51643 ("kbuild: require all architectures to have > arch/$(SRCARCH)/Kbuild"), we can use the "subdir- += b

[PATCH 2/2] kbuild: use more subdir- for visiting subdirectories while cleaning

2021-10-13 Thread Masahiro Yamada
Documentation/kbuild/makefiles.rst suggests to use "archclean" for cleaning arch/$(SRCARCH)/boot/. Since commit d92cc4d51643 ("kbuild: require all architectures to have arch/$(SRCARCH)/Kbuild"), we can use the "subdir- += boot" trick for all architectures. This can take advantage of the parallel o

Re: [PATCH 2/2] kbuild: use more subdir- for visiting subdirectories while cleaning

2021-10-13 Thread Geert Uytterhoeven
On Wed, Oct 13, 2021 at 8:43 AM Masahiro Yamada wrote: > Documentation/kbuild/makefiles.rst suggests to use "archclean" for > cleaning arch/$(SRCARCH)/boot/. > > Since commit d92cc4d51643 ("kbuild: require all architectures to have > arch/$(SRCARCH)/Kbuild"), we can use the "subdir- += boot" trick

Re: [PATCH v6 00/11] PCI: Drop duplicated tracking of a pci_dev's bound driver

2021-10-13 Thread Uwe Kleine-König
On Tue, Oct 12, 2021 at 06:32:12PM -0500, Bjorn Helgaas wrote: > On Mon, Oct 04, 2021 at 02:59:24PM +0200, Uwe Kleine-König wrote: > > Hello, > > > > this is v6 of the quest to drop the "driver" member from struct pci_dev > > which tracks the same data (apart from a constant offset) as dev.driver.

Re: [PATCH v6 00/11] PCI: Drop duplicated tracking of a pci_dev's bound driver

2021-10-13 Thread Andy Shevchenko
On Wed, Oct 13, 2021 at 2:33 AM Bjorn Helgaas wrote: > On Mon, Oct 04, 2021 at 02:59:24PM +0200, Uwe Kleine-König wrote: > I split some of the bigger patches apart so they only touched one > driver or subsystem at a time. I also updated to_pci_driver() so it > returns NULL when given NULL, which

Re: [PATCH v5 0/4] Add perf interface to expose nvdimm

2021-10-13 Thread kajoljain
Hi Dan, Any comments on this patch-set? Thanks, Kajol Jain On 9/28/21 6:11 PM, Kajol Jain wrote: > Patchset adds performance stats reporting support for nvdimm. > Added interface includes support for pmu register/unregister > functions. A structure is added called nvdimm_pmu to be used for > a

Re: [PATCH v1 06/10] asm-generic: Refactor dereference_[kernel]_function_descriptor()

2021-10-13 Thread Christophe Leroy
Le 13/10/2021 à 09:02, Kees Cook a écrit : On Mon, Oct 11, 2021 at 05:25:33PM +0200, Christophe Leroy wrote: dereference_function_descriptor() and dereference_kernel_function_descriptor() are identical on the three architectures implementing them. Make it common. Signed-off-by: Christophe L

Re: [PATCH v1 06/10] asm-generic: Refactor dereference_[kernel]_function_descriptor()

2021-10-13 Thread Arnd Bergmann
On Wed, Oct 13, 2021 at 1:20 PM Christophe Leroy wrote: > Le 13/10/2021 à 09:02, Kees Cook a écrit : > > On Mon, Oct 11, 2021 at 05:25:33PM +0200, Christophe Leroy wrote: > >> dereference_function_descriptor() and > >> dereference_kernel_function_descriptor() are identical on the > >> three archit

Re: [PATCH v1 10/10] lkdtm: Fix execute_[user]_location()

2021-10-13 Thread Christophe Leroy
Le 13/10/2021 à 09:16, Kees Cook a écrit : On Mon, Oct 11, 2021 at 05:25:37PM +0200, Christophe Leroy wrote: execute_location() and execute_user_location() intent to copy do_nothing() text and execute it at a new location. However, at the time being it doesn't copy do_nothing() function but d

Re: [PATCH v1 09/10] lkdtm: Fix lkdtm_EXEC_RODATA()

2021-10-13 Thread Christophe Leroy
Le 13/10/2021 à 09:48, Christophe Leroy a écrit : Le 13/10/2021 à 09:39, Christophe Leroy a écrit : Le 13/10/2021 à 09:23, Kees Cook a écrit : On Mon, Oct 11, 2021 at 05:25:36PM +0200, Christophe Leroy wrote: Behind a location, lkdtm_EXEC_RODATA() executes a real function, not a copy of

Re: [RESEND PATCH v2 1/2] ftrace: disable preemption between ftrace_test_recursion_trylock/unlock()

2021-10-13 Thread Steven Rostedt
On Wed, 13 Oct 2021 16:34:53 +0800 王贇 wrote: > On 2021/10/13 下午4:25, Miroslav Benes wrote: > >>> Side note... the comment will eventually conflict with peterz's > >>> https://lore.kernel.org/all/20210929152429.125997...@infradead.org/. > >> > >> Steven, would you like to share your opinion on

[RFC PATCH v3 10/13] ASoC: fsl: asrc_dma: protect for_each_dpcm_be() loops

2021-10-13 Thread Pierre-Louis Bossart
Follow the locking model used within soc-pcm.c Signed-off-by: Pierre-Louis Bossart --- sound/soc/fsl/fsl_asrc_dma.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/fsl/fsl_asrc_dma.c b/sound/soc/fsl/fsl_asrc_dma.c index cd9b36ec0ecb..b67097503836 100644 --- a/sound/soc/fsl/fsl_as

[PATCH] powerpc: Mark .opd section read-only

2021-10-13 Thread Christophe Leroy
.opd section contains function descriptors used to locate functions in the kernel. If someone is able to modify a function descriptor he will be able to run arbitrary kernel function instead of another. To avoid that, move .opd section inside read-only memory. Signed-off-by: Christophe Leroy ---

Re: [PATCH v3 02/52] powerpc/64s: guard optional TIDR SPR with CPU ftr test

2021-10-13 Thread Fabiano Rosas
Michael Ellerman writes: > Fabiano Rosas writes: >> Nicholas Piggin writes: >> >>> The TIDR SPR only exists on POWER9. Avoid accessing it when the >>> feature bit for it is not set. >> >> Not related to this patch, but how does this work with compat mode? A P9 >> compat mode guest would get an

[PATCH v2] powerpc/s64: Clarify that radix lacks DEBUG_PAGEALLOC

2021-10-13 Thread Joel Stanley
The page_alloc.c code will call into __kernel_map_pages when DEBUG_PAGEALLOC is configured and enabled. As the implementation assumes hash, this should crash spectacularly if not for a bit of luck in __kernel_map_pages. In this function linear_map_hash_count is always zero, the for loop exits with

[PATCH 2/4] powerpc/5200: dts: fix pci ranges warnings

2021-10-13 Thread Anatolij Gustschin
Fix ranges property warnings: pci@fd00:ranges: 'oneOf' conditional failed, one must be fixed: Signed-off-by: Anatolij Gustschin --- arch/powerpc/boot/dts/a4m072.dts| 6 +++--- arch/powerpc/boot/dts/charon.dts| 6 +++--- arch/powerpc/boot/dts/digsy_mtc.dts | 6 +++--- arch/powerpc/boo

[PATCH 0/4] Update mpc5200 dts files to fix warnings

2021-10-13 Thread Anatolij Gustschin
This series fixes localbus, memory and pci node build warnings. It was tested with current linux-next on digsy_mtc and tqm5200 boards. Anatolij Gustschin (4): powerpc/5200: dts: add missing pci ranges powerpc/5200: dts: fix pci ranges warnings powerpc/5200: dts: fix memory node unit name p

[PATCH 3/4] powerpc/5200: dts: fix memory node unit name

2021-10-13 Thread Anatolij Gustschin
Fixes build warnings: Warning (unit_address_vs_reg): /memory: node has a reg or ranges property, but no unit name Signed-off-by: Anatolij Gustschin --- arch/powerpc/boot/dts/charon.dts| 2 +- arch/powerpc/boot/dts/digsy_mtc.dts | 2 +- arch/powerpc/boot/dts/lite5200.dts | 2 +- arch/powerp

[PATCH 4/4] powerpc/5200: dts: fix localbus node warnings

2021-10-13 Thread Anatolij Gustschin
Fix build warnings like: localbus:ranges: 'oneOf' conditional failed, one must be fixed ... Warning (unit_address_vs_reg): /localbus: node has a reg or ranges property, but no unit name Warning (simple_bus_reg): /localbus/flash@0,0: simple-bus unit address format error, expected "0" Signed-off-b

[PATCH 1/4] powerpc/5200: dts: add missing pci ranges

2021-10-13 Thread Anatolij Gustschin
Add ranges property to fix build warnings: Warning (pci_bridge): /pci@fd00: missing ranges for PCI bridge (or not a bridge) Signed-off-by: Anatolij Gustschin --- arch/powerpc/boot/dts/mpc5200b.dtsi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/boot/dts/

Re: linux-next: build warnings in Linus' tree

2021-10-13 Thread Anatolij Gustschin
Hi Arnd, Rob, On Tue, 12 Oct 2021 16:39:56 +0200 Arnd Bergmann a...@arndb.de wrote: ... >Grant Likely was the original maintainer for MPC52xx until 2011, >Anatolij Gustschin is still listed as maintainer since then but hasn't >been active in it for a while either. Anatolij can probably best judge

Re: linux-next: build warnings in Linus' tree

2021-10-13 Thread Rob Herring
On Wed, Oct 13, 2021 at 5:12 PM Anatolij Gustschin wrote: > > Hi Arnd, Rob, > > On Tue, 12 Oct 2021 16:39:56 +0200 > Arnd Bergmann a...@arndb.de wrote: > ... > >Grant Likely was the original maintainer for MPC52xx until 2011, > >Anatolij Gustschin is still listed as maintainer since then but hasn'

Re: linux-next: build warnings in Linus' tree

2021-10-13 Thread Anatolij Gustschin
On Wed, 13 Oct 2021 17:17:25 -0500 Rob Herring robh...@kernel.org wrote: ... >In general, you shouldn't need to be changing the drivers. Can you >tell me which warnings need driver changes? ethernet and mdio drivers share registers, so they use same unit-address: arch/powerpc/boot/dts/tqm5200.dts

[PATCH] powerpc/5200: dts: fix psc node warning

2021-10-13 Thread Anatolij Gustschin
Fix build warning: Warning (spi_bus_bridge): /soc5200@f000/psc@2000: node name for SPI buses should be 'spi' Signed-off-by: Anatolij Gustschin --- arch/powerpc/boot/dts/motionpro.dts | 4 arch/powerpc/boot/dts/o2d.dtsi | 6 +- 2 files changed, 9 insertions(+), 1 deletion(-) d

Re: linux-next: build warnings in Linus' tree

2021-10-13 Thread Rob Herring
On Wed, Oct 13, 2021 at 5:28 PM Anatolij Gustschin wrote: > > On Wed, 13 Oct 2021 17:17:25 -0500 > Rob Herring robh...@kernel.org wrote: > ... > >In general, you shouldn't need to be changing the drivers. Can you > >tell me which warnings need driver changes? > > ethernet and mdio drivers share re

[PATCH] powerpc/64s: Default to 64K pages for 64 bit book3s

2021-10-13 Thread Joel Stanley
For 64-bit book3s the default should be 64K as that's what modern CPUs are designed for. The following defconfigs already set CONFIG_PPC_64K_PAGES: cell_defconfig pasemi_defconfig powernv_defconfig ppc64_defconfig pseries_defconfig skiroot_defconfig The have the option removed from the def

Re: [PATCH v6 00/11] PCI: Drop duplicated tracking of a pci_dev's bound driver

2021-10-13 Thread Bjorn Helgaas
On Wed, Oct 13, 2021 at 10:51:31AM +0200, Uwe Kleine-König wrote: > On Tue, Oct 12, 2021 at 06:32:12PM -0500, Bjorn Helgaas wrote: > > On Mon, Oct 04, 2021 at 02:59:24PM +0200, Uwe Kleine-König wrote: > > > Hello, > > > > > > this is v6 of the quest to drop the "driver" member from struct pci_dev

Re: [PATCH v6 00/11] PCI: Drop duplicated tracking of a pci_dev's bound driver

2021-10-13 Thread Uwe Kleine-König
Hello, On Wed, Oct 13, 2021 at 05:54:28AM -0500, Bjorn Helgaas wrote: > On Wed, Oct 13, 2021 at 10:51:31AM +0200, Uwe Kleine-König wrote: > > On Tue, Oct 12, 2021 at 06:32:12PM -0500, Bjorn Helgaas wrote: > > > diff --git a/drivers/misc/cxl/guest.c b/drivers/misc/cxl/guest.c > > > index d997c9c3eb

Re: [PATCH v6 00/11] PCI: Drop duplicated tracking of a pci_dev's bound driver

2021-10-13 Thread Bjorn Helgaas
On Wed, Oct 13, 2021 at 12:26:42PM +0300, Andy Shevchenko wrote: > On Wed, Oct 13, 2021 at 2:33 AM Bjorn Helgaas wrote: > > On Mon, Oct 04, 2021 at 02:59:24PM +0200, Uwe Kleine-König wrote: > > > I split some of the bigger patches apart so they only touched one > > driver or subsystem at a time.

Re: [PATCH v6 00/11] PCI: Drop duplicated tracking of a pci_dev's bound driver

2021-10-13 Thread Andy Shevchenko
On Wed, Oct 13, 2021 at 06:33:56AM -0500, Bjorn Helgaas wrote: > On Wed, Oct 13, 2021 at 12:26:42PM +0300, Andy Shevchenko wrote: > > On Wed, Oct 13, 2021 at 2:33 AM Bjorn Helgaas wrote: > > > On Mon, Oct 04, 2021 at 02:59:24PM +0200, Uwe Kleine-König wrote: ... > > It's a bit unusual. Other to_

[PATCH] powerpc/dcr: Use cmplwi instead of 3-argument cmpli

2021-10-13 Thread Michael Ellerman
In dcr-low.S we use cmpli with three arguments, instead of four arguments as defined in the ISA: cmpli cr0,r3,1024 This appears to be a PPC440-ism, looking at the "PPC440x5 CPU Core User’s Manual" it shows cmpli having no L field, but implied to be 0 due to the core being 32-bit. It men

[PATCH v2 09/13] lkdtm: Force do_nothing() out of line

2021-10-13 Thread Christophe Leroy
LKDTM tests display that the run do_nothing() at a given address, but in reality do_nothing() is inlined into the caller. Force it out of line so that it really runs text at the displayed address. Acked-by: Kees Cook Signed-off-by: Christophe Leroy --- drivers/misc/lkdtm/perms.c | 4 ++-- 1 fi

[PATCH v2 11/13] lkdtm: Fix lkdtm_EXEC_RODATA()

2021-10-13 Thread Christophe Leroy
Behind its location, lkdtm_EXEC_RODATA() executes lkdtm_rodata_do_nothing() which is a real function, not a copy of do_nothing(). So executes it directly instead of using execute_location(). This is necessary because following patch will fix execute_location() to use a copy of the function descri

[PATCH v2 10/13] lkdtm: Really write into kernel text in WRITE_KERN

2021-10-13 Thread Christophe Leroy
WRITE_KERN is supposed to overwrite some kernel text, namely do_overwritten() function. But at the time being it overwrites do_overwritten() function descriptor, not function text. Fix it by dereferencing the function descriptor to obtain function text pointer. And make do_overwritten() noinline

[PATCH v2 01/13] powerpc: Move 'struct ppc64_opd_entry' back into asm/elf.h

2021-10-13 Thread Christophe Leroy
'struct ppc64_opd_entry' doesn't belong to uapi/asm/elf.h It was initially in module_64.c and commit 2d291e902791 ("Fix compile failure with non modular builds") moved it into asm/elf.h But it was by mistake added outside of __KERNEL__ section, therefore commit c3617f72036c ("UAPI: (Scripted) Dis

[PATCH v2 04/13] powerpc: Prepare func_desc_t for refactorisation

2021-10-13 Thread Christophe Leroy
In preparation of making func_desc_t generic, change it to a struct containing 'addr' element. In addition this allows using single helpers common to ELFv1 and ELFv2. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/module_64.c | 34 +++-- 1 file changed, 15 i

[PATCH v2 05/13] ia64: Rename 'ip' to 'addr' in 'struct fdesc'

2021-10-13 Thread Christophe Leroy
There are three architectures with function descriptors, try to have common names for the address they contain in order to refactor some functions into generic functions later. powerpc has 'funcaddr' ia64 has 'ip' parisc has 'addr' Vote for 'addr' and update 'struct fdesc' accordingly. Reviewed-

[PATCH v2 03/13] powerpc: Remove func_descr_t

2021-10-13 Thread Christophe Leroy
'func_descr_t' is redundant with 'struct ppc64_opd_entry' Remove it. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/code-patching.h | 2 +- arch/powerpc/include/asm/types.h | 6 -- arch/powerpc/kernel/signal_64.c | 8 3 files changed, 5 insertions(+),

[PATCH v2 00/13] Fix LKDTM for PPC64/IA64/PARISC

2021-10-13 Thread Christophe Leroy
PPC64/IA64/PARISC have function descriptors. LKDTM doesn't work on those three architectures because LKDTM messes up function descriptors with functions. This series does some cleanup in the three architectures and refactors function descriptors so that it can then easily use it in a generic way i

[PATCH v2 02/13] powerpc: Rename 'funcaddr' to 'addr' in 'struct ppc64_opd_entry'

2021-10-13 Thread Christophe Leroy
There are three architectures with function descriptors, try to have common names for the address they contain in order to refactor some functions into generic functions later. powerpc has 'funcaddr' ia64 has 'ip' parisc has 'addr' Vote for 'addr' and update 'struct ppc64_opd_entry' accordingly.

[PATCH v2 13/13] lkdtm: Add a test for function descriptors protection

2021-10-13 Thread Christophe Leroy
Add WRITE_OPD to check that you can't modify function descriptors. Gives the following result when function descriptors are not protected: lkdtm: Performing direct entry WRITE_OPD lkdtm: attempting bad 16 bytes write at c269b358 lkdtm: FAIL: survived bad write

[PATCH v2 07/13] asm-generic: Define 'func_desc_t' to commonly describe function descriptors

2021-10-13 Thread Christophe Leroy
We have three architectures using function descriptors, each with its own name. Add a common typedef that can be used in generic code. Also add a stub typedef for architecture without function descriptors, to avoid a forest of #ifdefs. It replaces the similar func_desc_t previously defined in ar

[PATCH v2 12/13] lkdtm: Fix execute_[user]_location()

2021-10-13 Thread Christophe Leroy
execute_location() and execute_user_location() intent to copy do_nothing() text and execute it at a new location. However, at the time being it doesn't copy do_nothing() function but do_nothing() function descriptor which still points to the original text. So at the end it still executes do_nothing

[PATCH v2 06/13] asm-generic: Use HAVE_FUNCTION_DESCRIPTORS to define associated stubs

2021-10-13 Thread Christophe Leroy
Replace HAVE_DEREFERENCE_FUNCTION_DESCRIPTOR by HAVE_FUNCTION_DESCRIPTORS and use it instead of 'dereference_function_descriptor' macro to know whether an arch has function descriptors. To limit churn in one of the following patches, use an #ifdef/#else construct with empty first part instead of a

[PATCH v2 08/13] asm-generic: Refactor dereference_[kernel]_function_descriptor()

2021-10-13 Thread Christophe Leroy
dereference_function_descriptor() and dereference_kernel_function_descriptor() are identical on the three architectures implementing them. Make them common and put them out-of-line in kernel/extable.c which is one of the users and has similar type of functions. Reviewed-by: Kees Cook Reviewed-by

Re: [PATCH v2 07/13] asm-generic: Define 'func_desc_t' to commonly describe function descriptors

2021-10-13 Thread Arnd Bergmann
On Thu, Oct 14, 2021 at 7:49 AM Christophe Leroy wrote: > > We have three architectures using function descriptors, each with its > own name. > > Add a common typedef that can be used in generic code. > > Also add a stub typedef for architecture without function descriptors, > to avoid a forest of