All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf-l3A5Bk7waGM@public.gmane.org>
To: Hollis Blanchard <hollis-yUx37fBWTUITNcAmw9vGhQ@public.gmane.org>
Cc: kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	kvm-ppc <kvm-ppc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Benjamin Herrenschmidt
	<benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>,
	Liu Yu <yuliu-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Subject: Re: [PATCH 7/9] KVM: PPC: Emulate trap SRR1 flags properly
Date: Fri, 8 Jan 2010 20:32:41 +0100	[thread overview]
Message-ID: <1FB2DDB0-F72E-437C-BEC5-8E1AEE5FBCC7@suse.de> (raw)
In-Reply-To: <fb412d761001081129q26d7fdcj9d1a26184127d002-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>


On 08.01.2010, at 20:29, Hollis Blanchard wrote:

> On Thu, Jan 7, 2010 at 5:58 PM, Alexander Graf <agraf-l3A5Bk7waGM@public.gmane.org> wrote:
>> Book3S needs some flags in SRR1 to get to know details about an interrupt.
>> 
>> One such example is the trap instruction. It tells the guest kernel that
>> a program interrupt is due to a trap using a bit in SRR1.
>> 
>> This patch implements above behavior, making WARN_ON behave like WARN_ON.
> 
> ... "for Book S". It already works properly for Book E, thankyouverymuch. ;)
> 
>> diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
>> index 338baf9..e283e44 100644
>> --- a/arch/powerpc/kvm/booke.c
>> +++ b/arch/powerpc/kvm/booke.c
>> @@ -82,8 +82,9 @@ static void kvmppc_booke_queue_irqprio(struct kvm_vcpu *vcpu,
>>        set_bit(priority, &vcpu->arch.pending_exceptions);
>>  }
>> 
>> -void kvmppc_core_queue_program(struct kvm_vcpu *vcpu)
>> +void kvmppc_core_queue_program(struct kvm_vcpu *vcpu, ulong flags)
>>  {
>> +       /* BookE does flags in ESR, so ignore those we get here */
>>        kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_PROGRAM);
>>  }
> 
> Actually, I think Book E prematurely sets ESR, since it's done before
> the program interrupt is actually delivered. Architecturally, I'm not
> sure if it's a problem, but philosophically I've always wanted it to
> work the way you've just implemented for Book S.
> 
> Anyways, since we can't test changes at the moment (Yu, can you?), I'd
> settle for a comment to the effect that Book E code *should* do this,
> but doesn't (rather than the comment above that says it's ok).

Hm, can't you just write up a patch that removes the comment I put in, does the ESR setting in the function and do an #ifdef in emulate.c?

That way we can incrementally improve things. This series is really about Book3S. Improving BookE should go in a different patch.

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

WARNING: multiple messages have this Message-ID (diff)
From: Alexander Graf <agraf@suse.de>
To: Hollis Blanchard <hollis-yUx37fBWTUITNcAmw9vGhQ@public.gmane.org>
Cc: kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	kvm-ppc <kvm-ppc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Benjamin Herrenschmidt
	<benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>,
	Liu Yu <yuliu-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Subject: Re: [PATCH 7/9] KVM: PPC: Emulate trap SRR1 flags properly
Date: Fri, 08 Jan 2010 19:32:41 +0000	[thread overview]
Message-ID: <1FB2DDB0-F72E-437C-BEC5-8E1AEE5FBCC7@suse.de> (raw)
In-Reply-To: <fb412d761001081129q26d7fdcj9d1a26184127d002-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>


On 08.01.2010, at 20:29, Hollis Blanchard wrote:

> On Thu, Jan 7, 2010 at 5:58 PM, Alexander Graf <agraf@suse.de> wrote:
>> Book3S needs some flags in SRR1 to get to know details about an interrupt.
>> 
>> One such example is the trap instruction. It tells the guest kernel that
>> a program interrupt is due to a trap using a bit in SRR1.
>> 
>> This patch implements above behavior, making WARN_ON behave like WARN_ON.
> 
> ... "for Book S". It already works properly for Book E, thankyouverymuch. ;)
> 
>> diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
>> index 338baf9..e283e44 100644
>> --- a/arch/powerpc/kvm/booke.c
>> +++ b/arch/powerpc/kvm/booke.c
>> @@ -82,8 +82,9 @@ static void kvmppc_booke_queue_irqprio(struct kvm_vcpu *vcpu,
>>        set_bit(priority, &vcpu->arch.pending_exceptions);
>>  }
>> 
>> -void kvmppc_core_queue_program(struct kvm_vcpu *vcpu)
>> +void kvmppc_core_queue_program(struct kvm_vcpu *vcpu, ulong flags)
>>  {
>> +       /* BookE does flags in ESR, so ignore those we get here */
>>        kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_PROGRAM);
>>  }
> 
> Actually, I think Book E prematurely sets ESR, since it's done before
> the program interrupt is actually delivered. Architecturally, I'm not
> sure if it's a problem, but philosophically I've always wanted it to
> work the way you've just implemented for Book S.
> 
> Anyways, since we can't test changes at the moment (Yu, can you?), I'd
> settle for a comment to the effect that Book E code *should* do this,
> but doesn't (rather than the comment above that says it's ok).

