From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752602AbbEGHEF (ORCPT ); Thu, 7 May 2015 03:04:05 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:42216 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751818AbbEGHEA (ORCPT ); Thu, 7 May 2015 03:04:00 -0400 X-Listener-Flag: 11101 Message-ID: <1430982231.4930.4.camel@mtksdaap41> Subject: Re: [PATCH] ARM: alignment: Use is_wide_instruction() to check wide instruction From: Yingjoe Chen To: Russell King CC: Catalin Marinas , , , Date: Thu, 7 May 2015 15:03:51 +0800 In-Reply-To: <1428674741-5409-1-git-send-email-yingjoe.chen@mediatek.com> References: <1428674741-5409-1-git-send-email-yingjoe.chen@mediatek.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2015-04-10 at 22:05 +0800, Yingjoe Chen wrote: > I first notice the comment is incorrect, then I realize there's another > macro which do exactly the same thing. > Tested with hand written userspace program with a few wide instructions > to make sure this still work as expect. > > 8<------------------------------------------------- > do_alignment() is using locally added IS_T32() macro to check if an > instruction is a Thumb-2 32 bit instruction. The macro > is_wide_instruction() is doing the same thing, with slightly faster > implementation. > Change to use is_wide_instruction() in do_alignment() and remove > IS_T32(). > Hi Russell, Any suggestion about this patch? Should I put this into your patch system? Joe.C > Signed-off-by: Yingjoe Chen > --- > arch/arm/mm/alignment.c | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c > index 2c0c541..f8e82f5 100644 > --- a/arch/arm/mm/alignment.c > +++ b/arch/arm/mm/alignment.c > @@ -71,10 +71,6 @@ > > #define BAD_INSTR 0xdeadc0de > > -/* Thumb-2 32 bit format per ARMv7 DDI0406A A6.3, either f800h,e800h,f800h */ > -#define IS_T32(hi16) \ > - (((hi16) & 0xe000) == 0xe000 && ((hi16) & 0x1800)) > - > static unsigned long ai_user; > static unsigned long ai_sys; > static void *ai_sys_last_pc; > @@ -770,7 +766,7 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs) > tinstr = __mem_to_opcode_thumb16(tinstr); > if (!fault) { > if (cpu_architecture() >= CPU_ARCH_ARMv7 && > - IS_T32(tinstr)) { > + is_wide_instruction(tinstr)) { > /* Thumb-2 32-bit */ > u16 tinst2 = 0; > fault = probe_kernel_address(ptr + 1, tinst2);