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: Wood Scott-B07421 <B07421@freescale.com>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH 2/2] powerpc/e6500: TLB miss handler with hardware tablewalk support
Date: Tue, 11 Sep 2012 12:24:26 -0500	[thread overview]
Message-ID: <504F73CA.4020209@freescale.com> (raw)
In-Reply-To: <300B73AA675FCE4A93EB4FC1D42459FF1DC945@039-SN2MPN1-011.039d.mgd.msft.net>

On 09/11/2012 12:06 PM, Caraman Mihai Claudiu-B02008 wrote:
>> diff --git a/arch/powerpc/mm/tlb_low_64e.S
>> b/arch/powerpc/mm/tlb_low_64e.S
>> index efe0f33..8e82772 100644
>> --- a/arch/powerpc/mm/tlb_low_64e.S
>> +++ b/arch/powerpc/mm/tlb_low_64e.S
>> @@ -232,6 +232,173 @@ itlb_miss_fault_bolted:
>>  	beq	tlb_miss_common_bolted
>>  	b	itlb_miss_kernel_bolted
>>
>> +/*
>> + * TLB miss handling for e6500 and derivatives, using hardware
>> tablewalk.
>> + *
>> + * Linear mapping is bolted: no virtual page table or nested TLB misses
>> + * Indirect entries in TLB1, hardware loads resulting direct entries
>> + *    into TLB0
>> + * No HES or NV hint on TLB1, so we need to do software round-robin
>> + * No tlbsrx. so we need a spinlock, and we have to deal
>> + *    with MAS-damage caused by tlbsx
>> + * 4K pages only
>> + */
>> +
>> +	START_EXCEPTION(instruction_tlb_miss_e6500)
>> +	tlb_prolog_bolted SPRN_SRR0
>> +
>> +	ld	r11,PACA_TLB_PER_CORE_PTR(r13)
>> +	srdi.	r15,r16,60		/* get region */
>> +	ori	r16,r16,1
>> +
>> +	TLB_MISS_STATS_SAVE_INFO_BOLTED
>> +	bne	tlb_miss_kernel_e6500	/* user/kernel test */
>> +
>> +	b	tlb_miss_common_e6500
>> +
>> +	START_EXCEPTION(data_tlb_miss_e6500)
>> +	tlb_prolog_bolted SPRN_DEAR
>> +
>> +	ld	r11,PACA_TLB_PER_CORE_PTR(r13)
>> +	srdi.	r15,r16,60		/* get region */
>> +	rldicr	r16,r16,0,62
>> +
>> +	TLB_MISS_STATS_SAVE_INFO_BOLTED
>> +	bne	tlb_miss_kernel_e6500	/* user vs kernel check */
>> +
> 
> This ends up calling DO_KVM macro twice with same parameters which
> generates the following compile error:
> 
>  arch/powerpc/mm/tlb_low_64e.S:307: Error: symbol `kvmppc_resume_14_0x01B' is already defined
>  arch/powerpc/mm/tlb_low_64e.S:319: Error: symbol `kvmppc_resume_13_0x01B' is already defined

I assume the reason you don't already see this is because you only did
DO_KVM for the bolted version of the handlers.

> We can live with it if we patch DO_KVM like this:
> 
> diff --git a/arch/powerpc/include/asm/kvm_booke_hv_asm.h b/arch/powerpc/include/asm/kvm_booke_hv_asm.h
> index 4610fb0..029ecab 100644
> --- a/arch/powerpc/include/asm/kvm_booke_hv_asm.h
> +++ b/arch/powerpc/include/asm/kvm_booke_hv_asm.h
> @@ -55,9 +55,9 @@
>  #ifdef CONFIG_KVM_BOOKE_HV
>  BEGIN_FTR_SECTION
>         mtocrf  0x80, r11       /* check MSR[GS] without clobbering reg */
> -       bf      3, kvmppc_resume_\intno\()_\srr1
> +       bf      3, 1f
>         b       kvmppc_handler_\intno\()_\srr1
> -kvmppc_resume_\intno\()_\srr1:
> +1:
>  END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
>  #endif
>  .endm

Please do that, though maybe use a more unique label number in case the
calling context is using numbered labels.

-Scott

      reply	other threads:[~2012-09-11 17:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-14 23:41 [PATCH 2/2] powerpc/e6500: TLB miss handler with hardware tablewalk support Scott Wood
2012-06-15  1:05 ` Benjamin Herrenschmidt
2012-06-15 16:50   ` Scott Wood
2012-06-15 22:02     ` Benjamin Herrenschmidt
2012-07-19 20:12   ` Scott Wood
2012-09-08 23:09   ` Benjamin Herrenschmidt
2012-09-07  4:41 ` Benjamin Herrenschmidt
     [not found]   ` <504A4C3D.3040709@freescale.com>
2012-09-07 23:01     ` Scott Wood
2012-09-07 23:50       ` Benjamin Herrenschmidt
2012-09-08  0:55         ` Nishanth Aravamudan
2012-09-08 10:15           ` Benjamin Herrenschmidt
2012-09-11  0:26         ` Scott Wood
2012-09-11 17:06 ` Caraman Mihai Claudiu-B02008
2012-09-11 17:24   ` Scott Wood [this message]

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=504F73CA.4020209@freescale.com \
    --to=scottwood@freescale.com \
    --cc=B02008@freescale.com \
    --cc=B07421@freescale.com \
    --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.