Re: [PATCH] perf test: Update event group check for support of uncore event
> On 08-Dec-2022, at 9:48 AM, Ravi Bangoria wrote: > > On 07-Dec-22 10:28 PM, Athira Rajeev wrote: >> Event group test checks group creation for combinations of >> hw, sw and uncore PMU events. Some of the uncore pmus may >> require additional permission to access the counters. >> For example, in case of hv_24x7, partition need to have >> permissions to access hv_24x7 pmu counters. If not, event_open >> will fail. Hence add a sanity check to see if event_open >> succeeds before proceeding with the test. >> >> Fixes: b20d9215a35f ("perf test: Add event group test for events in multiple >> PMUs") >> Signed-off-by: Athira Rajeev > > Acked-by: Ravi Bangoria Thanks Ravi for checking the patch Athira > > Thanks, > Ravi
[powerpc:next-test] BUILD SUCCESS f2636eaac7dee1d7d096cc115ff4f5111b0c508c
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next-test branch HEAD: f2636eaac7dee1d7d096cc115ff4f5111b0c508c powerpc/64: Set default CPU in Kconfig elapsed time: 728m configs tested: 60 configs skipped: 2 The following configs have been built successfully. More configs may be tested in the coming days. gcc tested configs: powerpc allnoconfig arc defconfig s390 allmodconfig alpha defconfig um i386_defconfig um x86_64_defconfig s390defconfig arc randconfig-r043-20221207 m68k allyesconfig m68k allmodconfig sh allmodconfig s390 allyesconfig mips allyesconfig arc allyesconfig x86_64 rhel-8.3-syz powerpc allmodconfig x86_64 rhel-8.3-kunit alphaallyesconfig riscvrandconfig-r042-20221207 x86_64 rhel-8.3 x86_64 rhel-8.3-kvm i386defconfig s390 randconfig-r044-20221207 x86_64 defconfig x86_64rhel-8.3-kselftests x86_64 rhel-8.3-func x86_64 rhel-8.3-rust x86_64randconfig-a004 x86_64randconfig-a002 i386 randconfig-a001 i386 randconfig-a003 x86_64randconfig-a006 ia64 allmodconfig i386 randconfig-a005 x86_64randconfig-a015 x86_64randconfig-a013 i386 randconfig-a014 x86_64randconfig-a011 i386 randconfig-a012 i386 randconfig-a016 arm defconfig x86_64 allyesconfig i386 allyesconfig arm64allyesconfig arm allyesconfig clang tested configs: arm randconfig-r046-20221207 hexagon randconfig-r041-20221207 hexagon randconfig-r045-20221207 x86_64randconfig-a001 x86_64randconfig-a003 i386 randconfig-a013 i386 randconfig-a002 x86_64randconfig-a005 i386 randconfig-a004 i386 randconfig-a015 x86_64randconfig-a014 x86_64randconfig-a016 i386 randconfig-a011 x86_64randconfig-a012 i386 randconfig-a006 -- 0-DAY CI Kernel Test Service https://01.org/lkp
[powerpc:next] BUILD SUCCESS f24f21c4122e837fa031cc512a7f20eb8c554c5e
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next branch HEAD: f24f21c4122e837fa031cc512a7f20eb8c554c5e Merge branch 'topic/objtool' into next elapsed time: 729m configs tested: 60 configs skipped: 2 The following configs have been built successfully. More configs may be tested in the coming days. gcc tested configs: arc defconfig s390 allmodconfig alpha defconfig s390defconfig s390 allyesconfig m68k allyesconfig um i386_defconfig m68k allmodconfig um x86_64_defconfig arc allyesconfig alphaallyesconfig x86_64 rhel-8.3 x86_64 defconfig x86_64 rhel-8.3-syz x86_64 rhel-8.3-kunit x86_64 rhel-8.3-kvm arc randconfig-r043-20221207 riscvrandconfig-r042-20221207 i386defconfig s390 randconfig-r044-20221207 x86_64 rhel-8.3-rust x86_64rhel-8.3-kselftests x86_64 rhel-8.3-func ia64 allmodconfig x86_64randconfig-a013 x86_64randconfig-a011 x86_64randconfig-a015 arm defconfig x86_64randconfig-a002 x86_64randconfig-a006 x86_64randconfig-a004 i386 randconfig-a001 i386 randconfig-a003 x86_64 allyesconfig arm64allyesconfig arm allyesconfig i386 randconfig-a014 i386 randconfig-a012 i386 randconfig-a005 i386 randconfig-a016 i386 allyesconfig powerpc allnoconfig mips allyesconfig sh allmodconfig powerpc allmodconfig clang tested configs: arm randconfig-r046-20221207 hexagon randconfig-r041-20221207 hexagon randconfig-r045-20221207 x86_64randconfig-a012 x86_64randconfig-a014 x86_64randconfig-a016 x86_64randconfig-a001 x86_64randconfig-a003 x86_64randconfig-a005 i386 randconfig-a002 i386 randconfig-a004 i386 randconfig-a013 i386 randconfig-a015 i386 randconfig-a011 i386 randconfig-a006 -- 0-DAY CI Kernel Test Service https://01.org/lkp
Re: [PATCH] cxl/pci: Move tracepoint definitions to drivers/cxl/core/
On Thu, Dec 08, 2022 at 09:02:00AM -0800, Dan Williams wrote: > CXL is using tracepoints for reporting RAS capability register payloads > for AER events, and has plans to use tracepoints for the output payload > of Get Poison List and Get Event Records commands. For organization > purposes it would be nice to keep those all under a single + local CXL > trace system. This also organization also potentially helps in the > future when CXL drivers expand beyond generic memory expanders, however > that would also entail a move away from the expander-specific > cxl_dev_state context, save that for later. > > Note that the powerpc-specific drivers/misc/cxl/ also defines a 'cxl' > trace system, however, it is unlikely that a single platform will ever > load both drivers simultaneously. Verified this on top of cxl/next with the get-poison-list patchset using the new trace file layout. Also, confirmed that the cxl_aer_*_error events appeared correctly in sys/kernel/debug/tracing/events/ and that 'cxl monitor' could be run. Tested-by: Alison Schofield > > Cc: Steven Rostedt > Signed-off-by: Dan Williams > --- > This patch is targeting v6.3. I am sending it out now to enable the > in-flight Event and Poison list patch sets to build upon. It will not > move to a non-rebasing branch until after v6.2-rc2, but in the meantime > I can throw it out on the list and the cxl/preview branch. > > drivers/cxl/core/Makefile |3 + > drivers/cxl/core/pci.c | 112 > > drivers/cxl/core/trace.c |5 ++ > drivers/cxl/core/trace.h | 11 ++-- > drivers/cxl/cxl.h |2 + > drivers/cxl/cxlpci.h |3 + > drivers/cxl/pci.c | 111 > > tools/testing/cxl/Kbuild |2 + > 8 files changed, 131 insertions(+), 118 deletions(-) > create mode 100644 drivers/cxl/core/trace.c > rename include/trace/events/cxl.h => drivers/cxl/core/trace.h (94%) > > diff --git a/drivers/cxl/core/Makefile b/drivers/cxl/core/Makefile > index 79c7257f4107..ca4ae31d8f57 100644 > --- a/drivers/cxl/core/Makefile > +++ b/drivers/cxl/core/Makefile > @@ -3,6 +3,8 @@ obj-$(CONFIG_CXL_BUS) += cxl_core.o > obj-$(CONFIG_CXL_SUSPEND) += suspend.o > > ccflags-y += -I$(srctree)/drivers/cxl > +CFLAGS_trace.o = -DTRACE_INCLUDE_PATH=. -I$(src) > + > cxl_core-y := port.o > cxl_core-y += pmem.o > cxl_core-y += regs.o > @@ -10,4 +12,5 @@ cxl_core-y += memdev.o > cxl_core-y += mbox.o > cxl_core-y += pci.o > cxl_core-y += hdm.o > +cxl_core-$(CONFIG_TRACING) += trace.o > cxl_core-$(CONFIG_CXL_REGION) += region.o > diff --git a/drivers/cxl/core/pci.c b/drivers/cxl/core/pci.c > index 57764e9cd19d..1d1492440287 100644 > --- a/drivers/cxl/core/pci.c > +++ b/drivers/cxl/core/pci.c > @@ -9,6 +9,7 @@ > #include > #include > #include "core.h" > +#include "trace.h" > > /** > * DOC: cxl core pci > @@ -622,3 +623,114 @@ void read_cdat_data(struct cxl_port *port) > } > } > EXPORT_SYMBOL_NS_GPL(read_cdat_data, CXL); > + > +void cxl_cor_error_detected(struct pci_dev *pdev) > +{ > + struct cxl_dev_state *cxlds = pci_get_drvdata(pdev); > + struct cxl_memdev *cxlmd = cxlds->cxlmd; > + struct device *dev = >dev; > + void __iomem *addr; > + u32 status; > + > + if (!cxlds->regs.ras) > + return; > + > + addr = cxlds->regs.ras + CXL_RAS_CORRECTABLE_STATUS_OFFSET; > + status = readl(addr); > + if (status & CXL_RAS_CORRECTABLE_STATUS_MASK) { > + writel(status & CXL_RAS_CORRECTABLE_STATUS_MASK, addr); > + trace_cxl_aer_correctable_error(dev, status); > + } > +} > +EXPORT_SYMBOL_NS_GPL(cxl_cor_error_detected, CXL); > + > +/* CXL spec rev3.0 8.2.4.16.1 */ > +static void header_log_copy(struct cxl_dev_state *cxlds, u32 *log) > +{ > + void __iomem *addr; > + u32 *log_addr; > + int i, log_u32_size = CXL_HEADERLOG_SIZE / sizeof(u32); > + > + addr = cxlds->regs.ras + CXL_RAS_HEADER_LOG_OFFSET; > + log_addr = log; > + > + for (i = 0; i < log_u32_size; i++) { > + *log_addr = readl(addr); > + log_addr++; > + addr += sizeof(u32); > + } > +} > + > +/* > + * Log the state of the RAS status registers and prepare them to log the > + * next error status. Return 1 if reset needed. > + */ > +static bool cxl_report_and_clear(struct cxl_dev_state *cxlds) > +{ > + struct cxl_memdev *cxlmd = cxlds->cxlmd; > + struct device *dev = >dev; > + u32 hl[CXL_HEADERLOG_SIZE_U32]; > + void __iomem *addr; > + u32 status; > + u32 fe; > + > + if (!cxlds->regs.ras) > + return false; > + > + addr = cxlds->regs.ras + CXL_RAS_UNCORRECTABLE_STATUS_OFFSET; > + status = readl(addr); > + if (!(status & CXL_RAS_UNCORRECTABLE_STATUS_MASK)) > + return false; > + > + /* If multiple errors, log header points to first error from ctrl reg */ > + if (hweight32(status) > 1) {
Re: [PATCH v3] powerpc/boot: Don't always pass -mcpu=powerpc when building 32-bit uImage
Le 08/12/2022 à 20:16, Pali Rohár a écrit : > On Sunday 28 August 2022 17:43:53 Christophe Leroy wrote: >> Le 28/08/2022 à 19:41, Pali Rohár a écrit : >>> On Sunday 28 August 2022 17:39:25 Christophe Leroy wrote: Le 28/08/2022 à 19:33, Christophe Leroy a écrit : > > > Le 28/08/2022 à 11:56, Pali Rohár a écrit : >> When CONFIG_TARGET_CPU is specified then pass its value to the compiler >> -mcpu option. This fixes following build error when building kernel with >> powerpc e500 SPE capable cross compilers: >> >> BOOTAS arch/powerpc/boot/crt0.o >> powerpc-linux-gnuspe-gcc: error: unrecognized argument in option >> ‘-mcpu=powerpc’ >> powerpc-linux-gnuspe-gcc: note: valid arguments to ‘-mcpu=’ are: >> 8540 8548 native >> make[1]: *** [arch/powerpc/boot/Makefile:231: >> arch/powerpc/boot/crt0.o] Error 1 > > corenet64_smp_defconfig : > > BOOTAS arch/powerpc/boot/crt0.o > powerpc64-linux-gcc: error: missing argument to '-mcpu=' > make[1]: *** [arch/powerpc/boot/Makefile:237 : arch/powerpc/boot/crt0.o] > Erreur 1 > make: *** [arch/powerpc/Makefile:253 : uImage] Erreur 2 > > Seems like in fact, E5500_CPU and E6500_CPU are not taken into account in CONFIG_TARGET_CPU, and get special treatment directly in arch/powerpc/Makefile. This goes unnoticed because of CFLAGS-$(CONFIG_TARGET_CPU_BOOL) += $(call cc-option,-mcpu=$(CONFIG_TARGET_CPU)) I think we need to fix that prior to your patch. >>> >>> It looks like that CONFIG_TARGET_CPU is broken. >>> >>> $ make ARCH=powerpc corenet64_smp_defconfig >>> CROSS_COMPILE=powerpc64-linux-gnu- >>> ... >>> # configuration written to .config >>> >>> $ grep CONFIG_TARGET_CPU .config >>> CONFIG_TARGET_CPU_BOOL=y >>> >>> CONFIG_TARGET_CPU_BOOL is set but CONFIG_TARGET_CPU not! >> >> Yes, because there is no default value for E5500_CPU and E6500_CPU. We >> need to add one for each. > > With "[PATCH v1] powerpc/64: Set default CPU in Kconfig" patch from > https://lore.kernel.org/linuxppc-dev/3fd60c2d8a28668a42b766b18362a526ef47e757.1670420281.git.christophe.le...@csgroup.eu/ > this change does not throw above compile error anymore. That patch should land in powerpc/next soon. When it has landed, could you resent this patch so that snowpatch checks the build again ? Because at the time being it is flagged as "failed", see https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20220828095659.4061-1-p...@kernel.org/ Christophe
Re: [PATCH v3] powerpc/boot: Don't always pass -mcpu=powerpc when building 32-bit uImage
On Wednesday 07 December 2022 13:39:18 Christophe Leroy wrote: > Le 26/11/2022 à 17:30, Pali Rohár a écrit : > > On Wednesday 02 November 2022 14:05:35 Christophe Leroy wrote: > >> Le 01/11/2022 à 23:12, Pali Rohár a écrit : > >>> On Sunday 09 October 2022 13:06:52 Pali Rohár wrote: > On Monday 29 August 2022 10:54:51 Pali Rohár wrote: > > On Sunday 28 August 2022 17:43:53 Christophe Leroy wrote: > >> Le 28/08/2022 à 19:41, Pali Rohár a écrit : > >>> On Sunday 28 August 2022 17:39:25 Christophe Leroy wrote: > Le 28/08/2022 à 19:33, Christophe Leroy a écrit : > > > > > > Le 28/08/2022 à 11:56, Pali Rohár a écrit : > >> When CONFIG_TARGET_CPU is specified then pass its value to the > >> compiler > >> -mcpu option. This fixes following build error when building > >> kernel with > >> powerpc e500 SPE capable cross compilers: > >> > >> BOOTAS arch/powerpc/boot/crt0.o > >> powerpc-linux-gnuspe-gcc: error: unrecognized argument in > >> option > >> ‘-mcpu=powerpc’ > >> powerpc-linux-gnuspe-gcc: note: valid arguments to ‘-mcpu=’ > >> are: > >> 8540 8548 native > >> make[1]: *** [arch/powerpc/boot/Makefile:231: > >> arch/powerpc/boot/crt0.o] Error 1 > > > > corenet64_smp_defconfig : > > > > BOOTAS arch/powerpc/boot/crt0.o > > powerpc64-linux-gcc: error: missing argument to '-mcpu=' > > make[1]: *** [arch/powerpc/boot/Makefile:237 : > > arch/powerpc/boot/crt0.o] > > Erreur 1 > > make: *** [arch/powerpc/Makefile:253 : uImage] Erreur 2 > > > > > > Seems like in fact, E5500_CPU and E6500_CPU are not taken into > account > in CONFIG_TARGET_CPU, and get special treatment directly in > arch/powerpc/Makefile. > > This goes unnoticed because of CFLAGS-$(CONFIG_TARGET_CPU_BOOL) += > $(call cc-option,-mcpu=$(CONFIG_TARGET_CPU)) > > I think we need to fix that prior to your patch. > >>> > >>> It looks like that CONFIG_TARGET_CPU is broken. > >>> > >>> $ make ARCH=powerpc corenet64_smp_defconfig > >>> CROSS_COMPILE=powerpc64-linux-gnu- > >>> ... > >>> # configuration written to .config > >>> > >>> $ grep CONFIG_TARGET_CPU .config > >>> CONFIG_TARGET_CPU_BOOL=y > >>> > >>> CONFIG_TARGET_CPU_BOOL is set but CONFIG_TARGET_CPU not! > >> > >> Yes, because there is no default value for E5500_CPU and E6500_CPU. We > >> need to add one for each. > > > > I see... Will you prepare this fixup for your previous patch? > > > > And I think that following construct > > > > $(call cc-option,-mcpu=$(CONFIG_TARGET_CPU)) > > > > should be changed just to > > > > -mcpu=$(CONFIG_TARGET_CPU) > > > > Because if user specified that want build for specific target CPU, it > > should not be silently ignored. > > Christophe, should I do something in this area? > >>> > >>> Christophe, any input from your side? > >> > >> Hi, sorry I was on holiday until today. I'll try to have a look in the > >> coming days. > > > > Ok, Did you have a time to look at it? > > I just sent a patch for it. > > Christophe Thanks!
Re: [PATCH v3] powerpc/boot: Don't always pass -mcpu=powerpc when building 32-bit uImage
On Sunday 28 August 2022 17:43:53 Christophe Leroy wrote: > Le 28/08/2022 à 19:41, Pali Rohár a écrit : > > On Sunday 28 August 2022 17:39:25 Christophe Leroy wrote: > >> Le 28/08/2022 à 19:33, Christophe Leroy a écrit : > >>> > >>> > >>> Le 28/08/2022 à 11:56, Pali Rohár a écrit : > When CONFIG_TARGET_CPU is specified then pass its value to the compiler > -mcpu option. This fixes following build error when building kernel with > powerpc e500 SPE capable cross compilers: > > BOOTAS arch/powerpc/boot/crt0.o > powerpc-linux-gnuspe-gcc: error: unrecognized argument in option > ‘-mcpu=powerpc’ > powerpc-linux-gnuspe-gcc: note: valid arguments to ‘-mcpu=’ are: > 8540 8548 native > make[1]: *** [arch/powerpc/boot/Makefile:231: > arch/powerpc/boot/crt0.o] Error 1 > >>> > >>> corenet64_smp_defconfig : > >>> > >>> BOOTAS arch/powerpc/boot/crt0.o > >>> powerpc64-linux-gcc: error: missing argument to '-mcpu=' > >>> make[1]: *** [arch/powerpc/boot/Makefile:237 : arch/powerpc/boot/crt0.o] > >>> Erreur 1 > >>> make: *** [arch/powerpc/Makefile:253 : uImage] Erreur 2 > >>> > >>> > >> > >> Seems like in fact, E5500_CPU and E6500_CPU are not taken into account > >> in CONFIG_TARGET_CPU, and get special treatment directly in > >> arch/powerpc/Makefile. > >> > >> This goes unnoticed because of CFLAGS-$(CONFIG_TARGET_CPU_BOOL) += > >> $(call cc-option,-mcpu=$(CONFIG_TARGET_CPU)) > >> > >> I think we need to fix that prior to your patch. > > > > It looks like that CONFIG_TARGET_CPU is broken. > > > >$ make ARCH=powerpc corenet64_smp_defconfig > > CROSS_COMPILE=powerpc64-linux-gnu- > >... > ># configuration written to .config > > > >$ grep CONFIG_TARGET_CPU .config > >CONFIG_TARGET_CPU_BOOL=y > > > > CONFIG_TARGET_CPU_BOOL is set but CONFIG_TARGET_CPU not! > > Yes, because there is no default value for E5500_CPU and E6500_CPU. We > need to add one for each. With "[PATCH v1] powerpc/64: Set default CPU in Kconfig" patch from https://lore.kernel.org/linuxppc-dev/3fd60c2d8a28668a42b766b18362a526ef47e757.1670420281.git.christophe.le...@csgroup.eu/ this change does not throw above compile error anymore. > > > >>> Christophe > >>> > >>> > > Similar change was already introduced for the main powerpc Makefile in > commit 446cda1b21d9 ("powerpc/32: Don't always pass -mcpu=powerpc to the > compiler"). > > Fixes: 40a75584e526 ("powerpc/boot: Build wrapper for an appropriate > CPU") > Cc: sta...@vger.kernel.org # 446cda1b21d9 ("powerpc/32: Don't always > pass -mcpu=powerpc to the compiler") > Signed-off-by: Pali Rohár > --- > arch/powerpc/boot/Makefile | 14 ++ > 1 file changed, 10 insertions(+), 4 deletions(-) > > diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile > index a9cd2ea4a861..1957a3de7a1c 100644 > --- a/arch/powerpc/boot/Makefile > +++ b/arch/powerpc/boot/Makefile > @@ -38,13 +38,19 @@ BOOTCFLAGS := -Wall -Wundef -Wstrict-prototypes > -Wno-trigraphs \ > $(LINUXINCLUDE) > ifdef CONFIG_PPC64_BOOT_WRAPPER > -ifdef CONFIG_CPU_LITTLE_ENDIAN > -BOOTCFLAGS += -m64 -mcpu=powerpc64le > +BOOTCFLAGS += -m64 > else > -BOOTCFLAGS += -m64 -mcpu=powerpc64 > +BOOTCFLAGS += -m32 > endif > + > +ifdef CONFIG_TARGET_CPU_BOOL > +BOOTCFLAGS += -mcpu=$(CONFIG_TARGET_CPU) > +else ifdef CONFIG_PPC64_BOOT_WRAPPER > +ifdef CONFIG_CPU_LITTLE_ENDIAN > +BOOTCFLAGS += -mcpu=powerpc64le > else > -BOOTCFLAGS += -m32 -mcpu=powerpc > +BOOTCFLAGS += -mcpu=powerpc64 > +endif > endif > BOOTCFLAGS += -isystem $(shell $(BOOTCC) -print-file-name=include)
Re: [PATCH v1] powerpc/64: Set default CPU in Kconfig
On Wednesday 07 December 2022 14:38:40 Christophe Leroy wrote: > Since 0069f3d14e7a ("powerpc/64e: Tie PPC_BOOK3E_64 to PPC_E500MC"), > the only possible BOOK3E/64 are E500, so no need of a default CPU > over the E5500. > When the user selects book3e, he must have a e500 compatible compiler, > and it won't work anymore with the default -mcpu=power64, see > commit d6b551b8f90c ("powerpc/64e: Fix build failure with GCC 12 > (unrecognized opcode: `wrteei')") > > For book3s/64, replace GENERIC_CPU by POWERPC64_CPU to match the PPC32 > POWERPC_CPU, and set a default mpcu value in Kconfig directly. > > When a user selects a particular CPU, he must ensure his compiler has > the requested capability. Therefore, remove hidden fallback, instead > offer user the possibility to say he wants to use toolchain default. > > Reported-by: Pali Rohár > Signed-off-by: Christophe Leroy Tested-by: Pali Rohár $ make ARCH=powerpc CROSS_COMPILE=powerpc64-linux-gnu- corenet64_smp_defconfig ... # configuration written to .config $ grep CONFIG_TARGET_CPU .config CONFIG_TARGET_CPU_BOOL=y CONFIG_TARGET_CPU="e500mc64" Without this patch CONFIG_TARGET_CPU is not set but CONFIG_TARGET_CPU_BOOL is. > --- > arch/powerpc/Makefile | 22 +- > arch/powerpc/platforms/Kconfig.cputype | 12 +++- > 2 files changed, 12 insertions(+), 22 deletions(-) > > diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile > index dc4cbf0a5ca9..bf5f0a998273 100644 > --- a/arch/powerpc/Makefile > +++ b/arch/powerpc/Makefile > @@ -146,19 +146,6 @@ CFLAGS-$(CONFIG_PPC32) += $(call cc-option, > $(MULTIPLEWORD)) > > CFLAGS-$(CONFIG_PPC32) += $(call cc-option,-mno-readonly-in-sdata) > > -ifdef CONFIG_PPC_BOOK3S_64 > -ifdef CONFIG_CPU_LITTLE_ENDIAN > -CFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=power8 > -else > -CFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=power4 > -endif > -CFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=power10, \ > - $(call cc-option,-mtune=power9, \ > - $(call cc-option,-mtune=power8))) > -else ifdef CONFIG_PPC_BOOK3E_64 > -CFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=powerpc64 > -endif > - > ifdef CONFIG_FUNCTION_TRACER > CC_FLAGS_FTRACE := -pg > ifdef CONFIG_MPROFILE_KERNEL > @@ -166,11 +153,12 @@ CC_FLAGS_FTRACE += -mprofile-kernel > endif > endif > > -CFLAGS-$(CONFIG_TARGET_CPU_BOOL) += $(call > cc-option,-mcpu=$(CONFIG_TARGET_CPU)) > -AFLAGS-$(CONFIG_TARGET_CPU_BOOL) += $(call > cc-option,-mcpu=$(CONFIG_TARGET_CPU)) > +CFLAGS-$(CONFIG_TARGET_CPU_BOOL) += -mcpu=$(CONFIG_TARGET_CPU) > +AFLAGS-$(CONFIG_TARGET_CPU_BOOL) += -mcpu=$(CONFIG_TARGET_CPU) > > -CFLAGS-$(CONFIG_E5500_CPU) += $(call > cc-option,-mcpu=e500mc64,-mcpu=powerpc64) > -CFLAGS-$(CONFIG_E6500_CPU) += $(call cc-option,-mcpu=e6500,$(E5500_CPU)) > +CFLAGS-$(CONFIG_POWERPC64_CPU) += $(call cc-option,-mtune=power10, \ > + $(call cc-option,-mtune=power9, \ > + $(call cc-option,-mtune=power8))) > > asinstr := $(call as-instr,lis 9$(comma)foo@high,-DHAVE_AS_ATHIGH=1) > > diff --git a/arch/powerpc/platforms/Kconfig.cputype > b/arch/powerpc/platforms/Kconfig.cputype > index 9563336e3348..31cea2eeb59e 100644 > --- a/arch/powerpc/platforms/Kconfig.cputype > +++ b/arch/powerpc/platforms/Kconfig.cputype > @@ -118,19 +118,18 @@ endchoice > > choice > prompt "CPU selection" > - default GENERIC_CPU > help > This will create a kernel which is optimised for a particular CPU. > The resulting kernel may not run on other CPUs, so use this with care. > > If unsure, select Generic. > > -config GENERIC_CPU > +config POWERPC64_CPU > bool "Generic (POWER5 and PowerPC 970 and above)" > depends on PPC_BOOK3S_64 && !CPU_LITTLE_ENDIAN > select PPC_64S_HASH_MMU > > -config GENERIC_CPU > +config POWERPC64_CPU > bool "Generic (POWER8 and above)" > depends on PPC_BOOK3S_64 && CPU_LITTLE_ENDIAN > select ARCH_HAS_FAST_MULTIPLIER > @@ -233,13 +232,12 @@ config E500MC_CPU > > config TOOLCHAIN_DEFAULT_CPU > bool "Rely on the toolchain's implicit default CPU" > - depends on PPC32 > > endchoice > > config TARGET_CPU_BOOL > bool > - default !GENERIC_CPU && !TOOLCHAIN_DEFAULT_CPU > + default !TOOLCHAIN_DEFAULT_CPU > > config TARGET_CPU > string > @@ -251,6 +249,10 @@ config TARGET_CPU > default "power8" if POWER8_CPU > default "power9" if POWER9_CPU > default "power10" if POWER10_CPU > + default "e500mc64" if E5500_CPU > + default "e6500" if E6500_CPU > + default "power4" if POWERPC64_CPU && !CPU_LITTLE_ENDIAN > + default "power8" if POWERPC64_CPU && CPU_LITTLE_ENDIAN > default "405" if 405_CPU > default "440" if 440_CPU > default "464" if 464_CPU > -- > 2.38.1 >
Re: [PATCH] cxl/pci: Move tracepoint definitions to drivers/cxl/core/
On 12/8/2022 10:02 AM, Dan Williams wrote: CXL is using tracepoints for reporting RAS capability register payloads for AER events, and has plans to use tracepoints for the output payload of Get Poison List and Get Event Records commands. For organization purposes it would be nice to keep those all under a single + local CXL trace system. This also organization also potentially helps in the future when CXL drivers expand beyond generic memory expanders, however that would also entail a move away from the expander-specific cxl_dev_state context, save that for later. Note that the powerpc-specific drivers/misc/cxl/ also defines a 'cxl' trace system, however, it is unlikely that a single platform will ever load both drivers simultaneously. Cc: Steven Rostedt Signed-off-by: Dan Williams Reviewed-by: Dave Jiang --- This patch is targeting v6.3. I am sending it out now to enable the in-flight Event and Poison list patch sets to build upon. It will not move to a non-rebasing branch until after v6.2-rc2, but in the meantime I can throw it out on the list and the cxl/preview branch. drivers/cxl/core/Makefile |3 + drivers/cxl/core/pci.c | 112 drivers/cxl/core/trace.c |5 ++ drivers/cxl/core/trace.h | 11 ++-- drivers/cxl/cxl.h |2 + drivers/cxl/cxlpci.h |3 + drivers/cxl/pci.c | 111 tools/testing/cxl/Kbuild |2 + 8 files changed, 131 insertions(+), 118 deletions(-) create mode 100644 drivers/cxl/core/trace.c rename include/trace/events/cxl.h => drivers/cxl/core/trace.h (94%) diff --git a/drivers/cxl/core/Makefile b/drivers/cxl/core/Makefile index 79c7257f4107..ca4ae31d8f57 100644 --- a/drivers/cxl/core/Makefile +++ b/drivers/cxl/core/Makefile @@ -3,6 +3,8 @@ obj-$(CONFIG_CXL_BUS) += cxl_core.o obj-$(CONFIG_CXL_SUSPEND) += suspend.o ccflags-y += -I$(srctree)/drivers/cxl +CFLAGS_trace.o = -DTRACE_INCLUDE_PATH=. -I$(src) + cxl_core-y := port.o cxl_core-y += pmem.o cxl_core-y += regs.o @@ -10,4 +12,5 @@ cxl_core-y += memdev.o cxl_core-y += mbox.o cxl_core-y += pci.o cxl_core-y += hdm.o +cxl_core-$(CONFIG_TRACING) += trace.o cxl_core-$(CONFIG_CXL_REGION) += region.o diff --git a/drivers/cxl/core/pci.c b/drivers/cxl/core/pci.c index 57764e9cd19d..1d1492440287 100644 --- a/drivers/cxl/core/pci.c +++ b/drivers/cxl/core/pci.c @@ -9,6 +9,7 @@ #include #include #include "core.h" +#include "trace.h" /** * DOC: cxl core pci @@ -622,3 +623,114 @@ void read_cdat_data(struct cxl_port *port) } } EXPORT_SYMBOL_NS_GPL(read_cdat_data, CXL); + +void cxl_cor_error_detected(struct pci_dev *pdev) +{ + struct cxl_dev_state *cxlds = pci_get_drvdata(pdev); + struct cxl_memdev *cxlmd = cxlds->cxlmd; + struct device *dev = >dev; + void __iomem *addr; + u32 status; + + if (!cxlds->regs.ras) + return; + + addr = cxlds->regs.ras + CXL_RAS_CORRECTABLE_STATUS_OFFSET; + status = readl(addr); + if (status & CXL_RAS_CORRECTABLE_STATUS_MASK) { + writel(status & CXL_RAS_CORRECTABLE_STATUS_MASK, addr); + trace_cxl_aer_correctable_error(dev, status); + } +} +EXPORT_SYMBOL_NS_GPL(cxl_cor_error_detected, CXL); + +/* CXL spec rev3.0 8.2.4.16.1 */ +static void header_log_copy(struct cxl_dev_state *cxlds, u32 *log) +{ + void __iomem *addr; + u32 *log_addr; + int i, log_u32_size = CXL_HEADERLOG_SIZE / sizeof(u32); + + addr = cxlds->regs.ras + CXL_RAS_HEADER_LOG_OFFSET; + log_addr = log; + + for (i = 0; i < log_u32_size; i++) { + *log_addr = readl(addr); + log_addr++; + addr += sizeof(u32); + } +} + +/* + * Log the state of the RAS status registers and prepare them to log the + * next error status. Return 1 if reset needed. + */ +static bool cxl_report_and_clear(struct cxl_dev_state *cxlds) +{ + struct cxl_memdev *cxlmd = cxlds->cxlmd; + struct device *dev = >dev; + u32 hl[CXL_HEADERLOG_SIZE_U32]; + void __iomem *addr; + u32 status; + u32 fe; + + if (!cxlds->regs.ras) + return false; + + addr = cxlds->regs.ras + CXL_RAS_UNCORRECTABLE_STATUS_OFFSET; + status = readl(addr); + if (!(status & CXL_RAS_UNCORRECTABLE_STATUS_MASK)) + return false; + + /* If multiple errors, log header points to first error from ctrl reg */ + if (hweight32(status) > 1) { + addr = cxlds->regs.ras + CXL_RAS_CAP_CONTROL_OFFSET; + fe = BIT(FIELD_GET(CXL_RAS_CAP_CONTROL_FE_MASK, readl(addr))); + } else { + fe = status; + } + + header_log_copy(cxlds, hl); + trace_cxl_aer_uncorrectable_error(dev, status, fe, hl); + writel(status & CXL_RAS_UNCORRECTABLE_STATUS_MASK, addr); + + return true; +} +
[PATCH] cxl/pci: Move tracepoint definitions to drivers/cxl/core/
CXL is using tracepoints for reporting RAS capability register payloads for AER events, and has plans to use tracepoints for the output payload of Get Poison List and Get Event Records commands. For organization purposes it would be nice to keep those all under a single + local CXL trace system. This also organization also potentially helps in the future when CXL drivers expand beyond generic memory expanders, however that would also entail a move away from the expander-specific cxl_dev_state context, save that for later. Note that the powerpc-specific drivers/misc/cxl/ also defines a 'cxl' trace system, however, it is unlikely that a single platform will ever load both drivers simultaneously. Cc: Steven Rostedt Signed-off-by: Dan Williams --- This patch is targeting v6.3. I am sending it out now to enable the in-flight Event and Poison list patch sets to build upon. It will not move to a non-rebasing branch until after v6.2-rc2, but in the meantime I can throw it out on the list and the cxl/preview branch. drivers/cxl/core/Makefile |3 + drivers/cxl/core/pci.c | 112 drivers/cxl/core/trace.c |5 ++ drivers/cxl/core/trace.h | 11 ++-- drivers/cxl/cxl.h |2 + drivers/cxl/cxlpci.h |3 + drivers/cxl/pci.c | 111 tools/testing/cxl/Kbuild |2 + 8 files changed, 131 insertions(+), 118 deletions(-) create mode 100644 drivers/cxl/core/trace.c rename include/trace/events/cxl.h => drivers/cxl/core/trace.h (94%) diff --git a/drivers/cxl/core/Makefile b/drivers/cxl/core/Makefile index 79c7257f4107..ca4ae31d8f57 100644 --- a/drivers/cxl/core/Makefile +++ b/drivers/cxl/core/Makefile @@ -3,6 +3,8 @@ obj-$(CONFIG_CXL_BUS) += cxl_core.o obj-$(CONFIG_CXL_SUSPEND) += suspend.o ccflags-y += -I$(srctree)/drivers/cxl +CFLAGS_trace.o = -DTRACE_INCLUDE_PATH=. -I$(src) + cxl_core-y := port.o cxl_core-y += pmem.o cxl_core-y += regs.o @@ -10,4 +12,5 @@ cxl_core-y += memdev.o cxl_core-y += mbox.o cxl_core-y += pci.o cxl_core-y += hdm.o +cxl_core-$(CONFIG_TRACING) += trace.o cxl_core-$(CONFIG_CXL_REGION) += region.o diff --git a/drivers/cxl/core/pci.c b/drivers/cxl/core/pci.c index 57764e9cd19d..1d1492440287 100644 --- a/drivers/cxl/core/pci.c +++ b/drivers/cxl/core/pci.c @@ -9,6 +9,7 @@ #include #include #include "core.h" +#include "trace.h" /** * DOC: cxl core pci @@ -622,3 +623,114 @@ void read_cdat_data(struct cxl_port *port) } } EXPORT_SYMBOL_NS_GPL(read_cdat_data, CXL); + +void cxl_cor_error_detected(struct pci_dev *pdev) +{ + struct cxl_dev_state *cxlds = pci_get_drvdata(pdev); + struct cxl_memdev *cxlmd = cxlds->cxlmd; + struct device *dev = >dev; + void __iomem *addr; + u32 status; + + if (!cxlds->regs.ras) + return; + + addr = cxlds->regs.ras + CXL_RAS_CORRECTABLE_STATUS_OFFSET; + status = readl(addr); + if (status & CXL_RAS_CORRECTABLE_STATUS_MASK) { + writel(status & CXL_RAS_CORRECTABLE_STATUS_MASK, addr); + trace_cxl_aer_correctable_error(dev, status); + } +} +EXPORT_SYMBOL_NS_GPL(cxl_cor_error_detected, CXL); + +/* CXL spec rev3.0 8.2.4.16.1 */ +static void header_log_copy(struct cxl_dev_state *cxlds, u32 *log) +{ + void __iomem *addr; + u32 *log_addr; + int i, log_u32_size = CXL_HEADERLOG_SIZE / sizeof(u32); + + addr = cxlds->regs.ras + CXL_RAS_HEADER_LOG_OFFSET; + log_addr = log; + + for (i = 0; i < log_u32_size; i++) { + *log_addr = readl(addr); + log_addr++; + addr += sizeof(u32); + } +} + +/* + * Log the state of the RAS status registers and prepare them to log the + * next error status. Return 1 if reset needed. + */ +static bool cxl_report_and_clear(struct cxl_dev_state *cxlds) +{ + struct cxl_memdev *cxlmd = cxlds->cxlmd; + struct device *dev = >dev; + u32 hl[CXL_HEADERLOG_SIZE_U32]; + void __iomem *addr; + u32 status; + u32 fe; + + if (!cxlds->regs.ras) + return false; + + addr = cxlds->regs.ras + CXL_RAS_UNCORRECTABLE_STATUS_OFFSET; + status = readl(addr); + if (!(status & CXL_RAS_UNCORRECTABLE_STATUS_MASK)) + return false; + + /* If multiple errors, log header points to first error from ctrl reg */ + if (hweight32(status) > 1) { + addr = cxlds->regs.ras + CXL_RAS_CAP_CONTROL_OFFSET; + fe = BIT(FIELD_GET(CXL_RAS_CAP_CONTROL_FE_MASK, readl(addr))); + } else { + fe = status; + } + + header_log_copy(cxlds, hl); + trace_cxl_aer_uncorrectable_error(dev, status, fe, hl); + writel(status & CXL_RAS_UNCORRECTABLE_STATUS_MASK, addr); + + return true; +} + +pci_ers_result_t cxl_error_detected(struct pci_dev *pdev, + pci_channel_state_t state)
Re: [PATCH v8 4/9] phy: fsl: Add Lynx 10G SerDes driver
On 12/6/22 21:17, Stephen Boyd wrote: > Quoting Sean Anderson (2022-11-01 16:27:21) >> On 11/1/22 16:10, Stephen Boyd wrote: >> >> >> >> Oh, I remember why I did this. I need the reference clock for >> >> clk_hw_round_rate, >> >> which is AFAICT the only correct way to implement round_rate. >> >> >> > >> > Is the reference clk the parent of the clk implementing >> > clk_ops::round_rate()? >> >> Yes. We may be able to produce a given output with multiple reference >> rates. However, the clock API provides no mechanism to say "Don't ask >> for the parent clock to be rate X, you just tried it and the parent >> clock can't support it." So instead, we loop over the possible reference >> rates and pick the first one which the parent says it can round to. >> > > Sorry, I'm lost. Why can't you loop over possible reference rates in > determine_rate/round_rate clk op here? This is what I do currently, but you need to have the parent clock to do so. With your suggested method, we never actually get a struct clk(_hw) which we can query for rate support. --Sean
Re: [PATCH] powerpc/mce: log the error for all unrecoverable errors
On 2022-11-14 13:26:07 Mon, Ganesh Goudar wrote: > machine_check_log_err() is not getting called for all > unrecoverable errors, And we are missing to log the error. > > Raise irq work in save_mce_event() for unrecoverable errors, > So that we log the error from MCE event handling block in > timer handler. Thanks for fixing this. Reviewed-by: Mahesh Salgaonkar > > Signed-off-by: Ganesh Goudar > --- > arch/powerpc/kernel/mce.c | 8 +++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/arch/powerpc/kernel/mce.c b/arch/powerpc/kernel/mce.c > index 6c5d30fba766..a1cb2172eb7b 100644 > --- a/arch/powerpc/kernel/mce.c > +++ b/arch/powerpc/kernel/mce.c > @@ -131,6 +131,13 @@ void save_mce_event(struct pt_regs *regs, long handled, > if (mce->error_type == MCE_ERROR_TYPE_UE) > mce->u.ue_error.ignore_event = mce_err->ignore_event; > > + /* > + * Raise irq work, So that we don't miss to log the error for > + * unrecoverable errors. > + */ > + if (mce->disposition == MCE_DISPOSITION_NOT_RECOVERED) > + mce_irq_work_queue(); > + > if (!addr) > return; > > @@ -235,7 +242,6 @@ static void machine_check_ue_event(struct > machine_check_event *evt) > evt, sizeof(*evt)); > > /* Queue work to process this event later. */ > - mce_irq_work_queue(); > } With your patch now we can see RTAS event logged for other unrecoverable errors as well. [ 573.006337] Disabling lock debugging due to kernel taint [ 573.006357] MCE: CPU27: machine check (Severe) Real address Load/Store (foreign/control memory) [Not recovered] [ 573.006362] MCE: CPU27: PID: 10580 Comm: inject-ra-err NIP: [1df4] [ 573.006366] MCE: CPU27: Initiator CPU [ 573.006369] MCE: CPU27: Unknown [ 573.006426] RTAS: event: 1, Type: Platform Error (224), Severity: 3 Tested-by: Mahesh Salgaonkar Thanks, -Mahesh.
[powerpc:next] BUILD SUCCESS 64fdcbcc064966bbf261bb455876dffa58858d32
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next branch HEAD: 64fdcbcc064966bbf261bb455876dffa58858d32 powerpc/prom: Fix 32-bit build elapsed time: 721m configs tested: 61 configs skipped: 2 The following configs have been built successfully. More configs may be tested in the coming days. gcc tested configs: um i386_defconfig um x86_64_defconfig arc defconfig alpha defconfig s390 allmodconfig m68k allyesconfig m68k allmodconfig arc allyesconfig alphaallyesconfig s390defconfig s390 allyesconfig x86_64randconfig-a002 x86_64randconfig-a004 x86_64randconfig-a006 x86_64randconfig-a013 x86_64randconfig-a011 x86_64randconfig-a015 x86_64 rhel-8.3 x86_64 rhel-8.3-kunit i386 randconfig-a001 x86_64 rhel-8.3-syz i386defconfig i386 randconfig-a003 x86_64 defconfig x86_64 rhel-8.3-kvm i386 randconfig-a014 i386 randconfig-a005 i386 randconfig-a012 i386 randconfig-a016 x86_64 allyesconfig x86_64 rhel-8.3-rust ia64 allmodconfig arc randconfig-r043-20221207 x86_64rhel-8.3-kselftests x86_64 rhel-8.3-func riscvrandconfig-r042-20221207 s390 randconfig-r044-20221207 arm defconfig powerpc allnoconfig mips allyesconfig powerpc allmodconfig sh allmodconfig i386 allyesconfig arm64allyesconfig arm allyesconfig x86_64allnoconfig clang tested configs: x86_64randconfig-a005 x86_64randconfig-a001 x86_64randconfig-a003 x86_64randconfig-a012 x86_64randconfig-a014 x86_64randconfig-a016 i386 randconfig-a013 i386 randconfig-a002 i386 randconfig-a011 arm randconfig-r046-20221207 i386 randconfig-a004 i386 randconfig-a015 i386 randconfig-a006 hexagon randconfig-r041-20221207 hexagon randconfig-r045-20221207 -- 0-DAY CI Kernel Test Service https://01.org/lkp
[PATCH] powerpc/pseries: Fix potential memleak in papr_get_attr()
`buf` is allocated in papr_get_attr(), and krealloc() of `buf` could fail. We need to free the original `buf` in the case of failure. Fixes: 3c14b73454cf ("powerpc/pseries: Interface to represent PAPR firmware attributes") Signed-off-by: Qiheng Lin --- arch/powerpc/platforms/pseries/papr_platform_attributes.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/platforms/pseries/papr_platform_attributes.c b/arch/powerpc/platforms/pseries/papr_platform_attributes.c index 526c621b098b..eea2041b270b 100644 --- a/arch/powerpc/platforms/pseries/papr_platform_attributes.c +++ b/arch/powerpc/platforms/pseries/papr_platform_attributes.c @@ -101,10 +101,12 @@ static int papr_get_attr(u64 id, struct energy_scale_attribute *esi) esi_buf_size = ESI_HDR_SIZE + (CURR_MAX_ESI_ATTRS * max_esi_attrs); temp_buf = krealloc(buf, esi_buf_size, GFP_KERNEL); - if (temp_buf) + if (temp_buf) { buf = temp_buf; - else - return -ENOMEM; + } else { + ret = -ENOMEM; + goto out_buf; + } goto retry; } -- 2.32.0
Re: [PATCH v6 00/16] objtool: Enable and implement --mcount option on powerpc
On Mon, 14 Nov 2022 23:27:38 +0530, Sathvika Vasireddy wrote: > This patchset enables and implements objtool --mcount > option on powerpc. This applies atop powerpc/merge branch. > > Changelog: > > > v6: > > [...] Applied to powerpc/next (and topic/objtool). [01/16] powerpc: Fix __WARN_FLAGS() for use with Objtool https://git.kernel.org/powerpc/c/93e3f45a26310e3f3f8558be40df411e23ab742c [02/16] powerpc: Override __ALIGN and __ALIGN_STR macros https://git.kernel.org/powerpc/c/01f2cf0b990e58ae89142f57c7e02d33621311d2 [03/16] powerpc: Fix objtool unannotated intra-function call warnings https://git.kernel.org/powerpc/c/29a011fc79e625b2b02f25262657f7c4c59ae9f7 [04/16] powerpc: Curb objtool unannotated intra-function call warnings https://git.kernel.org/powerpc/c/8d0c21b50655bfe136a76cf384495ba1f9c87224 [05/16] powerpc: Skip objtool from running on drivers/crypto/vmx/aesp8-ppc.o https://git.kernel.org/powerpc/c/1c137323e9a2a970b4a5bf8cf3c50e0ea1cefbeb [06/16] powerpc: Fix objtool unannotated intra-function call warnings on PPC32 https://git.kernel.org/powerpc/c/2da37761671b5bdedbe04e6469cfa57cd6b6ae45 [07/16] powerpc: Skip objtool from running on VDSO files https://git.kernel.org/powerpc/c/d0160bd5d389da247fb5affb6a35ea393d22fedb [08/16] objtool: Fix SEGFAULT https://git.kernel.org/powerpc/c/efb11fdb3e1a9f694fa12b70b21e69e55ec59c36 [09/16] objtool: Use target file endianness instead of a compiled constant https://git.kernel.org/powerpc/c/0646c28b417b7fe307c9da72ca1c508e43b57dc0 [10/16] objtool: Use target file class size instead of a compiled constant https://git.kernel.org/powerpc/c/86ea7f361537f825a699e86fdc9e49be19f128d1 [11/16] objtool: Add --mnop as an option to --mcount https://git.kernel.org/powerpc/c/280981d6994e0700abd36647b141e73059851e66 [12/16] objtool: Read special sections with alts only when specific options are selected https://git.kernel.org/powerpc/c/de6fbcedf5abce4c321eeb15d7d286b79804b8b6 [13/16] objtool: Use macros to define arch specific reloc types https://git.kernel.org/powerpc/c/c1449735211dd8c4c2d54fa0ece6890ecbd74e24 [14/16] objtool: Add arch specific function arch_ftrace_match() https://git.kernel.org/powerpc/c/4ca993d498987332ceeedee5380101b84accaf35 [15/16] objtool/powerpc: Enable objtool to be built on ppc https://git.kernel.org/powerpc/c/e52ec98c5ab18c0710ea22bf52f45e60a725adaf [16/16] objtool/powerpc: Add --mcount specific implementation https://git.kernel.org/powerpc/c/c984aef8c8326035570ff6e01d0ff9e79a5dfa76 cheers
Re: [PATCH] powerpc/64s: Add missing declaration for machine_check_early_boot()
On Sat, 26 Nov 2022 00:25:21 +1100, Michael Ellerman wrote: > There's no declaration for machine_check_early_boot(), which leads to a > build failure with W=1. Add one. > > Applied to powerpc/fixes. [1/1] powerpc/64s: Add missing declaration for machine_check_early_boot() https://git.kernel.org/powerpc/c/2e7ec190a0e38aaa8a6d87fd5f804ec07947febc cheers
Re: [PATCH v2] powerpc/bpf/32: Fix Oops on tail call tests
On Thu, 24 Nov 2022 09:37:27 +0100, Christophe Leroy wrote: > test_bpf tail call tests end up as: > > test_bpf: #0 Tail call leaf jited:1 85 PASS > test_bpf: #1 Tail call 2 jited:1 111 PASS > test_bpf: #2 Tail call 3 jited:1 145 PASS > test_bpf: #3 Tail call 4 jited:1 170 PASS > test_bpf: #4 Tail call load/store leaf jited:1 190 PASS > test_bpf: #5 Tail call load/store jited:1 > BUG: Unable to handle kernel data access on write at 0xf1b4e000 > Faulting instruction address: 0xbe86b710 > Oops: Kernel access of bad area, sig: 11 [#1] > BE PAGE_SIZE=4K MMU=Hash PowerMac > Modules linked in: test_bpf(+) > CPU: 0 PID: 97 Comm: insmod Not tainted 6.1.0-rc4+ #195 > Hardware name: PowerMac3,1 750CL 0x87210 PowerMac > NIP: be86b710 LR: be857e88 CTR: be86b704 > REGS: f1b4df20 TRAP: 0300 Not tainted (6.1.0-rc4+) > MSR: 9032 CR: 28008242 XER: > DAR: f1b4e000 DSISR: 4200 > GPR00: 0001 f1b4dfe0 c11d2280 0002 > > GPR08: f1b4e000 be86b704 f1b4e000 100d816a f244 > fe73baa8 > GPR16: f2458000 c1941ae4 f1fe2248 0045 c0de f2458030 > > GPR24: 03e8 000f f2458000 f1b4dc90 3e584b46 f24466a0 > c1941a00 > NIP [be86b710] 0xbe86b710 > LR [be857e88] __run_one+0xec/0x264 [test_bpf] > Call Trace: > [f1b4dfe0] [0002] 0x2 (unreliable) > Instruction dump: > > > ---[ end trace ]--- > > [...] Applied to powerpc/fixes. [1/1] powerpc/bpf/32: Fix Oops on tail call tests https://git.kernel.org/powerpc/c/89d21e259a94f7d5582ec675aa445f5a79f347e4 cheers
Re: [PATCH v2] powerpc/83xx/mpc832x_rdb: call platform_device_put() in error case in of_fsl_spi_probe()
On Sat, 29 Oct 2022 19:16:26 +0800, Yang Yingliang wrote: > If platform_device_add() is not called or failed, it can not call > platform_device_del() to clean up memory, it should call > platform_device_put() in error case. > > Applied to powerpc/next. [1/1] powerpc/83xx/mpc832x_rdb: call platform_device_put() in error case in of_fsl_spi_probe() https://git.kernel.org/powerpc/c/4d0eea415216fe3791da2f65eb41399e70c7bedf cheers
Re: [PATCH] selftests: powerpc: Use "grep -E" instead of "egrep"
On Thu, 1 Dec 2022 10:49:57 +0800, Tiezhu Yang wrote: > The latest version of grep claims the egrep is now obsolete so the build > now contains warnings that look like: > egrep: warning: egrep is obsolescent; using grep -E > fix this using "grep -E" instead. > > sed -i "s/egrep/grep -E/g" `grep egrep -rwl tools/testing/selftests/powerpc` > > [...] Applied to powerpc/next. [1/1] selftests: powerpc: Use "grep -E" instead of "egrep" https://git.kernel.org/powerpc/c/5921eb36d2a1b276b16a24e529788550e6a65449 cheers
Re: [PATCH] KVM: PPC: Use the arg->size directly for kvm_vm_ioctl_create_spapr_tce
On Sun, 3 Jul 2022 13:29:32 -0400, Deming Wang wrote: > Use arg->size directly may be better for code readability.Because, the > variable of size has not been found for special purpose at present. > Also,We can reduce the use of a variable. > > Applied to powerpc/next. [1/1] KVM: PPC: Use the arg->size directly for kvm_vm_ioctl_create_spapr_tce https://git.kernel.org/powerpc/c/6fa1efeaa6671fb7339a6c62ceeec19e8e787963 cheers
Re: [PATCH v5 1/7] powerpc/64: Add INTERRUPT_SANITIZE_REGISTERS Kconfig
On Thu, 1 Dec 2022 18:10:13 +1100, Rohan McLure wrote: > Add Kconfig option for enabling clearing of registers on arrival in an > interrupt handler. This reduces the speculation influence of registers > on kernel internals. The option will be consumed by 64-bit systems that > feature speculation and wish to implement this mitigation. > > This patch only introduces the Kconfig option, no actual mitigations. > > [...] Applied to powerpc/next. [1/7] powerpc/64: Add INTERRUPT_SANITIZE_REGISTERS Kconfig https://git.kernel.org/powerpc/c/0e23347f1e0f2b1c98f87a4088231d0d6f59b962 [2/7] powerpc/64: Add interrupt register sanitisation macros https://git.kernel.org/powerpc/c/cbf892ba56677b942020d2bc7ca9b79281fa0bcc [3/7] powerpc/64: Sanitise common exit code for interrupts https://git.kernel.org/powerpc/c/75c5d6b1e194c341371639469fcb8691afa0e254 [4/7] powerpc/64s: IOption for MSR stored in r12 https://git.kernel.org/powerpc/c/2487fd2e6d61b5293eed8ecd25add3cc78593d38 [5/7] powerpc/64s: Zeroise gprs on interrupt routine entry on Book3S https://git.kernel.org/powerpc/c/1df45d78b8a89da6544fab5267e8f5da15073d28 [6/7] powerpc/64e: Clear gprs on interrupt routine entry on Book3E https://git.kernel.org/powerpc/c/efe1691ac814e4cf3653538b701662cbd905bddc [7/7] powerpc/64: Sanitise user registers on interrupt in pseries, POWERNV https://git.kernel.org/powerpc/c/7cd882df9485988f7d9b3fae04fde4e95a4c7a74 cheers
Re: [PATCH] powerpc/fsl-pci: Choose PCI host bridge with alias pci0 as the primary
On Sat, 20 Aug 2022 14:33:27 +0200, Pali Rohár wrote: > If there's no PCI host bridge with ISA then check for PCI host bridge with > alias "pci0" (first PCI host bridge) and if it exists then choose it as the > primary PCI host bridge. > > This makes choice of primary PCI host bridge more stable across boots and > updates as the last fallback candidate for primary PCI host bridge (if > there is no choice) is selected arbitrary. > > [...] Applied to powerpc/next. [1/1] powerpc/fsl-pci: Choose PCI host bridge with alias pci0 as the primary https://git.kernel.org/powerpc/c/e082e99f6f87f5204b2531d5a3db7bbd929d23b1 cheers
Re: [PATCH] powerpc: dts: turris1x.dts: Add channel labels for temperature sensor
On Fri, 30 Sep 2022 14:39:01 +0200, Pali Rohár wrote: > Channel 0 of SA56004ED chip refers to internal SA56004ED chip sensor (chip > itself is located on the board) and channel 1 of SA56004ED chip refers to > external sensor which is connected to temperature diode of the P2020 CPU. > > Applied to powerpc/next. [1/1] powerpc: dts: turris1x.dts: Add channel labels for temperature sensor https://git.kernel.org/powerpc/c/67bbb62f61e810734da0a1577a9802ddaed24140 cheers
Re: [PATCH v6 0/4] Option to build big-endian with ELFv2 ABI
On Mon, 28 Nov 2022 14:15:35 +1000, Nicholas Piggin wrote: > This is hopefully the final attempt. Luis was happy for the module > patch to go via the powerpc tree, so I've put the the ELFv2 for big > endian build patches into the series. Hopefully we can deprecate > the ELFv1 ABI > > Since v5, I cleaned up patch 2 as per Christophe's review. And patch > 4 I removed the EXPERT depends so it's easier to test. It's marked as > experimental, but we should soon make it default and try to deprecate > the v1 ABI so we can eventually remove it. > > [...] Applied to powerpc/next. [1/4] module: add module_elf_check_arch for module-specific checks https://git.kernel.org/powerpc/c/f9231a996e229c13d23f907352c2cea84bd1c30a [2/4] powerpc/64: Add module check for ELF ABI version https://git.kernel.org/powerpc/c/de3d098dd1fc635535e3689c5d4aa0684242adde [3/4] powerpc/64: Add big-endian ELFv2 flavour to crypto VMX asm generation https://git.kernel.org/powerpc/c/505ea33089dcfc3ee3201b0fcb94751165805413 [4/4] powerpc/64: Option to build big-endian with ELFv2 ABI https://git.kernel.org/powerpc/c/5017b45946722bdd20ac255c9ae7273b78d1f12e cheers
Re: (subset) [PATCH v3 00/17] powerpc: alternate queued spinlock implementation
On Sat, 26 Nov 2022 19:59:15 +1000, Nicholas Piggin wrote: > This replaces the generic queued spinlock code (like s390 does) with > our own implementation. There is an extra shim patch 1a to get the > series to apply. > > Generic PV qspinlock code is causing latency / starvation regressions on > large systems that are resulting in hard lockups reported (mostly in > pathoogical cases). The generic qspinlock code has a number of issues > important for powerpc hardware and hypervisors that aren't easily solved > without changing code that would impact other architectures. Follow > s390's lead and implement our own for now. > > [...] Applied to powerpc/next. [00/17] powerpc/qspinlock: powerpc qspinlock implementation https://git.kernel.org/powerpc/c/9f61521c7a284e799050cd2adacc9a611bd2b491 [01/17] powerpc/qspinlock: add mcs queueing for contended waiters https://git.kernel.org/powerpc/c/84990b169557428c318df87b7836cd15f65b62dc [02/17] powerpc/qspinlock: use a half-word store to unlock to avoid larx/stcx. https://git.kernel.org/powerpc/c/4c93c2e4b9e8988511c06b9c042f23d4b8f593ad [03/17] powerpc/qspinlock: convert atomic operations to assembly https://git.kernel.org/powerpc/c/b3a73b7db2b6cb3b2e5bfda5518a0e92230ef673 [04/17] powerpc/qspinlock: allow new waiters to steal the lock before queueing https://git.kernel.org/powerpc/c/6aa42f883c438ea132a28801bef3f86f3883d14c [05/17] powerpc/qspinlock: theft prevention to control latency https://git.kernel.org/powerpc/c/0944534ef4d5cf39c8133575524be0be3337dd62 [06/17] powerpc/qspinlock: store owner CPU in lock word https://git.kernel.org/powerpc/c/e1a31e7fd7130628cfd229253da2b4630e7a809c [07/17] powerpc/qspinlock: paravirt yield to lock owner https://git.kernel.org/powerpc/c/085f03311bcede99550e08a1f7cad41bf758b460 [08/17] powerpc/qspinlock: implement option to yield to previous node https://git.kernel.org/powerpc/c/bd48287b2cf4cd6e95576db3a94fd2a7cdf9832d [09/17] powerpc/qspinlock: allow stealing when head of queue yields https://git.kernel.org/powerpc/c/b4c3cdc1a698a2f6168768d0bed4bf062723722e [10/17] powerpc/qspinlock: allow propagation of yield CPU down the queue https://git.kernel.org/powerpc/c/28db61e207ea3890d286cff3141c1ce67346074d [11/17] powerpc/qspinlock: add ability to prod new queue head CPU https://git.kernel.org/powerpc/c/be742c573fdafcfa1752642ca1c7aaf08c258128 [12/17] powerpc/qspinlock: allow lock stealing in trylock and lock fastpath https://git.kernel.org/powerpc/c/f61ab43cc1a6146d6eef7e0713a452c3677ad13e [13/17] powerpc/qspinlock: use spin_begin/end API https://git.kernel.org/powerpc/c/71c235027ce7940434acd3f553602ad8b5d36469 [14/17] powerpc/qspinlock: reduce remote node steal spins https://git.kernel.org/powerpc/c/cc79701114154efe79663ba47d9e51aad2ed3c78 [15/17] powerpc/qspinlock: allow indefinite spinning on a preempted owner https://git.kernel.org/powerpc/c/39dfc73596b48bb50cf7e4f3f54e38427dda5b4e [16/17] powerpc/qspinlock: provide accounting and options for sleepy locks https://git.kernel.org/powerpc/c/12b459a5ebf3308e718bc1dd48acb7c4cf7f1a75 [17/17] powerpc/qspinlock: add compile-time tuning adjustments https://git.kernel.org/powerpc/c/0b2199841a7952d01a717b465df028b40b2cf3e9 cheers
Re: [PATCH] powerpc/64s/hash: add stress_hpt kernel boot option to increase hash faults
On Mon, 24 Oct 2022 13:01:50 +1000, Nicholas Piggin wrote: > This option increases the number of hash misses by limiting the number > of kernel HPT entries, by keeping a per-CPU record of the last kernel > HPTEs installed, and removing that from the hash table on the next hash > insertion. A timer round-robins CPUs removing remaining kernel HPTEs and > clearing the TLB (in the case of bare metal) to increase and slightly > randomise kernel fault activity. > > [...] Applied to powerpc/next. [1/1] powerpc/64s/hash: add stress_hpt kernel boot option to increase hash faults https://git.kernel.org/powerpc/c/6b34a099faa123488b13caf704562f4dbe483fc4 cheers
Re: [PATCH 00/17] powerpc: Remove STACK_FRAME_OVERHEAD
On Sun, 27 Nov 2022 22:49:25 +1000, Nicholas Piggin wrote: > Since RFC: > - Fix a compile bug. > - Fix BookE KVM properly. Hopefully -- I don't have a BookE > KVM environment to test. Can QEMU do it? Is it still tested? > - Drop the last two patches that changed the stack layout, they > can be done later. > - Drop the load/store-multiple change to 32-bit. > > [...] Applied to powerpc/next. [01/17] KVM: PPC: Book3E: Fix CONFIG_TRACE_IRQFLAGS support https://git.kernel.org/powerpc/c/6c645b01e536757a9e1a9f72c13767f9b3f8559f [02/17] powerpc/64: Remove asm interrupt tracing call helpers https://git.kernel.org/powerpc/c/d6aee468e4ecbfec46a3eafae4d31d6efc0d4da4 [03/17] powerpc/perf: callchain validate kernel stack pointer bounds https://git.kernel.org/powerpc/c/32c5209214bd8d4f8c4e9d9b630ef4c671f58e79 [04/17] powerpc: Rearrange copy_thread child stack creation https://git.kernel.org/powerpc/c/bc0677363d0ffaec0c56685291e97b080116976c [05/17] powerpc/pseries: hvcall stack frame overhead https://git.kernel.org/powerpc/c/baa49d81a94bb4170e7f2f4d97016772117d0f60 [06/17] powerpc: simplify ppc_save_regs https://git.kernel.org/powerpc/c/37195b820d32c23bdefce3f460ed7de48a57e5e4 [07/17] powerpc: add definition for pt_regs offset within an interrupt frame https://git.kernel.org/powerpc/c/c03be0a3f3cc656eab5c427b78959b8f1b169a11 [08/17] powerpc: add a definition for the marker offset within the interrupt frame https://git.kernel.org/powerpc/c/d2e8ff9f1492f44c5a6d93f759eea27574d753de [09/17] powerpc: Rename STACK_FRAME_MARKER and derive it from frame offset https://git.kernel.org/powerpc/c/e856e336924b0ecd0b7058e65e6b3e7266ee0b95 [10/17] powerpc: add a define for the user interrupt frame size https://git.kernel.org/powerpc/c/1223e5a20f7fb3c31c91a328d1a04ed26d5e889b [11/17] powerpc: add a define for the switch frame size and regs offset https://git.kernel.org/powerpc/c/6f291a03819e4051ebc870471d26915ef2e6ba31 [12/17] powerpc: copy_thread fill in interrupt frame marker and back chain https://git.kernel.org/powerpc/c/6895dfc0474170c492191c126fcfc420f7771a09 [13/17] powerpc: copy_thread add a back chain to the switch stack frame https://git.kernel.org/powerpc/c/edbd0387f3249cc7e102f86d4852a9a9f3bb1305 [14/17] powerpc: split validate_sp into two functions https://git.kernel.org/powerpc/c/4cefb0f6c555971b3e6544a9b15470f9d1f12089 [15/17] powerpc: allow minimum sized kernel stack frames https://git.kernel.org/powerpc/c/90f1b43196c5e79f6c986a359011a19857984c27 [16/17] powerpc/64: ELFv2 use minimal stack frames in int and switch frame sizes https://git.kernel.org/powerpc/c/cd52414d5a6ccea6ce956ef05161fe824522a107 [17/17] powerpc: remove STACK_FRAME_OVERHEAD https://git.kernel.org/powerpc/c/dfecd06bc5524517ed7737c30eaaf747338b280a cheers
Re: [PATCH 0/3] selftests/powerpc: ptrace/perf_hwbreak test fixes
On Tue, 22 Nov 2022 12:10:51 +0530, Naveen N. Rao wrote: > This series fixes two issues with the perf_hwbreak test: > - Test fails on systems with large number of cpus due to hitting the > resource limit for maximum number of open file descriptors. > - Test fails on systems running with lower SMT levels since it assumes > all cpus are online. > > Fix those issues. The first patch is a small cleanup to aid subsequent > fixes. > > [...] Applied to powerpc/next. [1/3] selftests/powerpc: Move perror closer to its use https://git.kernel.org/powerpc/c/71ae6305ad41cfd1ac5aa91d356e71c7a537df2e [2/3] selftests/powerpc: Bump up rlimit for perf-hwbreak test https://git.kernel.org/powerpc/c/616ad3f4aac287c48b66c92cb777395b4465ed4f [3/3] selftests/powerpc: Account for offline cpus in perf-hwbreak test https://git.kernel.org/powerpc/c/260095926d3956071c6699a28824c3f0fa7cd97a cheers
Re: [PATCH 00/13] RTAS maintenance
On Fri, 18 Nov 2022 09:07:38 -0600, Nathan Lynch wrote: > A collection of loosely-related RTAS code changes, most notably: > > * Fixing misuses of rtas_token() for non-function properties. > * The stronger validation for sys_rtas() offered by the > PPC_RTAS_FILTER config option is always enabled. > * Improved function token lookups, including efficient "reverse" > token-to-name mappings. > * Static tracepoints for RTAS entry and exit. > > [...] Patches 1-9 applied to powerpc/next. [01/13] powerpc/rtas: document rtas_call() https://git.kernel.org/powerpc/c/336e2554ec99eb97616004c791ee89abe96bdab2 [02/13] powerpc/rtasd: use correct OF API for event scan rate https://git.kernel.org/powerpc/c/b10af504a2015d12c566b6b0a4c7e3b602949eeb [03/13] powerpc/rtas: avoid device tree lookups in rtas_os_term() https://git.kernel.org/powerpc/c/ed2213bfb192ab51f09f12e9b49b5d482c6493f3 [04/13] powerpc/rtas: avoid scheduling in rtas_os_term() https://git.kernel.org/powerpc/c/6c606e57eecc37d6b36d732b1ff7e55b7dc32dd4 [05/13] powerpc/pseries/eeh: use correct API for error log size https://git.kernel.org/powerpc/c/9aafbfa5f57a4b75bafd3bed0191e8429c5fa618 [06/13] powerpc/rtas: clean up rtas_error_log_max initialization https://git.kernel.org/powerpc/c/c67a0e411d0ffe0648fe84e25e9f899ce770feb3 [07/13] powerpc/rtas: clean up includes https://git.kernel.org/powerpc/c/9581f8a00777a073fdd8146659a51ca007cae8d6 [08/13] powerpc/rtas: define pr_fmt and convert printk call sites https://git.kernel.org/powerpc/c/f975b6559bac510f1b1b39637997bb240f0a9969 [09/13] powerpc/rtas: mandate RTAS syscall filtering https://git.kernel.org/powerpc/c/98c738c8cee6e5a58d4060862e2f8cf3cdc8a328 cheers
Re: [PATCH] powerpc/ftrace: fix syscall tracing on PPC64_ELF_ABI_V1
On Thu, 1 Dec 2022 11:14:42 -0500, Michael Jeanson wrote: > In v5.7 the powerpc syscall entry/exit logic was rewritten in C, on > PPC64_ELF_ABI_V1 this resulted in the symbols in the syscall table > changing from their dot prefixed variant to the non-prefixed ones. > > Since ftrace prefixes a dot to the syscall names when matching them to > build its syscall event list, this resulted in no syscall events being > available. > > [...] Applied to powerpc/next. [1/1] powerpc/ftrace: fix syscall tracing on PPC64_ELF_ABI_V1 https://git.kernel.org/powerpc/c/ad050d2390fccb22aa3e6f65e11757ce7a5a7ca5 cheers
Re: (subset) [PATCH 1/3] firmware_loader: remove #include
On Sat, 26 Nov 2022 06:09:59 +0100, Thomas Weißschuh wrote: > utsrelease.h is potentially generated on each build. > By removing this unused include we can get rid of some spurious > recompilations. > > Applied to powerpc/next. [2/3] powerpc/book3e: remove #include https://git.kernel.org/powerpc/c/d5090716be6791ada9ee142163a4934c1c147aaa cheers
Re: [PATCH] selftests/powerpc: Fix resource leaks
On Mon, 5 Dec 2022 12:44:27 +0400, Miaoqian Lin wrote: > In check_all_cpu_dscr_defaults, opendir() opens the directory stream. > Add missing closedir() in the error path to release it. > > In check_cpu_dscr_default, open() creates an open file descriptor. > Add missing close() in the error path to release it. > > > [...] Applied to powerpc/next. [1/1] selftests/powerpc: Fix resource leaks https://git.kernel.org/powerpc/c/8f4ab7da904ab7027ccd43ddb4f0094e932a5877 cheers
Re: [PATCH v2 0/2] Consider the size of the added CPU nodes in the kexec FDT
On Thu, 10 Nov 2022 19:06:17 +0100, Laurent Dufour wrote: > When adding CPUs to an already big system (test show it seems to start with > more than 256 CPUs), the kernel is showing error messages when building the > FDT for the kexec kernel (kdump or kexec). > > It's worth to mention that the kdump kernel is reloaded after a CPU add > operation. > > [...] Applied to powerpc/next. [1/2] powerpc: export the CPU node count https://git.kernel.org/powerpc/c/e13d23a404f2e6dfaf8b1ef7d161a0836fce4fa5 [2/2] powerpc: Take in account addition CPU node when building kexec FDT https://git.kernel.org/powerpc/c/340a4a9f8773e102cc5ef531665970a686dfa245 cheers
Re: [PATCH] pseries/mobility: reset the RCU watchdogs after a LPM
On Fri, 25 Nov 2022 18:32:04 +0100, Laurent Dufour wrote: > The RCU watchdog timer should be reset when restarting the CPU after a Live > Partition Mobility operation. > > Applied to powerpc/next. [1/1] pseries/mobility: reset the RCU watchdogs after a LPM https://git.kernel.org/powerpc/c/9b574cfab7d4e68c67c4ee4fcde912ef54a25b88 cheers
Re: [PATCH] powerpc/pseries: unregister VPA when hot unplugging a CPU
On Mon, 14 Nov 2022 17:01:50 +0100, Laurent Dufour wrote: > The VPA should unregister when offlining a CPU. Otherwise there could be a > short window where 2 CPUs could share the same VPA. > > This happens because the hypervisor is still keeping the VPA attached to > the vCPU even if it became offline. > > Here is a potential situation: > 1. remove proc A, > 2. add proc B. If proc B gets proc A's place in cpu_present_map, then it > registers proc A's VPAs. > 3. If proc B is then re-added to the LP, its threads are sharing VPAs with > proc A briefly as they come online. > > [...] Applied to powerpc/next. [1/1] powerpc/pseries: unregister VPA when hot unplugging a CPU https://git.kernel.org/powerpc/c/f6aa37c51ec0d053ee34c235bfe0e18a3baf cheers
Re: [PATCH v3] powerpc/hv-gpci: Fix hv_gpci event list
On Wed, 30 Nov 2022 23:15:13 +0530, Kajol Jain wrote: > Based on getPerfCountInfo v1.018 documentation, some of the > hv_gpci events were deprecated for platform firmware that > supports counter_info_version 0x8 or above. > > Fix the hv_gpci event list by adding a new attribute group > called "hv_gpci_event_attrs_v6" and a "ENABLE_EVENTS_COUNTERINFO_V6" > macro to enable these events for platform firmware > that supports counter_info_version 0x6 or below. And assigning > the hv_gpci event list based on output counter info version > of underlying plaform. > > [...] Applied to powerpc/next. [1/1] powerpc/hv-gpci: Fix hv_gpci event list https://git.kernel.org/powerpc/c/03f7c1d2a49acd30e38789cd809d3300721e9b0e cheers
Re: [PATCH] KVM: Fix spelling mistake
On Thu, 23 Jun 2022 18:20:31 +0800, Zhang Jiaming wrote: > Change 'subsquent' to 'subsequent'. > Change 'accross' to 'across'. > > Applied to powerpc/next. [1/1] KVM: Fix spelling mistake https://git.kernel.org/powerpc/c/392a58f1eaab0c90b80d7ba4a03dbf6eaaeabe60 cheers
Re: [PATCH] cxl: Remove unnecessary cxl_pci_window_alignment()
On Mon, 5 Dec 2022 16:32:31 -0600, Bjorn Helgaas wrote: > From: Bjorn Helgaas > > cxl_pci_window_alignment() is referenced only via the struct > pci_controller_ops.window_alignment function pointer, and only in the > powerpc implementation of pcibios_window_alignment(). > > pcibios_window_alignment() defaults to returning 1 if the function pointer > is NULL, which is the same was what cxl_pci_window_alignment() does. > > [...] Applied to powerpc/next. [1/1] cxl: Remove unnecessary cxl_pci_window_alignment() https://git.kernel.org/powerpc/c/6aecc0a59e07ba895b5473e0c916ba5f3d556c15 cheers
Re: [PATCH] powerpc/ps3: mark ps3_system_bus_type static
On Tue, 22 Nov 2022 08:22:25 +0100, Christoph Hellwig wrote: > ps3_system_bus_type is only used inside of system-bus.c, so remove > the external declaration and the very outdated comment next to it. > > Applied to powerpc/next. [1/1] powerpc/ps3: mark ps3_system_bus_type static https://git.kernel.org/powerpc/c/dea681c91d3cd5326f87d0a3c93079573e22ce9a cheers
Re: (subset) [PATCH 00/11] Fix pca954x i2c-mux node names
On Fri, 2 Dec 2022 17:49:15 +0100, Geert Uytterhoeven wrote: > Hi all, > > According to the I2C bus multiplexer/switch DT bindings, i2c-mux nodes > should be named "i2c-mux" (or something similar). > This patch series renames nodes for pca954x i2c-muxes that are flagged > by > > [...] Applied to powerpc/next. [11/11] powerpc: dts: fsl: Fix pca954x i2c-mux node names https://git.kernel.org/powerpc/c/3ae7c96dd51025550c8001c6f87f11d00807 cheers
Re: [PATCH v2 1/5] powerpc/code-patching: Remove #ifdef CONFIG_STRICT_KERNEL_RWX
On Fri, 2 Dec 2022 09:31:39 +0100, Christophe Leroy wrote: > No need to have one implementation of patch_instruction() for > CONFIG_STRICT_KERNEL_RWX and one for !CONFIG_STRICT_KERNEL_RWX. > > In patch_instruction(), call raw_patch_instruction() when > !CONFIG_STRICT_KERNEL_RWX. > > In poking_init(), bail out immediately, it will be equivalent > to the weak default implementation. > > [...] Applied to powerpc/next. [1/5] powerpc/code-patching: Remove #ifdef CONFIG_STRICT_KERNEL_RWX https://git.kernel.org/powerpc/c/84ecfe6f38ae4ee779ebd97ee173937fff565bf9 [2/5] powerpc/feature-fixups: Refactor entry fixups patching https://git.kernel.org/powerpc/c/6076dc349b1c587c74c37027efff76f0fa4646f4 [3/5] powerpc/feature-fixups: Refactor other fixups patching https://git.kernel.org/powerpc/c/3d1dbbca33a9c6dd3aafd4d14aaea9cc310723e1 [4/5] powerpc/feature-fixups: Do not patch init section after init https://git.kernel.org/powerpc/c/b988e7797d09379057cf991ae082f9ad7a309a63 [5/5] powerpc/code-patching: Remove protection against patching init addresses after init https://git.kernel.org/powerpc/c/6f3a81b60091031c2c14eb2373d1937b027deb46 cheers
Re: [PATCH] KVM: PPC: Book3S HV: Use the bitmap API to allocate bitmaps
On Sat, 9 Jul 2022 17:56:43 +0200, Christophe JAILLET wrote: > Use bitmap_zalloc()/bitmap_free() instead of hand-writing them. > > It is less verbose and it improves the semantic. > > Applied to powerpc/next. [1/1] KVM: PPC: Book3S HV: Use the bitmap API to allocate bitmaps https://git.kernel.org/powerpc/c/a96b20758b23be7e9f693218908228d6100c3c26 cheers
Re: [PATCH] KVM: PPC: use __func__ to get funcion's name in an output message
On Fri, 17 Jun 2022 23:50:19 +0800 (GMT+08:00), XueBing Chen wrote: > Prefer using '"%s...", __func__' to get current function's name in > an output message. > > Applied to powerpc/next. [1/1] KVM: PPC: use __func__ to get funcion's name in an output message https://git.kernel.org/powerpc/c/61119786de40f61b8843aa57217b678361763d67 cheers
Re: [PATCH v2] powerpc/cpuidle: Set CPUIDLE_FLAG_POLLING for snooze state
On Mon, 14 Nov 2022 20:26:11 +0530, Aboorva Devarajan wrote: > During the comparative study of cpuidle governors, it is noticed that the > menu governor does not select CEDE state in some scenarios even though when > the sleep duration of the CPU exceeds the target residency of the CEDE idle > state this is because the CPU exits the snooze "polling" state when snooze > time limit is reached in the snooze_loop(), which is not a real wake up > and it just means that the polling state selection was not adequate. > > [...] Applied to powerpc/next. [1/1] powerpc/cpuidle: Set CPUIDLE_FLAG_POLLING for snooze state https://git.kernel.org/powerpc/c/5ddcc03a07ae1ab5062f89a946d9495f1fd8eaa4 cheers
Re: (subset) [PATCH v3 0/7] Expand selftest utils
On Mon, 28 Nov 2022 15:19:41 +1100, Benjamin Gray wrote: > Started this when writing tests for a feature I'm working on, needing a way to > read/write numbers to system files. After writing some utils to safely handle > file IO and parsing, I realised I'd made the ~6th file read/write > implementation > and only(?) number parser that checks all the failure modes when expecting to > parse a single number from a file. > > So these utils ended up becoming this series. I also modified some other test > utils I came across while doing so. My understanding is selftests are not > expected > to be backported, so I wasn't concerned about only introducing new utils and > leaving > the existing implementations be. > > [...] Patches 1 & 2 applied to powerpc/next. [1/7] selftests/powerpc: Use mfspr/mtspr macros https://git.kernel.org/powerpc/c/aecfd680099ba518c34dff2941017c5aa97def52 [2/7] selftests/powerpc: Add ptrace setup_core_pattern() null-terminator https://git.kernel.org/powerpc/c/94ba4f2c33f42dae7813dc169a177e922a39560c cheers
Re: [PATCH v10 0/9] powerpc/code-patching: Use temporary mm for Radix MMU
On Wed, 9 Nov 2022 15:51:03 +1100, Benjamin Gray wrote: > This is a revision of Chris and Jordan's series to introduce a per-cpu > temporary > mm to be used for patching with strict rwx on radix mmus. > > v10: * Don't set poking_init_enabled on boot CPU init failure > * Remove extern from functions in files touched by this series > * Changed book3s/32/tlbflush.h stub body from warning to build bug > * Remove empty hash__ set of functions. Also removed the ones that are > just warnings (would have preferred to make them build bugs, but they > blocked the build even though it's all inline inside a radix_enabled() > if-block). > - It's not possible to use the radix specific necessary TLB > flush > in code patching, as code-patching.c is compiled even when > radix__* > functions aren't visible. #ifdefs would be required. > The cxl usage required radix__* be visible anyway, so there > is no > compile issue. > * Mention cache benefits of struct of patching context variables > * Don't open-code mm init and teardown. It seems tlb_gather_mmu does > the necessary steps to detect page table pages to free, so it should > not leak. get_locked_pte() is used over __get_locked_pte() because I > don't know what makes the double-underscore function dangerous. > > [...] Patches 1-2 and 4-9 applied to powerpc/next. [1/9] powerpc: Allow clearing and restoring registers independent of saved breakpoint state https://git.kernel.org/powerpc/c/3671f4ebe3eb12e7222e4d7b0f94e85cfe34253a [2/9] powerpc/code-patching: Use WARN_ON and fix check in poking_init https://git.kernel.org/powerpc/c/071c95c1acbd96e76bab8b25b5cad0d71a011f37 [4/9] powerpc/mm: Remove empty hash__ functions https://git.kernel.org/powerpc/c/baf1ed24b27db475b38f534953885d0425e2232d [5/9] cxl: Use radix__flush_all_mm instead of generic flush_all_mm https://git.kernel.org/powerpc/c/0f0a0a6091e678b1a75078ecd6b02176f3228dbb [6/9] powerpc/mm: Remove flush_all_mm, local_flush_all_mm https://git.kernel.org/powerpc/c/d34471c9bd5d47ab148dd68817631a4238f755c4 [7/9] powerpc/tlb: Add local flush for page given mm_struct and psize https://git.kernel.org/powerpc/c/274d842fa1efd9449e6c8896e0be11621f1f [8/9] powerpc/code-patching: Use temporary mm for Radix MMU https://git.kernel.org/powerpc/c/c28c15b6d28a776538482101522cbcd9f906b15c [9/9] powerpc/code-patching: Consolidate and cache per-cpu patching context https://git.kernel.org/powerpc/c/2f228ee1ade5d8d1f26cf94863a36c5693023c58 cheers
[PATCH] powerpc/qspinlock: Fix 32-bit build
Some 32-bit configurations don't pull in the spin_begin/end/relax definitions. Fix is to restore a lost include. Reported-by: kernel test robot Link: https://lore.kernel.org/oe-kbuild-all/202212050224.i7uh9foh-...@intel.com Fixes: 84990b169557 ("powerpc/qspinlock: add mcs queueing for contended waiters") Signed-off-by: Nicholas Piggin --- arch/powerpc/lib/qspinlock.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/lib/qspinlock.c b/arch/powerpc/lib/qspinlock.c index 2eab84774911..c81fe8fff2b2 100644 --- a/arch/powerpc/lib/qspinlock.c +++ b/arch/powerpc/lib/qspinlock.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include -- 2.37.2
Re: [PATCH 10/11] MIPS: mscc: jaguar2: Fix pca9545 i2c-mux node names
On Fri, Dec 02, 2022 at 05:49:25PM +0100, Geert Uytterhoeven wrote: > "make dtbs_check": > > arch/mips/boot/dts/mscc/jaguar2_pcb110.dtb: pca9545@70: $nodename:0: > 'pca9545@70' does not match '^(i2c-?)?mux' > From schema: > Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.yaml > arch/mips/boot/dts/mscc/jaguar2_pcb110.dtb: pca9545@70: Unevaluated > properties are not allowed ('#address-cells', '#size-cells', 'i2c@0', > 'i2c@1', 'i2c@2', 'i2c@3' were unexpected) > From schema: > Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.yaml > ... > > Fix this by renaming PCA9545 nodes to "i2c-mux", to match the I2C bus > multiplexer/switch DT bindings and the Generic Names Recommendation in > the Devicetree Specification. > > Signed-off-by: Geert Uytterhoeven > --- > arch/mips/boot/dts/mscc/jaguar2_pcb110.dts | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) applied to mips-next. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea.[ RFC1925, 2.3 ]
[PATCH 3/3] USB: sisusbvga: use module_usb_driver()
Now, that we only do usb_register() and usb_sisusb_exit() in module_init() and module_exit() respectivelly, we can simply use module_usb_driver(). Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Christophe Leroy Cc: Yoshinori Sato Cc: Rich Felker Cc: Thomas Winischhofer Cc: Greg Kroah-Hartman Cc: linuxppc-dev@lists.ozlabs.org Cc: linux...@vger.kernel.org Cc: linux-...@vger.kernel.org Signed-off-by: Jiri Slaby (SUSE) --- drivers/usb/misc/sisusbvga/sisusbvga.c | 13 + 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/usb/misc/sisusbvga/sisusbvga.c b/drivers/usb/misc/sisusbvga/sisusbvga.c index a0d5ba8058f8..654a79fd3231 100644 --- a/drivers/usb/misc/sisusbvga/sisusbvga.c +++ b/drivers/usb/misc/sisusbvga/sisusbvga.c @@ -2947,18 +2947,7 @@ static struct usb_driver sisusb_driver = { .id_table = sisusb_table, }; -static int __init usb_sisusb_init(void) -{ - return usb_register(_driver); -} - -static void __exit usb_sisusb_exit(void) -{ - usb_deregister(_driver); -} - -module_init(usb_sisusb_init); -module_exit(usb_sisusb_exit); +module_usb_driver(sisusb_driver); MODULE_AUTHOR("Thomas Winischhofer "); MODULE_DESCRIPTION("sisusbvga - Driver for Net2280/SiS315-based USB2VGA dongles"); -- 2.38.1
[PATCH 2/3] USB: sisusbvga: rename sisusb.c to sisusbvga.c
As it's the only source for the sisusbvga module, there is no need for a 2-steps build. Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Christophe Leroy Cc: Yoshinori Sato Cc: Rich Felker Cc: Thomas Winischhofer Cc: Greg Kroah-Hartman Cc: linuxppc-dev@lists.ozlabs.org Cc: linux...@vger.kernel.org Cc: linux-...@vger.kernel.org Signed-off-by: Jiri Slaby (SUSE) --- drivers/usb/misc/sisusbvga/Makefile | 2 -- drivers/usb/misc/sisusbvga/{sisusb.c => sisusbvga.c} | 0 2 files changed, 2 deletions(-) rename drivers/usb/misc/sisusbvga/{sisusb.c => sisusbvga.c} (100%) diff --git a/drivers/usb/misc/sisusbvga/Makefile b/drivers/usb/misc/sisusbvga/Makefile index 93265de80eb9..28aa1e6ef823 100644 --- a/drivers/usb/misc/sisusbvga/Makefile +++ b/drivers/usb/misc/sisusbvga/Makefile @@ -4,5 +4,3 @@ # obj-$(CONFIG_USB_SISUSBVGA) += sisusbvga.o - -sisusbvga-y := sisusb.o diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusbvga.c similarity index 100% rename from drivers/usb/misc/sisusbvga/sisusb.c rename to drivers/usb/misc/sisusbvga/sisusbvga.c -- 2.38.1
[PATCH 1/3] USB: sisusbvga: remove console support
It was marked as BROKEN since commit 862ee699fefe (USB: sisusbvga: Make console support depend on BROKEN) 2 years ago. Since noone stepped up to fix it, remove it completely. Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Christophe Leroy Cc: Yoshinori Sato Cc: Rich Felker Cc: Thomas Winischhofer Cc: linuxppc-dev@lists.ozlabs.org Cc: linux...@vger.kernel.org Cc: linux-...@vger.kernel.org Signed-off-by: Jiri Slaby (SUSE) --- arch/powerpc/configs/ppc6xx_defconfig|1 - arch/sh/configs/landisk_defconfig|1 - drivers/usb/misc/sisusbvga/Kconfig | 34 - drivers/usb/misc/sisusbvga/Makefile |1 - drivers/usb/misc/sisusbvga/sisusb.c | 276 +--- drivers/usb/misc/sisusbvga/sisusb.h | 21 - drivers/usb/misc/sisusbvga/sisusb_con.c | 1496 -- drivers/usb/misc/sisusbvga/sisusb_init.c | 955 -- drivers/usb/misc/sisusbvga/sisusb_init.h | 180 --- 9 files changed, 6 insertions(+), 2959 deletions(-) delete mode 100644 drivers/usb/misc/sisusbvga/sisusb_con.c delete mode 100644 drivers/usb/misc/sisusbvga/sisusb_init.c delete mode 100644 drivers/usb/misc/sisusbvga/sisusb_init.h diff --git a/arch/powerpc/configs/ppc6xx_defconfig b/arch/powerpc/configs/ppc6xx_defconfig index 115d40be5481..110258277959 100644 --- a/arch/powerpc/configs/ppc6xx_defconfig +++ b/arch/powerpc/configs/ppc6xx_defconfig @@ -911,7 +911,6 @@ CONFIG_USB_IDMOUSE=m CONFIG_USB_FTDI_ELAN=m CONFIG_USB_APPLEDISPLAY=m CONFIG_USB_SISUSBVGA=m -CONFIG_USB_SISUSBVGA_CON=y CONFIG_USB_LD=m CONFIG_USB_TRANCEVIBRATOR=m CONFIG_USB_IOWARRIOR=m diff --git a/arch/sh/configs/landisk_defconfig b/arch/sh/configs/landisk_defconfig index 492a0a2e0e36..7037320b654a 100644 --- a/arch/sh/configs/landisk_defconfig +++ b/arch/sh/configs/landisk_defconfig @@ -92,7 +92,6 @@ CONFIG_USB_SERIAL_PL2303=m CONFIG_USB_EMI62=m CONFIG_USB_EMI26=m CONFIG_USB_SISUSBVGA=m -CONFIG_USB_SISUSBVGA_CON=y CONFIG_EXT2_FS=y CONFIG_EXT3_FS=y # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set diff --git a/drivers/usb/misc/sisusbvga/Kconfig b/drivers/usb/misc/sisusbvga/Kconfig index c12cdd015410..42f81c8eaa92 100644 --- a/drivers/usb/misc/sisusbvga/Kconfig +++ b/drivers/usb/misc/sisusbvga/Kconfig @@ -3,7 +3,6 @@ config USB_SISUSBVGA tristate "USB 2.0 SVGA dongle support (Net2280/SiS315)" depends on (USB_MUSB_HDRC || USB_EHCI_HCD) - select FONT_SUPPORT if USB_SISUSBVGA_CON help Say Y here if you intend to attach a USB2VGA dongle based on a Net2280 and a SiS315 chip. @@ -13,36 +12,3 @@ config USB_SISUSBVGA To compile this driver as a module, choose M here; the module will be called sisusbvga. If unsure, say N. - -config USB_SISUSBVGA_CON - bool "Text console and mode switching support" if USB_SISUSBVGA - depends on VT && BROKEN - select FONT_8x16 - help - Say Y here if you want a VGA text console via the USB dongle or - want to support userland applications that utilize the driver's - display mode switching capabilities. - - Note that this console supports VGA/EGA text mode only. - - By default, the console part of the driver will not kick in when - the driver is initialized. If you want the driver to take over - one or more of the consoles, you need to specify the number of - the first and last consoles (starting at 1) as driver parameters. - - For example, if the driver is compiled as a module: - -modprobe sisusbvga first=1 last=5 - - If you use hotplug, add this to your modutils config files with - the "options" keyword, such as eg. - -options sisusbvga first=1 last=5 - - If the driver is compiled into the kernel image, the parameters - must be given in the kernel command like, such as - -sisusbvga.first=1 sisusbvga.last=5 - - - diff --git a/drivers/usb/misc/sisusbvga/Makefile b/drivers/usb/misc/sisusbvga/Makefile index 6551bce68ac5..93265de80eb9 100644 --- a/drivers/usb/misc/sisusbvga/Makefile +++ b/drivers/usb/misc/sisusbvga/Makefile @@ -6,4 +6,3 @@ obj-$(CONFIG_USB_SISUSBVGA) += sisusbvga.o sisusbvga-y := sisusb.o -sisusbvga-$(CONFIG_USB_SISUSBVGA_CON) += sisusb_con.o sisusb_init.o diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c index f08de33d9ff3..a0d5ba8058f8 100644 --- a/drivers/usb/misc/sisusbvga/sisusb.c +++ b/drivers/usb/misc/sisusbvga/sisusb.c @@ -51,25 +51,11 @@ #include #include "sisusb.h" -#include "sisusb_init.h" - -#ifdef CONFIG_USB_SISUSBVGA_CON -#include -#endif #define SISUSB_DONTSYNC /* Forward declarations / clean-up routines */ -#ifdef CONFIG_USB_SISUSBVGA_CON -static int sisusb_first_vc; -static int sisusb_last_vc; -module_param_named(first, sisusb_first_vc, int, 0); -module_param_named(last, sisusb_last_vc, int, 0); -MODULE_PARM_DESC(first, "Number of first console to take over (1 -
Re: [PATCH mm-unstable RFC 17/26] powerpc/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE on 32bit book3s
On 08.12.22 09:52, David Hildenbrand wrote: On 07.12.22 14:55, Christophe Leroy wrote: Le 06/12/2022 à 15:47, David Hildenbrand a écrit : We already implemented support for 64bit book3s in commit bff9beaa2e80 ("powerpc/pgtable: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE for book3s") Let's support __HAVE_ARCH_PTE_SWP_EXCLUSIVE also in 32bit by reusing yet unused LSB 2 / MSB 29. There seems to be no real reason why that bit cannot be used, and reusing it avoids having to steal one bit from the swap offset. While at it, mask the type in __swp_entry(). Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Christophe Leroy Signed-off-by: David Hildenbrand --- arch/powerpc/include/asm/book3s/32/pgtable.h | 38 +--- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/include/asm/book3s/32/pgtable.h b/arch/powerpc/include/asm/book3s/32/pgtable.h index 75823f39e042..8107835b38c1 100644 --- a/arch/powerpc/include/asm/book3s/32/pgtable.h +++ b/arch/powerpc/include/asm/book3s/32/pgtable.h @@ -42,6 +42,9 @@ #define _PMD_PRESENT_MASK (PAGE_MASK) #define _PMD_BAD(~PAGE_MASK) +/* We borrow the _PAGE_USER bit to store the exclusive marker in swap PTEs. */ +#define _PAGE_SWP_EXCLUSIVE_PAGE_USER + /* And here we include common definitions */ #define _PAGE_KERNEL_RO 0 @@ -363,17 +366,42 @@ static inline void __ptep_set_access_flags(struct vm_area_struct *vma, #define pmd_page(pmd) pfn_to_page(pmd_pfn(pmd)) /* - * Encode and decode a swap entry. - * Note that the bits we use in a PTE for representing a swap entry - * must not include the _PAGE_PRESENT bit or the _PAGE_HASHPTE bit (if used). - * -- paulus + * Encode/decode swap entries and swap PTEs. Swap PTEs are all PTEs that + * are !pte_none() && !pte_present(). + * + * Format of swap PTEs (32bit PTEs): + * + * 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 + * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + * E H P <- type --> <- offset --> That's in reversed order. _PAGE_HASHPTE is bit 30 and should be on the right hand side. Etc ... Ugh, messed it up while converting back and forth between LSB 0 and MSB 0. /* * Format of swap PTEs (32bit PTEs): * * 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * <- offset --> <- type --> E H P Still wrong, the type is only 5 bits: + * Format of swap PTEs (32bit PTEs): + * + * 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 + * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + * <- offset > < type -> E H P + * -- Thanks, David / dhildenb
Re: [PATCH mm-unstable RFC 17/26] powerpc/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE on 32bit book3s
On 07.12.22 14:55, Christophe Leroy wrote: Le 06/12/2022 à 15:47, David Hildenbrand a écrit : We already implemented support for 64bit book3s in commit bff9beaa2e80 ("powerpc/pgtable: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE for book3s") Let's support __HAVE_ARCH_PTE_SWP_EXCLUSIVE also in 32bit by reusing yet unused LSB 2 / MSB 29. There seems to be no real reason why that bit cannot be used, and reusing it avoids having to steal one bit from the swap offset. While at it, mask the type in __swp_entry(). Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Christophe Leroy Signed-off-by: David Hildenbrand --- arch/powerpc/include/asm/book3s/32/pgtable.h | 38 +--- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/include/asm/book3s/32/pgtable.h b/arch/powerpc/include/asm/book3s/32/pgtable.h index 75823f39e042..8107835b38c1 100644 --- a/arch/powerpc/include/asm/book3s/32/pgtable.h +++ b/arch/powerpc/include/asm/book3s/32/pgtable.h @@ -42,6 +42,9 @@ #define _PMD_PRESENT_MASK (PAGE_MASK) #define _PMD_BAD (~PAGE_MASK) +/* We borrow the _PAGE_USER bit to store the exclusive marker in swap PTEs. */ +#define _PAGE_SWP_EXCLUSIVE_PAGE_USER + /* And here we include common definitions */ #define _PAGE_KERNEL_RO 0 @@ -363,17 +366,42 @@ static inline void __ptep_set_access_flags(struct vm_area_struct *vma, #define pmd_page(pmd)pfn_to_page(pmd_pfn(pmd)) /* - * Encode and decode a swap entry. - * Note that the bits we use in a PTE for representing a swap entry - * must not include the _PAGE_PRESENT bit or the _PAGE_HASHPTE bit (if used). - * -- paulus + * Encode/decode swap entries and swap PTEs. Swap PTEs are all PTEs that + * are !pte_none() && !pte_present(). + * + * Format of swap PTEs (32bit PTEs): + * + * 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 + * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + * E H P <- type --> <- offset --> That's in reversed order. _PAGE_HASHPTE is bit 30 and should be on the right hand side. Etc ... Ugh, messed it up while converting back and forth between LSB 0 and MSB 0. /* * Format of swap PTEs (32bit PTEs): * * 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * <- offset --> <- type --> E H P Now the patch description ("unused LSB 2 / MSB 29") makes sense. Thanks! Any feedback if the bit could be problematic? -- Thanks, David / dhildenb