Re: [PATCH 2/3] powerpc/pci: unmap legacy INTx interrupts of passthrough IO adapters

2020-05-27 Thread Cédric Le Goater
On 5/27/20 2:57 AM, Oliver O'Halloran wrote: > On Wed, Apr 29, 2020 at 5:51 PM Cédric Le Goater wrote: >> >> When a passthrough IO adapter is removed from a pseries machine using >> hash MMU and the XIVE interrupt mode, the POWER hypervisor, pHyp, >> expects the guest OS to have cleared all page

[PATCH V4 2/2] tools/perf: Add perf tools support for extended register capability in powerpc

2020-05-27 Thread Athira Rajeev
From: Anju T Sudhakar Add extended regs to sample_reg_mask in the tool side to use with `-I?` option. Perf tools side uses extended mask to display the platform supported register names (with -I? option) to the user and also send this mask to the kernel to capture the extended registers in each

Re: [PATCH v3 3/7] kunit: tests for stats_fs API

2020-05-27 Thread Alan Maguire
On Tue, 26 May 2020, Emanuele Giuseppe Esposito wrote: > Add kunit tests to extensively test the stats_fs API functionality. > I've added in the kunit-related folks. > In order to run them, the kernel .config must set CONFIG_KUNIT=y > and a new .kunitconfig file must be created with

Re: [PATCH v3 3/7] kunit: tests for stats_fs API

2020-05-27 Thread Emanuele Giuseppe Esposito
In order to run them, the kernel .config must set CONFIG_KUNIT=y and a new .kunitconfig file must be created with CONFIG_STATS_FS=y and CONFIG_STATS_FS_TEST=y It looks like CONFIG_STATS_FS is built-in, but it exports much of the functionality you are testing. However could the tests also

Re: [PATCH 2/3] powerpc/pci: unmap legacy INTx interrupts of passthrough IO adapters

2020-05-27 Thread Cédric Le Goater
Hello Michael, On 4/29/20 9:51 AM, Cédric Le Goater wrote: > When a passthrough IO adapter is removed from a pseries machine using > hash MMU and the XIVE interrupt mode, the POWER hypervisor, pHyp, > expects the guest OS to have cleared all page table entries related to > the adapter. If some

[PATCH V4 1/2] powerpc/perf: Add support for outputting extended regs in perf intr_regs

2020-05-27 Thread Athira Rajeev
From: Anju T Sudhakar Add support for perf extended register capability in powerpc. The capability flag PERF_PMU_CAP_EXTENDED_REGS, is used to indicate the PMU which support extended registers. The generic code define the mask of extended registers as 0 for non supported architectures. Patch

Re: [PATCH v3 0/7] Statsfs: a new ram-based file system for Linux kernel statistics

2020-05-27 Thread Andrew Lunn
> I don't really know a lot about the networking subsystem, and as it was > pointed out in another email on patch 7 by Andrew, networking needs to > atomically gather and display statistics in order to make them consistent, > and currently this is not supported by stats_fs but could be added in >

Re: [PATCH] media: omap3isp: Shuffle cacheflush.h and include mm.h

