Patchwork [35/37] KVM: PPC: booke: Support perfmon interrupts

login
register
mail settings
Submitter Alexander Graf
Date Feb. 24, 2012, 2:26 p.m.
Message ID <1330093591-19523-36-git-send-email-agraf@suse.de>
Download mbox | patch
Permalink /patch/142854/
State New
Headers show

Comments

Alexander Graf - Feb. 24, 2012, 2:26 p.m.
When during guest context we get a performance monitor interrupt, we
currently bail out and oops. Let's route it to its correct handler
instead.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 arch/powerpc/kvm/booke.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
Scott Wood - Feb. 24, 2012, 11:33 p.m.
On 02/24/2012 08:26 AM, Alexander Graf wrote:
> When during guest context we get a performance monitor interrupt, we
> currently bail out and oops. Let's route it to its correct handler
> instead.
> 
> Signed-off-by: Alexander Graf <agraf@suse.de>
> ---
>  arch/powerpc/kvm/booke.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
> index 7adef28..423701b 100644
> --- a/arch/powerpc/kvm/booke.c
> +++ b/arch/powerpc/kvm/booke.c
> @@ -677,6 +677,10 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
>  		r = RESUME_GUEST;
>  		break;
>  
> +	case BOOKE_INTERRUPT_PERFORMANCE_MONITOR:
> +		r = RESUME_GUEST;
> +		break;
> +
>  	case BOOKE_INTERRUPT_HV_PRIV:
>  		r = emulation_exit(run, vcpu);
>  		break;

Why do we need to call timer_interrupt() explicitly, but can rely on
automatic retriggering for perfmon?

-Scott

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Alexander Graf - Feb. 26, 2012, 11:58 a.m.
On 25.02.2012, at 00:33, Scott Wood wrote:

> On 02/24/2012 08:26 AM, Alexander Graf wrote:
>> When during guest context we get a performance monitor interrupt, we
>> currently bail out and oops. Let's route it to its correct handler
>> instead.
>> 
>> Signed-off-by: Alexander Graf <agraf@suse.de>
>> ---
>> arch/powerpc/kvm/booke.c |    4 ++++
>> 1 files changed, 4 insertions(+), 0 deletions(-)
>> 
>> diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
>> index 7adef28..423701b 100644
>> --- a/arch/powerpc/kvm/booke.c
>> +++ b/arch/powerpc/kvm/booke.c
>> @@ -677,6 +677,10 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
>> 		r = RESUME_GUEST;
>> 		break;
>> 
>> +	case BOOKE_INTERRUPT_PERFORMANCE_MONITOR:
>> +		r = RESUME_GUEST;
>> +		break;
>> +
>> 	case BOOKE_INTERRUPT_HV_PRIV:
>> 		r = emulation_exit(run, vcpu);
>> 		break;
> 
> Why do we need to call timer_interrupt() explicitly, but can rely on
> automatic retriggering for perfmon?

We don't rely on automatic retriggering for perfmon. There are 2 different places where we need to handle an incoming exit code - the "reinject" code path and the "big switch over all exits" code path. This one deals with the latter.


Alex

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
index 7adef28..423701b 100644
--- a/arch/powerpc/kvm/booke.c
+++ b/arch/powerpc/kvm/booke.c
@@ -677,6 +677,10 @@  int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
 		r = RESUME_GUEST;
 		break;
 
+	case BOOKE_INTERRUPT_PERFORMANCE_MONITOR:
+		r = RESUME_GUEST;
+		break;
+
 	case BOOKE_INTERRUPT_HV_PRIV:
 		r = emulation_exit(run, vcpu);
 		break;