* [PATCH] KVM: PPC: BookE: Use vcpu_err() instead of printk() in kvmppc_dump_vcpu()
@ 2026-08-07 8:40 Gaurav Yadav
2026-11-12 9:45 ` Gaurav Yadav
2026-11-15 3:42 ` Ritesh Harjani
0 siblings, 2 replies; 3+ messages in thread
From: Gaurav Yadav @ 2026-08-07 8:40 UTC (permalink / raw)
To: Madhavan Srinivasan, Michael Ellerman
Cc: Nicholas Piggin, Christophe Leroy, linuxppc-dev, kvm,
linux-kernel, Gaurav Yadav
Replace generic printk() calls in kvmppc_dump_vcpu() with vcpu_err()
and remove the corresponding TODO comment.
Using vcpu_err() provides vCPU-aware logging context, making it easier
to associate register dumps with specific vCPU instances in logs.
Signed-off-by: Gaurav Yadav <yadavgaurav386@gmail.com>
---
arch/powerpc/kvm/booke.c | 25 ++++++++++++-------------
1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
index f3ddb24ece74..23159eb5f5af 100644
--- a/arch/powerpc/kvm/booke.c
+++ b/arch/powerpc/kvm/booke.c
@@ -86,26 +86,25 @@ const struct kvm_stats_header kvm_vcpu_stats_header = {
sizeof(kvm_vcpu_stats_desc),
};
-/* TODO: use vcpu_printf() */
void kvmppc_dump_vcpu(struct kvm_vcpu *vcpu)
{
int i;
- printk("pc: %08lx msr: %08llx\n", vcpu->arch.regs.nip,
- vcpu->arch.shared->msr);
- printk("lr: %08lx ctr: %08lx\n", vcpu->arch.regs.link,
- vcpu->arch.regs.ctr);
- printk("srr0: %08llx srr1: %08llx\n", vcpu->arch.shared->srr0,
- vcpu->arch.shared->srr1);
+ vcpu_err(vcpu, "pc: %08lx msr: %08llx\n", vcpu->arch.regs.nip,
+ vcpu->arch.shared->msr);
+ vcpu_err(vcpu, "lr: %08lx ctr: %08lx\n", vcpu->arch.regs.link,
+ vcpu->arch.regs.ctr);
+ vcpu_err(vcpu, "srr0: %08llx srr1: %08llx\n", vcpu->arch.shared->srr0,
+ vcpu->arch.shared->srr1);
- printk("exceptions: %08lx\n", vcpu->arch.pending_exceptions);
+ vcpu_err(vcpu, "exceptions: %08lx\n", vcpu->arch.pending_exceptions);
for (i = 0; i < 32; i += 4) {
- printk("gpr%02d: %08lx %08lx %08lx %08lx\n", i,
- kvmppc_get_gpr(vcpu, i),
- kvmppc_get_gpr(vcpu, i+1),
- kvmppc_get_gpr(vcpu, i+2),
- kvmppc_get_gpr(vcpu, i+3));
+ vcpu_err(vcpu, "gpr%02d: %08lx %08lx %08lx %08lx\n", i,
+ kvmppc_get_gpr(vcpu, i),
+ kvmppc_get_gpr(vcpu, i+1),
+ kvmppc_get_gpr(vcpu, i+2),
+ kvmppc_get_gpr(vcpu, i+3));
}
}
--
2.54.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] KVM: PPC: BookE: Use vcpu_err() instead of printk() in kvmppc_dump_vcpu()
2026-08-07 8:40 [PATCH] KVM: PPC: BookE: Use vcpu_err() instead of printk() in kvmppc_dump_vcpu() Gaurav Yadav
@ 2026-11-12 9:45 ` Gaurav Yadav
2026-11-15 3:42 ` Ritesh Harjani
1 sibling, 0 replies; 3+ messages in thread
From: Gaurav Yadav @ 2026-11-12 9:45 UTC (permalink / raw)
To: Madhavan Srinivasan, Michael Ellerman
Cc: Nicholas Piggin, Christophe Leroy, linuxppc-dev, kvm,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 2636 bytes --]
A gentle reminder: please take a look.
On Fri, Aug 7, 2026 at 2:11 PM Gaurav Yadav <yadavgaurav386@gmail.com>
wrote:
> Replace generic printk() calls in kvmppc_dump_vcpu() with vcpu_err()
> and remove the corresponding TODO comment.
>
> Using vcpu_err() provides vCPU-aware logging context, making it easier
> to associate register dumps with specific vCPU instances in logs.
>
> Signed-off-by: Gaurav Yadav <yadavgaurav386@gmail.com>
> ---
> arch/powerpc/kvm/booke.c | 25 ++++++++++++-------------
> 1 file changed, 12 insertions(+), 13 deletions(-)
>
> diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
> index f3ddb24ece74..23159eb5f5af 100644
> --- a/arch/powerpc/kvm/booke.c
> +++ b/arch/powerpc/kvm/booke.c
> @@ -86,26 +86,25 @@ const struct kvm_stats_header kvm_vcpu_stats_header = {
> sizeof(kvm_vcpu_stats_desc),
> };
>
> -/* TODO: use vcpu_printf() */
> void kvmppc_dump_vcpu(struct kvm_vcpu *vcpu)
> {
> int i;
>
> - printk("pc: %08lx msr: %08llx\n", vcpu->arch.regs.nip,
> - vcpu->arch.shared->msr);
> - printk("lr: %08lx ctr: %08lx\n", vcpu->arch.regs.link,
> - vcpu->arch.regs.ctr);
> - printk("srr0: %08llx srr1: %08llx\n", vcpu->arch.shared->srr0,
> - vcpu->arch.shared->srr1);
> + vcpu_err(vcpu, "pc: %08lx msr: %08llx\n", vcpu->arch.regs.nip,
> + vcpu->arch.shared->msr);
> + vcpu_err(vcpu, "lr: %08lx ctr: %08lx\n", vcpu->arch.regs.link,
> + vcpu->arch.regs.ctr);
> + vcpu_err(vcpu, "srr0: %08llx srr1: %08llx\n",
> vcpu->arch.shared->srr0,
> + vcpu->arch.shared->srr1);
>
> - printk("exceptions: %08lx\n", vcpu->arch.pending_exceptions);
> + vcpu_err(vcpu, "exceptions: %08lx\n",
> vcpu->arch.pending_exceptions);
>
> for (i = 0; i < 32; i += 4) {
> - printk("gpr%02d: %08lx %08lx %08lx %08lx\n", i,
> - kvmppc_get_gpr(vcpu, i),
> - kvmppc_get_gpr(vcpu, i+1),
> - kvmppc_get_gpr(vcpu, i+2),
> - kvmppc_get_gpr(vcpu, i+3));
> + vcpu_err(vcpu, "gpr%02d: %08lx %08lx %08lx %08lx\n", i,
> + kvmppc_get_gpr(vcpu, i),
> + kvmppc_get_gpr(vcpu, i+1),
> + kvmppc_get_gpr(vcpu, i+2),
> + kvmppc_get_gpr(vcpu, i+3));
> }
> }
>
> --
> 2.54.0
>
>
--
With Regards
Gaurav Yadav
+919310150558
[-- Attachment #2: Type: text/html, Size: 3822 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] KVM: PPC: BookE: Use vcpu_err() instead of printk() in kvmppc_dump_vcpu()
2026-08-07 8:40 [PATCH] KVM: PPC: BookE: Use vcpu_err() instead of printk() in kvmppc_dump_vcpu() Gaurav Yadav
2026-11-12 9:45 ` Gaurav Yadav
@ 2026-11-15 3:42 ` Ritesh Harjani
1 sibling, 0 replies; 3+ messages in thread
From: Ritesh Harjani @ 2026-11-15 3:42 UTC (permalink / raw)
To: Gaurav Yadav, Madhavan Srinivasan, Michael Ellerman
Cc: Nicholas Piggin, Christophe Leroy, linuxppc-dev, kvm,
linux-kernel, Gaurav Yadav
Gaurav Yadav <yadavgaurav386@gmail.com> writes:
> Replace generic printk() calls in kvmppc_dump_vcpu() with vcpu_err()
> and remove the corresponding TODO comment.
>
> Using vcpu_err() provides vCPU-aware logging context, making it easier
> to associate register dumps with specific vCPU instances in logs.
>
> Signed-off-by: Gaurav Yadav <yadavgaurav386@gmail.com>
> ---
> arch/powerpc/kvm/booke.c | 25 ++++++++++++-------------
> 1 file changed, 12 insertions(+), 13 deletions(-)
Fair enough, this will print vcpu_id as an additional info here.
Looks good to me. Please feel free to add:
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-15 3:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-07 8:40 [PATCH] KVM: PPC: BookE: Use vcpu_err() instead of printk() in kvmppc_dump_vcpu() Gaurav Yadav
2026-11-12 9:45 ` Gaurav Yadav
2026-11-15 3:42 ` Ritesh Harjani
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.