Re: [PATCH] KVM: PPC: Book3S HV: Fix IRQ map warnings with XICS on pSeries KVM Guest

2025-05-05 Thread Vaibhav Jain
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(

[RESEND PATCH v5 6/6] powerpc/kvm-hv-pmu: Add perf-events for Hostwide counters

2025-04-18 Thread Vaibhav Jain
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

[RESEND PATCH v5 2/6] kvm powerpc/book3s-apiv2: Add support for Hostwide GSB elements

2025-04-16 Thread Vaibhav Jain
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

[RESEND PATCH v5 4/6] kvm powerpc/book3s-apiv2: Introduce kvm-hv specific PMU

2025-04-16 Thread Vaibhav Jain
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

[RESEND PATCH v5 5/6] powerpc/kvm-hv-pmu: Implement GSB message-ops for hostwide counters

2025-04-16 Thread Vaibhav Jain
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: *

[RESEND PATCH v5 3/6] kvm powerpc/book3s-apiv2: Add kunit tests for Hostwide GSB elements

2025-04-16 Thread Vaibhav Jain
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

[RESEND PATCH v5 1/6] powerpc: Document APIv2 KVM hcall spec for Hostwide counters

2025-04-16 Thread Vaibhav Jain
-...@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

[RESEND PATCH v5 0/6] kvm powerpc/book3s-hv: Expose Hostwide counters as perf-events

2025-04-16 Thread Vaibhav Jain
("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

[PATCH v5 6/6] powerpc/kvm-hv-pmu: Add perf-events for Hostwide counters

2025-03-17 Thread Vaibhav Jain
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

[PATCH v5 5/6] powerpc/kvm-hv-pmu: Implement GSB message-ops for hostwide counters

2025-03-17 Thread Vaibhav Jain
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

[PATCH v5 4/6] kvm powerpc/book3s-apiv2: Introduce kvm-hv specific PMU

2025-03-17 Thread Vaibhav Jain
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

[PATCH v5 2/6] kvm powerpc/book3s-apiv2: Add support for Hostwide GSB elements

2025-03-17 Thread Vaibhav Jain
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.

[PATCH v5 3/6] kvm powerpc/book3s-apiv2: Add kunit tests for Hostwide GSB elements

2025-03-17 Thread Vaibhav Jain
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:

[PATCH v5 0/6] kvm powerpc/book3s-hv: Expose Hostwide counters as perf-events

2025-03-17 Thread Vaibhav Jain
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

[PATCH v5 1/6] powerpc: Document APIv2 KVM hcall spec for Hostwide counters

2025-03-17 Thread Vaibhav Jain
-...@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

Re: [PATCH] powerpc/pseries/msi: Avoid reading PCI device registers in reduced power states

2025-03-15 Thread Vaibhav Jain
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

Re: [PATCH v4 6/6] powerpc/kvm-hv-pmu: Add perf-events for Hostwide counters

2025-03-11 Thread Vaibhav Jain
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

Re: [PATCH v4 4/6] kvm powerpc/book3s-apiv2: Introduce kvm-hv specific PMU

2025-03-10 Thread Vaibhav Jain
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

[PATCH v4 0/6] kvm powerpc/book3s-hv: Expose Hostwide counters as perf-events

2025-02-24 Thread Vaibhav Jain
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"

[PATCH v4 2/6] kvm powerpc/book3s-apiv2: Add support for Hostwide GSB elements

2025-02-24 Thread Vaibhav Jain
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

[PATCH v4 6/6] powerpc/kvm-hv-pmu: Add perf-events for Hostwide counters

2025-02-24 Thread Vaibhav Jain
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

[PATCH v4 5/6] powerpc/kvm-hv-pmu: Implement GSB message-ops for hostwide counters

2025-02-24 Thread Vaibhav Jain
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_

[PATCH v4 4/6] kvm powerpc/book3s-apiv2: Introduce kvm-hv specific PMU

2025-02-24 Thread Vaibhav Jain
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

[PATCH v4 3/6] kvm powerpc/book3s-apiv2: Add kunit tests for Hostwide GSB elements

2025-02-24 Thread Vaibhav Jain
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

[PATCH v4 1/6] powerpc: Document APIv2 KVM hcall spec for Hostwide counters

2025-02-24 Thread Vaibhav Jain
-...@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: *

[PATCH] powerpc/perf: Fix ref-counting on the PMU 'vpa_pmu'

2025-02-04 Thread Vaibhav Jain
: 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 ---

Re: [PATCH v3 4/6] kvm powerpc/book3s-apiv2: Introduce kvm-hv specific PMU

2025-01-26 Thread Vaibhav Jain
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

[PATCH v3 6/6] kvm powerpc/book3s-hv-pmu: Add perf-events for Hostwide counters

2025-01-23 Thread Vaibhav Jain
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

[PATCH v3 5/6] powerpc/book3s-hv-pmu: Implement GSB message-ops for hostwide counters

2025-01-23 Thread Vaibhav Jain
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/

[PATCH v3 4/6] kvm powerpc/book3s-apiv2: Introduce kvm-hv specific PMU

2025-01-23 Thread Vaibhav Jain
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

[PATCH v3 3/6] kvm powerpc/book3s-apiv2: Add kunit tests for Hostwide GSB elements

2025-01-23 Thread Vaibhav Jain
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

[PATCH v3 1/6] powerpc: Document APIv2 KVM hcall spec for Hostwide counters

2025-01-23 Thread Vaibhav Jain
-...@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

[PATCH v3 2/6] kvm powerpc/book3s-apiv2: Add support for Hostwide GSB elements

2025-01-23 Thread Vaibhav Jain
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

[PATCH v3 0/6] kvm powerpc/book3s-hv: Expose Hostwide counters as perf-events

2025-01-23 Thread Vaibhav Jain
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

Re: [PATCH v2 4/6] kvm powerpc/book3s-apiv2: Introduce kvm-hv specific PMU

2025-01-17 Thread Vaibhav Jain
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

[PATCH v2 6/6] kvm powerpc/book3s-hv-pmu: Add perf-events for Hostwide counters

2025-01-15 Thread Vaibhav Jain
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

[PATCH v2 1/6] powerpc: Document APIv2 KVM hcall spec for Hostwide counters

2025-01-15 Thread Vaibhav Jain
-...@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(+),

[PATCH v2 5/6] powerpc/book3s-hv-pmu: Implement GSB message-ops for hostwide counters

2025-01-15 Thread Vaibhav Jain
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,

[PATCH v2 4/6] kvm powerpc/book3s-apiv2: Introduce kvm-hv specific PMU

2025-01-15 Thread Vaibhav Jain
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

[PATCH v2 3/6] kvm powerpc/book3s-apiv2: Add kunit tests for Hostwide GSB elements

2025-01-15 Thread Vaibhav Jain
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

[PATCH v2 2/6] kvm powerpc/book3s-apiv2: Add support for Hostwide GSB elements

2025-01-15 Thread Vaibhav Jain
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 ++

[PATCH v2 0/5] kvm powerpc/book3s-hv: Expose Hostwide counters as perf-events

2025-01-15 Thread Vaibhav Jain
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.

Re: [PATCH 5/6] powerpc/book3s-hv-pmu: Implement GSB message-ops for hostwide counters

2025-01-06 Thread Vaibhav Jain
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(

Re: [PATCH 4/6] kvm powerpc/book3s-apiv2: Introduce kvm-hv specific PMU

2025-01-06 Thread Vaibhav Jain
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

Re: [PATCH 1/6] [DOC] powerpc: Document APIv2 KVM hcall spec for Hostwide counters

2025-01-06 Thread Vaibhav Jain
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

[PATCH 6/6] kvm powerpc/book3s-hv-pmu: Add perf-events for Hostwide counters

2024-12-22 Thread Vaibhav Jain
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

[PATCH 5/6] powerpc/book3s-hv-pmu: Implement GSB message-ops for hostwide counters

2024-12-22 Thread Vaibhav Jain
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

[PATCH 4/6] kvm powerpc/book3s-apiv2: Introduce kvm-hv specific PMU

2024-12-22 Thread Vaibhav Jain
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

[PATCH 3/6] kvm powerpc/book3s-apiv2: Add kunit tests for Hostwide GSB elements

2024-12-22 Thread Vaibhav Jain
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

[PATCH 0/6] kvm powerpc/book3s-hv: Expose Hostwide counters as perf-events

2024-12-22 Thread Vaibhav Jain
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

[PATCH 2/6] kvm powerpc/book3s-apiv2: Add support for Hostwide GSB elements

2024-12-22 Thread Vaibhav Jain
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 ++

[PATCH 1/6] [DOC] powerpc: Document APIv2 KVM hcall spec for Hostwide counters

2024-12-22 Thread Vaibhav Jain
: 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

Re: [PATCH] powerpc/pseries/eeh: Fix get PE state translation

2024-11-20 Thread Vaibhav Jain
; -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

Re: [PATCH v5 00/11] KVM: PPC: Nested APIv2 guest support

2024-09-25 Thread Vaibhav Jain
this, then following can be helpful in setting up the environment: https://github.com/iamjpn/kvm-powervm-test > Thanks > > Michal > -- Cheers ~ Vaibhav

Re: [PATCH] powerpc/pseries/eeh: move pseries_eeh_err_inject() outside CONFIG_DEBUG_FS block

2024-09-19 Thread Vaibhav Jain
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

Re: [PATCH] powerpc: Switch back to struct platform_driver::remove()

2024-09-11 Thread Vaibhav Jain
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

Re: [PATCH v2] powerpc/pseries/eeh: Fix pseries_eeh_err_inject

2024-08-26 Thread Vaibhav Jain
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

[PATCH v2] KVM: PPC: Book3S HV nestedv2: Cancel pending DEC exception

2024-04-14 Thread Vaibhav Jain
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

[PATCH] KVM: PPC: Book3S HV nestedv2: Cancel pending HDEC exception

2024-03-13 Thread Vaibhav Jain
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

Re: [PATCH 2/2] powerpc/pseries: Set CPU_FTR_DBELL according to ibm,pi-features

2024-02-07 Thread Vaibhav Jain
u_features` getting cleared. [1] https://lore.kernel.org/all/20240207035220.339726-1-npig...@gmail.com Hence, Tested-by: Vaibhav Jain -- Cheers ~ Vaibhav

Re: [PATCH 1/2] powerpc/pseries: Add a clear modifier to ibm,pa/pi-features parser

2024-02-07 Thread Vaibhav Jain
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

Re: [PATCH v2] KVM: PPC: Book3S HV: Fix L2 guest reboot failure due to empty 'arch_compat'

2024-02-05 Thread Vaibhav Jain
. 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

Re: [PATCH] KVM: PPC: Book3S HV nestedv2: Fix an error handling path in gs_msg_ops_kvmhv_nestedv2_config_fill_info()

2024-01-28 Thread Vaibhav Jain
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

[PATCH] powerpc/hvcall: Reorder Nestedv2 hcall opcodes

2023-12-19 Thread Vaibhav Jain
("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

Re: [PATCH 09/12] KVM: PPC: Book3S HV nestedv2: Do not call H_COPY_TOFROM_GUEST

2023-12-17 Thread Vaibhav Jain
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

Re: [PATCH 01/12] KVM: PPC: Book3S HV nestedv2: Invalidate RPT before deleting a guest

2023-12-17 Thread Vaibhav Jain
"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

Re: [PATCH 09/12] KVM: PPC: Book3S HV nestedv2: Do not call H_COPY_TOFROM_GUEST

2023-12-10 Thread Vaibhav Jain
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

Re: [PATCH 01/12] KVM: PPC: Book3S HV nestedv2: Invalidate RPT before deleting a guest

2023-12-08 Thread Vaibhav Jain
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

[PATCH 11/12] KVM: PPC: Reduce reliance on analyse_instr() in mmio emulation

2023-12-01 Thread Vaibhav Jain
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

[PATCH 09/12] KVM: PPC: Book3S HV nestedv2: Do not call H_COPY_TOFROM_GUEST

2023-12-01 Thread Vaibhav Jain
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_

[PATCH 12/12] KVM: PPC: Book3S HV nestedv2: Do not cancel pending decrementer exception

2023-12-01 Thread Vaibhav Jain
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.

[PATCH 03/12] KVM: PPC: Book3S HV nestedv2: Do not check msr on hcalls

2023-12-01 Thread Vaibhav Jain
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

[PATCH 10/12] KVM: PPC: Book3S HV nestedv2: Register the VPA with the L0

2023-12-01 Thread Vaibhav Jain
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

[PATCH 08/12] KVM: PPC: Book3S HV nestedv2: Avoid msr check in kvmppc_handle_exit_hv()

2023-12-01 Thread Vaibhav Jain
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

[PATCH 04/12] KVM: PPC: Book3S HV nestedv2: Get the PID only if needed to copy tofrom a guest

2023-12-01 Thread Vaibhav Jain
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 ---

[PATCH 07/12] KVM: PPC: Book3S HV nestedv2: Do not inject certain interrupts

2023-12-01 Thread Vaibhav Jain
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

[PATCH 00/12] KVM: PPC: Nested APIv2 : Performance improvements

2023-12-01 Thread Vaibhav Jain
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

[PATCH 06/12] KVM: PPC: Book3S HV: Handle pending exceptions on guest entry with MSR_EE

2023-12-01 Thread Vaibhav Jain
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

[PATCH 05/12] KVM: PPC: Book3S HV nestedv2: Ensure LPCR_MER bit is passed to the L0

2023-12-01 Thread Vaibhav Jain
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:

[PATCH 01/12] KVM: PPC: Book3S HV nestedv2: Invalidate RPT before deleting a guest

2023-12-01 Thread Vaibhav Jain
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

[PATCH 02/12] KVM: PPC: Book3S HV nestedv2: Avoid reloading the tb offset

2023-12-01 Thread Vaibhav Jain
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

Re: [PATCH] powerpc: Enable generic cpu idle-loop

2023-08-20 Thread Vaibhav Jain
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

[PATCH v2] powerpc: Enable generic cpu idle-loop

2023-08-20 Thread Vaibhav Jain
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

[PATCH] powerpc: Enable generic cpu idle-loop

2023-08-17 Thread Vaibhav Jain
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|

Re: [PATCH v3] powerpc/papr_scm: Fix nvdimm event mappings

2022-08-04 Thread Vaibhav Jain
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

Re: [PATCH v2] powerpc/papr_scm: Fix nvdimm event mappings

2022-07-11 Thread Vaibhav Jain
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

Re: [PATCH v2] of: check previous kernel's ima-kexec-buffer against memory bounds

2022-05-30 Thread Vaibhav Jain
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

[PATCH v3] of: check previous kernel's ima-kexec-buffer against memory bounds

2022-05-30 Thread Vaibhav Jain
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

Re: [PATCH v2] of: check previous kernel's ima-kexec-buffer against memory bounds

2022-05-25 Thread Vaibhav Jain
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

Re: [powerpc] linux-next 20220520 boot failure (drc_pmem_query_stats)

2022-05-24 Thread Vaibhav Jain
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

[PATCH] powerpc/papr_scm: don't requests stats with '0' sized stats buffer

2022-05-24 Thread Vaibhav Jain
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

Re: [PATCH] powerpc: check previous kernel's ima-kexec-buffer against memory bounds

2022-05-23 Thread Vaibhav Jain
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

[PATCH v2] of: check previous kernel's ima-kexec-buffer against memory bounds

2022-05-23 Thread Vaibhav Jain
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:

Re: [PATCH] powerpc: check previous kernel's ima-kexec-buffer against memory bounds

2022-05-22 Thread Vaibhav Jain
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

[PATCH] powerpc: check previous kernel's ima-kexec-buffer against memory bounds

2022-05-18 Thread Vaibhav Jain
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

[PATCH v2] powerpc/papr_scm: Fix leaking nvdimm_events_map elements

2022-05-11 Thread Vaibhav Jain
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

Re: [PATCH] powerpc/papr_scm: Fix leaking nvdimm_events_map elements

2022-05-11 Thread Vaibhav Jain
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

[PATCH] powerpc/papr_scm: Fix leaking nvdimm_events_map elements

2022-05-08 Thread Vaibhav Jain
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

Re: [PATCH] powerpc/papr_scm: Fix buffer overflow issue with CONFIG_FORTIFY_SOURCE

2022-05-06 Thread Vaibhav Jain
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

Re: [PATCH 2/2] powerpc/papr_scm: Fix build failure when CONFIG_PERF_EVENTS is not set

2022-03-23 Thread Vaibhav Jain
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   2   3   4   5   6   >