linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: Scott Wood <scottwood@freescale.com>
Cc: Caraman Mihai Claudiu-B02008 <mihai.caraman@freescale.com>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"kvm-ppc@vger.kernel.org" <kvm-ppc@vger.kernel.org>
Subject: Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for SPE/FP/AltiVec int numbers
Date: Fri, 04 Jul 2014 01:02:07 +0200	[thread overview]
Message-ID: <53B5E0EF.5070609@suse.de> (raw)
In-Reply-To: <1404428423.21434.107.camel@snotra.buserror.net>


On 04.07.14 01:00, Scott Wood wrote:
> On Fri, 2014-07-04 at 00:35 +0200, Alexander Graf wrote:
>> On 04.07.14 00:31, Scott Wood wrote:
>>> On Thu, 2014-07-03 at 17:15 -0500, Scott Wood wrote:
>>>> On Thu, 2014-07-03 at 10:25 -0500, Caraman Mihai Claudiu-B02008 wrote:
>>>>>> -----Original Message-----
>>>>>> From: Alexander Graf [mailto:agraf@suse.de]
>>>>>> Sent: Thursday, July 03, 2014 3:21 PM
>>>>>> To: Caraman Mihai Claudiu-B02008; kvm-ppc@vger.kernel.org
>>>>>> Cc: kvm@vger.kernel.org; linuxppc-dev@lists.ozlabs.org
>>>>>> Subject: Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for
>>>>>> SPE/FP/AltiVec int numbers
>>>>>>
>>>>>>
>>>>>> On 30.06.14 17:34, Mihai Caraman wrote:
>>>>>>> Use common BOOKE_IRQPRIO and BOOKE_INTERRUPT defines for SPE/FP/AltiVec
>>>>>>> which share the same interrupt numbers.
>>>>>>>
>>>>>>> Signed-off-by: Mihai Caraman <mihai.caraman@freescale.com>
>>>>>>> ---
>>>>>>> v2:
>>>>>>>     - remove outdated definitions
>>>>>>>
>>>>>>>     arch/powerpc/include/asm/kvm_asm.h    |  8 --------
>>>>>>>     arch/powerpc/kvm/booke.c              | 17 +++++++++--------
>>>>>>>     arch/powerpc/kvm/booke.h              |  4 ++--
>>>>>>>     arch/powerpc/kvm/booke_interrupts.S   |  9 +++++----
>>>>>>>     arch/powerpc/kvm/bookehv_interrupts.S |  4 ++--
>>>>>>>     arch/powerpc/kvm/e500.c               | 10 ++++++----
>>>>>>>     arch/powerpc/kvm/e500_emulate.c       | 10 ++++++----
>>>>>>>     7 files changed, 30 insertions(+), 32 deletions(-)
>>>>>>>
>>>>>>> diff --git a/arch/powerpc/include/asm/kvm_asm.h
>>>>>> b/arch/powerpc/include/asm/kvm_asm.h
>>>>>>> index 9601741..c94fd33 100644
>>>>>>> --- a/arch/powerpc/include/asm/kvm_asm.h
>>>>>>> +++ b/arch/powerpc/include/asm/kvm_asm.h
>>>>>>> @@ -56,14 +56,6 @@
>>>>>>>     /* E500 */
>>>>>>>     #define BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL 32
>>>>>>>     #define BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST 33
>>>>>>> -/*
>>>>>>> - * TODO: Unify 32-bit and 64-bit kernel exception handlers to use same
>>>>>> defines
>>>>>>> - */
>>>>>>> -#define BOOKE_INTERRUPT_SPE_UNAVAIL
>>>>>> BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
>>>>>>> -#define BOOKE_INTERRUPT_SPE_FP_DATA
>>>>>> BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
>>>>>>> -#define BOOKE_INTERRUPT_ALTIVEC_UNAVAIL
>>>>>> BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
>>>>>>> -#define BOOKE_INTERRUPT_ALTIVEC_ASSIST \
>>>>>>> -				BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
>>>>>> I think I'd prefer to keep them separate.
>>>>> What is the reason from changing your mind from ver 1? Do you want to have
>>>>> different defines with same values (we specifically mapped them to the
>>>>> hardware interrupt numbers). We already upstreamed the necessary changes
>>>>> in the kernel. Scott, please share your opinion here.
>>>> I don't like hiding the fact that they're the same number, which could
>>>> lead to wrong code in the absence of ifdefs that strictly mutually
>>>> exclude SPE and Altivec code -- there was an instance of this with
>>>> MSR_VEC versus MSR_SPE in a previous patchset.
>>> That said, if you want to enforce that mutual exclusion in a way that is
>>> clear, I won't object too loudly -- but the code does look pretty
>>> similar between the two (as well as between the two IVORs).
>> Yes, I want to make sure we have 2 separate code paths for SPE and
>> Altivec. No code sharing at all unless it's very generically possible.
>>
>> Also, which code does look pretty similar? The fact that we deflect
>> interrupts back into the guest? That's mostly boilerplate.
> There's also the injection of a program check (or exiting to userspace)
> when CONFIG_SPE/ALTIVEC is missing.  Not a big deal, but maybe it could
> be factored into a helper function.  I like minimizing boilerplate.

Yes, me too - but I also like to be explicit. If there's enough code to 
share, factoring those into helpers certainly works well for me.


Alex

  reply	other threads:[~2014-07-03 23:02 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-30 15:34 [PATCH 0/6 v2] KVM: PPC: Book3e: AltiVec support Mihai Caraman
2014-06-30 15:34 ` [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for SPE/FP/AltiVec int numbers Mihai Caraman
2014-07-03 12:21   ` Alexander Graf
2014-07-03 15:25     ` mihai.caraman
2014-07-03 15:30       ` Alexander Graf
2014-07-03 15:53         ` mihai.caraman
2014-07-03 22:15       ` Scott Wood
2014-07-03 22:31         ` Scott Wood
2014-07-03 22:35           ` Alexander Graf
2014-07-03 23:00             ` Scott Wood
2014-07-03 23:02               ` Alexander Graf [this message]
2014-07-03 22:31         ` Alexander Graf
2014-07-21 13:23     ` mihai.caraman
2014-07-24  9:16       ` mihai.caraman
2014-07-26  0:10         ` Scott Wood
2014-07-28  8:54           ` mihai.caraman
2014-07-28 22:42             ` Scott Wood
2014-06-30 15:34 ` [PATCH 2/6 v2] KVM: PPC: Book3E: Refactor SPE/FP exit handling Mihai Caraman
2014-07-03 12:21   ` Alexander Graf
2014-06-30 15:34 ` [PATCH 3/6 v2] KVM: PPC: Book3E: Increase FPU laziness Mihai Caraman
2014-07-03 12:28   ` Alexander Graf
2014-07-03 15:46     ` mihai.caraman
2014-07-04  7:46       ` Alexander Graf
2014-07-04  7:52         ` Alexander Graf
2014-06-30 15:34 ` [PATCH 4/6 v2] KVM: PPC: Book3E: Add AltiVec support Mihai Caraman
2014-07-03 12:32   ` Alexander Graf
2014-07-03 15:58     ` mihai.caraman
2014-07-03 23:07   ` Scott Wood
2014-06-30 15:34 ` [PATCH 5/6 v2] KVM: PPC: Book3E: Add ONE_REG " Mihai Caraman
2014-07-03 12:33   ` Alexander Graf
2014-07-03 16:11     ` mihai.caraman
2014-07-04  7:54       ` Alexander Graf
2014-06-30 15:34 ` [PATCH 6/6 v2] KVM: PPC: Book3E: Enable e6500 core Mihai Caraman

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=53B5E0EF.5070609@suse.de \
    --to=agraf@suse.de \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mihai.caraman@freescale.com \
    --cc=scottwood@freescale.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).