2020-05-27 Thread Laurent Pinchart
Hi Nathan, (CC'ing Sakari Ailus and the linux-media mailing list) On Wed, May 27, 2020 at 01:13:37AM -0700, Nathan Chancellor wrote: > On Wed, May 27, 2020 at 09:02:51AM +0200, Geert Uytterhoeven wrote: > > On Wed, May 27, 2020 at 6:37 AM Nathan Chancellor wrote: > > > After mm.h was removed

[PATCH] powerpc/bpf: Enable bpf_probe_read{, str}() on powerpc again

2020-05-27 Thread Petr Mladek
The commit 0ebeea8ca8a4d1d453a ("bpf: Restrict bpf_probe_read{, str}() only to archs where they work") caused that bpf_probe_read{, str}() functions were not longer available on architectures where the same logical address might have different content in kernel and user memory mapping. These

[PATCH V4 0/2] powerpc/perf: Add support for perf extended regs in powerpc

2020-05-27 Thread Athira Rajeev
Patch set to add support for perf extended register capability in powerpc. The capability flag PERF_PMU_CAP_EXTENDED_REGS, is used to indicate the PMU which support extended registers. The generic code define the mask of extended registers as 0 for non supported architectures. patch 1/2 defines

[RFC PATCH 1/4] powerpc/64s: Don't init FSCR_DSCR in __init_FSCR()

2020-05-27 Thread Michael Ellerman
__init_FSCR() was added originally in commit 2468dcf641e4 ("powerpc: Add support for context switching the TAR register") (Feb 2013), and only set FSCR_TAR. At that point FSCR (Facility Status and Control Register) was not context switched, so the setting was permanent after boot. Later we added

Re: [PATCH v3 0/7] Statsfs: a new ram-based file system for Linux kernel statistics

2020-05-27 Thread Emanuele Giuseppe Esposito
The file system is mounted on /sys/kernel/stats and would be already used by kvm. Statsfs was initially introduced by Paolo Bonzini [1]. What's the direct motivation for this work? Moving KVM stats out of debugfs? There's many reasons: one of these is not using debugfs for statistics,

[RFC PATCH 2/4] powerpc/64s: Don't let DT CPU features set FSCR_DSCR

2020-05-27 Thread Michael Ellerman
The device tree CPU features binding includes FSCR bit numbers which Linux is instructed to set by firmware. Whether that's a good idea or not, in the case of the DSCR the Linux implementation has a hard requirement that the FSCR_DSCR bit not be set by default. We use it to track when a process

[PATCH v3 0/8] padata: parallelize deferred page init

2020-05-27 Thread Daniel Jordan
Thanks to Alex for his continued review and Josh for running v2! Please continue to review and test, and acks for the padata parts would be appreciated. Daniel -- Deferred struct page init is a bottleneck in kernel boot--the biggest for us and probably others. Optimizing it maximizes

[PATCH v3 8/8] padata: document multithreaded jobs

2020-05-27 Thread Daniel Jordan
Add Documentation for multithreaded jobs. Signed-off-by: Daniel Jordan Tested-by: Josh Triplett --- Documentation/core-api/padata.rst | 41 +++ 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/Documentation/core-api/padata.rst

[RFC PATCH 3/4] powerpc/64s: Save FSCR to init_task.thread.fscr after feature init

2020-05-27 Thread Michael Ellerman
At boot the FSCR is initialised via one of two paths. On most systems it's set to a hard coded value in __init_FSCR(). On newer skiboot systems we use the device tree CPU features binding, where firmware can tell Linux what bits to set in FSCR (and HFSCR). In both cases the value that's

Re: [PATCH v3 0/7] Statsfs: a new ram-based file system for Linux kernel statistics

2020-05-27 Thread Paolo Bonzini
On 27/05/20 15:33, Andrew Lunn wrote: >> I don't really know a lot about the networking subsystem, and as it was >> pointed out in another email on patch 7 by Andrew, networking needs to >> atomically gather and display statistics in order to make them consistent, >> and currently this is not

[RFC PATCH 4/4] powerpc/64s: Don't set FSCR bits in INIT_THREAD

2020-05-27 Thread Michael Ellerman
Since the previous commit that saves the value of FSCR configured at boot into init_task.thread.fscr, the static initialisation in INIT_THREAD now no longer has any effect. So remove it. For non DT CPU features, the end result is the same, because __init_FSCR() is called on all CPUs that have an

[PATCH v3 7/8] mm: make deferred init's max threads arch-specific

2020-05-27 Thread Daniel Jordan
Using padata during deferred init has only been tested on x86, so for now limit it to this architecture. If another arch wants this, it can find the max thread limit that's best for it and override deferred_page_init_max_threads(). Signed-off-by: Daniel Jordan Tested-by: Josh Triplett ---

[PATCH v3 4/8] padata: add basic support for multithreaded jobs

2020-05-27 Thread Daniel Jordan
Sometimes the kernel doesn't take full advantage of system memory bandwidth, leading to a single CPU spending excessive time in initialization paths where the data scales with memory size. Multithreading naturally addresses this problem. Extend padata, a framework that handles many parallel yet

[PATCH v3 1/8] padata: remove exit routine

2020-05-27 Thread Daniel Jordan
padata_driver_exit() is unnecessary because padata isn't built as a module and doesn't exit. padata's init routine will soon allocate memory, so getting rid of the exit function now avoids pointless code to free it. Signed-off-by: Daniel Jordan Tested-by: Josh Triplett --- kernel/padata.c | 6

[PATCH v3 5/8] mm: don't track number of pages during deferred initialization

2020-05-27 Thread Daniel Jordan
Deferred page init used to report the number of pages initialized: node 0 initialised, 32439114 pages in 97ms Tracking this makes the code more complicated when using multiple threads. Given that the statistic probably has limited value, especially since a zone grows on demand so that the

[PATCH v3 2/8] padata: initialize earlier

2020-05-27 Thread Daniel Jordan
padata will soon initialize the system's struct pages in parallel, so it needs to be ready by page_alloc_init_late(). The error return from padata_driver_init() triggers an initcall warning, so add a warning to padata_init() to avoid silent failure. Signed-off-by: Daniel Jordan Tested-by: Josh

[PATCH v3 6/8] mm: parallelize deferred_init_memmap()

2020-05-27 Thread Daniel Jordan
Deferred struct page init is a significant bottleneck in kernel boot. Optimizing it maximizes availability for large-memory systems and allows spinning up short-lived VMs as needed without having to leave them running. It also benefits bare metal machines hosting VMs that are sensitive to

[PATCH v3 3/8] padata: allocate work structures for parallel jobs from a pool

2020-05-27 Thread Daniel Jordan
padata allocates per-CPU, per-instance work structs for parallel jobs. A do_parallel call assigns a job to a sequence number and hashes the number to a CPU, where the job will eventually run using the corresponding work. This approach fit with how padata used to bind a job to each CPU

Re: [PATCH] powerpc/bpf: Enable bpf_probe_read{, str}() on powerpc again

2020-05-27 Thread Michael Ellerman
Petr Mladek writes: > The commit 0ebeea8ca8a4d1d453a ("bpf: Restrict bpf_probe_read{, str}() only > to archs where they work") caused that bpf_probe_read{, str}() functions > were not longer available on architectures where the same logical address > might have different content in kernel and

Re: [PATCH] powerpc/64: Remove unused generic_secondary_thread_init()

2020-05-27 Thread Jordan Niethe
On Tue, May 26, 2020 at 4:36 PM Michael Ellerman wrote: > > The last caller was removed in 2014 in commit fb5a515704d7 ("powerpc: > Remove platforms/wsp and associated pieces"). > > Once generic_secondary_thread_init() is removed there are no longer > any uses of book3e_secondary_thread_init() or

Re: [v3 2/2] dts: ppc: t1024rdb: remove interrupts property

2020-05-27 Thread Li Yang
On Tue, May 26, 2020 at 10:52 PM Biwen Li wrote: > > From: Biwen Li > > Since the interrupt pin for RTC DS1339 is not connected > to the CPU on T1024RDB, remove the interrupt property > from the device tree. > > This also fix the following warning for hwclock.util-linux: > $ hwclock.util-linux >

Re: [PATCH v4 09/22] powerpc/kvm/book3s: Add helper to walk partition scoped linux page table.

2020-05-27 Thread Paul Mackerras
On Tue, May 05, 2020 at 12:47:16PM +0530, Aneesh Kumar K.V wrote: > The locking rules for walking partition scoped table is different from process > scoped table. Hence add a helper for secondary linux page table walk and also > add check whether we are holding the right locks. This patch is

Re: [v3 1/2] dts: ppc: t4240rdb: remove interrupts property

2020-05-27 Thread Li Yang
On Tue, May 26, 2020 at 10:49 PM Biwen Li wrote: > > From: Biwen Li > > Since the interrupt pin for RTC DS1374 is not connected > to the CPU on T4240RDB, remove the interrupt property > from the device tree. > > This also fix the following warning for hwclock.util-linux: > $ hwclock.util-linux >

Re: [PATCH v3 0/7] Statsfs: a new ram-based file system for Linux kernel statistics

2020-05-27 Thread David Ahern
On 5/27/20 3:07 PM, Paolo Bonzini wrote: > I see what you meant now. statsfs can also be used to enumerate objects > if one is so inclined (with the prototype in patch 7, for example, each > network interface becomes a directory). there are many use cases that have 100's to 1000's have network

Re: [PATCH v3 0/7] Statsfs: a new ram-based file system for Linux kernel statistics

2020-05-27 Thread Andrew Lunn
On Tue, May 26, 2020 at 01:03:10PM +0200, Emanuele Giuseppe Esposito wrote: > There is currently no common way for Linux kernel subsystems to expose > statistics to userspace shared throughout the Linux kernel; subsystems have > to take care of gathering and displaying statistics by themselves,

Re: [PATCH v3 6/8] mm: parallelize deferred_init_memmap()

2020-05-27 Thread Alexander Duyck
On Wed, May 27, 2020 at 10:37 AM Daniel Jordan wrote: > > Deferred struct page init is a significant bottleneck in kernel boot. > Optimizing it maximizes availability for large-memory systems and allows > spinning up short-lived VMs as needed without having to leave them > running. It also

Re: [PATCH v3 0/7] Statsfs: a new ram-based file system for Linux kernel statistics

2020-05-27 Thread Paolo Bonzini
On 27/05/20 22:23, Jakub Kicinski wrote: > On Wed, 27 May 2020 15:14:41 +0200 Emanuele Giuseppe Esposito wrote: >> Regarding the config, as I said the idea is to gather multiple >> subsystems' statistics, therefore there wouldn't be a single >> configuration method like in netlink. >> For

Re: [PATCH v8 1/5] powerpc: Document details on H_SCM_HEALTH hcall

2020-05-27 Thread Dan Williams
On Tue, May 26, 2020 at 9:13 PM Vaibhav Jain wrote: > > Add documentation to 'papr_hcalls.rst' describing the bitmap flags > that are returned from H_SCM_HEALTH hcall as per the PAPR-SCM > specification. > Please do a global s/SCM/PMEM/ or s/SCM/NVDIMM/. It's unfortunate that we already have 2

Re: [PATCH v3 0/7] Statsfs: a new ram-based file system for Linux kernel statistics

2020-05-27 Thread Jakub Kicinski
On Wed, 27 May 2020 15:14:41 +0200 Emanuele Giuseppe Esposito wrote: > Regarding the config, as I said the idea is to gather multiple > subsystems' statistics, therefore there wouldn't be a single > configuration method like in netlink. > For example in kvm there are file descriptors for

Re: [PATCH v3 5/8] mm: don't track number of pages during deferred initialization

2020-05-27 Thread Alexander Duyck
On Wed, May 27, 2020 at 10:37 AM Daniel Jordan wrote: > > Deferred page init used to report the number of pages initialized: > > node 0 initialised, 32439114 pages in 97ms > > Tracking this makes the code more complicated when using multiple > threads. Given that the statistic probably has

Re: [PATCH v3 0/7] Statsfs: a new ram-based file system for Linux kernel statistics

2020-05-27 Thread Jakub Kicinski
On Wed, 27 May 2020 23:07:53 +0200 Paolo Bonzini wrote: > > Again, I have little KVM knowledge, but BPF also uses a fd-based API, > > and carries stats over the same syscall interface. > > Can BPF stats (for BPF scripts created by whatever process is running in > the system) be collected by an

Re: [PATCH v3 0/7] Statsfs: a new ram-based file system for Linux kernel statistics

2020-05-27 Thread Paolo Bonzini
On 27/05/20 23:27, Jakub Kicinski wrote: > On Wed, 27 May 2020 23:07:53 +0200 Paolo Bonzini wrote: >>> Again, I have little KVM knowledge, but BPF also uses a fd-based API, >>> and carries stats over the same syscall interface. >> >> Can BPF stats (for BPF scripts created by whatever process is

Re: [PATCH v3 0/7] Statsfs: a new ram-based file system for Linux kernel statistics

2020-05-27 Thread Paolo Bonzini
On 28/05/20 00:21, David Ahern wrote: > On 5/27/20 3:07 PM, Paolo Bonzini wrote: >> I see what you meant now. statsfs can also be used to enumerate objects >> if one is so inclined (with the prototype in patch 7, for example, each >> network interface becomes a directory). > > there are many use

Re: [PATCH v3 1/3] riscv: Move kernel mapping to vmalloc zone

2020-05-27 Thread Alex Ghiti
Le 5/27/20 à 2:05 AM, Zong Li a écrit : On Wed, May 27, 2020 at 1:06 AM Alex Ghiti wrote: Hi Zong, Le 5/26/20 à 5:43 AM, Zong Li a écrit : On Sun, May 24, 2020 at 4:54 PM Alexandre Ghiti wrote: This is a preparatory patch for relocatable kernel. The kernel used to be linked at PAGE_OFFSET

Re: [PATCH v3 1/3] riscv: Move kernel mapping to vmalloc zone

2020-05-27 Thread kbuild test robot
Hi Alexandre, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on powerpc/next] [also build test WARNING on linus/master v5.7-rc7 next-20200526] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest

Re: [PATCH] media: omap3isp: Shuffle cacheflush.h and include mm.h

2020-05-27 Thread Nathan Chancellor
Hi Geert, On Wed, May 27, 2020 at 09:02:51AM +0200, Geert Uytterhoeven wrote: > Hi Nathan, > > CC Laurent > > On Wed, May 27, 2020 at 6:37 AM Nathan Chancellor > wrote: > > After mm.h was removed from the asm-generic version of cacheflush.h, > > s390 allyesconfig shows several warnings of the

Re: [PATCH] media: omap3isp: Shuffle cacheflush.h and include mm.h

2020-05-27 Thread Geert Uytterhoeven
Hi Nathan, CC Laurent On Wed, May 27, 2020 at 6:37 AM Nathan Chancellor wrote: > After mm.h was removed from the asm-generic version of cacheflush.h, > s390 allyesconfig shows several warnings of the following nature: > > In file included from ./arch/s390/include/generated/asm/cacheflush.h:1, >

Re: [PATCH v3 1/3] riscv: Move kernel mapping to vmalloc zone

2020-05-27 Thread Zong Li
On Wed, May 27, 2020 at 1:06 AM Alex Ghiti wrote: > > Hi Zong, > > Le 5/26/20 à 5:43 AM, Zong Li a écrit : > > On Sun, May 24, 2020 at 4:54 PM Alexandre Ghiti wrote: > >> This is a preparatory patch for relocatable kernel. > >> > >> The kernel used to be linked at PAGE_OFFSET address and used to

Re: [PATCH v4 6/7] KVM: MIPS: clean up redundant 'kvm_run' parameters

2020-05-27 Thread Tianjia Zhang
On 2020/4/27 13:40, Huacai Chen wrote: Reviewed-by: Huacai Chen On Mon, Apr 27, 2020 at 12:35 PM Tianjia Zhang wrote: In the current kvm version, 'kvm_run' has been included in the 'kvm_vcpu' structure. For historical reasons, many kvm-related function parameters retain the 'kvm_run' and

Re: [PATCH v2] KVM: PPC: Book3S HV: relax check on H_SVM_INIT_ABORT

2020-05-27 Thread Laurent Dufour
Le 27/05/2020 à 06:16, Paul Mackerras a écrit : On Wed, May 20, 2020 at 07:43:08PM +0200, Laurent Dufour wrote: The commit 8c47b6ff29e3 ("KVM: PPC: Book3S HV: Check caller of H_SVM_* Hcalls") added checks of secure bit of SRR1 to filter out the Hcall reserved to the Ultravisor. However, the

[PATCH] powerpc/fadump: account for memory_limit while reserving memory

2020-05-27 Thread Hari Bathini
If the memory chunk found for reserving memory overshoots the memory limit imposed, do not proceed with reserving memory. Default behavior was this until commit 140777a3d8df ("powerpc/fadump: consider reserved ranges while reserving memory") changed it unwittingly. Reported-by: kbuild test robot

Re: [PATCH v8 3/5] powerpc/papr_scm: Fetch nvdimm health information from PHYP

2020-05-27 Thread Aneesh Kumar K.V
Vaibhav Jain writes: > Implement support for fetching nvdimm health information via > H_SCM_HEALTH hcall as documented in Ref[1]. The hcall returns a pair > of 64-bit bitmap, bitwise-and of which is then stored in > 'struct papr_scm_priv' and subsequently partially exposed to > user-space via

Re: [PATCH v8 4/5] ndctl/papr_scm,uapi: Add support for PAPR nvdimm specific methods

2020-05-27 Thread Aneesh Kumar K.V
Vaibhav Jain writes: > Introduce support for PAPR NVDIMM Specific Methods (PDSM) in papr_scm > module and add the command family to the white list of NVDIMM command > sets. Also advertise support for ND_CMD_CALL for the nvdimm > command mask and implement necessary scaffolding in the module to >

Re: [PATCH v8 5/5] powerpc/papr_scm: Implement support for PAPR_SCM_PDSM_HEALTH

2020-05-27 Thread Aneesh Kumar K.V
Vaibhav Jain writes: > This patch implements support for PDSM request 'PAPR_SCM_PDSM_HEALTH' > that returns a newly introduced 'struct nd_papr_pdsm_health' instance > containing dimm health information back to user space in response to > ND_CMD_CALL. This functionality is implemented in newly