Hm, can't you just write up a patch that removes the comment I put in, does the ESR setting in the function and do an #ifdef in emulate.c?

That way we can incrementally improve things. This series is really about Book3S. Improving BookE should go in a different patch.

Alex

  parent reply	other threads:[~2010-01-08 19:32 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-08  1:58 [PATCH 0/9] KVM: PPC: Reduce races, fix code Alexander Graf
2010-01-08  1:58 ` Alexander Graf
2010-01-08  1:58 ` [PATCH 2/9] KVM: PPC: Add helpers for CR, XER Alexander Graf
2010-01-08  1:58   ` Alexander Graf
2010-01-08  1:58 ` [PATCH 6/9] KVM: PPC: Call SLB patching code in interrupt safe manner Alexander Graf
2010-01-08  1:58   ` Alexander Graf
2010-01-08  1:58 ` [PATCH 7/9] KVM: PPC: Emulate trap SRR1 flags properly Alexander Graf
2010-01-08  1:58   ` Alexander Graf
2010-01-08 19:29   ` Hollis Blanchard
2010-01-08 19:29     ` Hollis Blanchard
2010-01-11  6:58     ` Liu Yu-B13201
2010-01-11  6:58       ` Liu Yu-B13201
     [not found]       ` <0A1FE637C2C7E148B9573BB60CC630E56C3F11-bKEhWGtIRUJ4Lp7cDGe+DVjVikpgYyvb5NbjCUgZEJk@public.gmane.org>
2010-01-12  0:08         ` Alexander Graf
2010-01-12  0:08           ` Alexander Graf
     [not found]           ` <375F3E96-79CD-4451-B984-7CC896C2FA5A-l3A5Bk7waGM@public.gmane.org>
2010-01-12  9:08             ` Liu Yu-B13201
2010-01-12  9:08               ` Liu Yu-B13201
     [not found]     ` <fb412d761001081129q26d7fdcj9d1a26184127d002-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-01-08 19:32       ` Alexander Graf [this message]
2010-01-08 19:32         ` Alexander Graf
     [not found]         ` <1FB2DDB0-F72E-437C-BEC5-8E1AEE5FBCC7-l3A5Bk7waGM@public.gmane.org>
2010-01-08 19:35           ` Hollis Blanchard
2010-01-08 19:35             ` Hollis Blanchard
2010-01-08 19:37             ` Alexander Graf
2010-01-08 19:37               ` Alexander Graf
2010-01-10 12:34               ` Avi Kivity
2010-01-10 12:34                 ` Avi Kivity
     [not found]                 ` <4B49C959.8040900-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-01-10 12:48                   ` Alexander Graf
2010-01-10 12:48                     ` Alexander Graf
2010-01-10 12:58                     ` Avi Kivity
2010-01-10 12:58                       ` Avi Kivity
2010-01-21  8:09       ` Liu Yu-B13201
2010-01-21  8:09         ` Liu Yu-B13201
2010-01-21 12:12         ` Alexander Graf
2010-01-21 12:12           ` Alexander Graf
     [not found] ` <1262915889-11526-1-git-send-email-agraf-l3A5Bk7waGM@public.gmane.org>
2010-01-08  1:58   ` [PATCH 1/9] KVM: PPC: Use accessor functions for GPR access Alexander Graf
2010-01-08  1:58     ` Alexander Graf
2010-01-08  1:58   ` [PATCH 3/9] KVM: PPC: Use PACA backed shadow vcpu Alexander Graf
2010-01-08  1:58     ` Alexander Graf
2010-01-08  1:58   ` [PATCH 4/9] KVM: PPC: Implement 'skip instruction' mode Alexander Graf
2010-01-08  1:58     ` Alexander Graf
2010-01-08  1:58   ` [PATCH 5/9] KVM: PPC: Get rid of unnecessary RFI Alexander Graf
2010-01-08  1:58     ` Alexander Graf
2010-01-08  1:58   ` [PATCH 8/9] KVM: PPC: Fix HID5 setting code Alexander Graf
2010-01-08  1:58     ` Alexander Graf
2010-01-08  1:58   ` [PATCH 9/9] KVM: PPC: Pass program interrupt flags to the guest Alexander Graf
2010-01-08  1:58     ` Alexander Graf

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=1FB2DDB0-F72E-437C-BEC5-8E1AEE5FBCC7@suse.de \
    --to=agraf-l3a5bk7wagm@public.gmane.org \
    --cc=benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org \
    --cc=hollis-yUx37fBWTUITNcAmw9vGhQ@public.gmane.org \
    --cc=kvm-ppc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=yuliu-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    /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 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.