<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/arch/powerpc/platforms/pseries, branch master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/arch/powerpc/platforms/pseries?h=master</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/arch/powerpc/platforms/pseries?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2022-10-18T11:46:18Z</updated>
<entry>
<title>powerpc/pseries: Use lparcfg to reconfig VAS windows for DLPAR CPU</title>
<updated>2022-10-18T11:46:18Z</updated>
<author>
<name>Haren Myneni</name>
<email>haren@linux.ibm.com</email>
</author>
<published>2022-10-07T05:29:59Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=2147783d6bf0b7ca14c72a25527dc5135bd17f65'/>
<id>urn:sha1:2147783d6bf0b7ca14c72a25527dc5135bd17f65</id>
<content type='text'>
The hypervisor assigns VAS (Virtual Accelerator Switchboard)
windows depends on cores configured in LPAR. The kernel uses
OF reconfig notifier to reconfig VAS windows for DLPAR CPU event.
In the case of shared CPU mode partition, the hypervisor assigns
VAS windows depends on CPU entitled capacity, not based on vcpus.
When the user changes CPU entitled capacity for the partition,
drmgr uses /proc/ppc64/lparcfg interface to notify the kernel.

This patch adds the following changes to update VAS resources
for shared mode:
- Call vas reconfig windows from lparcfg_write()
- Ignore reconfig changes in the VAS notifier

Signed-off-by: Haren Myneni &lt;haren@linux.ibm.com&gt;
[mpe: Rework error handling, report any errors as EIO]
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/efa9c16e4a78dda4567a16f13dabfd73cb4674a2.camel@linux.ibm.com

</content>
</entry>
<entry>
<title>powerpc/pseries/vas: Add VAS IRQ primary handler</title>
<updated>2022-10-18T11:46:18Z</updated>
<author>
<name>Haren Myneni</name>
<email>haren@linux.ibm.com</email>
</author>
<published>2022-10-10T03:41:25Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=89ed0b769d6adf30364f60e6b1566961821a9893'/>
<id>urn:sha1:89ed0b769d6adf30364f60e6b1566961821a9893</id>
<content type='text'>
irq_default_primary_handler() can be used only with IRQF_ONESHOT
flag, but the flag disables IRQ before executing the thread handler
and enables it after the interrupt is handled. But this IRQ disable
sets the VAS IRQ OFF state in the hypervisor. In case if NX faults
during this window, the hypervisor will not deliver the fault
interrupt to the partition and the user space may wait continuously
for the CSB update. So use VAS specific IRQ handler instead of
calling the default primary handler.

Increment pending_faults counter in IRQ handler and the bottom
thread handler will process all faults based on this counter.
In case if the another interrupt is received while the thread is
running, it will be processed using this counter. The synchronization
of top and bottom handlers will be done with IRQTF_RUNTHREAD flag
and will re-enter to bottom half if this flag is set.

Signed-off-by: Haren Myneni &lt;haren@linux.ibm.com&gt;
Reviewed-by: Frederic Barrat &lt;fbarrat@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/aaad8813b4762a6753cfcd0b605a7574a5192ec7.camel@linux.ibm.com

</content>
</entry>
<entry>
<title>powerpc/pseries: Fix CONFIG_DTL=n build</title>
<updated>2022-10-13T11:30:07Z</updated>
<author>
<name>Nicholas Piggin</name>
<email>npiggin@gmail.com</email>
</author>
<published>2022-10-13T07:31:31Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=90d5ce82e143b42b2fdfb95401a89f86b71cedb7'/>
<id>urn:sha1:90d5ce82e143b42b2fdfb95401a89f86b71cedb7</id>
<content type='text'>
The recently moved dtl code must be compiled-in if
CONFIG_VIRT_CPU_ACCOUNTING_NATIVE=y even if CONFIG_DTL=n.

