All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: Caraman Mihai Claudiu-B02008 <B02008@freescale.com>
Cc: Alexander Graf <agraf@suse.de>,
	"kvm-ppc@vger.kernel.org" <kvm-ppc@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH 1/5] KVM: PPC: e500: Move VCPU's MMUCFG register initialization earlier
Date: Thu, 31 Jan 2013 16:48:24 +0000	[thread overview]
Message-ID: <1359650904.31540.0@snotra> (raw)
In-Reply-To: <300B73AA675FCE4A93EB4FC1D42459FF2F7861@039-SN2MPN1-012.039d.mgd.msft.net> (from B02008@freescale.com on Thu Jan 31 09:26:20 2013)

On 01/31/2013 09:26:20 AM, Caraman Mihai Claudiu-B02008 wrote:
> > -----Original Message-----
> > From: Alexander Graf [mailto:agraf@suse.de]
> > Sent: Thursday, January 31, 2013 4:58 PM
> > To: Caraman Mihai Claudiu-B02008
> > Cc: kvm-ppc@vger.kernel.org; kvm@vger.kernel.org; linuxppc-
> > dev@lists.ozlabs.org
> > Subject: Re: [PATCH 1/5] KVM: PPC: e500: Move VCPU's MMUCFG register
> > initialization earlier
> >
> >
> > On 31.01.2013, at 15:56, Caraman Mihai Claudiu-B02008 wrote:
> >
> > >> -----Original Message-----
> > >> From: Alexander Graf [mailto:agraf@suse.de]
> > >> Sent: Thursday, January 31, 2013 3:21 PM
> > >> To: Caraman Mihai Claudiu-B02008
> > >> Cc: kvm-ppc@vger.kernel.org; kvm@vger.kernel.org; linuxppc-
> > >> dev@lists.ozlabs.org
> > >> Subject: Re: [PATCH 1/5] KVM: PPC: e500: Move VCPU's MMUCFG  
> register
> > >> initialization earlier
> > >>
> > >>
> > >> On 30.01.2013, at 14:29, Mihai Caraman wrote:
> > >>
> > >>> VCPU's MMUCFG register initialization should not depend on
> > >> KVM_CAP_SW_TLB
> > >>> ioctl call. Move it earlier into tlb initalization phase.
> > >>
> > >> Quite the contrary. The fact that there is an mfspr() in  
> e500_mmu.c
> > >> already tells us that the code is broken. The TLB guest code  
> should
> > only
> > >> depend on input from the SW_TLB configuration. It's completely
> > orthogonal
> > >> to the host capabilities.
> > >
> > > Then we have the same issue for TLBnCFG registers which need to be
> > configured
> > > via SW_TLB ioctl. What is the purpose of guest tlb initalization  
> in
> > e500_mmu.c
> > > if we rely on SW_TLB?
> >
> > It's to provide a fallback to user space that doesn't implement  
> SW_TLB
> > configuration yet.
> 
> Do we have such a case now or is it just hypothetical? For the  
> fallback we
> need to initialize the MMUCFG register which I intended to say in the  
> commit
> message.

I don't think we need to support a fallback for e6500, since there's  
nothing to be backwards compatible with.

As for use case, I don't see us ever supporting the guest being a  
different CPU than the host.  Page sizes probably aren't a problem, but  
there are other barriers.

The main reasons that TLBnCFG are settable through SW_TLB are:
1. The guest TLB can be enlarged as a performance hack (like in Topaz,  
though QEMU doesn't currently do this),
2. The legacy default in KVM is based on the e500v1 TLB0 size, which is  
half of what e500v2/e500mc have, and
3. QEMU needs to know the exact geometry of the TLB so that it can  
interpret the shared data properly.

#3 seems like a compelling reason here, to avoid silent weirdness if  
there's a slight mismatch between what QEMU thinks it's modelling and  
what we're actually running on.

-Scott

WARNING: multiple messages have this Message-ID (diff)
From: Scott Wood <scottwood@freescale.com>
To: Caraman Mihai Claudiu-B02008 <B02008@freescale.com>
Cc: "linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	Alexander Graf <agraf@suse.de>,
	"kvm-ppc@vger.kernel.org" <kvm-ppc@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH 1/5] KVM: PPC: e500: Move VCPU's MMUCFG register initialization earlier
Date: Thu, 31 Jan 2013 10:48:24 -0600	[thread overview]
Message-ID: <1359650904.31540.0@snotra> (raw)
In-Reply-To: <300B73AA675FCE4A93EB4FC1D42459FF2F7861@039-SN2MPN1-012.039d.mgd.msft.net> (from B02008@freescale.com on Thu Jan 31 09:26:20 2013)

