[powerpc:next] BUILD SUCCESS 86052e407e8e1964c81965de25832258875a0e6d

2020-07-27 Thread kernel test robot
powerpc allyesconfig powerpc allmodconfig powerpc allnoconfig i386 randconfig-a003-20200727 i386 randconfig-a005-20200727 i386 randconfig-a004-20200727 i386

Re: [PATCH] lockdep: Fix TRACE_IRQFLAGS vs NMIs

2020-07-27 Thread Ingo Molnar
* pet...@infradead.org wrote: > > Prior to commit 859d069ee1dd ("lockdep: Prepare for NMI IRQ state > tracking") IRQ state tracking was disabled in NMIs due to nmi_enter() > doing lockdep_off() -- with the obvious requirement that NMI entry > call nmi_enter() before trace_hardirqs_off(). > >

Re: [PATCH v2 2/5] powerpc: Allow 4224 bytes of stack expansion for the signal frame

2020-07-27 Thread Daniel Axtens
Hi Michael, I have tested this with the test from the bug and it now seems to pass fine. On that basis: Tested-by: Daniel Axtens Thank you for coming up with a better solution than my gross hack! Kind regards, Daniel > We have powerpc specific logic in our page fault handling to decide if >

Re: [PATCH v2 2/5] powerpc: Allow 4224 bytes of stack expansion for the signal frame

2020-07-27 Thread Michael Ellerman
Gabriel Paubert writes: > On Fri, Jul 24, 2020 at 07:25:25PM +1000, Michael Ellerman wrote: >> We have powerpc specific logic in our page fault handling to decide if >> an access to an unmapped address below the stack pointer should expand >> the stack VMA. >> >> The code was originally added in

[PATCH] powerpc/mm: Limit resize_hpt_for_hotplug() call to hash guests only

2020-07-27 Thread Bharata B Rao
During memory hotplug and unplug, resize_hpt_for_hotplug() gets called for both hash and radix guests but it should be called only for hash guests. Though the call does nothing in the radix guest case, it is cleaner to push this call into hash specific memory hotplug routines. Reported-by: Nathan

Re: [PATCH v2 01/14] powerpc/eeh: Remove eeh_dev_phb_init_dynamic()

2020-07-27 Thread Michael Ellerman
Michael Ellerman writes: > On Wed, 22 Jul 2020 14:26:15 +1000, Oliver O'Halloran wrote: >> This function is a one line wrapper around eeh_phb_pe_create() and despite >> the name it doesn't create any eeh_dev structures. Replace it with direct >> calls to eeh_phb_pe_create() since that does what

Re: [PATCH v2] powerpc/book3s64/radix: Add kernel command line option to disable radix GTSE

2020-07-27 Thread Bharata B Rao
On Mon, Jul 27, 2020 at 02:29:08PM +0530, Aneesh Kumar K.V wrote: > This adds a kernel command line option that can be used to disable GTSE > support. > Disabling GTSE implies kernel will make hcalls to invalidate TLB entries. > > This was done so that we can do VM migration between configs that

Re: [PATCH] powerpc/64s/hash: Fix hash_preload running with interrupts enabled

2020-07-27 Thread Michael Ellerman
Athira Rajeev writes: >> On 27-Jul-2020, at 11:39 AM, Nicholas Piggin wrote: >> >> Commit 2f92447f9f96 ("powerpc/book3s64/hash: Use the pte_t address from the >> caller") removed the local_irq_disable from hash_preload, but it was >> required for more than just the page table walk: the hash pte

Re: [PATCH] powerpc/sstep: Fix incorrect CONFIG symbol in scv handling

2020-07-27 Thread Michael Ellerman
On Fri, 24 Jul 2020 23:16:09 +1000, Michael Ellerman wrote: > When I "fixed" the ppc64e build in Nick's recent patch, I typoed the > CONFIG symbol, resulting in one that doesn't exist. Fix it to use the > correct symbol. Applied to powerpc/next. [1/1] powerpc/sstep: Fix incorrect CONFIG symbol

Re: [PATCH] powerpc/test_emulate_sstep: Fix build error

2020-07-27 Thread Michael Ellerman
On Fri, 24 Jul 2020 10:41:09 +1000, Michael Ellerman wrote: > ppc64_book3e_allmodconfig fails with: > > arch/powerpc/lib/test_emulate_step.c: In function 'test_pld': > arch/powerpc/lib/test_emulate_step.c:113:7: error: implicit declaration of > function 'cpu_has_feature' > 113 | if

Re: [PATCH v3 09/10] powerpc/smp: Create coregroup domain

2020-07-27 Thread Srikar Dronamraju
* Gautham R Shenoy [2020-07-27 10:09:41]: > > > > static void fixup_topology(void) > > { > > + if (!has_coregroup_support()) > > + powerpc_topology[mc_idx].mask = cpu_bigcore_mask; > > + > > if (shared_caches) { > > pr_info("Using shared cache scheduler

[PATCH] lockdep: Fix TRACE_IRQFLAGS vs NMIs

2020-07-27 Thread peterz
Prior to commit 859d069ee1dd ("lockdep: Prepare for NMI IRQ state tracking") IRQ state tracking was disabled in NMIs due to nmi_enter() doing lockdep_off() -- with the obvious requirement that NMI entry call nmi_enter() before trace_hardirqs_off(). [ afaict, PowerPC and SH violate this order on

Re: [PATCH 0/9] powerpc: delete duplicated words

2020-07-27 Thread Joe Perches
On Sun, 2020-07-26 at 12:08 -0700, Randy Dunlap wrote: > v0.1 of this script also found lots of repeated numbers and strings of > special characters (ASCII art etc.), so now it ignores duplicated numbers > or special characters -- since it is really looking for duplicate words. > > Anyway, I

[PATCH 1/7] powerpc/topology: Update topology_core_cpumask

2020-07-27 Thread Srikar Dronamraju
On Power, cpu_core_mask and cpu_cpu_mask refer to the same set of CPUs. cpu_cpu_mask is needed by scheduler, hence look at deprecating cpu_core_mask. Before deleting the cpu_core_mask, ensure its only user is moved to cpu_cpu_mask. Cc: linuxppc-dev Cc: LKML Cc: Michael Ellerman Cc: Nicholas

[PATCH 7/7] powerpc/smp: Depend on cpu_l1_cache_map when adding cpus

2020-07-27 Thread Srikar Dronamraju
Currently on hotplug/hotunplug, the cpu iterates through all the cpus in its core to find threads in its thread group. However this info is already captured in cpu_l1_cache_map. Hence we could reduce the iteration and cleanup add_cpu_to_smallcore_masks function. Cc: linuxppc-dev Cc: LKML Cc:

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

2020-07-27 Thread Ravi Bangoria
On 7/26/20 8:15 PM, Athira Rajeev wrote: 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

Re: [PATCH 0/9] Macintosh II ADB driver fixes

2020-07-27 Thread Michael Ellerman
On Sun, 28 Jun 2020 14:23:12 +1000, Finn Thain wrote: > Various issues with the via-macii driver have become apparent over the > years. Some examples: > > - A Talk command response can be lost. This can result in phantom devices > being probed or an incorrect device handler ID being retrieved. >

Re: [PATCH v2 1/2] powerpc/ptdump: Refactor update of st->last_pa

2020-07-27 Thread Michael Ellerman
On Mon, 29 Jun 2020 11:17:18 + (UTC), Christophe Leroy wrote: > st->last_pa is always updated in note_page() so it can > be done outside the if/elseif/else block. Applied to powerpc/next. [1/2] powerpc/ptdump: Refactor update of st->last_pa

Re: [PATCH 0/9] powerpc: delete duplicated words

2020-07-27 Thread Michael Ellerman
On Sat, 25 Jul 2020 17:38:00 -0700, Randy Dunlap wrote: > Drop duplicated words in arch/powerpc/ header files. > > Cc: Michael Ellerman > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: linuxppc-dev@lists.ozlabs.org > > [...] Applied to powerpc/next. [1/9] powerpc/book3s/mmu-hash.h:

Re: [PATCH v2] powerpc/numa: Limit possible nodes to within num_possible_nodes

2020-07-27 Thread Michael Ellerman
On Fri, 24 Jul 2020 16:28:09 +0530, Srikar Dronamraju wrote: > MAX_NUMNODES is a theoretical maximum number of nodes thats is supported > by the kernel. Device tree properties exposes the number of possible > nodes on the current platform. The kernel would detected this and would > use it for most

Re: [PATCH] powerpc/book3s64/radix: Add kernel command line option to disable radix GTSE

2020-07-27 Thread Bharata B Rao
On Fri, Jul 24, 2020 at 01:26:00PM +0530, Aneesh Kumar K.V wrote: > This adds a kernel command line option that can be used to disable GTSE > support. > Disabling GTSE implies kernel will make hcalls to invalidate TLB entries. > > This was done so that we can do VM migration between configs that

[PATCH 5/7] powerpc/smp: Limit cpus traversed to within a node.

2020-07-27 Thread Srikar Dronamraju
All the arch specific topology cpumasks are within a node/die. However when setting these per cpu cpumasks, system traverses through all the online cpus. This is redundant. Reduce the traversal to only cpus that are online in the node to which the cpu belongs to. Cc: linuxppc-dev Cc: LKML Cc:

Re: [PATCH v2 2/5] powerpc: Allow 4224 bytes of stack expansion for the signal frame

2020-07-27 Thread Gabriel Paubert
On Fri, Jul 24, 2020 at 07:25:25PM +1000, Michael Ellerman wrote: > We have powerpc specific logic in our page fault handling to decide if > an access to an unmapped address below the stack pointer should expand > the stack VMA. > > The code was originally added in 2004 "ported from 2.4". The

Re: [PATCH][v3] powerpc/lib: remove memcpy_flushcache redundant return

2020-07-27 Thread Michael Ellerman
On Fri, 26 Apr 2019 19:36:30 +0800, Li RongQing wrote: > Align it with other architectures and none of the callers has > been interested its return Applied to powerpc/next. [1/1] powerpc/lib: remove memcpy_flushcache redundant return

Re: [PATCH v5 00/10] powerpc/watchpoint: Enable 2nd DAWR on baremetal and powervm

2020-07-27 Thread Michael Ellerman
On Thu, 23 Jul 2020 14:38:03 +0530, Ravi Bangoria wrote: > Last series[1] was to add basic infrastructure support for more than > one watchpoint on Book3S powerpc. This series actually enables the 2nd > DAWR for baremetal and powervm. Kvm guest is still not supported. > > v4: >

Re: [PATCH v3 01/14] powerpc/eeh: Remove eeh_dev_phb_init_dynamic()

2020-07-27 Thread Michael Ellerman
On Sat, 25 Jul 2020 18:12:18 +1000, Oliver O'Halloran wrote: > This function is a one line wrapper around eeh_phb_pe_create() and despite > the name it doesn't create any eeh_dev structures. Replace it with direct > calls to eeh_phb_pe_create() since that does what it says on the tin > and removes

Re: [PATCH -next] powerpc/papr_scm: Make some symbols static

2020-07-27 Thread Michael Ellerman
On Sat, 25 Jul 2020 17:19:49 +0800, Wei Yongjun wrote: > The sparse tool complains as follows: > > arch/powerpc/platforms/pseries/papr_scm.c:97:1: warning: > symbol 'papr_nd_regions' was not declared. Should it be static? > arch/powerpc/platforms/pseries/papr_scm.c:98:1: warning: > symbol

[PATCH 4/7] powerpc/smp: Optimize remove_cpu_from_masks

2020-07-27 Thread Srikar Dronamraju
Currently while offlining a cpu, we iterate through all the cpus in the DIE to clear sibling, l2_cache and smallcore maps. However if there are more number of cores in a DIE, we end up spending more time iterating through cpus which are completely unrelated. Optimize this by only iterating

[PATCH 6/7] powerpc/smp: Stop passing mask to update_mask_by_l2

2020-07-27 Thread Srikar Dronamraju
update_mask_by_l2 is called only once. But it passes cpu_l2_cache_mask as parameter. Instead of passing cpu_l2_cache_mask, use it directly in update_mask_by_l2. Cc: linuxppc-dev Cc: LKML Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Anton Blanchard Cc: Oliver O'Halloran Cc: Nathan Lynch Cc:

[PATCH] powerpc/fadump: Fix build error with CONFIG_PRESERVE_FA_DUMP=y

2020-07-27 Thread Michael Ellerman
skiroot_defconfig fails: arch/powerpc/kernel/fadump.c:48:17: error: ‘cpus_in_fadump’ defined but not used 48 | static atomic_t cpus_in_fadump; Fix it by moving the definition into the #ifdef where it's used. Fixes: ba608c4fa12c ("powerpc/fadump: fix race between pstore write and fadump

Re: [PATCH v2 01/16] powernv/pci: Add pci_bus_to_pnvhb() helper

2020-07-27 Thread Michael Ellerman
On Wed, 22 Jul 2020 16:57:00 +1000, Oliver O'Halloran wrote: > Add a helper to go from a pci_bus structure to the pnv_phb that hosts that > bus. There's a lot of instances of the following pattern: > > struct pci_controller *hose = pci_bus_to_host(pdev->bus); > struct pnv_phb *phb =

[PATCH 3/7] powerpc/smp: Remove get_physical_package_id

2020-07-27 Thread Srikar Dronamraju
Now that cpu_core_mask has been removed and topology_core_cpumask has been updated to use cpu_cpu_mask, we no more need get_physical_package_id. Please note get_physical_package_id is an exported symbol. However it was introduced recently and probably no users outside kernel. Cc: linuxppc-dev

Re: [PATCH] powerpc/64s/hash: Fix hash_preload running with interrupts enabled

2020-07-27 Thread Athira Rajeev
> On 27-Jul-2020, at 11:39 AM, Nicholas Piggin wrote: > > Commit 2f92447f9f96 ("powerpc/book3s64/hash: Use the pte_t address from the > caller") removed the local_irq_disable from hash_preload, but it was > required for more than just the page table walk: the hash pte busy bit is >

[PATCH v4 10/10] powerpc/smp: Implement cpu_to_coregroup_id

2020-07-27 Thread Srikar Dronamraju
Lookup the coregroup id from the associativity array. If unable to detect the coregroup id, fallback on the core id. This way, ensure sched_domain degenerates and an extra sched domain is not created. Ideally this function should have been implemented in arch/powerpc/kernel/smp.c. However if its

[powerpc:merge] BUILD SUCCESS 163c4334d6564fc8cb638d9f816ef5e1db1b8f1d

2020-07-27 Thread kernel test robot
defconfig powerpc allyesconfig powerpc allmodconfig powerpc allnoconfig i386 randconfig-a016-20200727 i386 randconfig-a013-20200727 i386 randconfig-a012-20200727

Re: [v4] powerpc/perf: Initialize power10 PMU registers in cpu setup routine

2020-07-27 Thread Michael Ellerman
On Thu, 23 Jul 2020 03:32:37 -0400, Athira Rajeev wrote: > Initialize Monitor Mode Control Register 3 (MMCR3) > SPR which is new in power10. For PowerISA v3.1, BHRB disable > is controlled via Monitor Mode Control Register A (MMCRA) bit, > namely "BHRB Recording Disable (BHRBRD)". This patch also

Re: [PATCH v2] powerpc/64s: allow for clang's objdump differences

2020-07-27 Thread Michael Ellerman
On Fri, 24 Jul 2020 15:49:01 -0700, Bill Wendling wrote: > Clang's objdump emits slightly different output from GNU's objdump, > causing a list of warnings to be emitted during relocatable builds. > E.g., clang's objdump emits this: > >c004: 2c 00 00 48 b 0xc030 >

Re: [PATCH v4 0/6] powerpc: queued spinlocks and rwlocks

2020-07-27 Thread Michael Ellerman
On Fri, 24 Jul 2020 23:14:17 +1000, Nicholas Piggin wrote: > Updated with everybody's feedback (thanks all), and more performance > results. > > What I've found is I might have been measuring the worst load point for > the paravirt case, and by looking at a range of loads it's clear that > queued

[PATCH 2/7] powerpc/smp: Stop updating cpu_core_mask

2020-07-27 Thread Srikar Dronamraju
Anton Blanchard reported that his 4096 vcpu KVM guest took around 30 minutes to boot. He also analyzed it to the time taken to iterate while setting the cpu_core_mask. Further analysis shows that cpu_core_mask and cpu_cpu_mask for any CPU would be equal on Power. However updating cpu_core_mask

[powerpc:next-test] BUILD SUCCESS 78807804b0854ecb7dc6906e379fc688aca36456

2020-07-27 Thread kernel test robot
defconfig powerpc allyesconfig powerpc allmodconfig powerpc allnoconfig i386 randconfig-a016-20200727 i386 randconfig-a013-20200727 i386 randconfig-a012-20200727 i386

Re: [PATCH] KVM: PPC: Book3S HV: increase KVMPPC_NR_LPIDS on POWER8 and POWER9

2020-07-27 Thread Cédric Le Goater
On 7/23/20 8:20 AM, Paul Mackerras wrote: > On Mon, Jun 08, 2020 at 01:57:14PM +0200, Cédric Le Goater wrote: >> POWER8 and POWER9 have 12-bit LPIDs. Change LPID_RSVD to support up to >> (4096 - 2) guests on these processors. POWER7 is kept the same with a >> limitation of (1024 - 2), but it might

Re: [PATCH v2] powerpc/book3s64/pkey: Disable pkey on POWER6 and before

2020-07-27 Thread Michael Ellerman
On Sun, 26 Jul 2020 18:55:17 +0530, Aneesh Kumar K.V wrote: > POWER6 only support AMR update via privileged mode(MSR[PR] = 0, SPRN_AMR=29) > The PR=1 alias for that SPR (SPRN_AMR=13) was only supported > from POWER7. Since we don't allow userspace modifying of AMR value > we should disable pkey

[PATCH 0/7] Optimization to improve cpu online/offline on Powerpc

2020-07-27 Thread Srikar Dronamraju
Anton reported that his 4096 cpu (1024 cores in a socket) was taking too long to boot. He also analyzed that most of the time was being spent on updating cpu_core_mask. Here are some optimizations and fixes to make ppc64_cpu --smt=8/ppc64_cpu --smt=1 run faster and hence boot the kernel also

[PATCH] powerpc/64s/hash: Fix hash_preload running with interrupts enabled

2020-07-27 Thread Nicholas Piggin
Commit 2f92447f9f96 ("powerpc/book3s64/hash: Use the pte_t address from the caller") removed the local_irq_disable from hash_preload, but it was required for more than just the page table walk: the hash pte busy bit is effectively a lock which may be taken in interrupt context, and the local

Re: [PATCH v4 00/10] Coregroup support on Powerpc

2020-07-27 Thread Srikar Dronamraju
* Srikar Dronamraju [2020-07-27 10:47:55]: > Changelog v3 ->v4: > v3: > https://lore.kernel.org/lkml/20200723085116.4731-1-sri...@linux.vnet.ibm.com/t/#u > > powerpc/smp: Create coregroup domain > if coregroup_support doesn't exist, update MC mask to the next > smaller domain

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

2020-07-27 Thread Ravi Bangoria
Hi Athira, +/* Function to return the extended register values */ +static u64 get_ext_regs_value(int idx) +{ + switch (idx) { + case PERF_REG_POWERPC_MMCR0: + return mfspr(SPRN_MMCR0); + case PERF_REG_POWERPC_MMCR1: + return mfspr(SPRN_MMCR1); +

Re: [PATCH 0/8] Mac ADB IOP driver fixes

2020-07-27 Thread Michael Ellerman
On Sun, 31 May 2020 09:17:03 +1000, Finn Thain wrote: > The adb-iop driver was never finished. Some deficiencies have become > apparent over the years. For example, > > - Mouse and/or keyboard may stop working if used together > > - SRQ autopoll list cannot be changed > > [...] Applied to

Re: [PATCH v2 0/6] powerpc/32s: Allocate modules outside of vmalloc space for STRICT_KERNEL_RWX

2020-07-27 Thread Michael Ellerman
On Mon, 29 Jun 2020 11:15:19 + (UTC), Christophe Leroy wrote: > On book3s32 (hash), exec protection is set per 256Mb segments with NX bit. > Instead of clearing NX bit on vmalloc space when CONFIG_MODULES is selected, > allocate modules in a dedicated segment (0xb000-0xbfff by

Re: [PATCH v2 01/14] powerpc/eeh: Remove eeh_dev_phb_init_dynamic()

2020-07-27 Thread Michael Ellerman
On Wed, 22 Jul 2020 14:26:15 +1000, Oliver O'Halloran wrote: > This function is a one line wrapper around eeh_phb_pe_create() and despite > the name it doesn't create any eeh_dev structures. Replace it with direct > calls to eeh_phb_pe_create() since that does what it says on the tin > and removes

[PATCH v2] powerpc/book3s64/radix: Add kernel command line option to disable radix GTSE

2020-07-27 Thread Aneesh Kumar K.V
This adds a kernel command line option that can be used to disable GTSE support. Disabling GTSE implies kernel will make hcalls to invalidate TLB entries. This was done so that we can do VM migration between configs that enable/disable GTSE support via hypervisor. To migrate a VM from a system

Re: [PATCH 0/5] cpuidle-pseries: Parse extended CEDE information for idle.

2020-07-27 Thread Rafael J. Wysocki
On Tue, Jul 7, 2020 at 1:32 PM Gautham R Shenoy wrote: > > Hi, > > On Tue, Jul 07, 2020 at 04:41:34PM +0530, Gautham R. Shenoy wrote: > > From: "Gautham R. Shenoy" > > > > Hi, > > > > > > > > > > Gautham R. Shenoy (5): > > cpuidle-pseries: Set the latency-hint before entering CEDE > >

Re: [PATCH v3 1/2] cpuidle: Trace IPI based and timer based wakeup latency from idle states

2020-07-27 Thread Rafael J. Wysocki
On Tue, Jul 21, 2020 at 2:43 PM Pratik Rajesh Sampat wrote: > > Fire directed smp_call_function_single IPIs from a specified source > CPU to the specified target CPU to reduce the noise we have to wade > through in the trace log. And what's the purpose of it? > The module is based on the idea

Re: [PATCH v2 4/5] powerpc/mm: Remove custom stack expansion checking

2020-07-27 Thread Daniel Axtens
Hi Michael, I tested v1 of this. I ran the test from the bug with a range of stack sizes, in a loop, for several hours and didn't see any crashes/signal delivery failures. I retested v2 for a few minutes just to be sure, and I ran stress-ng's stack, stackmmap and bad-altstack stressors to make

[PATCH -next] powerpc/powernv/sriov: Remove unused but set variable 'phb'

2020-07-27 Thread Wei Yongjun
Gcc report warning as follows: arch/powerpc/platforms/powernv/pci-sriov.c:602:25: warning: variable 'phb' set but not used [-Wunused-but-set-variable] 602 | struct pnv_phb*phb; | ^~~ This variable is not used, so this commit removing it. Reported-by:

[PATCH V5 3/4] tools/perf: Add perf tools support for extended register capability in powerpc

2020-07-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] powerpc/64s/hash: Fix hash_preload running with interrupts enabled

2020-07-27 Thread Athira Rajeev
> On 27-Jul-2020, at 6:05 PM, Michael Ellerman wrote: > > Athira Rajeev writes: >>> On 27-Jul-2020, at 11:39 AM, Nicholas Piggin wrote: >>> >>> Commit 2f92447f9f96 ("powerpc/book3s64/hash: Use the pte_t address from the >>> caller") removed the local_irq_disable from hash_preload, but it

[PATCH V5 4/4] tools/perf: Add perf tools support for extended regs in power10

2020-07-27 Thread Athira Rajeev
Added support for supported regs which are new in power10 ( MMCR3, SIER2, SIER3 ) to sample_reg_mask in the tool side to use with `-I?` option. Also added PVR check to send extended mask for power10 at kernel while capturing extended regs in each sample. Signed-off-by: Athira Rajeev Reviewed-by:

[PATCH v6 0/5] Migrate non-migrated pages of a SVM.

2020-07-27 Thread Ram Pai
The time to switch a VM to Secure-VM, increases by the size of the VM. A 100GB VM takes about 7minutes. This is unacceptable. This linear increase is caused by a suboptimal behavior by the Ultravisor and the Hypervisor. The Ultravisor unnecessarily migrates all the GFN of the VM from

[PATCH v2 2/2] KVM: PPC: Book3S HV: rework secure mem slot dropping

2020-07-27 Thread Ram Pai
From: Laurent Dufour When a secure memslot is dropped, all the pages backed in the secure device (aka really backed by secure memory by the Ultravisor) should be paged out to a normal page. Previously, this was achieved by triggering the page fault mechanism which is calling

[PATCH V5 2/4] powerpc/perf: Add extended regs support for power10 platform

2020-07-27 Thread Athira Rajeev
Include capability flag `PERF_PMU_CAP_EXTENDED_REGS` for power10 and expose MMCR3, SIER2, SIER3 registers as part of extended regs. Also introduce `PERF_REG_PMU_MASK_31` to define extended mask value at runtime for power10 Signed-off-by: Athira Rajeev [Fix build failure on PPC32 platform]

[PATCH v6 1/5] KVM: PPC: Book3S HV: Fix function definition in book3s_hv_uvmem.c

2020-07-27 Thread Ram Pai
Without this fix, git is confused. It generates wrong function context for code changes in subsequent patches. Weird, but true. Cc: Paul Mackerras Cc: Benjamin Herrenschmidt Cc: Michael Ellerman Cc: Bharata B Rao Cc: Aneesh Kumar K.V Cc: Sukadev Bhattiprolu Cc: Laurent Dufour Cc: Thiago

[PATCH v6 5/5] KVM: PPC: Book3S HV: migrate hot plugged memory

2020-07-27 Thread Ram Pai
From: Laurent Dufour When a memory slot is hot plugged to a SVM, PFNs associated with the GFNs in that slot must be migrated to the secure-PFNs, aka device-PFNs. Call kvmppc_uv_migrate_mem_slot() to accomplish this. Disable page-merge for all pages in the memory slot. Reviewed-by: Bharata B

[PATCH V5 0/4] powerpc/perf: Add support for perf extended regs in powerpc

2020-07-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. Patches 1 and 2 are

[PATCH v6 3/5] KVM: PPC: Book3S HV: track the state GFNs associated with secure VMs

2020-07-27 Thread Ram Pai
During the life of SVM, its GFNs transition through normal, secure and shared states. Since the kernel does not track GFNs that are shared, it is not possible to disambiguate a shared GFN from a GFN whose PFN has not yet been migrated to a secure-PFN. Also it is not possible to disambiguate a

Re: [PATCH 0/5] cpuidle-pseries: Parse extended CEDE information for idle.

2020-07-27 Thread Gautham R Shenoy
Hello Rafael, On Mon, Jul 27, 2020 at 04:14:12PM +0200, Rafael J. Wysocki wrote: > On Tue, Jul 7, 2020 at 1:32 PM Gautham R Shenoy > wrote: > > > > Hi, > > > > On Tue, Jul 07, 2020 at 04:41:34PM +0530, Gautham R. Shenoy wrote: > > > From: "Gautham R. Shenoy" > > > > > > Hi, > > > > > > > > > >

[PATCH v6 4/5] KVM: PPC: Book3S HV: in H_SVM_INIT_DONE, migrate remaining normal-GFNs to secure-GFNs.

2020-07-27 Thread Ram Pai
The Ultravisor is expected to explicitly call H_SVM_PAGE_IN for all the pages of the SVM before calling H_SVM_INIT_DONE. This causes a huge delay in tranistioning the VM to SVM. The Ultravisor is only interested in the pages that contain the kernel, initrd and other important data structures. The

[PATCH v2 1/2] powerpc/perf: consolidate GPCI hcall structs into asm/hvcall.h

2020-07-27 Thread Scott Cheloha
The H_GetPerformanceCounterInfo (GPCI) hypercall input/output structs are useful to modules outside of perf/, so move them into asm/hvcall.h to live alongside the other powerpc hypercall structs. Leave the perf-specific GPCI stuff in perf/hv-gpci.h. Signed-off-by: Scott Cheloha ---

Re: [PATCH v4 09/10] Powerpc/smp: Create coregroup domain

2020-07-27 Thread Gautham R Shenoy
Hi Srikar, On Mon, Jul 27, 2020 at 11:02:29AM +0530, Srikar Dronamraju wrote: > Add percpu coregroup maps and masks to create coregroup domain. > If a coregroup doesn't exist, the coregroup domain will be degenerated > in favour of SMT/CACHE domain. > > Cc: linuxppc-dev > Cc: LKML > Cc:

[PATCH v2 1/2] KVM: PPC: Book3S HV: move kvmppc_svm_page_out up

2020-07-27 Thread Ram Pai
From: Laurent Dufour kvmppc_svm_page_out() will need to be called by kvmppc_uvmem_drop_pages() so move it upper in this file. Furthermore it will be interesting to call this function when already holding the kvm->arch.uvmem_lock, so prefix the original function with __ and remove the locking in

[PATCH v2 0/2] Rework secure memslot dropping

2020-07-27 Thread Ram Pai
From: Laurent Dufour When doing memory hotplug on a secure VM, the secure pages are not well cleaned from the secure device when dropping the memslot. This silent error, is then preventing the SVM to reboot properly after the following sequence of commands are run in the Qemu monitor:

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

2020-07-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

[PATCH v6 2/5] KVM: PPC: Book3S HV: Disable page merging in H_SVM_INIT_START

2020-07-27 Thread Ram Pai
Page-merging of pages in memory-slots associated with a Secure VM, is disabled in H_SVM_PAGE_IN handler. This operation should have been done the much earlier; the moment the VM is initiated for secure-transition. Delaying this operation, increases the probability for those pages to acquire new

[PATCH v2 2/2] powerpc/pseries: new lparcfg key/value pair: partition_affinity_score

2020-07-27 Thread Scott Cheloha
The H_GetPerformanceCounterInfo (GPCI) PHYP hypercall has a subcall, Affinity_Domain_Info_By_Partition, which returns, among other things, a "partition affinity score" for a given LPAR. This score, a value on [0-100], represents the processor-memory affinity for the LPAR in question. A score of

[PATCH][next] powerpc: Use fallthrough pseudo-keyword

2020-07-27 Thread Gustavo A. R. Silva
Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary fall-through markings when it is the case. [1]

[PATCH][next] dmaengine: Use fallthrough pseudo-keyword

2020-07-27 Thread Gustavo A. R. Silva
Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary fall-through markings when it is the case. [1]

Re: [PATCH -next] powerpc/powernv/sriov: Remove unused but set variable 'phb'

2020-07-27 Thread Oliver O'Halloran
On Tue, Jul 28, 2020 at 3:01 AM Wei Yongjun wrote: > > Gcc report warning as follows: > > arch/powerpc/platforms/powernv/pci-sriov.c:602:25: warning: > variable 'phb' set but not used [-Wunused-but-set-variable] > 602 | struct pnv_phb*phb; > | ^~~ > >

[Bug 205183] PPC64: Signal delivery fails with SIGSEGV if between about 1KB and 4KB bytes of stack remain

2020-07-27 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=205183 Michael Ellerman (mich...@ellerman.id.au) changed: What|Removed |Added Status|NEW |ASSIGNED

[Bug 205183] PPC64: Signal delivery fails with SIGSEGV if between about 1KB and 4KB bytes of stack remain

2020-07-27 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=205183 Michael Ellerman (mich...@ellerman.id.au) changed: What|Removed |Added Status|ASSIGNED|RESOLVED

Re: [RESEND PATCH v5 07/11] ppc64/kexec_file: enable early kernel's OPAL calls

2020-07-27 Thread Thiago Jung Bauermann
Hari Bathini writes: > Kernel built with CONFIG_PPC_EARLY_DEBUG_OPAL enabled expects r8 & r9 > to be filled with OPAL base & entry addresses respectively. Setting > these registers allows the kernel to perform OPAL calls before the > device tree is parsed. > > Signed-off-by: Hari Bathini

Re: [RESEND PATCH v5 08/11] ppc64/kexec_file: setup backup region for kdump kernel

2020-07-27 Thread Thiago Jung Bauermann
Hari Bathini writes: > Though kdump kernel boots from loaded address, the first 64KB of it is > copied down to real 0. So, setup a backup region and let purgatory > copy the first 64KB of crashed kernel into this backup region before > booting into kdump kernel. Update reserve map with backup

Re: [PATCH] powerpc/64s/hash: Fix hash_preload running with interrupts enabled

2020-07-27 Thread Michael Ellerman
Athira Rajeev writes: >> On 27-Jul-2020, at 6:05 PM, Michael Ellerman wrote: >> >> Athira Rajeev writes: On 27-Jul-2020, at 11:39 AM, Nicholas Piggin wrote: Commit 2f92447f9f96 ("powerpc/book3s64/hash: Use the pte_t address from the caller") removed the local_irq_disable

[PATCH -next] powerpc: use for_each_child_of_node() macro

2020-07-27 Thread Qinglang Miao
Use for_each_child_of_node() macro instead of open coding it. Signed-off-by: Qinglang Miao --- arch/powerpc/platforms/pasemi/misc.c | 3 +-- arch/powerpc/platforms/powermac/low_i2c.c| 6 ++ arch/powerpc/platforms/powermac/pfunc_base.c | 4 ++--

Re: [PATCH v2 4/5] powerpc/mm: Remove custom stack expansion checking

2020-07-27 Thread Michael Ellerman
Daniel Axtens writes: > Hi Michael, > > I tested v1 of this. I ran the test from the bug with a range of stack > sizes, in a loop, for several hours and didn't see any crashes/signal > delivery failures. > > I retested v2 for a few minutes just to be sure, and I ran stress-ng's > stack, stackmmap

Re: [RESEND PATCH v5 06/11] ppc64/kexec_file: restrict memory usage of kdump kernel

2020-07-27 Thread Thiago Jung Bauermann
Hari Bathini writes: > Kdump kernel, used for capturing the kernel core image, is supposed > to use only specific memory regions to avoid corrupting the image to > be captured. The regions are crashkernel range - the memory reserved > explicitly for kdump kernel, memory used for the tce-table,

Re: [RESEND PATCH v5 00/11] ppc64: enable kdump support for kexec_file_load syscall

2020-07-27 Thread piliu
On 07/27/2020 03:36 AM, Hari Bathini wrote: > Sorry! There was a gateway issue on my system while posting v5, due to > which some patches did not make it through. Resending... > > This patch series enables kdump support for kexec_file_load system > call (kexec -s -p) on PPC64. The changes are

[PATCH 00/15] memblock: seasonal cleaning^w cleanup

2020-07-27 Thread Mike Rapoport
From: Mike Rapoport Hi, These patches simplify several uses of memblock iterators and hide some of the memblock implementation details from the rest of the system. The patches are on top of v5.8-rc7 + cherry-pick of "mm/sparse: cleanup the code surrounding memory_present()" [1] from mmotm

[PATCH 01/15] KVM: PPC: Book3S HV: simplify kvm_cma_reserve()

2020-07-27 Thread Mike Rapoport
From: Mike Rapoport The memory size calculation in kvm_cma_reserve() traverses memblock.memory rather than simply call memblock_phys_mem_size(). The comment in that function suggests that at some point there should have been call to memblock_analyze() before memblock_phys_mem_size() could be

[PATCH 05/15] h8300, nds32, openrisc: simplify detection of memory extents

2020-07-27 Thread Mike Rapoport
From: Mike Rapoport Instead of traversing memblock.memory regions to find memory_start and memory_end, simply query memblock_{start,end}_of_DRAM(). Signed-off-by: Mike Rapoport --- arch/h8300/kernel/setup.c| 8 +++- arch/nds32/kernel/setup.c| 8 ++--

[PATCH 10/15] memblock: make memblock_debug and related functionality private

2020-07-27 Thread Mike Rapoport
From: Mike Rapoport The only user of memblock_dbg() outside memblock was s390 setup code and it is converted to use pr_debug() instead. This allows to stop exposing memblock_debug and memblock_dbg() to the rest of the kernel. Signed-off-by: Mike Rapoport --- arch/s390/kernel/setup.c | 4 ++--

[PATCH 09/15] memblock: make for_each_memblock_type() iterator private

2020-07-27 Thread Mike Rapoport
From: Mike Rapoport for_each_memblock_type() is not used outside mm/memblock.c, move it there from include/linux/memblock.h Signed-off-by: Mike Rapoport --- include/linux/memblock.h | 5 - mm/memblock.c| 5 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git

[PATCH 13/15] arch, drivers: replace for_each_membock() with for_each_mem_range()

2020-07-27 Thread Mike Rapoport
From: Mike Rapoport There are several occurrences of the following pattern: for_each_memblock(memory, reg) { start = __pfn_to_phys(memblock_region_memory_base_pfn(reg); end = __pfn_to_phys(memblock_region_memory_end_pfn(reg)); /* do

[PATCH 14/15] x86/numa: remove redundant iteration over memblock.reserved

2020-07-27 Thread Mike Rapoport
From: Mike Rapoport numa_clear_kernel_node_hotplug() function first traverses numa_meminfo regions to set node ID in memblock.reserved and than traverses memblock.reserved to update reserved_nodemask to include node IDs that were set in the first loop. Remove redundant traversal over

[PATCH 16/24] powerpc: use asm-generic/mmu_context.h for no-op implementations

2020-07-27 Thread Nicholas Piggin
Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/mmu_context.h | 22 +++--- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git

[PATCH 02/15] dma-contiguous: simplify cma_early_percent_memory()

2020-07-27 Thread Mike Rapoport
From: Mike Rapoport The memory size calculation in cma_early_percent_memory() traverses memblock.memory rather than simply call memblock_phys_mem_size(). The comment in that function suggests that at some point there should have been call to memblock_analyze() before memblock_phys_mem_size()

[PATCH 03/15] arm, xtensa: simplify initialization of high memory pages

2020-07-27 Thread Mike Rapoport
From: Mike Rapoport The function free_highpages() in both arm and xtensa essentially open-code for_each_free_mem_range() loop to detect high memory pages that were not reserved and that should be initialized and passed to the buddy allocator. Replace open-coded implementation of

[PATCH 04/15] arm64: numa: simplify dummy_numa_init()

2020-07-27 Thread Mike Rapoport
From: Mike Rapoport dummy_numa_init() loops over memblock.memory and passes nid=0 to numa_add_memblk() which essentially wraps memblock_set_node(). However, memblock_set_node() can cope with entire memory span itself, so the loop over memblock.memory regions is redundant. Replace the loop with

[PATCH 06/15] powerpc: fadamp: simplify fadump_reserve_crash_area()

2020-07-27 Thread Mike Rapoport
From: Mike Rapoport fadump_reserve_crash_area() reserves memory from a specified base address till the end of the RAM. Replace iteration through the memblock.memory with a single call to memblock_reserve() with appropriate that will take care of proper memory reservation. Signed-off-by: Mike

[PATCH 07/15] riscv: drop unneeded node initialization

2020-07-27 Thread Mike Rapoport
From: Mike Rapoport RISC-V does not (yet) support NUMA and for UMA architectures node 0 is used implicitly during early memory initialization. There is no need to call memblock_set_node(), remove this call and the surrounding code. Signed-off-by: Mike Rapoport --- arch/riscv/mm/init.c | 9

[PATCH 08/15] mircoblaze: drop unneeded NUMA and sparsemem initializations

2020-07-27 Thread Mike Rapoport
From: Mike Rapoport microblaze does not support neither NUMA not SPARSMEM, so there is no point to call memblock_set_node() and sparse_memory_present_with_active_regions() functions during microblaze memory initialization. Remove these calls and the surrounding code. Signed-off-by: Mike

[PATCH 11/15] memblock: reduce number of parameters in for_each_mem_range()

2020-07-27 Thread Mike Rapoport
From: Mike Rapoport Currently for_each_mem_range() iterator is the most generic way to traverse memblock regions. As such, it has 8 parameters and it is hardly convenient to users. Most users choose to utilize one of its wrappers and the only user that actually needs most of the parameters

  1   2   >