ss enablement on pSeries systems by
> making the IRQ bypass callbacks unavailable when running on pSeries
> platform.
>
> Signed-off-by: Amit Machhiwal
Reviewed-by: Vaibhav Jain
> ---
> arch/powerpc/kvm/book3s_hv.c | 20
> 1 file changed, 16 insertions(
per is kvmppc_pmu_event_update() which is called from
'kvmppv_pmu' callbacks and uses kvmppc_update_l0_stats() to update
'l0_stats' and the update the 'struct perf_event's event-counter.
Some minor updates to kvmppc_pmu_{add, del, read}() to remove some debug
scaffol
rpc/kvm-nested.rst
Signed-off-by: Vaibhav Jain
---
Changelog
v5->resend:
* Rebase the patch to latest upstream kernel tree
v4->v5:
None
v3->v4:
None
v2->v3:
None
v1->v2:
None
---
arch/powerpc/include/asm/guest-state-buffer.h | 35 ++---
arch/powerpc/include/asm/hv
kvm-hv based guests.
The patch creates necessary scaffolding to for the new PMU callbacks and
introduces the new kernel module name 'kvm-hv-pmu' which is built with
CONFIG_KVM_BOOK3S_HV_PMU. The patch doesn't introduce any perf-events yet,
which will be introduced in later patches
Sig
vmppc_init_hostwide() and
similarly the cleanup is performed in newly introduced
kvmppc_cleanup_hostwide().
Signed-off-by: Vaibhav Jain
---
Changelog
v5->resend:
* Rebase the patch to latest upstream kernel tree
v4->v5:
* Update kvmppc_register_pmu() to refactor the module init path.
v3->v4:
*
3648 bytes
# test_gs_hostwide_counters: Guest Page-table Reclaim Size=0 bytes
ok 7 test_gs_hostwide_counters
# guest_state_buffer_test: pass:7 fail:0 skip:0 total:7
# Totals: pass:7 fail:0 skip:0 total:7
ok 1 guest_state_buffer_test
Signed-off-by: Vaibhav Jain
---
Changelog
v5->resend:
* Rebase
-...@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Madhavan Srinivasan
Cc: Nicholas Piggin
Reviewed-by: Bagas Sanjaya
Tested-by: Gautam Menghani
Signed-off-by: Vaibhav Jain
---
Changelog
v5->resend:
* Rebase the patch to latest upstream kernel tree
v4->v5:
* None
v3->v4:
* Added re
("KVM: PPC: Add support for nestedv2 guests")
[2] - "KVM in a PowerVM LPAR: A Power user guide Part II"
https://ibm.biz/BdGHeY
[3] - https://lore.kernel.org/all/20250221155449.530645-1-vaib...@linux.ibm.com
Vaibhav Jain (6):
powerpc: Document APIv2 KVM hcall spec for Ho
per is kvmppc_pmu_event_update() which is called from
'kvmppv_pmu' callbacks and uses kvmppc_update_l0_stats() to update
'l0_stats' and the update the 'struct perf_event's event-counter.
Some minor updates to kvmppc_pmu_{add, del, read}() to remove some debug
scaffoldi
vmppc_init_hostwide() and
similarly the cleanup is performed in newly introduced
kvmppc_cleanup_hostwide().
Signed-off-by: Vaibhav Jain
---
Changelog
v4->v5:
* Update kvmppc_register_pmu() to refactor the module init path.
v3->v4:
* Minor tweaks to code and patch description since this
kvm-hv based guests.
The patch creates necessary scaffolding to for the new PMU callbacks and
introduces the new kernel module name 'kvm-hv-pmu' which is built with
CONFIG_KVM_BOOK3S_HV_PMU. The patch doesn't introduce any perf-events yet,
which will be introduced in later patches
Sig
rpc/kvm-nested.rst
Signed-off-by: Vaibhav Jain
---
Changelog
v4->v5:
None
v3->v4:
None
v2->v3:
None
v1->v2:
None
---
arch/powerpc/include/asm/guest-state-buffer.h | 35 ++---
arch/powerpc/include/asm/hvcall.h | 13 ---
arch/powerpc/kvm/book3s_hv_nestedv2.
3648 bytes
# test_gs_hostwide_counters: Guest Page-table Reclaim Size=0 bytes
ok 7 test_gs_hostwide_counters
# guest_state_buffer_test: pass:7 fail:0 skip:0 total:7
# Totals: pass:7 fail:0 skip:0 total:7
ok 1 guest_state_buffer_test
Signed-off-by: Vaibhav Jain
---
Changelog
v4->v5:
None
v3->v4:
ences
==
[1] - commit 19d31c5f1157 ("KVM: PPC: Add support for nestedv2 guests")
[2] - "KVM in a PowerVM LPAR: A Power user guide Part II"
https://ibm.biz/BdGHeY
[3] - https://lore.kernel.org/all/20250221155449.530645-1-vaib...@linux.ibm.com
[4] - https://lore.kern
-...@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Madhavan Srinivasan
Cc: Nicholas Piggin
Signed-off-by: Vaibhav Jain
Reviewed-by: Bagas Sanjaya
---
Changelog
v4->v5:
* None
v3->v4:
* Added reviewed by [ Bagas Sanjaya ]
v2->v3:
* Minor reword for the cumulative reclaim counter
he hardware.
>
> Fixes: a5f3d2c17b07 ("powerpc/pseries/pci: Add MSI domains")
> Cc: sta...@vger.kernel.org # v5.15+
> Signed-off-by: Gautam Menghani
LGTM. Hence
Reviewed-by: Vaibhav Jain
--
Cheers
~ Vaibhav
Athira Rajeev writes:
>> On 24 Feb 2025, at 6:45 PM, Vaibhav Jain wrote:
>>
>> Update 'kvm-hv-pmu.c' to add five new perf-events mapped to the five
>> Hostwide counters. Since these newly introduced perf events are at system
>> wide scope and can b
Athira Rajeev writes:
>> On 24 Feb 2025, at 6:45 PM, Vaibhav Jain wrote:
>>
>> Introduce a new PMU named 'kvm-hv' inside a new module named 'kvm-hv-pmu'
>> to report Book3s kvm-hv specific performance counters. This will expose
>> KVM-HV
ook3s-HV APIv2
proposed at [3]. Currently with Qemu-TCG the values for all the Hostwide
counters is reported as '0'.
References
==
[1] - commit 19d31c5f1157 ("KVM: PPC: Add support for nestedv2 guests")
[2] - "KVM in a PowerVM LPAR: A Power user guide Part II"
rpc/kvm-nested.rst
Signed-off-by: Vaibhav Jain
---
Changelog
v3->v4:
None
v2->v3:
None
v1->v2:
None
---
arch/powerpc/include/asm/guest-state-buffer.h | 35 ++---
arch/powerpc/include/asm/hvcall.h | 13 ---
arch/powerpc/kvm/book3s_hv_nestedv2.c
per is kvmppc_pmu_event_update() which is called from
'kvmppv_pmu' callbacks and uses kvmppc_update_l0_stats() to update
'l0_stats' and the update the 'struct perf_event's event-counter.
Some minor updates to kvmppc_pmu_{add, del, read}() to remove some debug
scaffoldi
vmppc_init_hostwide() and
similarly the cleanup is performed in newly introduced
kvmppc_cleanup_hostwide().
Signed-off-by: Vaibhav Jain
---
Changelog
v3->v4:
* Minor tweaks to code and patch description since this code is now being
built as a kernel module.
* Introduced kvmppc_events_sysfs_show() as power_
kvm-hv based guests.
The patch creates necessary scaffolding to for the new PMU callbacks and
introduces the new kernel module name 'kvm-hv-pmu' which is built with
CONFIG_KVM_BOOK3S_HV_PMU. The patch doesn't introduce any perf-events yet,
which will be introduced in later patches
Sig
3648 bytes
# test_gs_hostwide_counters: Guest Page-table Reclaim Size=0 bytes
ok 7 test_gs_hostwide_counters
# guest_state_buffer_test: pass:7 fail:0 skip:0 total:7
# Totals: pass:7 fail:0 skip:0 total:7
ok 1 guest_state_buffer_test
Signed-off-by: Vaibhav Jain
---
Changelog
v3->v4:
* Force skip
-...@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Madhavan Srinivasan
Cc: Nicholas Piggin
Signed-off-by: Vaibhav Jain
Reviewed-by: Bagas Sanjaya
---
Changelog
v3->v4:
* Added reviewed by [ Bagas Sanjaya ]
v2->v3:
* Minor reword for the cumulative reclaim counter [ Gautam ]
v1->v2:
*
: 176cda0619b6 ("powerpc/perf: Add perf interface to expose vpa counters")
Signed-off-by: Vaibhav Jain
---
arch/powerpc/perf/vpa-pmu.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/powerpc/perf/vpa-pmu.c b/arch/powerpc/perf/vpa-pmu.c
index 6a5bfd2a13b5..840733468959 100644
---
Hi Athira,
Thanks for reviewing this patch series. My responses to your review
comment inline below:
Athira Rajeev writes:
>> On 23 Jan 2025, at 5:37 PM, Vaibhav Jain wrote:
>>
>> Introduce a new PMU named 'kvm-hv' to report Book3s kvm-hv specific
>
> Hi
ble updated.
Second helper is kvmppc_pmu_event_update() which is called from
'kvmppv_pmu' callbacks and uses kvmppc_update_l0_stats() to update
'l0_stats' and the update the 'struct perf_event's event-counter.
Some minor updates to kvmppc_pmu_{add, del, read}() to remove some debug
scaff
vmppc_init_hostwide() and
similarly the cleanup is performed in newly introduced
kvmppc_cleanup_hostwide().
Signed-off-by: Vaibhav Jain
---
Changelog
v2->v3:
Removed a redundant branch in kvmppc_init_hostwide() [Gautam]
v1->v2:
* Added error handling to hostwide_fill_info() [Gautam]
---
arch/
n later patches
Signed-off-by: Vaibhav Jain
---
Changelog
v2->v3:
* Fixed a build warning reported by kernel build robot.
Link:
https://lore.kernel.org/oe-kbuild-all/202501171030.3x0gqw8g-...@intel.com
v1->v2:
* Fixed an issue of kvm-hv not loading on baremetal kvm [Gautam]
---
arch/po
3648 bytes
# test_gs_hostwide_counters: Guest Page-table Reclaim Size=0 bytes
ok 7 test_gs_hostwide_counters
# guest_state_buffer_test: pass:7 fail:0 skip:0 total:7
# Totals: pass:7 fail:0 skip:0 total:7
ok 1 guest_state_buffer_test
Signed-off-by: Vaibhav Jain
---
Changelog
v2->v3:
None
v1->v2
-...@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Madhavan Srinivasan
Cc: Nicholas Piggin
Signed-off-by: Vaibhav Jain
---
Changelog
v2->v3:
* Minor reword for the cumulative reclaim counter [ Gautam ]
v1->v2:
* Reworded section on GSID [Gautam]
---
Documentation/arch/powerpc/kvm-nest
rpc/kvm-nested.rst
Signed-off-by: Vaibhav Jain
---
Changelog
v2->v3:
None
v1->v2:
None
---
arch/powerpc/include/asm/guest-state-buffer.h | 35 ++---
arch/powerpc/include/asm/hvcall.h | 13 ---
arch/powerpc/kvm/book3s_hv_nestedv2.c | 6 +++
arch/powerpc/k
0'.
References
==
[1] - commit 19d31c5f1157 ("KVM: PPC: Add support for nestedv2 guests")
[2] - "KVM in a PowerVM LPAR: A Power user guide Part II"
https://ibm.biz/BdGHeY
[3] - https://lore.kernel.org/all/20250123115538.86821-1-vaib...@linux.ibm.com
[4] - http
Thanks for catching this build warning kernel-test-robot. I will
spin-off a v3 fixing this.
kernel test robot writes:
> Hi Vaibhav,
>
> kernel test robot noticed the following build warnings:
>
> [auto build test WARNING on powerpc/topic/ppc-kvm]
> [also build test WARNI
ble updated.
Second helper is kvmppc_pmu_event_update() which is called from
'kvmppv_pmu' callbacks and uses kvmppc_update_l0_stats() to update
'l0_stats' and the update the 'struct perf_event's event-counter.
Some minor updates to kvmppc_pmu_{add, del, read}() to remove some debug
scaff
-...@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Madhavan Srinivasan
Cc: Nicholas Piggin
Signed-off-by: Vaibhav Jain
---
Changelog
v1->v2:
* Reworded section on GSID [Gautam]
---
Documentation/arch/powerpc/kvm-nested.rst | 40 +--
1 file changed, 30 insertions(+),
vmppc_init_hostwide() and
similarly the cleanup is performed in newly introduced
kvmppc_cleanup_hostwide().
Signed-off-by: Vaibhav Jain
---
Changelog
v1->v2:
* Added error handling to hostwide_fill_info() [Gautam]
---
arch/powerpc/kvm/book3s_hv_pmu.c | 199 +++
1 file changed,
n later patches
Signed-off-by: Vaibhav Jain
---
Changelog
v1->v2:
* Fixed an issue of kvm-hv not loading on baremetal kvm [Gautam]
---
arch/powerpc/include/asm/kvm_book3s.h | 12 +++
arch/powerpc/kvm/Makefile | 6 ++
arch/powerpc/kvm/book3s_hv.c | 9 ++
arch/power
3648 bytes
# test_gs_hostwide_counters: Guest Page-table Reclaim Size=0 bytes
ok 7 test_gs_hostwide_counters
# guest_state_buffer_test: pass:7 fail:0 skip:0 total:7
# Totals: pass:7 fail:0 skip:0 total:7
ok 1 guest_state_buffer_test
Signed-off-by: Vaibhav Jain
---
arch/powerpc/kvm/test-guest-stat
rpc/kvm-nested.rst
Signed-off-by: Vaibhav Jain
---
arch/powerpc/include/asm/guest-state-buffer.h | 35 ++---
arch/powerpc/include/asm/hvcall.h | 13 ---
arch/powerpc/kvm/book3s_hv_nestedv2.c | 6 +++
arch/powerpc/kvm/guest-state-buffer.c | 39 ++
ported as '0'.
References
==
[1] - commit 19d31c5f1157 ("KVM: PPC: Add support for nestedv2 guests")
[2] - "KVM in a PowerVM LPAR: A Power user guide Part II"
https://ibm.biz/BdGHeY
[3] - https://lore.kernel.org/all/20250115070741.297944-1-vaib...@linux.
Hi Gautam,
Thanks for reviewing this patch. My responses to your review comments
inline below:
Gautam Menghani writes:
> On Sun, Dec 22, 2024 at 07:32:33PM +0530, Vaibhav Jain wrote:
>> Implement and setup necessary structures to send a prepolulated
>> Guest-State-Buffer(
Hi Gautam,
Thanks for reviewing this patch. My responses to your review comments
inline below:
Gautam Menghani writes:
> On Sun, Dec 22, 2024 at 07:32:32PM +0530, Vaibhav Jain wrote:
>> Introduce a new PMU named 'kvm-hv' to report Book3s kvm-hv specific
>> perfor
Hi Gautam,
Thanks for reviewing this patch. My responses to your review comments
inline below:
Gautam Menghani writes:
> On Sun, Dec 22, 2024 at 07:32:29PM +0530, Vaibhav Jain wrote:
>> Update kvm-nested APIv2 documentation to include five new
>> Guest-State-Elements to fet
ble updated.
Second helper is kvmppc_pmu_event_update() which is called from
'kvmppv_pmu' callbacks and uses kvmppc_update_l0_stats() to update
'l0_stats' and the update the 'struct perf_event's event-counter.
Some minor updates to kvmppc_pmu_{add, del, read}() to remove some debug
scaff
vmppc_init_hostwide() and
similarly the cleanup is performed in newly introduced
kvmppc_cleanup_hostwide().
Signed-off-by: Vaibhav Jain
---
arch/powerpc/kvm/book3s_hv_pmu.c | 189 +++
1 file changed, 189 insertions(+)
diff --git a/arch/powerpc/kvm/book3s_hv_pmu.c b/arch/powerpc/kv
n later patches
Signed-off-by: Vaibhav Jain
---
arch/powerpc/include/asm/kvm_book3s.h | 12 +++
arch/powerpc/kvm/Makefile | 6 ++
arch/powerpc/kvm/book3s_hv.c | 7 ++
arch/powerpc/kvm/book3s_hv_pmu.c | 133 ++
4 files changed, 158 insertio
3648 bytes
# test_gs_hostwide_counters: Guest Page-table Reclaim Size=0 bytes
ok 7 test_gs_hostwide_counters
# guest_state_buffer_test: pass:7 fail:0 skip:0 total:7
# Totals: pass:7 fail:0 skip:0 total:7
ok 1 guest_state_buffer_test
Signed-off-by: Vaibhav Jain
---
arch/powerpc/kvm/test-guest-stat
v/host_pagetable_max/
0 kvm-hv/host_pagetable_reclaim/
References
==
[1] - commit 19d31c5f1157 ("KVM: PPC: Add support for nestedv2 guests")
[2] - "KVM in a PowerVM LPAR: A Power user guide Part II"
https://ibm.biz/BdGHeY
Vaibhav Jain (6
rpc/kvm-nested.rst
Signed-off-by: Vaibhav Jain
---
arch/powerpc/include/asm/guest-state-buffer.h | 35 ++---
arch/powerpc/include/asm/hvcall.h | 13 ---
arch/powerpc/kvm/book3s_hv_nestedv2.c | 6 +++
arch/powerpc/kvm/guest-state-buffer.c | 39 ++
: Vaibhav Jain
---
Documentation/arch/powerpc/kvm-nested.rst | 40 ---
1 file changed, 29 insertions(+), 11 deletions(-)
diff --git a/Documentation/arch/powerpc/kvm-nested.rst
b/Documentation/arch/powerpc/kvm-nested.rst
index 5defd13cc6c1..c506192f3f98 100644
--- a/Documentation
; -result = EEH_STATE_MMIO_ACTIVE |
>> - EEH_STATE_DMA_ACTIVE;
>> +result = EEH_STATE_MMIO_ACTIVE |
>> + EEH_STATE_DMA_ACTIVE |
>> + EEH_STATE_MMIO_ENABLED |
>> + EEH_STATE_DMA_ENABLED;
>> break;
>> case 1:
>> result = EEH_STATE_RESET_ACTIVE |
>> --
>> 2.45.2
>
--
Cheers
~ Vaibhav
this, then following can be helpful in setting up the
environment:
https://github.com/iamjpn/kvm-powervm-test
> Thanks
>
> Michal
>
--
Cheers
~ Vaibhav
t;> +in_8(mapped);
>> +pci_write_config_word(pdev, pos, old);
>> +
>> +iounmap(mapped);
>> +
>> +return 0;
>> +}
>> +
>> +int eeh_pe_inject_mmio_error(struct pci_dev *pdev)
>> +{
>> +return eeh_break_device(pdev);
>> +}
>> +
>
> Why have an extra eeh_pe_inject_mmio_error() function which only calls
> eeh_break_device()?
>
> Maybe we can rename eeh_break_device() to eeh_mmio_break_device() and use
> this function itself at both call sites?
Fair suggestion,
However we want to keep the method debugfs interface uses
to inject EEH (thats ppc platform agonistic), decoupled from what pseries
uses. Right now to support as initial work VFIO EEH injection on
pseries, we are piggy backing on eeh_debugfs_break_device().
This will change in future as we add more capabilities to pseries EEH
injection and this will change working of eeh_pe_inject_mmio_error()
without impacting the semantics of existing eeh_break_device().
--
Cheers
~ Vaibhav
f_msi_remove,
> + .remove = fsl_of_msi_remove,
> };
Dont have any objections to changes in arch/powerpc/platforms/pseries/papr_scm.c
Reviewed-by: Vaibhav Jain
--
Cheers
~ Vaibhav
e changes LGTM, hence
Reviewed-by: Vaibhav Jain
> ---
>
> Testing:
>
> vfio-test [1] by Alex Willamson, was forked and updated to add
> support inject error on pSeries guest and used to test this
> patch[2].
>
> References:
> ===
> [1] https://git
in an overall ~4% improvement of arithoh[2] throughput.
[1] commit 180c6b072bf3 ("KVM: PPC: Book3S HV nestedv2: Do not cancel pending
decrementer exception")
[2] https://github.com/kdlucas/byte-unixbench/
Fixes: 180c6b072bf3 ("KVM: PPC: Book3S HV nestedv2: Do not cancel pe
ap to L1. From there the
value of this register is cached, made available in kvmhv_run_single_vcpu()
to compare it against host(L1) timebase and cancel the pending hypervisor
decrementer exception if needed.
Fixes: 180c6b072bf3 ("KVM: PPC: Book3S HV nestedv2: Do not cancel pending
decrementer
u_features`
getting cleared.
[1]
https://lore.kernel.org/all/20240207035220.339726-1-npig...@gmail.com
Hence,
Tested-by: Vaibhav Jain
--
Cheers
~ Vaibhav
ier, which is unused since commit
> 7d4703455168 ("powerpc/feature: Remove CPU_FTR_NODSISRALIGN").
>
> Signed-off-by: Nicholas Piggin
> ---
Tested this patch on a PP64-LE lpar with the patch[1] and seeing the
relevant pi-feature bit CPU_FTR_DBELL getting cleared.
[1]
https://lore.kernel.org/all/20240207035220.339726-2-npig...@gmail.com
Hence,
Tested-by: Vaibhav Jain
--
Cheers
~ Vaibhav
.
However you probably dont want this switch-case to fallthrough so please
use a 'break' instead.
> + default:
> + break;
> + }
> +
> + return cap;
> +}
> +
>
With the suggested change above
Reviewed-by: Vaibhav Jain
--
Cheers
~ Vaibhav
t_buff_info(gsb, KVMPPC_GSID_RUN_OUTPUT,
> + cfg->vcpu_run_output_cfg);
> if (rc < 0)
> return rc;
> }
> --
Thanks for catching this and the change looks good to me.
Reviewed-by: Vaibhav Jain
--
Cheers
~ Vaibhav
("KVM: PPC: Add support for nestedv2 guests")
Suggested-by: Michael Ellerman
Signed-off-by: Vaibhav Jain
---
arch/powerpc/include/asm/hvcall.h | 21 +++--
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/arch/powerpc/include/asm/hvcall.h
b/arch/powerpc/includ
I can do a follow up
patch later when we have a clarity on how we want to advertise support
for this hcall. For now current kernel supporting nestedv2 wont be
using this hcall assuming its not supported. Future kernels can use one
of the two ways above to set the firmware_has_feature flag to take
advantage of this hcall.
--
Cheers
~ Vaibhav
"Aneesh Kumar K.V" writes:
> Vaibhav Jain writes:
>
>> Hi Aneesh,
>>
>> Thanks for looking into this patch. My responses inline below:
>>
>> "Aneesh Kumar K.V (IBM)" writes:
>>
>>> Vaibhav Jain writes:
>>&g
return H_UNSUPPORTED;
>> +
>> /* Can't access quadrants 1 or 2 in non-HV mode, call the HV to do it */
>> if (kvmhv_on_pseries())
>> return plpar_hcall_norets(H_COPY_TOFROM_GUEST, lpid, pid, eaddr,
>> --
>> 2.42.0
--
Cheers
~ Vaibhav
Hi Aneesh,
Thanks for looking into this patch. My responses inline below:
"Aneesh Kumar K.V (IBM)" writes:
> Vaibhav Jain writes:
>
>> From: Jordan Niethe
>>
>> An L0 must invalidate the L2's RPT during H_GUEST_DELETE if this has not
>> alr
From: Jordan Niethe
Commit 709236039964 ("KVM: PPC: Reimplement non-SIMD LOAD/STORE
instruction mmio emulation with analyse_instr() input") and
commit 2b33cb585f94 ("KVM: PPC: Reimplement LOAD_FP/STORE_FP instruction
mmio emulation with analyse_instr() input") made
kvmppc_emulate_loadstore() use
From: Jordan Niethe
H_COPY_TOFROM_GUEST is part of the nestedv1 API and so should not be
called by a nestedv2 host. Do not attempt to call it.
Signed-off-by: Jordan Niethe
---
arch/powerpc/kvm/book3s_64_mmu_radix.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/powerpc/kvm/book3s_
From: Jordan Niethe
In the nestedv2 case, if there is a pending decrementer exception, the
L1 must get the L2's timebase from the L0 to see if the exception should
be cancelled. This adds the overhead of a H_GUEST_GET_STATE call to the
likely case in which the decrementer should not be cancelled.
From: Jordan Niethe
The check for a hcall coming from userspace is done for KVM-PR. This is
not supported for nestedv2 and the L0 will directly inject the necessary
exception to the L2 if userspace performs a hcall. Avoid checking the
MSR and thus avoid a H_GUEST_GET_STATE hcall in the L1.
Signe
From: Jordan Niethe
In the nestedv2 case, the L1 may register the L2's VPA with the L0. This
allows the L0 to manage the L2's dispatch count, as well as enable
possible performance optimisations by seeing if certain resources are
not being used by the L2 (such as the PMCs).
Use the H_GUEST_SET_S
From: Jordan Niethe
The msr check in kvmppc_handle_exit_hv() is not needed for nestedv2 hosts,
skip the check to avoid a H_GUEST_GET_STATE hcall.
Signed-off-by: Jordan Niethe
---
arch/powerpc/kvm/book3s_hv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/kvm/b
From: Jordan Niethe
kvmhv_copy_tofrom_guest_radix() gets the PID at the start of the
function. If pid is not used, then this is a wasteful H_GUEST_GET_STATE
hcall for nestedv2 hosts. Move the assignment to where pid will be used.
Suggested-by: Nicholas Piggin
Signed-off-by: Jordan Niethe
---
From: Jordan Niethe
There is no need to inject an external interrupt in
kvmppc_book3s_irqprio_deliver() as the test for BOOK3S_IRQPRIO_EXTERNAL
in kvmhv_run_single_vcpu() before guest entry will raise LPCR_MER if
needed. There is also no need to inject the decrementer interrupt as
this will be ra
From: vaibhav
This patch series introduces series of performance improvements to recently
added support for Nested APIv2 PPC64 Guests via [1]. Details for Nested
APIv2 for PPC64 Guests is available in Documentation/powerpc/kvm-nested.rst.
This patch series introduces various optimizations for
From: Nicholas Piggin
Commit 026728dc5d41 ("KVM: PPC: Book3S HV P9: Inject pending xive
interrupts at guest entry") changed guest entry so that if external
interrupts are enabled, BOOK3S_IRQPRIO_EXTERNAL is not tested for. Test
for this regardless of MSR_EE.
For an L1 host, do not inject an inte
From: Jordan Niethe
LPCR_MER is conditionally set during entry to a guest if there is a
pending external interrupt. In the nestedv2 case, this change is not
being communicated to the L0, which means it is not being set in the L2.
Ensure the updated LPCR value is passed to the L0.
Signed-off-by:
From: Jordan Niethe
An L0 must invalidate the L2's RPT during H_GUEST_DELETE if this has not
already been done. This is a slow operation that means H_GUEST_DELETE
must return H_BUSY multiple times before completing. Invalidating the
tables before deleting the guest so there is less work for the L
From: Jordan Niethe
The kvmppc_get_tb_offset() getter reloads KVMPPC_GSID_TB_OFFSET from the
L0 for nestedv2 host. This is unnecessary as the value does not change.
KVMPPC_GSID_TB_OFFSET also need not be reloaded in
kvmppc_{s,g}et_dec_expires().
Signed-off-by: Jordan Niethe
---
arch/powerpc/in
Thanks for looking at this patch Mpe.
Michael Ellerman writes:
> Vaibhav Jain writes:
>> This minor patch enables config option GENERIC_IDLE_POLL_SETUP for arch
>> powerpc. This should add support for kernel param 'nohlt'.
>
> Which is named after an 8086 instru
CPU to an idle-loop similar to what cpu_idle_poll() does. Hence this
patch also updates the handling of 'powersave=off' kernel param to enable
generic cpu idle-loop if its enabled.
Signed-off-by: Vaibhav Jain
---
Changelog:
Since v1:
https://lore.kernel.org/all/20230818050739.827851-1-v
CPU to an idle-loop similar to what cpu_idle_poll() does. This
patch however makes powerpc kernel-parameters better aligned to the
generic boot-time parameters.
Signed-off-by: Vaibhav Jain
---
Documentation/admin-guide/kernel-parameters.txt | 2 +-
arch/powerpc/Kconfig|
Remove function papr_scm_pmu_check_events() and replace the
> event checks in papr_scm_pmu_register() function with p->stat_buffer_len
> as suggested by Vaibhav Jain
> Link to the patch v2:
> https://lore.kernel.org/all/20220711034605.212683-1-kj...@linux.ibm.com/
V3 patch looks good to me.
Reviewed-by: Vaibhav Jain
--
Cheers
~ Vaibhav
vents map you dont really need to call
drc_pmem_query_stats() as that would have been already being done once
in papr_scm_probe() before papr_scm_pmu_register() is called:
papr_scm_probe()
{
...
/* Try retrieving the stat buffer and see if its supported */
stat_size = drc_pmem_query_stats(p, NULL, 0);
...
papr_scm_pmu_register(p);
...
}
I would suggest replacing single callsite of papr_scm_pmu_check_events()
with the check
if (!p->stat_buffer_len)
goto pmu_check_events_err;
--
Cheers
~ Vaibhav
Thanks for looking into this patch Rob,
I have addressed your review comment in v3 of the patch posted at
https://lore.kernel.org/all/20220531041446.3334259-1-vaib...@linux.ibm.com/
--
Cheers
~ Vaibhav
nsure correct memory bounds.
Fixes: 467d27824920 ("powerpc: ima: get the kexec buffer passed by the previous
kernel")
Cc: Frank Rowand
Cc: Prakhar Srivastava
Cc: Lakshmi Ramasubramanian
Cc: Thiago Jung Bauermann
Cc: Rob Herring
Cc: Ritesh Harjani
Cc: Robin Murphy
Signed-off-by: Vaibha
Hi Ritesh,
thanks for looking into this patch,
Ritesh Harjani writes:
> Just a minor nit which I noticed.
>
> On 22/05/24 11:20AM, Vaibhav Jain wrote:
>> Presently ima_get_kexec_buffer() doesn't check if the previous kernel's
>> ima-kexec-buffer lies outside the
000 ]---
> [ 10.951576]
> [ 11.951579] Kernel panic - not syncing: Fatal exception
>
> Following patch seems to be the cause for this regression.
> commit 8b8fb1355917
> powerpc/papr_scm: Fix leaking nvdimm_events_map elements
>
> Reverting this patch helps to boot the kernel.
>
> This crash is only seen with following option disabled(profile) for the said
> LPAR
> Enable Performance Information Collection
>
> - Sachin
--
Cheers
~ Vaibhav
introducing the check for 'p->stat_buffer_len' at the beginning of
papr_scm_pmu_check_events().
[1]
https://lore.kernel.org/all/6b3a522a-6a5f-4cc9-b268-0c63aa6e0...@linux.ibm.com
Fixes: 0e0946e22f3665d2732 ("powerpc/papr_scm: Fix leaking nvdimm_events_map
elements")
Reported-by: S
v2 with the updated Fixes tag and also changes as
suggested by Mpe and Rob at
https://lore.kernel.org/all/20220524055042.1527968-1-vaib...@linux.ibm.com/
--
Cheers
~ Vaibhav
nsure correct memory bounds.
Fixes: 467d27824920 ("powerpc: ima: get the kexec buffer passed by the previous
kernel")
Cc: Frank Rowand
Cc: Prakhar Srivastava
Cc: Lakshmi Ramasubramanian
Cc: Thiago Jung Bauermann
Cc: Rob Herring
Signed-off-by: Vaibhav Jain
---
Changelog
==
v2:
Rob Herring writes:
> On Thu, May 19, 2022 at 01:35:47AM +0530, Vaibhav Jain wrote:
>> Presently ima_get_kexec_buffer() doesn't check if the previous kernel's
>> ima-kexec-buffer lies outside the addressable memory range. This can result
>> in a kernel panic if the
27;s memory bounds.
Fixes: fee3ff99bc67("powerpc: Move arch independent ima kexec functions to
drivers/of/kexec.c")
Cc: Frank Rowand
Cc: Prakhar Srivastava
Cc: Lakshmi Ramasubramanian
Cc: Thiago Jung Bauermann
Cc: Rob Herring
Signed-off-by: Vaibhav Jain
---
drivers/of/kexec.c | 7
27;nvdimm_events_map' to 'stat_id'. Also rest of the code
can continue to call 'kfree(papr_scm_priv.nvdimm_events_map)' without needing to
iterate over the array and free up individual elements.
Fixes: 4c08d4bbc089 ("powerpc/papr_scm: Add perf interface support")
Signed-off-by: Vaibhav Jai
Thanks for reviewing this patch Aneesh,
"Aneesh Kumar K.V" writes:
> Vaibhav Jain writes:
>
>> Right now 'char *' elements allocated individual 'stat_id' in
>> 'papr_scm_priv.nvdimm_events_map' during papr_scm_pmu_check_event
x27;stat_id'. Also rest of the code
can continue to call 'kfree(papr_scm_priv.nvdimm_events_map)' without needing to
iterate over the array and free up individual elements.
Also introduce a new typedef called 'state_id_t' thats a 'u8[8]' and can be used
across papr_scm t
t]) {
> rc = -ENOMEM;
> goto out_nvdimm_events_map;
> }
>
> - strcpy(statid, stat->stat_id);
> - p->nvdimm_events_map[count] = statid;
> count++;
> }
> p->nvdimm_events_map[count] = NULL;
> --
> 2.31.1
>
--
Cheers
~ Vaibhav
oid papr_scm_pmu_register(struct papr_scm_priv *p) { }
>
> Since this isn't in a header file, it does not need to be marked
> "inline" the compiler will figure it out.
>
>> +#endif
>
> It might be time to create:
>
> arch/powerpc/platforms/pseries/papr_scm.h
>
> ...there is quite a bit of header material accrued in papr_scm.c and
> once the ifdefs start landing in it then it becomes a nominal coding
> style issue. That said, this is certainly more palatable than the
> previous version. So if you don't want to create papr_scm.h yet for
> this, at least make a note in the changelog that the first portion of
> arch/powerpc/platforms/pseries/papr_scm.c is effectively papr_scm.h
> content and may move there in the future, or something like that.
Great suggestion Dan and incidently we are already working on a patchset
to reconcile this by moving a bunch of these defines from papr_scm.c to a
header. That work is primarily done to towards remove the redundancy
between papr_scm and generic ndtest module that we have today. We will
post the patches in next few days.
--
Cheers
~ Vaibhav
1 - 100 of 548 matches
Mail list logo