On 01/31/2013 09:26:20 AM, Caraman Mihai Claudiu-B02008 wrote:
> > -----Original Message-----
> > From: Alexander Graf [mailto:agraf@suse.de]
> > Sent: Thursday, January 31, 2013 4:58 PM
> > To: Caraman Mihai Claudiu-B02008
> > Cc: kvm-ppc@vger.kernel.org; kvm@vger.kernel.org; linuxppc-
> > dev@lists.ozlabs.org
> > Subject: Re: [PATCH 1/5] KVM: PPC: e500: Move VCPU's MMUCFG register
> > initialization earlier
> >
> >
> > On 31.01.2013, at 15:56, Caraman Mihai Claudiu-B02008 wrote:
> >
> > >> -----Original Message-----
> > >> From: Alexander Graf [mailto:agraf@suse.de]
> > >> Sent: Thursday, January 31, 2013 3:21 PM
> > >> To: Caraman Mihai Claudiu-B02008
> > >> Cc: kvm-ppc@vger.kernel.org; kvm@vger.kernel.org; linuxppc-
> > >> dev@lists.ozlabs.org
> > >> Subject: Re: [PATCH 1/5] KVM: PPC: e500: Move VCPU's MMUCFG =20
> register
> > >> initialization earlier
> > >>
> > >>
> > >> On 30.01.2013, at 14:29, Mihai Caraman wrote:
> > >>
> > >>> VCPU's MMUCFG register initialization should not depend on
> > >> KVM_CAP_SW_TLB
> > >>> ioctl call. Move it earlier into tlb initalization phase.
> > >>
> > >> Quite the contrary. The fact that there is an mfspr() in =20
> e500_mmu.c
> > >> already tells us that the code is broken. The TLB guest code =20
> should
> > only
> > >> depend on input from the SW_TLB configuration. It's completely
> > orthogonal
> > >> to the host capabilities.
> > >
> > > Then we have the same issue for TLBnCFG registers which need to be
> > configured
> > > via SW_TLB ioctl. What is the purpose of guest tlb initalization =20
> in
> > e500_mmu.c
> > > if we rely on SW_TLB?
> >
> > It's to provide a fallback to user space that doesn't implement =20
> SW_TLB
> > configuration yet.
>=20
> Do we have such a case now or is it just hypothetical? For the =20
> fallback we
> need to initialize the MMUCFG register which I intended to say in the =20
> commit
> message.

I don't think we need to support a fallback for e6500, since there's =20
nothing to be backwards compatible with.

As for use case, I don't see us ever supporting the guest being a =20
different CPU than the host.  Page sizes probably aren't a problem, but =20
there are other barriers.

The main reasons that TLBnCFG are settable through SW_TLB are:
1. The guest TLB can be enlarged as a performance hack (like in Topaz, =20
though QEMU doesn't currently do this),
2. The legacy default in KVM is based on the e500v1 TLB0 size, which is =20
half of what e500v2/e500mc have, and
3. QEMU needs to know the exact geometry of the TLB so that it can =20
interpret the shared data properly.

#3 seems like a compelling reason here, to avoid silent weirdness if =20
there's a slight mismatch between what QEMU thinks it's modelling and =20
what we're actually running on.

-Scott=

WARNING: multiple messages have this Message-ID (diff)
From: Scott Wood <scottwood@freescale.com>
To: Caraman Mihai Claudiu-B02008 <B02008@freescale.com>
Cc: Alexander Graf <agraf@suse.de>,
	"kvm-ppc@vger.kernel.org" <kvm-ppc@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH 1/5] KVM: PPC: e500: Move VCPU's MMUCFG register initialization earlier
Date: Thu, 31 Jan 2013 10:48:24 -0600	[thread overview]
Message-ID: <1359650904.31540.0@snotra> (raw)
In-Reply-To: <300B73AA675FCE4A93EB4FC1D42459FF2F7861@039-SN2MPN1-012.039d.mgd.msft.net> (from B02008@freescale.com on Thu Jan 31 09:26:20 2013)

On 01/31/2013 09:26:20 AM, Caraman Mihai Claudiu-B02008 wrote:
> > -----Original Message-----
> > From: Alexander Graf [mailto:agraf@suse.de]
> > Sent: Thursday, January 31, 2013 4:58 PM
> > To: Caraman Mihai Claudiu-B02008
> > Cc: kvm-ppc@vger.kernel.org; kvm@vger.kernel.org; linuxppc-
> > dev@lists.ozlabs.org
> > Subject: Re: [PATCH 1/5] KVM: PPC: e500: Move VCPU's MMUCFG register
> > initialization earlier
> >
> >
> > On 31.01.2013, at 15:56, Caraman Mihai Claudiu-B02008 wrote:
> >
> > >> -----Original Message-----
> > >> From: Alexander Graf [mailto:agraf@suse.de]
> > >> Sent: Thursday, January 31, 2013 3:21 PM
> > >> To: Caraman Mihai Claudiu-B02008
> > >> Cc: kvm-ppc@vger.kernel.org; kvm@vger.kernel.org; linuxppc-
> > >> dev@lists.ozlabs.org
> > >> Subject: Re: [PATCH 1/5] KVM: PPC: e500: Move VCPU's MMUCFG  
> register
> > >> initialization earlier
> > >>
> > >>
> > >> On 30.01.2013, at 14:29, Mihai Caraman wrote:
> > >>
> > >>> VCPU's MMUCFG register initialization should not depend on
> > >> KVM_CAP_SW_TLB
> > >>> ioctl call. Move it earlier into tlb initalization phase.
> > >>
> > >> Quite the contrary. The fact that there is an mfspr() in  
> e500_mmu.c
> > >> already tells us that the code is broken. The TLB guest code  
> should
> > only
> > >> depend on input from the SW_TLB configuration. It's completely
> > orthogonal
> > >> to the host capabilities.
> > >
> > > Then we have the same issue for TLBnCFG registers which need to be
> > configured
> > > via SW_TLB ioctl. What is the purpose of guest tlb initalization  
> in
> > e500_mmu.c
> > > if we rely on SW_TLB?
> >
> > It's to provide a fallback to user space that doesn't implement  
> SW_TLB
> > configuration yet.
> 
> Do we have such a case now or is it just hypothetical? For the  
> fallback we
> need to initialize the MMUCFG register which I intended to say in the  
> commit
> message.

