All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH] Remove duplicate setting of the B field in tlbie
@ 2016-09-13  7:45 ` Balbir Singh
  0 siblings, 0 replies; 6+ messages in thread
From: Balbir Singh @ 2016-09-13  7:45 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: kvm, kvm-ppc, Aneesh Kumar K.V



Remove duplicate setting of the the "B" field when doing a tlbie(l).
In compute_tlbie_rb(), the "B" field is set again just before
returning the rb value to be used for tlbie(l).

Signed-off-by: Balbir Singh <bsingharora@gmail.com>
---
Quickly boot tested a VM with these changes in kvm with 64k
as the page size for the guest.

 arch/powerpc/include/asm/kvm_book3s_64.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/powerpc/include/asm/kvm_book3s_64.h b/arch/powerpc/include/asm/kvm_book3s_64.h
index 88d17b4..63b6900 100644
--- a/arch/powerpc/include/asm/kvm_book3s_64.h
+++ b/arch/powerpc/include/asm/kvm_book3s_64.h
@@ -159,7 +159,6 @@ static inline unsigned long compute_tlbie_rb(unsigned long v, unsigned long r,
 	/* This covers 14..54 bits of va*/
 	rb = (v & ~0x7fUL) << 16;		/* AVA field */
 
-	rb |= (v >> HPTE_V_SSIZE_SHIFT) << 8;	/*  B field */
 	/*
 	 * AVA in v had cleared lower 23 bits. We need to derive
 	 * that from pteg index
-- 
2.5.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [RFC][PATCH] Remove duplicate setting of the B field in tlbie
@ 2016-09-13  7:45 ` Balbir Singh
  0 siblings, 0 replies; 6+ messages in thread
From: Balbir Singh @ 2016-09-13  7:45 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: kvm, kvm-ppc, Aneesh Kumar K.V



Remove duplicate setting of the the "B" field when doing a tlbie(l).
In compute_tlbie_rb(), the "B" field is set again just before
returning the rb value to be used for tlbie(l).

Signed-off-by: Balbir Singh <bsingharora@gmail.com>
---
Quickly boot tested a VM with these changes in kvm with 64k
as the page size for the guest.

 arch/powerpc/include/asm/kvm_book3s_64.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/powerpc/include/asm/kvm_book3s_64.h b/arch/powerpc/include/asm/kvm_book3s_64.h