Fixes: 6ba5aa541aaa0 ("powerpc/pseries: Move dtl scanning and steal time accounting to pseries platform")
Reported-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Nicholas Piggin &lt;npiggin@gmail.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20221013073131.1485742-1-npiggin@gmail.com
</content>
</entry>
<entry>
<title>powerpc/pseries: Add firmware details to the hardware description</title>
<updated>2022-09-30T08:35:53Z</updated>
<author>
<name>Michael Ellerman</name>
<email>mpe@ellerman.id.au</email>
</author>
<published>2022-09-30T08:27:09Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=8535a1afff0f4f568eb589f3795a930ef3d483b0'/>
<id>urn:sha1:8535a1afff0f4f568eb589f3795a930ef3d483b0</id>
<content type='text'>
Add firmware version details to the hardware description, which is
printed at boot and in case of an oops.

Use /hypervisor if we find it, though currently it only exists if we're
running under qemu.

Look for "ibm,powervm-partition" which is specified in PAPR+ v2.11 and
tells us we're running under PowerVM.

Failing that look for "ibm,fw-net-version" which is seen on PowerVM
going back to at least Power6.

eg: Hardware name: ... of:IBM,FW860.42 (SV860_138) hv:phyp

Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20220930082709.55830-6-mpe@ellerman.id.au

</content>
</entry>
<entry>
<title>powerpc/pseries/vas: Pass hw_cpu_id to node associativity HCALL</title>
<updated>2022-09-30T08:35:51Z</updated>
<author>
<name>Haren Myneni</name>
<email>haren@linux.ibm.com</email>
</author>
<published>2022-09-29T01:57:33Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=f3e5d9e53e74d77e711a2c90a91a8b0836a9e0b3'/>
<id>urn:sha1:f3e5d9e53e74d77e711a2c90a91a8b0836a9e0b3</id>
<content type='text'>
Generally the hypervisor decides to allocate a window on different
VAS instances. But if user space wishes to allocate on the current VAS
instance where the process is executing, the kernel has to pass
associativity domain IDs to allocate VAS window HCALL.

To determine the associativity domain IDs for the current CPU,
smp_processor_id() is passed to node associativity HCALL which may
return H_P2 (-55) error during DLPAR CPU event. This is because Linux
CPU numbers (smp_processor_id()) are not the same as the hypervisor's
view of CPU numbers.

Fix the issue by passing hard_smp_processor_id() with
VPHN_FLAG_VCPU flag (PAPR 14.11.6.1 H_HOME_NODE_ASSOCIATIVITY).

Fixes: b22f2d88e435 ("powerpc/pseries/vas: Integrate API with open/close windows")
Reviewed-by: Nathan Lynch &lt;nathanl@linux.ibm.com&gt;
Signed-off-by: Haren Myneni &lt;haren@linux.ibm.com&gt;
[mpe: Update change log to mention Linux vs HV CPU numbers]
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/55380253ea0c11341824cd4c0fc6bbcfc5752689.camel@linux.ibm.com

</content>
</entry>
<entry>
<title>powerpc/pseries/vas: Remove the unneeded result variable</title>
<updated>2022-09-28T09:22:14Z</updated>
<author>
<name>ye xingchen</name>
<email>ye.xingchen@zte.com.cn</email>
</author>
<published>2022-08-25T07:26:57Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=91986d7f0300c2c01722e0eac5119bb0946fe9b5'/>
<id>urn:sha1:91986d7f0300c2c01722e0eac5119bb0946fe9b5</id>
<content type='text'>
Return the value vas_register_coproc_api() directly instead of storing it
in another redundant variable.

Reported-by: Zeal Robot &lt;zealci@zte.com.cn&gt;
Signed-off-by: ye xingchen &lt;ye.xingchen@zte.com.cn&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20220825072657.229168-1-ye.xingchen@zte.com.cn

