Re: [PATCH 02/10] MIPS: tlbex: Clear ISA bit when writing to handle_tlb{l,m,s}

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 7 Nov 2016, Paul Burton wrote:

> When generating TLB exception handling code we write to memory reserved
> at the handle_tlbl, handle_tlbm & handle_tlbs symbols. Up until now the
> ISA bit has always been clear simply because the assembly code reserving
> the space for those functions places no instructions in them. In
> preparation for marking all LEAF functions as containing code,
> explicitly clear the ISA bit when calculating the addresses at which to
> write TLB exception handling code.
> 
> Signed-off-by: Paul Burton <paul.burton@xxxxxxxxxx>
> ---

 You can avoid this extra code and unnecessary run-time calculation by 
defining a data alias and using that instead.  E.g. (expanding LEAF):

		.globl	handle_tlbl
		.globl	handle_tlbl_data
		.align	2
		.type	handle_tlbl, @function
		.ent	handle_tlbl, 0
handle_tlbl:
handle_tlbl_data = .
		.frame  sp, 0, ra

will make `handle_tlbl' and `handle_tlbl_data' both refer to the same 
location, hovewer the latter not being a (code) label will have the ISA 
bit clear, so you'll be able to use it in `build_r4000_tlb_load_handler' 
without a need to clear the ISA bit explicitly as it won't have been set 
in the first place.  See how this comes out in `objdump'.

 You might want to wrap the above piece in a macro, I suppose, maybe even 
do it implicitly in LEAF, etc, or maybe just follow the path of least 
resistance and use:

LEAF(handle_tlbl)
ABS(handle_tlbl_data, .)

etc. in arch/mips/mm/tlb-funcs.S, relying on both macros' internals -- 
being a pseudo `.frame' should not affect the value of `handle_tlbl_data' 
whether it precedes or follows the assignment operation.

 You could use `.set' or `.equ' in place of `=' too; there's also `.equiv' 
with a slightly different semantics as it bails out on an attempt of 
symbol redefinition while the other three ways do not.

 HTH,

  Maciej




[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux