Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1396838 > unrolled thread

Re: [PATCH] kvm-pr: manage illegal instructions

Started byThomas Huth <thuth@redhat.com>
First post2016-05-09 10:20 +0200
Last post2016-05-10 19:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] kvm-pr: manage illegal instructions Thomas Huth <thuth@redhat.com> - 2016-05-09 10:20 +0200
    Re: [PATCH] kvm-pr: manage illegal instructions Paolo Bonzini <pbonzini@redhat.com> - 2016-05-10 19:30 +0200

#1396838 — Re: [PATCH] kvm-pr: manage illegal instructions

FromThomas Huth <thuth@redhat.com>
Date2016-05-09 10:20 +0200
SubjectRe: [PATCH] kvm-pr: manage illegal instructions
Message-ID<rwOA2-1jg-21@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1398345

FromPaolo Bonzini <pbonzini@redhat.com>
Date2016-05-10 19:30 +0200
Message-ID<rxjDQ-75T-11@gated-at.bofh.it>
In reply to#1396838

On 09/05/2016 10:14, Thomas Huth wrote:
>> > 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...

I have a pull request for 4.6 final to send tomorrow; do you want me to
include it?

Thanks,

Paolo

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web