</content>
</entry>
<entry>
<title>powerpc/pseries: block untrusted device tree changes when locked down</title>
<updated>2022-09-28T09:22:14Z</updated>
<author>
<name>Nathan Lynch</name>
<email>nathanl@linux.ibm.com</email>
</author>
<published>2022-09-26T13:16:42Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=99df7a2810b6d24651d4887ab61a142e042fb235'/>
<id>urn:sha1:99df7a2810b6d24651d4887ab61a142e042fb235</id>
<content type='text'>
The /proc/powerpc/ofdt interface allows the root user to freely alter
the in-kernel device tree, enabling arbitrary physical address writes
via drivers that could bind to malicious device nodes, thus making it
possible to disable lockdown.

Historically this interface has been used on the pseries platform to
facilitate the runtime addition and removal of processor, memory, and
device resources (aka Dynamic Logical Partitioning or DLPAR). Years
ago, the processor and memory use cases were migrated to designs that
happen to be lockdown-friendly: device tree updates are communicated
directly to the kernel from firmware without passing through untrusted
user space. I/O device DLPAR via the "drmgr" command in powerpc-utils
remains the sole legitimate user of /proc/powerpc/ofdt, but it is
already broken in lockdown since it uses /dev/mem to allocate argument
buffers for the rtas syscall. So only illegitimate uses of the
interface should see a behavior change when running on a locked down
kernel.

Signed-off-by: Nathan Lynch &lt;nathanl@linux.ibm.com&gt;
Acked-by: Paul Moore &lt;paul@paul-moore.com&gt; (LSM)
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20220926131643.146502-2-nathanl@linux.ibm.com

</content>
</entry>
<entry>
<title>powerpc/pseries: Move vas_migration_handler early during migration</title>
<updated>2022-09-28T09:22:12Z</updated>
<author>
<name>Haren Myneni</name>
<email>haren@linux.ibm.com</email>
</author>
<published>2022-09-22T08:27:07Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=465dda9d320d1cb9424f1015b0520ec4c4f0d279'/>
<id>urn:sha1:465dda9d320d1cb9424f1015b0520ec4c4f0d279</id>
<content type='text'>
When the migration is initiated, the hypervisor changes VAS
mappings as part of pre-migration event. Then the OS gets the
migration event which closes all VAS windows before the migration
starts. NX generates continuous faults until windows are closed
and the user space can not differentiate these NX faults coming
from the actual migration. So to reduce this time window, close
VAS windows first in pseries_migrate_partition().

Signed-off-by: Haren Myneni &lt;haren@linux.ibm.com&gt;
Reviewed-by: Nathan Lynch &lt;nathanl@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/d8efade91dda831c9ed4abb226dab627da594c5f.camel@linux.ibm.com

</content>
</entry>
<entry>
<title>powerpc/pseries: move hcall_tracepoint_refcount out of .toc</title>
<updated>2022-09-26T10:57:42Z</updated>
<author>
<name>Nicholas Piggin</name>
<email>npiggin@gmail.com</email>
</author>
<published>2022-09-26T05:38:23Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=9a10ccb29c0a2befa5a9f691ed0ae37ee3e799a8'/>
<id>urn:sha1:9a10ccb29c0a2befa5a9f691ed0ae37ee3e799a8</id>
<content type='text'>
The .toc section is not really intended for arbitrary data. Writable
data in particular prevents making the TOC read-only after relocation.
Move hcall_tracepoint_refcount into the .data section.

Signed-off-by: Nicholas Piggin &lt;npiggin@gmail.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20220926053823.2668799-1-npiggin@gmail.com

</content>
</entry>
<entry>
<title>Merge branch 'fixes' into next</title>
<updated>2022-09-23T14:40:14Z</updated>
<author>
<name>Michael Ellerman</name>
<email>mpe@ellerman.id.au</email>
</author>
<published>2022-09-23T14:40:14Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=ec5c3a359cfaf68d4db30969745db18f9928aab9'/>
<id>urn:sha1:ec5c3a359cfaf68d4db30969745db18f9928aab9</id>
<content type='text'>
Merge our fixes branch to bring in a few things that new feature patches
rely on or conflict with.
</content>
</entry>
</feed>