I don't think we need to support a fallback for e6500, since there's  
nothing to be backwards compatible with.

As for use case, I don't see us ever supporting the guest being a  
different CPU than the host.  Page sizes probably aren't a problem, but  
there are other barriers.

The main reasons that TLBnCFG are settable through SW_TLB are:
1. The guest TLB can be enlarged as a performance hack (like in Topaz,  
though QEMU doesn't currently do this),
2. The legacy default in KVM is based on the e500v1 TLB0 size, which is  
half of what e500v2/e500mc have, and
3. QEMU needs to know the exact geometry of the TLB so that it can  
interpret the shared data properly.

#3 seems like a compelling reason here, to avoid silent weirdness if  
there's a slight mismatch between what QEMU thinks it's modelling and  
what we're actually running on.

-Scott

  reply	other threads:[~2013-01-31 16:48 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-30 13:29 [PATCH 0/5] KVM: PPC: e500: Enable FSL e6500 core Mihai Caraman
2013-01-30 13:29 ` Mihai Caraman
2013-01-30 13:29 ` Mihai Caraman
2013-01-30 13:29 ` [PATCH 1/5] KVM: PPC: e500: Move VCPU's MMUCFG register initialization earlier Mihai Caraman
2013-01-30 13:29   ` Mihai Caraman
2013-01-30 13:29   ` Mihai Caraman
2013-01-31 13:21   ` Alexander Graf
2013-01-31 13:21     ` Alexander Graf
2013-01-31 13:21     ` Alexander Graf
2013-01-31 14:56     ` Caraman Mihai Claudiu-B02008
2013-01-31 14:56       ` Caraman Mihai Claudiu-B02008
2013-01-31 14:58       ` Alexander Graf
2013-01-31 14:58         ` Alexander Graf
2013-01-31 14:58         ` Alexander Graf
2013-01-31 15:26         ` Caraman Mihai Claudiu-B02008
2013-01-31 15:26           ` Caraman Mihai Claudiu-B02008
2013-01-31 16:48           ` Scott Wood [this message]
2013-01-31 16:48             ` Scott Wood
2013-01-31 16:48             ` Scott Wood
2013-01-30 13:29 ` [PATCH 2/5] KVM: PPC: e500: Emulate TLBnPS registers Mihai Caraman
2013-01-30 13:29   ` Mihai Caraman
2013-01-30 13:29   ` Mihai Caraman
2013-01-31 13:24   ` Alexander Graf
2013-01-31 13:24     ` Alexander Graf
2013-01-31 13:24     ` Alexander Graf
2013-01-31 13:32     ` Alexander Graf
2013-01-31 13:32       ` Alexander Graf
2013-01-31 13:32       ` Alexander Graf
2013-01-30 13:29 ` [PATCH 3/5] KVM: PPC: e500: Remove E.PT category from VCPUs Mihai Caraman
2013-01-30 13:29   ` Mihai Caraman
2013-01-30 13:29   ` Mihai Caraman
2013-01-31 13:27   ` Alexander Graf
2013-01-31 13:27     ` Alexander Graf
2013-01-31 13:27     ` Alexander Graf
2013-01-30 13:29 ` [PATCH 4/5] KVM: PPC: e500: Emulate EPTCFG register Mihai Caraman
2013-01-30 13:29   ` Mihai Caraman
2013-01-30 13:29   ` Mihai Caraman
2013-01-31 13:31   ` Alexander Graf
2013-01-31 13:31     ` Alexander Graf
2013-01-31 13:31     ` Alexander Graf
2013-01-31 14:58     ` Caraman Mihai Claudiu-B02008
2013-01-31 14:58       ` Caraman Mihai Claudiu-B02008
2013-01-31 14:58       ` Caraman Mihai Claudiu-B02008
2013-01-30 13:29 ` [PATCH 5/5] KVM: PPC: e500mc: Enable e6500 cores Mihai Caraman
2013-01-30 13:29   ` Mihai Caraman
2013-01-30 13:29   ` Mihai Caraman
2013-01-31 13:31   ` Alexander Graf
2013-01-31 13:31     ` Alexander Graf
2013-01-31 13:31     ` 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=1359650904.31540.0@snotra \
    --to=scottwood@freescale.com \
    --cc=B02008@freescale.com \
    --cc=agraf@suse.de \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.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.