From patchwork Wed Jan 7 11:50:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jon Medhurst \(Tixy\)" X-Patchwork-Id: 42813 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f70.google.com (mail-ee0-f70.google.com [74.125.83.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 86D762055F for ; Wed, 7 Jan 2015 11:50:53 +0000 (UTC) Received: by mail-ee0-f70.google.com with SMTP id b57sf2132210eek.1 for ; Wed, 07 Jan 2015 03:50:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:subject:from:to:cc:date :in-reply-to:references:content-type:mime-version :content-transfer-encoding:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=BKxmU5b4yA1+daKzLWQ1Em9g/1ESMTNvpwPZpwA/C0w=; b=bY58aEpE4LYApPkUdIYXHmEWKx2Zkj8bfXcAVYoVLye2s5UaoXTa8rO77dEri4I07t h3e06scclORrCtvDiXPo/HvkFezUEPRvIzNBMUjCqRgJ3pHVv+wwtNNT7y2fx6FDTFVk pv2x2gU1n8yDeTDwr6zWs9FTyIfqv5IrSj94fACqt2vmd4wFcZ7xIOLmo053ig4OlROD /EE05Y+ONV628NcPXdHAvl3qEEOrgGs61v6ZOpZzBuQifkqYqmmfcF6x95YDtHw6TMRL CJUxJ/vGsf13gl6jQkhf5ltitnGt3Xf75tawyefG0llq4l7NQbQesydhooBCcGrGFqUf lCkA== X-Gm-Message-State: ALoCoQmK0Hm2zbxTNN9EMPOSn6AaOJLoqjPHB3Nps5KGl05HSxja4El6AcMpWJ6ZZkqJ68ius37H X-Received: by 10.112.188.199 with SMTP id gc7mr372642lbc.6.1420631452779; Wed, 07 Jan 2015 03:50:52 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.234.203 with SMTP id ug11ls130348lac.67.gmail; Wed, 07 Jan 2015 03:50:52 -0800 (PST) X-Received: by 10.152.7.229 with SMTP id m5mr3730278laa.80.1420631452603; Wed, 07 Jan 2015 03:50:52 -0800 (PST) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id tf9si2253271lbb.67.2015.01.07.03.50.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 07 Jan 2015 03:50:52 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by mail-la0-f49.google.com with SMTP id hs14so2914970lab.8 for ; Wed, 07 Jan 2015 03:50:52 -0800 (PST) X-Received: by 10.152.23.38 with SMTP id j6mr3646851laf.81.1420631452394; Wed, 07 Jan 2015 03:50:52 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.9.200 with SMTP id c8csp1455293lbb; Wed, 7 Jan 2015 03:50:51 -0800 (PST) X-Received: by 10.70.64.197 with SMTP id q5mr4389219pds.129.1420631450328; Wed, 07 Jan 2015 03:50:50 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id zn6si2578832pac.126.2015.01.07.03.50.49; Wed, 07 Jan 2015 03:50:50 -0800 (PST) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752288AbbAGLur (ORCPT + 27 others); Wed, 7 Jan 2015 06:50:47 -0500 Received: from smarthost01a.mail.zen.net.uk ([212.23.1.1]:48707 "EHLO smarthost01a.mail.zen.net.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751625AbbAGLuq (ORCPT ); Wed, 7 Jan 2015 06:50:46 -0500 Received: from [82.69.122.217] (helo=linaro1) by smarthost01a.mail.zen.net.uk with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1Y8p8G-000GZS-Qa; Wed, 07 Jan 2015 11:50:36 +0000 Message-ID: <1420631436.4044.26.camel@linaro.org> Subject: Re: [PATCH v19 02/11] ARM: kprobes: remove unused ARM decoder actions. From: "Jon Medhurst (Tixy)" To: Wang Nan , David Long Cc: masami.hiramatsu.pt@hitachi.com, linux@arm.linux.org.uk, lizefan@huawei.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Date: Wed, 07 Jan 2015 11:50:36 +0000 In-Reply-To: <1420457354-77099-1-git-send-email-wangnan0@huawei.com> References: <1420457284-76923-1-git-send-email-wangnan0@huawei.com> <1420457354-77099-1-git-send-email-wangnan0@huawei.com> X-Mailer: Evolution 3.12.9-1 Mime-Version: 1.0 X-Originating-smarthost01a-IP: [82.69.122.217] Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: tixy@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , On Mon, 2015-01-05 at 19:29 +0800, Wang Nan wrote: > There are 3 actions which is never used: > > PROBES_MOV_HALFWORD, > PROBES_SEV, > PROBES_WFE, > > This patch removes them. > > Signed-off-by: Wang Nan I think that PROBES_MOV_HALFWORD should be used, for MOVW and MOVT. Currently those instructions use PROBES_DATA_PROCESSING_IMM which, whilst it will work it ends up using a less efficient emulation routine than necessary. The other unused actions, PROBES_SEV and PROBES_WFE, could possibly be removed as redundant, but there are are Thumb equivalents for those which are used, so for symmetry I think we should use them. That will let us remove PROBES_EMULATE_NONE and PROBES_SIMULATE_NOP. So how about the following patch instead... ---------------------------------------------------------------------------- From: Jon Medhurst Date: Wed, 7 Jan 2015 11:42:30 +0000 Subject: [PATCH] ARM: probes: Use correct action types for MOVW, SEV and WFI This doesn't correct any bugs when probing these instructions but makes MOVW slightly faster and makes everything more symmetric with the Thumb instruction cases. We can also remove the now redundant PROBES_EMULATE_NONE and PROBES_SIMULATE_NOP actions. Signed-off-by: Jon Medhurst --- arch/arm/probes/decode-arm.c | 6 +++--- arch/arm/probes/decode-arm.h | 2 -- arch/arm/probes/kprobes/actions-arm.c | 2 -- arch/arm/probes/uprobes/actions-arm.c | 2 -- 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/arch/arm/probes/decode-arm.c b/arch/arm/probes/decode-arm.c index f46d8fc..f72c33a 100644 --- a/arch/arm/probes/decode-arm.c +++ b/arch/arm/probes/decode-arm.c @@ -370,17 +370,17 @@ static const union decode_item arm_cccc_001x_table[] = { /* MOVW cccc 0011 0000 xxxx xxxx xxxx xxxx xxxx */ /* MOVT cccc 0011 0100 xxxx xxxx xxxx xxxx xxxx */ - DECODE_EMULATEX (0x0fb00000, 0x03000000, PROBES_DATA_PROCESSING_IMM, + DECODE_EMULATEX (0x0fb00000, 0x03000000, PROBES_MOV_HALFWORD, REGS(0, NOPC, 0, 0, 0)), /* YIELD cccc 0011 0010 0000 xxxx xxxx 0000 0001 */ DECODE_OR (0x0fff00ff, 0x03200001), /* SEV cccc 0011 0010 0000 xxxx xxxx 0000 0100 */ - DECODE_EMULATE (0x0fff00ff, 0x03200004, PROBES_EMULATE_NONE), + DECODE_EMULATE (0x0fff00ff, 0x03200004, PROBES_SEV), /* NOP cccc 0011 0010 0000 xxxx xxxx 0000 0000 */ /* WFE cccc 0011 0010 0000 xxxx xxxx 0000 0010 */ /* WFI cccc 0011 0010 0000 xxxx xxxx 0000 0011 */ - DECODE_SIMULATE (0x0fff00fc, 0x03200000, PROBES_SIMULATE_NOP), + DECODE_SIMULATE (0x0fff00fc, 0x03200000, PROBES_WFE), /* DBG cccc 0011 0010 0000 xxxx xxxx ffff xxxx */ /* unallocated hints cccc 0011 0010 0000 xxxx xxxx xxxx xxxx */ /* MSR (immediate) cccc 0011 0x10 xxxx xxxx xxxx xxxx xxxx */ diff --git a/arch/arm/probes/decode-arm.h b/arch/arm/probes/decode-arm.h index a7b0398..b3b80f6 100644 --- a/arch/arm/probes/decode-arm.h +++ b/arch/arm/probes/decode-arm.h @@ -18,8 +18,6 @@ #include "decode.h" enum probes_arm_action { - PROBES_EMULATE_NONE, - PROBES_SIMULATE_NOP, PROBES_PRELOAD_IMM, PROBES_PRELOAD_REG, PROBES_BRANCH_IMM, diff --git a/arch/arm/probes/kprobes/actions-arm.c b/arch/arm/probes/kprobes/actions-arm.c index 1e67839..06988ef 100644 --- a/arch/arm/probes/kprobes/actions-arm.c +++ b/arch/arm/probes/kprobes/actions-arm.c @@ -303,8 +303,6 @@ emulate_rdlo12rdhi16rn0rm8_rwflags_nopc(probes_opcode_t insn, } const union decode_action kprobes_arm_actions[NUM_PROBES_ARM_ACTIONS] = { - [PROBES_EMULATE_NONE] = {.handler = probes_emulate_none}, - [PROBES_SIMULATE_NOP] = {.handler = probes_simulate_nop}, [PROBES_PRELOAD_IMM] = {.handler = probes_simulate_nop}, [PROBES_PRELOAD_REG] = {.handler = probes_simulate_nop}, [PROBES_BRANCH_IMM] = {.handler = simulate_blx1}, diff --git a/arch/arm/probes/uprobes/actions-arm.c b/arch/arm/probes/uprobes/actions-arm.c index 1dd4916..76eb449 100644 --- a/arch/arm/probes/uprobes/actions-arm.c +++ b/arch/arm/probes/uprobes/actions-arm.c @@ -195,8 +195,6 @@ uprobe_decode_ldmstm(probes_opcode_t insn, } const union decode_action uprobes_probes_actions[] = { - [PROBES_EMULATE_NONE] = {.handler = probes_simulate_nop}, - [PROBES_SIMULATE_NOP] = {.handler = probes_simulate_nop}, [PROBES_PRELOAD_IMM] = {.handler = probes_simulate_nop}, [PROBES_PRELOAD_REG] = {.handler = probes_simulate_nop}, [PROBES_BRANCH_IMM] = {.handler = simulate_blx1},