index 88d17b4..63b6900 100644
--- a/arch/powerpc/include/asm/kvm_book3s_64.h
+++ b/arch/powerpc/include/asm/kvm_book3s_64.h
@@ -159,7 +159,6 @@ static inline unsigned long compute_tlbie_rb(unsigned long v, unsigned long r,
 	/* This covers 14..54 bits of va*/
 	rb = (v & ~0x7fUL) << 16;		/* AVA field */
 
-	rb |= (v >> HPTE_V_SSIZE_SHIFT) << 8;	/*  B field */
 	/*
 	 * AVA in v had cleared lower 23 bits. We need to derive
 	 * that from pteg index
-- 
2.5.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [RFC][PATCH] Remove duplicate setting of the B field in tlbie
  2016-09-13  7:45 ` Balbir Singh
@ 2016-09-14  4:55   ` Aneesh Kumar K.V
  -1 siblings, 0 replies; 6+ messages in thread
From: Aneesh Kumar K.V @ 2016-09-14  4:55 UTC (permalink / raw)
  To: Balbir Singh, Paul Mackerras; +Cc: kvm, kvm-ppc

Balbir Singh <bsingharora@gmail.com> writes:

> Remove duplicate setting of the the "B" field when doing a tlbie(l).
> In compute_tlbie_rb(), the "B" field is set again just before
> returning the rb value to be used for tlbie(l).
>
> Signed-off-by: Balbir Singh <bsingharora@gmail.com>
> ---
> Quickly boot tested a VM with these changes in kvm with 64k
> as the page size for the guest.
>
>  arch/powerpc/include/asm/kvm_book3s_64.h | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/arch/powerpc/include/asm/kvm_book3s_64.h b/arch/powerpc/include/asm/kvm_book3s_64.h
> index 88d17b4..63b6900 100644
> --- a/arch/powerpc/include/asm/kvm_book3s_64.h
> +++ b/arch/powerpc/include/asm/kvm_book3s_64.h
> @@ -159,7 +159,6 @@ static inline unsigned long compute_tlbie_rb(unsigned long v, unsigned long r,
>  	/* This covers 14..54 bits of va*/
>  	rb = (v & ~0x7fUL) << 16;		/* AVA field */
>
> -	rb |= (v >> HPTE_V_SSIZE_SHIFT) << 8;	/*  B field */
>  	/*
>  	 * AVA in v had cleared lower 23 bits. We need to derive
>  	 * that from pteg index

Can we keep this and remove the other. This is much easier to follow
than

	rb |= (v >> 54) & 0x300;		/* B field */

-aneesh


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC][PATCH] Remove duplicate setting of the B field in tlbie
@ 2016-09-14  4:55   ` Aneesh Kumar K.V
  0 siblings, 0 replies; 6+ messages in thread
From: Aneesh Kumar K.V @ 2016-09-14  4:55 UTC (permalink / raw)
  To: Balbir Singh, Paul Mackerras; +Cc: kvm, kvm-ppc

Balbir Singh <bsingharora@gmail.com> writes:

> Remove duplicate setting of the the "B" field when doing a tlbie(l).
> In compute_tlbie_rb(), the "B" field is set again just before
> returning the rb value to be used for tlbie(l).
>
> Signed-off-by: Balbir Singh <bsingharora@gmail.com>
> ---
> Quickly boot tested a VM with these changes in kvm with 64k
> as the page size for the guest.
>
>  arch/powerpc/include/asm/kvm_book3s_64.h | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/arch/powerpc/include/asm/kvm_book3s_64.h b/arch/powerpc/include/asm/kvm_book3s_64.h
> index 88d17b4..63b6900 100644
> --- a/arch/powerpc/include/asm/kvm_book3s_64.h
> +++ b/arch/powerpc/include/asm/kvm_book3s_64.h
> @@ -159,7 +159,6 @@ static inline unsigned long compute_tlbie_rb(unsigned long v, unsigned long r,
>  	/* This covers 14..54 bits of va*/
>  	rb = (v & ~0x7fUL) << 16;		/* AVA field */
>
> -	rb |= (v >> HPTE_V_SSIZE_SHIFT) << 8;	/*  B field */
>  	/*
>  	 * AVA in v had cleared lower 23 bits. We need to derive
>  	 * that from pteg index

Can we keep this and remove the other. This is much easier to follow
than

	rb |= (v >> 54) & 0x300;		/* B field */

-aneesh


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC][PATCH] Remove duplicate setting of the B field in tlbie
  2016-09-14  4:55   ` Aneesh Kumar K.V
