linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: Fabiano Rosas <farosas@linux.ibm.com>, kvm-ppc@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org, npiggin@gmail.com
Subject: Re: [PATCH v2 3/7] KVM: PPC: Fix mmio length message
Date: Fri, 7 Jan 2022 11:19:56 +1100	[thread overview]
Message-ID: <21736a11-1b0f-d4b6-bdd5-2560fc8ffcf1@ozlabs.ru> (raw)
In-Reply-To: <20220106200304.4070825-4-farosas@linux.ibm.com>



On 07/01/2022 07:03, Fabiano Rosas wrote:
> We check against 'bytes' but print 'run->mmio.len' which at that point
> has an old value.
> 
> e.g. 16-byte load:
> 
> before:
> __kvmppc_handle_load: bad MMIO length: 8
> 
> now:
> __kvmppc_handle_load: bad MMIO length: 16
> 
> Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
> ---
>   arch/powerpc/kvm/powerpc.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
> index 92e552ab5a77..0b0818d032e1 100644
> --- a/arch/powerpc/kvm/powerpc.c
> +++ b/arch/powerpc/kvm/powerpc.c
> @@ -1246,7 +1246,7 @@ static int __kvmppc_handle_load(struct kvm_vcpu *vcpu,
>   
>   	if (bytes > sizeof(run->mmio.data)) {
>   		printk(KERN_ERR "%s: bad MMIO length: %d\n", __func__,
> -		       run->mmio.len);
> +		       bytes);


"return EMULATE_FAIL;" here and below as there is really no point in 
trashing kvm_run::mmio (not much harm too but still) and this code does 
not handle more than 8 bytes anyway.



>   	}
>   
>   	run->mmio.phys_addr = vcpu->arch.paddr_accessed;
> @@ -1335,7 +1335,7 @@ int kvmppc_handle_store(struct kvm_vcpu *vcpu,
>   
>   	if (bytes > sizeof(run->mmio.data)) {
>   		printk(KERN_ERR "%s: bad MMIO length: %d\n", __func__,
> -		       run->mmio.len);
> +		       bytes);
>   	}
>   
>   	run->mmio.phys_addr = vcpu->arch.paddr_accessed;

-- 
Alexey

  reply	other threads:[~2022-01-07  0:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-06 20:02 [PATCH v2 0/7] KVM: PPC: MMIO fixes Fabiano Rosas
2022-01-06 20:02 ` [PATCH v2 1/7] KVM: PPC: Book3S HV: Stop returning internal values to userspace Fabiano Rosas
2022-01-06 20:02 ` [PATCH v2 2/7] KVM: PPC: Fix vmx/vsx mixup in mmio emulation Fabiano Rosas
2022-01-06 20:03 ` [PATCH v2 3/7] KVM: PPC: Fix mmio length message Fabiano Rosas
2022-01-07  0:19   ` Alexey Kardashevskiy [this message]
2022-01-06 20:03 ` [PATCH v2 4/7] KVM: PPC: Don't use pr_emerg when mmio emulation fails Fabiano Rosas
2022-01-06 20:03 ` [PATCH v2 5/7] KVM: PPC: mmio: Queue interrupt at kvmppc_emulate_mmio Fabiano Rosas
2022-01-07  0:24   ` Alexey Kardashevskiy
2022-01-06 20:03 ` [PATCH v2 6/7] KVM: PPC: mmio: Return to guest after emulation failure Fabiano Rosas
2022-01-07  1:08   ` Alexey Kardashevskiy
2022-01-07 13:07     ` Fabiano Rosas
2022-01-06 20:03 ` [PATCH v2 7/7] KVM: PPC: mmio: Reject instructions that access more than mmio.data size Fabiano Rosas
2022-01-07  0:30   ` Alexey Kardashevskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=21736a11-1b0f-d4b6-bdd5-2560fc8ffcf1@ozlabs.ru \
    --to=aik@ozlabs.ru \
    --cc=farosas@linux.ibm.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=npiggin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).