All of lore.kernel.org
 help / color / mirror / Atom feed
From: r.sricharan@ti.com (Sricharan R)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 5/6] ARM: mm: Update runtime patching code to THUMB2 mode
Date: Sat, 3 Aug 2013 18:21:49 +0530	[thread overview]
Message-ID: <51FCFCE5.1010709@ti.com> (raw)
In-Reply-To: <alpine.LFD.2.03.1308022333470.14472@syhkavp.arg>

Hi Nicolas,

On Saturday 03 August 2013 09:10 AM, Nicolas Pitre wrote:
> On Wed, 31 Jul 2013, Santosh Shilimkar wrote:
>
>> From: Sricharan R <r.sricharan@ti.com>
>>
>> Update the runtime patching  code to support Thumb2. In testing the
>> 64 bit patching code, the issue was uncovered.
>>
>> For better review, the patch is kept separate. If needed it can be
>> merged into "ARM: LPAE: Correct virt_to_phys patching for 64 bit
>> physical addresses"
>>
>> Cc: Nicolas Pitre <nico@linaro.org>
>> Cc: Russell King <linux@arm.linux.org.uk>
>>
>> Signed-off-by: Sricharan R <r.sricharan@ti.com>
>> [santosh.shilimkar at ti.com: reduced #ifdef, updated commit log]
>> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
>> ---
>>  arch/arm/kernel/head.S |   69 ++++++++++++++++++++++++++++--------------------
>>  1 file changed, 40 insertions(+), 29 deletions(-)
>>
>> diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
>> index aa3b0f7..a70d330 100644
>> --- a/arch/arm/kernel/head.S
>> +++ b/arch/arm/kernel/head.S
>> @@ -573,62 +573,73 @@ ENDPROC(__fixup_pv_table)
>>  
>>  	.text
>>  __fixup_a_pv_table:
>> -#ifdef CONFIG_THUMB2_KERNEL
>> -	lsls	r6, #24
>> -	beq	2f
>> -	clz	r7, r6
>> -	lsr	r6, #24
>> -	lsl	r6, r7
>> -	bic	r6, #0x0080
>> -	lsrs	r7, #1
>> -	orrcs	r6, #0x0080
>> -	orr	r6, r6, r7, lsl #12
>> -	orr	r6, #0x4000
>> -	b	2f
>> -1:	add     r7, r3
>> -	ldrh	ip, [r7, #2]
>> -	and	ip, 0x8f00
>> -	orr	ip, r6	@ mask in offset bits 31-24
>> -	strh	ip, [r7, #2]
>> -2:	cmp	r4, r5
>> -	ldrcc	r7, [r4], #4	@ use branch for delay slot
>> -	bcc	1b
>> -	bx	lr
>> -#else
>>  	adr	r0, 5f
>>  	b	4f
>>  1:	ldr	ip, [r7, r3]
>> + THUMB(	1:	add	r7, r3)
>> + THUMB(	ldrh	ip, [r7])
>> + THUMB(	ldrh	r6, [r7, #2])
>> + THUMB(	orr	ip, r6, ip, lsl #16)
>> + ARM( 1: ldr	ip, [r7, r3])
>>  	lsr	r6, ip, #20		@ extract opcode
> Please don't do this.
>
> - Remember my comment about using mnemonics such as "lsr" in an 
>   ARM-mode compiled kernel when old binutils are used.
 Ok, i will remove this to be generic.
> - There is rather little commonalities between the patching of ARM 
>   instructions vs Thumb instructions.  Especially after you take into 
>   account my previous comments.  Interlacing them makes it harder 
>   to follow as well in this case.
>
>
> Nicolas
 Ok, then i will keep it under #ifdef CONFIG_THUMB2_KERNEL
 as it was originally.

Regards,
 Sricharan
 

  reply	other threads:[~2013-08-03 12:51 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-31 16:44 [PATCH v2 0/6] ARM: mm: Extend the runtime patch stub for PAE systems Santosh Shilimkar
2013-07-31 16:44 ` [PATCH v2 1/6] ARM: mm: LPAE: use phys_addr_t appropriately in p2v and v2p conversions Santosh Shilimkar
2013-07-31 16:44 ` [PATCH v2 2/6] ARM: mm: Introduce virt_to_idmap() with an arch hook Santosh Shilimkar
2013-08-03  1:53   ` Nicolas Pitre
2013-08-03 19:03     ` Santosh Shilimkar
2013-07-31 16:44 ` [PATCH v2 3/6] ARM: mm: Move the idmap print to appropriate place in the code Santosh Shilimkar
2013-08-03  1:55   ` Nicolas Pitre
2013-07-31 16:44 ` [PATCH v2 4/6] ARM: mm: LPAE: Correct virt_to_phys patching for 64 bit physical addresses Santosh Shilimkar
2013-07-31 18:31   ` Sricharan R
2013-08-03  3:32     ` Nicolas Pitre
2013-08-03  3:28   ` Nicolas Pitre
2013-08-03 12:47     ` Sricharan R
2013-08-03 14:01       ` Nicolas Pitre
2013-08-03 19:25         ` Santosh Shilimkar
2013-08-04  5:32           ` Nicolas Pitre
2013-08-05 14:38             ` Santosh Shilimkar
2013-08-03 14:05       ` Russell King - ARM Linux
2013-08-03 14:09         ` Russell King - ARM Linux
2013-08-03 19:15           ` Santosh Shilimkar
2013-08-09 19:37             ` Santosh Shilimkar
2013-07-31 16:44 ` [PATCH v2 5/6] ARM: mm: Update runtime patching code to THUMB2 mode Santosh Shilimkar
2013-08-03  3:40   ` Nicolas Pitre
2013-08-03 12:51     ` Sricharan R [this message]
2013-07-31 16:44 ` [PATCH v2 6/6] ARM: mm: Recreate kernel mappings in early_paging_init() Santosh Shilimkar
2013-08-03  1:52 ` [PATCH v2 0/6] ARM: mm: Extend the runtime patch stub for PAE systems Nicolas Pitre
2013-08-03 19:02   ` Santosh Shilimkar

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=51FCFCE5.1010709@ti.com \
    --to=r.sricharan@ti.com \
    --cc=linux-arm-kernel@lists.infradead.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.