diff mbox

[v2] powerpc/fsl-booke: declare tlbcam_index for use in c file

Message ID 1229654093-11398-1-git-send-email-yu.liu@freescale.com (mailing list archive)
State Not Applicable, archived
Delegated to: Kumar Gala
Headers show

Commit Message

Liu Yu-B13201 Dec. 19, 2008, 2:34 a.m. UTC
KVM on E500 platform currently utilize TLB1 entries without bothering host,
that is using unused TLB1 entries.

So, KVM needs to read tlbcam_index to know exactly
which TLB1 entry is unused by host.

Signed-off-by: Liu Yu <yu.liu@freescale.com>
---
[v2]
Remove num_tlbcam_entries declare and read from SPRN_TLB1CFG in KVM instead.

 arch/powerpc/include/asm/mmu-fsl-booke.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Comments

Liu Yu-B13201 Jan. 4, 2009, 6:57 a.m. UTC | #1
Hi Kumar,

Can I get your ack?
So that I can submit this patch through KVM tree.


> -----Original Message-----
> From: Liu Yu-B13201 
> Sent: Friday, December 19, 2008 10:35 AM
> To: kvm-ppc@vger.kernel.org; linuxppc-dev@ozlabs.org
> Cc: hollisb@us.ibm.com; Gala Kumar-B11780; Piepho 
> Trent-B16872; Wood Scott-B07421; Liu Yu-B13201
> Subject: [PATCH v2] powerpc/fsl-booke: declare tlbcam_index 
> for use in c file
> 
> KVM on E500 platform currently utilize TLB1 entries without 
> bothering host,
> that is using unused TLB1 entries.
> 
> So, KVM needs to read tlbcam_index to know exactly
> which TLB1 entry is unused by host.
> 
> Signed-off-by: Liu Yu <yu.liu@freescale.com>
> ---
> [v2]
> Remove num_tlbcam_entries declare and read from SPRN_TLB1CFG 
> in KVM instead.
> 
>  arch/powerpc/include/asm/mmu-fsl-booke.h |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/mmu-fsl-booke.h 
> b/arch/powerpc/include/asm/mmu-fsl-booke.h
> index 925d93c..c86af6c 100644
> --- a/arch/powerpc/include/asm/mmu-fsl-booke.h
> +++ b/arch/powerpc/include/asm/mmu-fsl-booke.h
> @@ -73,6 +73,8 @@
>  
>  #ifndef __ASSEMBLY__
>  
> +extern unsigned int tlbcam_index;
> +
>  typedef struct {
>  	unsigned long id;
>  	unsigned long vdso_base;
> -- 
> 1.5.4
> 
>
Kumar Gala Jan. 5, 2009, 4:26 p.m. UTC | #2
I'll pick this up, but wondering about this patch vs Trent's changes  
to remove this.

How is KVM on fsl-booke using this value?

- k

On Jan 4, 2009, at 12:57 AM, Liu Yu wrote:

> Hi Kumar,
>
> Can I get your ack?
> So that I can submit this patch through KVM tree.
>
>
>> -----Original Message-----
>> From: Liu Yu-B13201
>> Sent: Friday, December 19, 2008 10:35 AM
>> To: kvm-ppc@vger.kernel.org; linuxppc-dev@ozlabs.org
>> Cc: hollisb@us.ibm.com; Gala Kumar-B11780; Piepho
>> Trent-B16872; Wood Scott-B07421; Liu Yu-B13201
>> Subject: [PATCH v2] powerpc/fsl-booke: declare tlbcam_index
>> for use in c file
>>
>> KVM on E500 platform currently utilize TLB1 entries without
>> bothering host,
>> that is using unused TLB1 entries.
>>
>> So, KVM needs to read tlbcam_index to know exactly
>> which TLB1 entry is unused by host.
>>
>> Signed-off-by: Liu Yu <yu.liu@freescale.com>
>> ---
>> [v2]
>> Remove num_tlbcam_entries declare and read from SPRN_TLB1CFG
>> in KVM instead.
>>
>> arch/powerpc/include/asm/mmu-fsl-booke.h |    2 ++
>> 1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/powerpc/include/asm/mmu-fsl-booke.h
>> b/arch/powerpc/include/asm/mmu-fsl-booke.h
>> index 925d93c..c86af6c 100644
>> --- a/arch/powerpc/include/asm/mmu-fsl-booke.h
>> +++ b/arch/powerpc/include/asm/mmu-fsl-booke.h
>> @@ -73,6 +73,8 @@
>>
>> #ifndef __ASSEMBLY__
>>
>> +extern unsigned int tlbcam_index;
>> +
>> typedef struct {
>> 	unsigned long id;
>> 	unsigned long vdso_base;
>> -- 
>> 1.5.4
>>
>>
> --
> 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
Hollis Blanchard Jan. 5, 2009, 4:52 p.m. UTC | #3
On Mon, 2009-01-05 at 10:26 -0600, Kumar Gala wrote:
> I'll pick this up, but wondering about this patch vs Trent's changes  
> to remove this.

Please do not pick up this patch; if you ack it, let us push it through
kvm.git. Otherwise we need to wait for it to travel from kumar.git ->
benh.git -> linus.git -> kvm.git before KVM will build.

If you're referring to http://patchwork.ozlabs.org/patch/12882/, that
patch removes a different variable (num_tlbcam_entries). tlbcam_index,
referenced below, still exists.

> How is KVM on fsl-booke using this value?

I'll let Yu answer that in more detail, but in
http://git.kernel.org/?p=linux/kernel/git/avi/kvm.git;a=blob_plain;f=arch/powerpc/kvm/e500_tlb.c;hb=HEAD it looks like he's storing guest TLB1 mappings in the real TLB1, alongside the host TLB1 mappings. Accordingly, he needs to know where the host mappings are to avoid clobbering them.

> On Jan 4, 2009, at 12:57 AM, Liu Yu wrote:
> 
> > Hi Kumar,
> >
> > Can I get your ack?
> > So that I can submit this patch through KVM tree.
> >
> >
> >> -----Original Message-----
> >> From: Liu Yu-B13201
> >> Sent: Friday, December 19, 2008 10:35 AM
> >> To: kvm-ppc@vger.kernel.org; linuxppc-dev@ozlabs.org
> >> Cc: hollisb@us.ibm.com; Gala Kumar-B11780; Piepho
> >> Trent-B16872; Wood Scott-B07421; Liu Yu-B13201
> >> Subject: [PATCH v2] powerpc/fsl-booke: declare tlbcam_index
> >> for use in c file
> >>
> >> KVM on E500 platform currently utilize TLB1 entries without
> >> bothering host,
> >> that is using unused TLB1 entries.
> >>
> >> So, KVM needs to read tlbcam_index to know exactly
> >> which TLB1 entry is unused by host.
> >>
> >> Signed-off-by: Liu Yu <yu.liu@freescale.com>
> >> ---
> >> [v2]
> >> Remove num_tlbcam_entries declare and read from SPRN_TLB1CFG
> >> in KVM instead.
> >>
> >> arch/powerpc/include/asm/mmu-fsl-booke.h |    2 ++
> >> 1 files changed, 2 insertions(+), 0 deletions(-)
> >>
> >> diff --git a/arch/powerpc/include/asm/mmu-fsl-booke.h
> >> b/arch/powerpc/include/asm/mmu-fsl-booke.h
> >> index 925d93c..c86af6c 100644
> >> --- a/arch/powerpc/include/asm/mmu-fsl-booke.h
> >> +++ b/arch/powerpc/include/asm/mmu-fsl-booke.h
> >> @@ -73,6 +73,8 @@
> >>
> >> #ifndef __ASSEMBLY__
> >>
> >> +extern unsigned int tlbcam_index;
> >> +
> >> typedef struct {
> >> 	unsigned long id;
> >> 	unsigned long vdso_base;
> >> -- 
> >> 1.5.4
> >>
> >>
> > --
> > 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
>
Liu Yu-B13201 Jan. 6, 2009, 4:55 a.m. UTC | #4
> -----Original Message-----
> From: kvm-ppc-owner@vger.kernel.org 
> [mailto:kvm-ppc-owner@vger.kernel.org] On Behalf Of Hollis Blanchard
> Sent: Tuesday, January 06, 2009 12:52 AM
> To: Gala Kumar-B11780
> Cc: Liu Yu-B13201; kvm-ppc@vger.kernel.org; 
> linuxppc-dev@ozlabs.org; Piepho Trent-B16872; Wood Scott-B07421
> Subject: Re: [PATCH v2] powerpc/fsl-booke: declare 
> tlbcam_index for use inc file
> 
> On Mon, 2009-01-05 at 10:26 -0600, Kumar Gala wrote:
> > I'll pick this up, but wondering about this patch vs 
> Trent's changes  
> > to remove this.
> 
> Please do not pick up this patch; if you ack it, let us push 
> it through
> kvm.git. Otherwise we need to wait for it to travel from kumar.git ->
> benh.git -> linus.git -> kvm.git before KVM will build.
> 
> If you're referring to http://patchwork.ozlabs.org/patch/12882/, that
> patch removes a different variable (num_tlbcam_entries). tlbcam_index,
> referenced below, still exists.

Since v2 has removed the num_tlbcam_entries declare, this patch has no
conflict with Trent's changes.

> 
> > How is KVM on fsl-booke using this value?
> 
> I'll let Yu answer that in more detail, but in
> http://git.kernel.org/?p=linux/kernel/git/avi/kvm.git;a=blob_p
lain;f=arch/powerpc/kvm/e500_tlb.c;hb=HEAD it looks like he's storing >
guest TLB1 mappings in the real TLB1, alongside the host TLB1 
> mappings. Accordingly, he needs to know where the host 
> mappings are to avoid clobbering them.

Yes, just like Hollis described.
KVM only read tlbcam_index to know which entries are used by host.
And kvm assumes the value is fixed and will never change it.

> 
> > On Jan 4, 2009, at 12:57 AM, Liu Yu wrote:
> > 
> > > Hi Kumar,
> > >
> > > Can I get your ack?
> > > So that I can submit this patch through KVM tree.
> > >
> > >
> > >> -----Original Message-----
> > >> From: Liu Yu-B13201
> > >> Sent: Friday, December 19, 2008 10:35 AM
> > >> To: kvm-ppc@vger.kernel.org; linuxppc-dev@ozlabs.org
> > >> Cc: hollisb@us.ibm.com; Gala Kumar-B11780; Piepho
> > >> Trent-B16872; Wood Scott-B07421; Liu Yu-B13201
> > >> Subject: [PATCH v2] powerpc/fsl-booke: declare tlbcam_index
> > >> for use in c file
> > >>
> > >> KVM on E500 platform currently utilize TLB1 entries without
> > >> bothering host,
> > >> that is using unused TLB1 entries.
> > >>
> > >> So, KVM needs to read tlbcam_index to know exactly
> > >> which TLB1 entry is unused by host.
> > >>
> > >> Signed-off-by: Liu Yu <yu.liu@freescale.com>
> > >> ---
> > >> [v2]
> > >> Remove num_tlbcam_entries declare and read from SPRN_TLB1CFG
> > >> in KVM instead.
> > >>
> > >> arch/powerpc/include/asm/mmu-fsl-booke.h |    2 ++
> > >> 1 files changed, 2 insertions(+), 0 deletions(-)
> > >>
> > >> diff --git a/arch/powerpc/include/asm/mmu-fsl-booke.h
> > >> b/arch/powerpc/include/asm/mmu-fsl-booke.h
> > >> index 925d93c..c86af6c 100644
> > >> --- a/arch/powerpc/include/asm/mmu-fsl-booke.h
> > >> +++ b/arch/powerpc/include/asm/mmu-fsl-booke.h
> > >> @@ -73,6 +73,8 @@
> > >>
> > >> #ifndef __ASSEMBLY__
> > >>
> > >> +extern unsigned int tlbcam_index;
> > >> +
> > >> typedef struct {
> > >> 	unsigned long id;
> > >> 	unsigned long vdso_base;
> > >> -- 
> > >> 1.5.4
> > >>
> > >>
> > > --
> > > 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
> > 
> -- 
> Hollis Blanchard
> IBM Linux Technology Center
> 
> --
> 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
>
Kumar Gala Jan. 7, 2009, 3:09 p.m. UTC | #5
On Dec 18, 2008, at 8:34 PM, Liu Yu wrote:

> KVM on E500 platform currently utilize TLB1 entries without  
> bothering host,
> that is using unused TLB1 entries.
>
> So, KVM needs to read tlbcam_index to know exactly
> which TLB1 entry is unused by host.
>
> Signed-off-by: Liu Yu <yu.liu@freescale.com>
> ---
> [v2]
> Remove num_tlbcam_entries declare and read from SPRN_TLB1CFG in KVM  
> instead.
>
> arch/powerpc/include/asm/mmu-fsl-booke.h |    2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/mmu-fsl-booke.h b/arch/powerpc/ 
> include/asm/mmu-fsl-booke.h
> index 925d93c..c86af6c 100644
> --- a/arch/powerpc/include/asm/mmu-fsl-booke.h
> +++ b/arch/powerpc/include/asm/mmu-fsl-booke.h
> @@ -73,6 +73,8 @@
>
> #ifndef __ASSEMBLY__
>
> +extern unsigned int tlbcam_index;
> +
> typedef struct {
> 	unsigned long id;
> 	unsigned long vdso_base;
> -- 
> 1.5.4

Acked-by: Kumar Gala <galak@kernel.crashing.org>

(Hollis will you deal with sending this via the KVM tree?)

- k
diff mbox

Patch

diff --git a/arch/powerpc/include/asm/mmu-fsl-booke.h b/arch/powerpc/include/asm/mmu-fsl-booke.h
index 925d93c..c86af6c 100644
--- a/arch/powerpc/include/asm/mmu-fsl-booke.h
+++ b/arch/powerpc/include/asm/mmu-fsl-booke.h
@@ -73,6 +73,8 @@ 
 
 #ifndef __ASSEMBLY__
 
+extern unsigned int tlbcam_index;
+
 typedef struct {
 	unsigned long id;
 	unsigned long vdso_base;