[PATCH] powerpc/watchpoint: Don't call dar_within_range() for Book3S
DAR is set to the first byte of overlap between actual access and watched range at DSI on Book3S processor. But actual access range might or might not be within user asked range. So for Book3S, it must not call dar_within_range(). This revert portion of commit 39413ae00967 ("powerpc/hw_breakpoints: Rewrite 8xx breakpoints to allow any address range size."). Before patch: # ./tools/testing/selftests/powerpc/ptrace/perf-hwbreak ... TESTED: No overlap FAILED: Partial overlap: 0 != 2 TESTED: Partial overlap TESTED: No overlap FAILED: Full overlap: 0 != 2 failure: perf_hwbreak After patch: TESTED: No overlap TESTED: Partial overlap TESTED: Partial overlap TESTED: No overlap TESTED: Full overlap success: perf_hwbreak Fixes: 39413ae00967 ("powerpc/hw_breakpoints: Rewrite 8xx breakpoints to allow any address range size.") Reported-by: Michael Ellerman Signed-off-by: Ravi Bangoria --- arch/powerpc/kernel/hw_breakpoint.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/kernel/hw_breakpoint.c b/arch/powerpc/kernel/hw_breakpoint.c index 2462cd7c565c..d0854320bb50 100644 --- a/arch/powerpc/kernel/hw_breakpoint.c +++ b/arch/powerpc/kernel/hw_breakpoint.c @@ -331,11 +331,13 @@ int hw_breakpoint_handler(struct die_args *args) } info->type &= ~HW_BRK_TYPE_EXTRANEOUS_IRQ; - if (!dar_within_range(regs->dar, info)) - info->type |= HW_BRK_TYPE_EXTRANEOUS_IRQ; - - if (!IS_ENABLED(CONFIG_PPC_8xx) && !stepping_handler(regs, bp, info)) - goto out; + if (IS_ENABLED(CONFIG_PPC_8xx)) { + if (!dar_within_range(regs->dar, info)) + info->type |= HW_BRK_TYPE_EXTRANEOUS_IRQ; + } else { + if (!stepping_handler(regs, bp, info)) + goto out; + } /* * As a policy, the callback is invoked in a 'trigger-after-execute' -- 2.21.1
[PATCH 3/7] docs: fix broken references to text files
Several references got broken due to txt to ReST conversion. Several of them can be automatically fixed with: scripts/documentation-file-ref-check --fix Signed-off-by: Mauro Carvalho Chehab --- Documentation/admin-guide/kernel-parameters.txt | 10 +- Documentation/filesystems/cifs/cifsroot.txt | 2 +- Documentation/memory-barriers.txt| 2 +- Documentation/process/submit-checklist.rst | 2 +- .../translations/it_IT/process/submit-checklist.rst | 2 +- Documentation/translations/ko_KR/memory-barriers.txt | 2 +- .../translations/zh_CN/filesystems/sysfs.txt | 2 +- .../translations/zh_CN/process/submit-checklist.rst | 2 +- Documentation/virt/kvm/arm/pvtime.rst| 2 +- Documentation/virt/kvm/devices/vcpu.rst | 2 +- Documentation/virt/kvm/hypercalls.rst| 4 ++-- arch/powerpc/include/uapi/asm/kvm_para.h | 2 +- drivers/gpu/drm/Kconfig | 2 +- drivers/gpu/drm/drm_ioctl.c | 2 +- drivers/hwtracing/coresight/Kconfig | 2 +- fs/fat/Kconfig | 8 fs/fuse/Kconfig | 2 +- fs/fuse/dev.c| 2 +- fs/nfs/Kconfig | 2 +- fs/overlayfs/Kconfig | 6 +++--- include/linux/mm.h | 4 ++-- include/uapi/linux/ethtool_netlink.h | 2 +- include/uapi/rdma/rdma_user_ioctl_cmds.h | 2 +- mm/gup.c | 12 ++-- net/ipv4/Kconfig | 6 +++--- net/ipv4/ipconfig.c | 2 +- virt/kvm/arm/vgic/vgic-mmio-v3.c | 2 +- virt/kvm/arm/vgic/vgic.h | 4 ++-- 28 files changed, 47 insertions(+), 47 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 8be1d0bbfd16..e0fe9f70d22b 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -957,7 +957,7 @@ edid/1680x1050.bin, or edid/1920x1080.bin is given and no file with the same name exists. Details and instructions how to build your own EDID data are - available in Documentation/driver-api/edid.rst. An EDID + available in Documentation/admin-guide/edid.rst. An EDID data set will only be used for a particular connector, if its name and a colon are prepended to the EDID name. Each connector may use a unique EDID data @@ -1884,7 +1884,7 @@ No delay ip= [IP_PNP] - See Documentation/filesystems/nfs/nfsroot.txt. + See Documentation/admin-guide/nfs/nfsroot.rst. ipcmni_extend [KNL] Extend the maximum number of unique System V IPC identifiers from 32,768 to 16,777,216. @@ -2863,13 +2863,13 @@ Default value is 0. nfsaddrs= [NFS] Deprecated. Use ip= instead. - See Documentation/filesystems/nfs/nfsroot.txt. + See Documentation/admin-guide/nfs/nfsroot.rst. nfsroot=[NFS] nfs root filesystem for disk-less boxes. - See Documentation/filesystems/nfs/nfsroot.txt. + See Documentation/admin-guide/nfs/nfsroot.rst. nfsrootdebug[NFS] enable nfsroot debugging messages. - See Documentation/filesystems/nfs/nfsroot.txt. + See Documentation/admin-guide/nfs/nfsroot.rst. nfs.callback_nr_threads= [NFSv4] set the total number of threads that the diff --git a/Documentation/filesystems/cifs/cifsroot.txt b/Documentation/filesystems/cifs/cifsroot.txt index 0fa1a2c36a40..947b7ec6ce9e 100644 --- a/Documentation/filesystems/cifs/cifsroot.txt +++ b/Documentation/filesystems/cifs/cifsroot.txt @@ -13,7 +13,7 @@ network by utilizing SMB or CIFS protocol. In order to mount, the network stack will also need to be set up by using 'ip=' config option. For more details, see -Documentation/filesystems/nfs/nfsroot.txt. +Documentation/admin-guide/nfs/nfsroot.rst. A CIFS root mount currently requires the use of SMB1+UNIX Extensions which is only supported by the Samba server. SMB1 is the older diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt index e1c355e84edd..eaabc3134294 100644 --- a/Documentation/memory-barriers.txt +++ b/Documentation/memory-barriers.txt @@ -620,7 +620,7 @@ because the CPUs that
Re: [PATCH] powerpc/watchpoint: Don't call dar_within_range() for Book3S
On 02/22/2020 08:20 AM, Ravi Bangoria wrote: DAR is set to the first byte of overlap between actual access and watched range at DSI on Book3S processor. But actual access range might or might not be within user asked range. So for Book3S, it must not call dar_within_range(). This revert portion of commit 39413ae00967 ("powerpc/hw_breakpoints: Rewrite 8xx breakpoints to allow any address range size."). Before patch: # ./tools/testing/selftests/powerpc/ptrace/perf-hwbreak ... TESTED: No overlap FAILED: Partial overlap: 0 != 2 TESTED: Partial overlap TESTED: No overlap FAILED: Full overlap: 0 != 2 failure: perf_hwbreak After patch: TESTED: No overlap TESTED: Partial overlap TESTED: Partial overlap TESTED: No overlap TESTED: Full overlap success: perf_hwbreak Fixes: 39413ae00967 ("powerpc/hw_breakpoints: Rewrite 8xx breakpoints to allow any address range size.") Oh, this seems to have been introduced by 27985b2a640e ("powerpc/watchpoint: Don't ignore extraneous exceptions blindly"). I must have lost it through a rebase as we were doing our series approximately at the same time, sorry for that. Reviewed-by: Christophe Leroy Reported-by: Michael Ellerman Signed-off-by: Ravi Bangoria --- arch/powerpc/kernel/hw_breakpoint.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/kernel/hw_breakpoint.c b/arch/powerpc/kernel/hw_breakpoint.c index 2462cd7c565c..d0854320bb50 100644 --- a/arch/powerpc/kernel/hw_breakpoint.c +++ b/arch/powerpc/kernel/hw_breakpoint.c @@ -331,11 +331,13 @@ int hw_breakpoint_handler(struct die_args *args) } info->type &= ~HW_BRK_TYPE_EXTRANEOUS_IRQ; - if (!dar_within_range(regs->dar, info)) - info->type |= HW_BRK_TYPE_EXTRANEOUS_IRQ; - - if (!IS_ENABLED(CONFIG_PPC_8xx) && !stepping_handler(regs, bp, info)) - goto out; + if (IS_ENABLED(CONFIG_PPC_8xx)) { + if (!dar_within_range(regs->dar, info)) + info->type |= HW_BRK_TYPE_EXTRANEOUS_IRQ; + } else { + if (!stepping_handler(regs, bp, info)) + goto out; + } /* * As a policy, the callback is invoked in a 'trigger-after-execute'
Re: [PATCH] powerpc/watchpoint: Don't call dar_within_range() for Book3S
On 2/22/20 4:56 PM, Christophe Leroy wrote: On 02/22/2020 08:20 AM, Ravi Bangoria wrote: DAR is set to the first byte of overlap between actual access and watched range at DSI on Book3S processor. But actual access range might or might not be within user asked range. So for Book3S, it must not call dar_within_range(). This revert portion of commit 39413ae00967 ("powerpc/hw_breakpoints: Rewrite 8xx breakpoints to allow any address range size."). Before patch: # ./tools/testing/selftests/powerpc/ptrace/perf-hwbreak ... TESTED: No overlap FAILED: Partial overlap: 0 != 2 TESTED: Partial overlap TESTED: No overlap FAILED: Full overlap: 0 != 2 failure: perf_hwbreak After patch: TESTED: No overlap TESTED: Partial overlap TESTED: Partial overlap TESTED: No overlap TESTED: Full overlap success: perf_hwbreak Fixes: 39413ae00967 ("powerpc/hw_breakpoints: Rewrite 8xx breakpoints to allow any address range size.") Oh, this seems to have been introduced by 27985b2a640e ("powerpc/watchpoint: Don't ignore extraneous exceptions blindly"). I must have lost it through a rebase as we were doing our series approximately at the same time, sorry for that. Reviewed-by: Christophe Leroy No worries. Thanks for the review :) Ravi
Re: [PATCH] powerpc/kprobes: Blacklist functions running with MMU disabled on PPC32
Hi Christophe, Thank you for the patch! Yet something to improve: [auto build test ERROR on powerpc/next] [also build test ERROR on v5.6-rc2 next-20200221] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982] url: https://github.com/0day-ci/linux/commits/Christophe-Leroy/powerpc-kprobes-Blacklist-functions-running-with-MMU-disabled-on-PPC32/20200221-040310 base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next config: powerpc-mgcoge_defconfig (attached as .config) compiler: powerpc-linux-gcc (GCC) 7.5.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree GCC_VERSION=7.5.0 make.cross ARCH=powerpc If you fix the issue, kindly add following tag Reported-by: kbuild test robot All errors (new ones prefixed by >>): arch/powerpc/platforms/82xx/pq2.c:32:1: error: return type defaults to 'int' [-Werror=return-type] NOKPROBE_SYMBOL(pq2_restart) ^~~ >> arch/powerpc/platforms/82xx/pq2.c:32:1: error: function declaration isn't a >> prototype [-Werror=strict-prototypes] arch/powerpc/platforms/82xx/pq2.c: In function 'NOKPROBE_SYMBOL': >> arch/powerpc/platforms/82xx/pq2.c:37:1: error: expected '=', ',', ';', 'asm' >> or '__attribute__' before '{' token { ^ arch/powerpc/platforms/82xx/pq2.c:45:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token { ^ arch/powerpc/platforms/82xx/pq2.c:70:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token { ^ >> arch/powerpc/platforms/82xx/pq2.c:77:1: error: expected '{' at end of input } ^ arch/powerpc/platforms/82xx/pq2.c:77:1: error: control reaches end of non-void function [-Werror=return-type] } ^ cc1: all warnings being treated as errors vim +32 arch/powerpc/platforms/82xx/pq2.c 20 21 void __noreturn pq2_restart(char *cmd) 22 { 23 local_irq_disable(); 24 setbits32(&cpm2_immr->im_clkrst.car_rmr, RMR_CSRE); 25 26 /* Clear the ME,EE,IR & DR bits in MSR to cause checkstop */ 27 mtmsr(mfmsr() & ~(MSR_ME | MSR_EE | MSR_IR | MSR_DR)); 28 in_8(&cpm2_immr->im_clkrst.res[0]); 29 30 panic("Restart failed\n"); 31 } > 32 NOKPROBE_SYMBOL(pq2_restart) 33 34 #ifdef CONFIG_PCI 35 static int pq2_pci_exclude_device(struct pci_controller *hose, 36u_char bus, u8 devfn) > 37 { 38 if (bus == 0 && PCI_SLOT(devfn) == 0) 39 return PCIBIOS_DEVICE_NOT_FOUND; 40 else 41 return PCIBIOS_SUCCESSFUL; 42 } 43 44 static void __init pq2_pci_add_bridge(struct device_node *np) 45 { 46 struct pci_controller *hose; 47 struct resource r; 48 49 if (of_address_to_resource(np, 0, &r) || r.end - r.start < 0x10b) 50 goto err; 51 52 pci_add_flags(PCI_REASSIGN_ALL_BUS); 53 54 hose = pcibios_alloc_controller(np); 55 if (!hose) 56 return; 57 58 hose->dn = np; 59 60 setup_indirect_pci(hose, r.start + 0x100, r.start + 0x104, 0); 61 pci_process_bridge_OF_ranges(hose, np, 1); 62 63 return; 64 65 err: 66 printk(KERN_ERR "No valid PCI reg property in device tree\n"); 67 } 68 69 void __init pq2_init_pci(void) 70 { 71 struct device_node *np; 72 73 ppc_md.pci_exclude_device = pq2_pci_exclude_device; 74 75 for_each_compatible_node(np, NULL, "fsl,pq2-pci") 76 pq2_pci_add_bridge(np); > 77 } --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org .config.gz Description: application/gzip
Re: [PATCH 3/7] docs: fix broken references to text files
On Sat, Feb 22, 2020 at 10:00:03AM +0100, Mauro Carvalho Chehab wrote: > Several references got broken due to txt to ReST conversion. > > Several of them can be automatically fixed with: > > scripts/documentation-file-ref-check --fix > > Signed-off-by: Mauro Carvalho Chehab > --- > Documentation/admin-guide/kernel-parameters.txt | 10 +- > Documentation/filesystems/cifs/cifsroot.txt | 2 +- > Documentation/memory-barriers.txt| 2 +- > Documentation/process/submit-checklist.rst | 2 +- > .../translations/it_IT/process/submit-checklist.rst | 2 +- > Documentation/translations/ko_KR/memory-barriers.txt | 2 +- > .../translations/zh_CN/filesystems/sysfs.txt | 2 +- > .../translations/zh_CN/process/submit-checklist.rst | 2 +- > Documentation/virt/kvm/arm/pvtime.rst| 2 +- > Documentation/virt/kvm/devices/vcpu.rst | 2 +- > Documentation/virt/kvm/hypercalls.rst| 4 ++-- > arch/powerpc/include/uapi/asm/kvm_para.h | 2 +- > drivers/gpu/drm/Kconfig | 2 +- > drivers/gpu/drm/drm_ioctl.c | 2 +- These two look very correct. The patch that moved edid.rst seems to have not updated a lot of references :-/ Acked-by: Daniel Vetter > drivers/hwtracing/coresight/Kconfig | 2 +- > fs/fat/Kconfig | 8 > fs/fuse/Kconfig | 2 +- > fs/fuse/dev.c| 2 +- > fs/nfs/Kconfig | 2 +- > fs/overlayfs/Kconfig | 6 +++--- > include/linux/mm.h | 4 ++-- > include/uapi/linux/ethtool_netlink.h | 2 +- > include/uapi/rdma/rdma_user_ioctl_cmds.h | 2 +- > mm/gup.c | 12 ++-- > net/ipv4/Kconfig | 6 +++--- > net/ipv4/ipconfig.c | 2 +- > virt/kvm/arm/vgic/vgic-mmio-v3.c | 2 +- > virt/kvm/arm/vgic/vgic.h | 4 ++-- > 28 files changed, 47 insertions(+), 47 deletions(-) > > diff --git a/Documentation/admin-guide/kernel-parameters.txt > b/Documentation/admin-guide/kernel-parameters.txt > index 8be1d0bbfd16..e0fe9f70d22b 100644 > --- a/Documentation/admin-guide/kernel-parameters.txt > +++ b/Documentation/admin-guide/kernel-parameters.txt > @@ -957,7 +957,7 @@ > edid/1680x1050.bin, or edid/1920x1080.bin is given > and no file with the same name exists. Details and > instructions how to build your own EDID data are > - available in Documentation/driver-api/edid.rst. An EDID > + available in Documentation/admin-guide/edid.rst. An EDID > data set will only be used for a particular connector, > if its name and a colon are prepended to the EDID > name. Each connector may use a unique EDID data > @@ -1884,7 +1884,7 @@ > No delay > > ip= [IP_PNP] > - See Documentation/filesystems/nfs/nfsroot.txt. > + See Documentation/admin-guide/nfs/nfsroot.rst. > > ipcmni_extend [KNL] Extend the maximum number of unique System V > IPC identifiers from 32,768 to 16,777,216. > @@ -2863,13 +2863,13 @@ > Default value is 0. > > nfsaddrs= [NFS] Deprecated. Use ip= instead. > - See Documentation/filesystems/nfs/nfsroot.txt. > + See Documentation/admin-guide/nfs/nfsroot.rst. > > nfsroot=[NFS] nfs root filesystem for disk-less boxes. > - See Documentation/filesystems/nfs/nfsroot.txt. > + See Documentation/admin-guide/nfs/nfsroot.rst. > > nfsrootdebug[NFS] enable nfsroot debugging messages. > - See Documentation/filesystems/nfs/nfsroot.txt. > + See Documentation/admin-guide/nfs/nfsroot.rst. > > nfs.callback_nr_threads= > [NFSv4] set the total number of threads that the > diff --git a/Documentation/filesystems/cifs/cifsroot.txt > b/Documentation/filesystems/cifs/cifsroot.txt > index 0fa1a2c36a40..947b7ec6ce9e 100644 > --- a/Documentation/filesystems/cifs/cifsroot.txt > +++ b/Documentation/filesystems/cifs/cifsroot.txt > @@ -13,7 +13,7 @@ network by utilizing SMB or CIFS protocol. > > In order to mount, the network stack will also need to be set up by > using 'ip=' config option. For more details, see > -Documentation/filesystems/nfs/nfsroot.txt. > +Documentation/admin-guide/nfs/nfsroot.rst. > > A CIFS root mount currently requires the us
Re: vdso function descriptors (VDS64_HAS_DESCRIPTORS)?
On Mon, Feb 17, 2020 at 11:08:52AM -0500, Joe Lawrence wrote: > I was wondering if there was history behind VDS64_HAS_DESCRIPTORS and in > what cases would one want to turn them on? (Note, I'm assuming they are > an implementation of Function Descriptors. [1]) It's from the very first patch implementing VDSOs for powerpc, which says: commit 86b67fe764e9e54443226a3a0b298f650588d6c5 Author: Benjamin Herrenschmidt Date: Fri Mar 4 17:33:32 2005 -0800 [PATCH] ppc64: Implement a vDSO and use it for signal trampoline [...] Note that the symbols exposed by the vDSO aren't "normal" function symbols, apps can't be expected to link against them directly, the vDSO's are both seen as if they were linked at 0 and the symbols just contain offsets to the various functions. This is done on purpose to avoid a relocation step (ppc64 functions normally have descriptors with abs addresses in them). When glibc uses those functions, it's expected to use it's own trampolines that know how to reach them. so already then this was unused code, presumably it was just used during development. > arch/powerpc/include/asm/vdso.h unsets the macro: > > /* Define if 64 bits VDSO has procedure descriptors */ > #undef VDS64_HAS_DESCRIPTORS > > so I don't believe they are ever used by default -- in this case > V_FUNCTION_BEGIN doesn't add to the .opd section with .name, .TOC base, > etc. > > Manually setting VDS64_HAS_DESCRIPTORS results in a vdso64.so in which > binutils tools like readelf properly report functions with symbol type > FUNC instead of NOTYPE. > > Are there pieces of the build/etc toolchain unprepared for function > descriptors? I'm just trying to figure out why the code defaults to > unsetting them. Because direct calls are faster than indirect calls? Ben might have a fuller explanation, cc:ing him. Segher
Re: [PATCH v2 1/8] powerpc/perf/hv-24x7: Fix inconsistent output values incase multiple hv-24x7 events run
Kajol Jain [kj...@linux.ibm.com] wrote: > Commit 2b206ee6b0df ("powerpc/perf/hv-24x7: Display change in counter > values")' added to print _change_ in the counter value rather then raw > value for 24x7 counters. Incase of transactions, the event count > is set to 0 at the beginning of the transaction. It also sets > the event's prev_count to the raw value at the time of initialization. > Because of setting event count to 0, we are seeing some weird behaviour, > whenever we run multiple 24x7 events at a time. Interesting. Are we taking delta of a delta and ending up with large negative values in the -I case? However... > > Signed-off-by: Kajol Jain > --- > arch/powerpc/perf/hv-24x7.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/powerpc/perf/hv-24x7.c b/arch/powerpc/perf/hv-24x7.c > index 573e0b309c0c..6dbbf70232aa 100644 > --- a/arch/powerpc/perf/hv-24x7.c > +++ b/arch/powerpc/perf/hv-24x7.c > @@ -1409,7 +1409,7 @@ static void h_24x7_event_read(struct perf_event *event) >* that would require issuing a hcall, which would then >* defeat the purpose of using the txn interface. >*/ > - local64_set(&event->count, 0); > + local64_add(0, &event->count); ... not sure, how adding zero to the count helps. Should we just remove the line (and the comment block above it)? Or does it help to clear the event count in ->start_txn() rather than on read()? How does the change impact the counts when run without the -I? Thanks for chasing this down. Sukadev