@ 2016-09-14  6:15     ` Balbir Singh
  -1 siblings, 0 replies; 6+ messages in thread
From: Balbir Singh @ 2016-09-14  6:15 UTC (permalink / raw)
  To: Aneesh Kumar K.V, Paul Mackerras; +Cc: kvm, kvm-ppc



On 14/09/16 14:55, Aneesh Kumar K.V wrote:
> Balbir Singh <bsingharora@gmail.com> writes:
> 
>> Remove duplicate setting of the the "B" field when doing a tlbie(l).
>> In compute_tlbie_rb(), the "B" field is set again just before
>> returning the rb value to be used for tlbie(l).
>>
>> Signed-off-by: Balbir Singh <bsingharora@gmail.com>
>> ---
>> Quickly boot tested a VM with these changes in kvm with 64k
>> as the page size for the guest.
>>
>>  arch/powerpc/include/asm/kvm_book3s_64.h | 1 -
>>  1 file changed, 1 deletion(-)
>>
>> diff --git a/arch/powerpc/include/asm/kvm_book3s_64.h b/arch/powerpc/include/asm/kvm_book3s_64.h
>> index 88d17b4..63b6900 100644
>> --- a/arch/powerpc/include/asm/kvm_book3s_64.h
>> +++ b/arch/powerpc/include/asm/kvm_book3s_64.h
>> @@ -159,7 +159,6 @@ static inline unsigned long compute_tlbie_rb(unsigned long v, unsigned long r,
>>  	/* This covers 14..54 bits of va*/
>>  	rb = (v & ~0x7fUL) << 16;		/* AVA field */
>>
>> -	rb |= (v >> HPTE_V_SSIZE_SHIFT) << 8;	/*  B field */
>>  	/*
>>  	 * AVA in v had cleared lower 23 bits. We need to derive
>>  	 * that from pteg index
> 
> Can we keep this and remove the other. This is much easier to follow
> than
> 
> 	rb |= (v >> 54) & 0x300;		/* B field */
> 

OK, but I think for 64K page size

                rb &= ~((1ul << mmu_psize_defs[a_psize].shift) - 1);

ends up cleaning up the "B" field. That is why we've had the two "B" field settings.

Let me double check with some coffee.

Balbir Singh.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC][PATCH] Remove duplicate setting of the B field in tlbie
@ 2016-09-14  6:15     ` Balbir Singh
  0 siblings, 0 replies; 6+ messages in thread
From: Balbir Singh @ 2016-09-14  6:15 UTC (permalink / raw)
  To: Aneesh Kumar K.V, Paul Mackerras; +Cc: kvm, kvm-ppc



On 14/09/16 14:55, Aneesh Kumar K.V wrote:
> Balbir Singh <bsingharora@gmail.com> writes:
> 
>> Remove duplicate setting of the the "B" field when doing a tlbie(l).
>> In compute_tlbie_rb(), the "B" field is set again just before
>> returning the rb value to be used for tlbie(l).
>>
>> Signed-off-by: Balbir Singh <bsingharora@gmail.com>
>> ---
>> Quickly boot tested a VM with these changes in kvm with 64k
>> as the page size for the guest.
>>
>>  arch/powerpc/include/asm/kvm_book3s_64.h | 1 -
>>  1 file changed, 1 deletion(-)
>>
>> diff --git a/arch/powerpc/include/asm/kvm_book3s_64.h b/arch/powerpc/include/asm/kvm_book3s_64.h
>> index 88d17b4..63b6900 100644
>> --- a/arch/powerpc/include/asm/kvm_book3s_64.h
>> +++ b/arch/powerpc/include/asm/kvm_book3s_64.h
>> @@ -159,7 +159,6 @@ static inline unsigned long compute_tlbie_rb(unsigned long v, unsigned long r,
>>  	/* This covers 14..54 bits of va*/
>>  	rb = (v & ~0x7fUL) << 16;		/* AVA field */
>>
>> -	rb |= (v >> HPTE_V_SSIZE_SHIFT) << 8;	/*  B field */
>>  	/*
>>  	 * AVA in v had cleared lower 23 bits. We need to derive
>>  	 * that from pteg index
> 
> Can we keep this and remove the other. This is much easier to follow
> than
> 
> 	rb |= (v >> 54) & 0x300;		/* B field */
> 

OK, but I think for 64K page size

                rb &= ~((1ul << mmu_psize_defs[a_psize].shift) - 1);

ends up cleaning up the "B" field. That is why we've had the two "B" field settings.

Let me double check with some coffee.

Balbir Singh.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-09-14  6:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-13  7:45 [RFC][PATCH] Remove duplicate setting of the B field in tlbie Balbir Singh
2016-09-13  7:45 ` Balbir Singh
2016-09-14  4:55 ` Aneesh Kumar K.V
2016-09-14  4:55   ` Aneesh Kumar K.V
2016-09-14  6:15   ` Balbir Singh
2016-09-14  6:15     ` Balbir Singh

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.