linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Laurent Vivier <lvivier@redhat.com>,
	kvm-ppc@vger.kernel.org, kvm@vger.kernel.org,
	Alexander Graf <agraf@suse.com>,
	Paul Mackerras <paulus@samba.org>
Cc: Gleb Natapov <gleb@kernel.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kvm-pr: manage illegal instructions
Date: Mon, 9 May 2016 10:14:41 +0200	[thread overview]
Message-ID: <573046F1.7070704@redhat.com> (raw)
In-Reply-To: <57189C75.2060701@redhat.com>

On 21.04.2016 11:25, Thomas Huth wrote:
> On 15.03.2016 21:18, Laurent Vivier wrote:
>> While writing some instruction tests for kvm-unit-tests for powerpc,
>> I've found that illegal instructions are not managed correctly with kvm-pr,
>> while it is fine with kvm-hv.
>>
>> When an illegal instruction (like ".long 0") is processed by kvm-pr,
>> the kernel logs are filled with:
>>
>>      Couldn't emulate instruction 0x00000000 (op 0 xop 0)
>>      kvmppc_handle_exit_pr: emulation at 700 failed (00000000)
>>
>> While the exception handler receives an interrupt for each instruction
>> executed after the illegal instruction.
>>
>> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
>> ---
>>  arch/powerpc/kvm/book3s_emulate.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/powerpc/kvm/book3s_emulate.c b/arch/powerpc/kvm/book3s_emulate.c
>> index 2afdb9c..4ee969d 100644
>> --- a/arch/powerpc/kvm/book3s_emulate.c
>> +++ b/arch/powerpc/kvm/book3s_emulate.c
>> @@ -99,7 +99,6 @@ int kvmppc_core_emulate_op_pr(struct kvm_run *run, struct kvm_vcpu *vcpu,
>>  
>>  	switch (get_op(inst)) {
>>  	case 0:
>> -		emulated = EMULATE_FAIL;
>>  		if ((kvmppc_get_msr(vcpu) & MSR_LE) &&
>>  		    (inst == swab32(inst_sc))) {
>>  			/*
>> @@ -112,6 +111,9 @@ int kvmppc_core_emulate_op_pr(struct kvm_run *run, struct kvm_vcpu *vcpu,
>>  			kvmppc_set_gpr(vcpu, 3, EV_UNIMPLEMENTED);
>>  			kvmppc_set_pc(vcpu, kvmppc_get_pc(vcpu) + 4);
>>  			emulated = EMULATE_DONE;
>> +		} else {
>> +			kvmppc_core_queue_program(vcpu, SRR1_PROGILL);
>> +			emulated = EMULATE_AGAIN;
>>  		}
>>  		break;
>>  	case 19:
>>
> 
> Tested-by: Thomas Huth <thuth@redhat.com>

Ping!

Alex, Paul, could you please pick up this patch? This patch is required
to get the kvm-unit-tests working properly with kvm-pr, so I'd be glad
if we could get this included finally...

Thanks,
 Thomas

  reply	other threads:[~2016-05-09  8:14 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-15 20:18 [PATCH] kvm-pr: manage illegal instructions Laurent Vivier
2016-03-22 10:11 ` Laurent Vivier
2016-04-07 11:31 ` Laurent Vivier
2016-04-21  9:25 ` Thomas Huth
2016-05-09  8:14   ` Thomas Huth [this message]
2016-05-10 17:25     ` Paolo Bonzini
2016-05-11 10:35 ` Alexander Graf
2016-05-11 11:14   ` Laurent Vivier
2016-05-11 11:49     ` Alexander Graf
2016-05-12  9:10       ` Laurent Vivier
2016-05-12  9:27         ` Alexander Graf
2016-05-12 14:23           ` Laurent Vivier
2016-05-17  8:35             ` Laurent Vivier
2016-05-17  8:37               ` Alexander Graf
2016-05-17 17:49                 ` Laurent Vivier
2016-05-18 10:18                   ` Thomas Huth
2016-05-18 10:53                     ` Thomas Huth
2016-05-18 18:39                       ` Thomas Huth
2016-05-19  7:11                       ` Thomas Huth

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=573046F1.7070704@redhat.com \
    --to=thuth@redhat.com \
    --cc=agraf@suse.com \
    --cc=benh@kernel.crashing.org \
    --cc=gleb@kernel.org \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=lvivier@redhat.com \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.org \
    --cc=pbonzini@redhat.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).