From patchwork Fri Feb 15 20:14:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Burton X-Patchwork-Id: 10815801 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7CA48922 for ; Fri, 15 Feb 2019 20:14:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6AAE82FF69 for ; Fri, 15 Feb 2019 20:14:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5E83F2FFD0; Fri, 15 Feb 2019 20:14:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E270F2FF0E for ; Fri, 15 Feb 2019 20:14:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726317AbfBOUOW (ORCPT ); Fri, 15 Feb 2019 15:14:22 -0500 Received: from mail-eopbgr700091.outbound.protection.outlook.com ([40.107.70.91]:40096 "EHLO NAM04-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2390667AbfBOUOV (ORCPT ); Fri, 15 Feb 2019 15:14:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wavesemi.onmicrosoft.com; s=selector1-wavecomp-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dAYJvweJO52SnUzzJwO3VW/UkhT/zhfX0oytuWwkhAM=; b=WRcajbpmJQ8Dn34tpWhvxjSbvbOR4BW493O/wxGdHx882uTw8pq/PCwLE+iZRluJfb6kFICz2nejN99TY+yt5JFa9S9y+QQW6EzTs2jkx6r9xfxtL4GIHsa3XdL1WEVFoo8KuZlLtmIttqM4ZJ0cGv8ufKE9zkFMTMPwcGEZEwM= Received: from MWHPR2201MB1277.namprd22.prod.outlook.com (10.174.162.17) by MWHPR2201MB1582.namprd22.prod.outlook.com (10.174.167.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1622.16; Fri, 15 Feb 2019 20:14:16 +0000 Received: from MWHPR2201MB1277.namprd22.prod.outlook.com ([fe80::7d5e:f3b0:4a5:4636]) by MWHPR2201MB1277.namprd22.prod.outlook.com ([fe80::7d5e:f3b0:4a5:4636%9]) with mapi id 15.20.1601.023; Fri, 15 Feb 2019 20:14:16 +0000 From: Paul Burton To: "linux-mips@vger.kernel.org" , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , "netdev@vger.kernel.org" CC: "linux-kernel@vger.kernel.org" , Jiong Wang , Paul Burton Subject: [PATCH 2/2] MIPS: eBPF: Remove REG_32BIT_ZERO_EX Thread-Topic: [PATCH 2/2] MIPS: eBPF: Remove REG_32BIT_ZERO_EX Thread-Index: AQHUxWsGSv3U5Mub50SxgUEaRy+wZQ== Date: Fri, 15 Feb 2019 20:14:16 +0000 Message-ID: <20190215201321.15725-2-paul.burton@mips.com> References: <20190215201321.15725-1-paul.burton@mips.com> In-Reply-To: <20190215201321.15725-1-paul.burton@mips.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BYAPR07CA0036.namprd07.prod.outlook.com (2603:10b6:a02:bc::49) To MWHPR2201MB1277.namprd22.prod.outlook.com (2603:10b6:301:24::17) authentication-results: spf=none (sender IP is ) smtp.mailfrom=pburton@wavecomp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-originating-ip: [67.207.99.198] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f86e0e67-8488-42c4-6deb-08d6938228b0 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(2017052603328)(7153060)(7193020);SRVR:MWHPR2201MB1582; x-ms-traffictypediagnostic: MWHPR2201MB1582: x-microsoft-exchange-diagnostics: =?iso-8859-1?q?1=3BMWHPR2201MB1582=3B23=3A?= =?iso-8859-1?q?/8KPaz3cKnn8W5gtxx2Pu8gT5jtcPHoyNUGBzwMAwsBwYISryXvzypaKxopw?= =?iso-8859-1?q?2pdI4/EJcvfvbsIK8PsKpeN+0SE4Ch1y2VZF3fye1C+9sB1JTQaXXqwXSCQi?= =?iso-8859-1?q?vB0yUtyGNGE9+rdqRlEmxef68NwWEECHI2yzT2RuwzMWy7AbQUh/1aCBasJP?= =?iso-8859-1?q?adVWLOFlbR8IjelNFsO5RPWaaK7ziYqMMc0jnBHyfdy7pqzWzQUrY+sAwXe6?= =?iso-8859-1?q?LDCv2aVcdspHY/PxrcLWC7RIWDdQSOIJb65sdUPAIWpSaqgbEQJAR6o0b7MP?= =?iso-8859-1?q?aBSda2OvftAtMjNJyezarwKoHj4zBaXbqxzSYVCk83413h2hT/8Ci9hdDt07?= =?iso-8859-1?q?uaR2jgxLFSnvD/cKWtMuVjX4W10vTLZoOmoeBvaiE0f5pTZM1vCg7EtZeJsg?= =?iso-8859-1?q?cC3L7rhiUTy9VYtONIIBMzwIl7PFoTb8JV7oY/GDnMCea/OV3RUq7JKNACLa?= =?iso-8859-1?q?D7wqiF1oDQ+7E08klBVCbZJ8JfGkCjuHYLadKN+4uQTheKDG2IyNzrcOeo4l?= =?iso-8859-1?q?7D3I5r5PDYQJX/N3SO+bWGyBhoeNQ67klOk6eSxMgPtkMXZCS7dhRDUaJI8D?= =?iso-8859-1?q?lfCTnOg/Z1S+wp+PVBHMoqwKZ+qDCVQxOxCl6RUB8YWVYCAqqX0A0YU1uEDJ?= =?iso-8859-1?q?MVOWMnQWaI5dD5KsehMQuEv3mxsWecr/1/QBEu3p0qHwZH/fc7uRWZHpbKNp?= =?iso-8859-1?q?vT6tSt6eSJYBa9+BjPIWmVSAuKdcgyJ41Eiufb++W+IybBSqjwFb8XGQXdqD?= =?iso-8859-1?q?Ku430pSQb1MBiaHDfzEaTscNG8huh2vQ+ma3tzXfUUf491Cg5oUiaGXA2BpG?= =?iso-8859-1?q?Rs5H5rfiJljrOTF+SkEaaXCD3tj6Y+2WVHI/oWzkzLndtrMx/H6eijbXHB7A?= =?iso-8859-1?q?onmQKu0slnliwHtIJRRNykw0FF7ydgwB3bPfRVkgbL6t6N9JfamHetG+UziW?= =?iso-8859-1?q?I1U9nGeTN+7FfLjcZucrIhmZYK9sSBgD0GN0e+xd1QCVP9aNfIJhQllTKGiG?= =?iso-8859-1?q?s/YBasGTnHTyHdZF4nxYhJ6hZ+V1OZJpA712QRdnFaqm6fOBdhTp5jlNap1v?= =?iso-8859-1?q?M0RwNMvq5aL/v/WdYAWmVmO4Zg6KWK7heVXhokvaJtvTTRp6Av6K5iiAP3iE?= =?iso-8859-1?q?TXBerTlnr3EUR11AZzqyxtSDQQDgFkyFCyfOLJqaWFVqBovE9vseIh+AbFRP?= =?iso-8859-1?q?ydIG/KMzIzyWSUk/uDJCmhINb1XHOuVJykbAXBH2fhqlo10aYkswzQYJZtw?= =?iso-8859-1?q?=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 09497C15EB x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(136003)(346002)(376002)(39850400004)(396003)(366004)(199004)(189003)(71190400001)(76176011)(256004)(186003)(66066001)(68736007)(50226002)(36756003)(486006)(107886003)(102836004)(71200400001)(386003)(6506007)(7736002)(305945005)(4326008)(316002)(1076003)(6116002)(3846002)(25786009)(44832011)(11346002)(478600001)(2501003)(105586002)(97736004)(446003)(52116002)(42882007)(2906002)(476003)(53936002)(26005)(2616005)(110136005)(8676002)(81156014)(99286004)(8936002)(6512007)(14454004)(54906003)(6436002)(106356001)(6486002)(81166006);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR2201MB1582;H:MWHPR2201MB1277.namprd22.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: wavecomp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: sYavKm3EnElS9JWUfsrN2gieQpdn0mUlQUDe7rQMmdPTTffVkVhmzPWprCMVtvMNouMnu9zxz3EtyDqB0kpXoiip32eyCGd1q5d2788cvhOeCTuyRQQNfcwYxtGLlFcNN4KNYDTj1OJtxEw3qRTM4iRbgRkpoR03nDt5Cj25KlmkdI92aDzanYjPdV7CrulqZCekuXEqBFwTi7uxJl2vsABTl2lUs3DzahTEkYy5W8D9I9wh9xcqzkzkzGh7jXCrvkDOIORAwlDQiitONrdW4GvgUMFaV9ffH6RTdR/I4RABf5MAZIO+uMMcGIiB5M5mP2e/m/EiiYzRJhgnao7s0LrE2tsDGiDB3Lmc46C8pE4Q2KGZT6NEG5UUxckzsxztUxZNMN+Fy7rsTeQePp9tRDDrwd0MAJMGHCQKaTLNx/g= MIME-Version: 1.0 X-OriginatorOrg: mips.com X-MS-Exchange-CrossTenant-Network-Message-Id: f86e0e67-8488-42c4-6deb-08d6938228b0 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Feb 2019 20:14:15.4013 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: 463607d3-1db3-40a0-8a29-970c56230104 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR2201MB1582 Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP REG_32BIT_ZERO_EX and REG_64BIT are always handled in exactly the same way, and reg_val_propagate_range() never actually sets any register to type REG_32BIT_ZERO_EX. Remove the redundant & unused REG_32BIT_ZERO_EX. Signed-off-by: Paul Burton --- arch/mips/net/ebpf_jit.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/arch/mips/net/ebpf_jit.c b/arch/mips/net/ebpf_jit.c index 715415fa2345..76e9bf88d3b9 100644 --- a/arch/mips/net/ebpf_jit.c +++ b/arch/mips/net/ebpf_jit.c @@ -79,8 +79,6 @@ enum reg_val_type { REG_64BIT_32BIT, /* 32-bit compatible, need truncation for 64-bit ops. */ REG_32BIT, - /* 32-bit zero extended. */ - REG_32BIT_ZERO_EX, /* 32-bit no sign/zero extension needed. */ REG_32BIT_POS }; @@ -349,7 +347,7 @@ static int build_int_epilogue(struct jit_ctx *ctx, int dest_reg) if (dest_reg == MIPS_R_RA) { /* Don't let zero extended value escape. */ td = get_reg_val_type(ctx, prog->len, BPF_REG_0); - if (td == REG_64BIT || td == REG_32BIT_ZERO_EX) + if (td == REG_64BIT) emit_instr(ctx, sll, r0, r0, 0); } @@ -695,7 +693,7 @@ static int build_one_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, if (dst < 0) return dst; td = get_reg_val_type(ctx, this_idx, insn->dst_reg); - if (td == REG_64BIT || td == REG_32BIT_ZERO_EX) { + if (td == REG_64BIT) { /* sign extend */ emit_instr(ctx, sll, dst, dst, 0); } @@ -710,7 +708,7 @@ static int build_one_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, if (dst < 0) return dst; td = get_reg_val_type(ctx, this_idx, insn->dst_reg); - if (td == REG_64BIT || td == REG_32BIT_ZERO_EX) { + if (td == REG_64BIT) { /* sign extend */ emit_instr(ctx, sll, dst, dst, 0); } @@ -724,7 +722,7 @@ static int build_one_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, if (dst < 0) return dst; td = get_reg_val_type(ctx, this_idx, insn->dst_reg); - if (td == REG_64BIT || td == REG_32BIT_ZERO_EX) + if (td == REG_64BIT) /* sign extend */ emit_instr(ctx, sll, dst, dst, 0); if (insn->imm == 1) { @@ -863,13 +861,13 @@ static int build_one_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, if (src < 0 || dst < 0) return -EINVAL; td = get_reg_val_type(ctx, this_idx, insn->dst_reg); - if (td == REG_64BIT || td == REG_32BIT_ZERO_EX) { + if (td == REG_64BIT) { /* sign extend */ emit_instr(ctx, sll, dst, dst, 0); } did_move = false; ts = get_reg_val_type(ctx, this_idx, insn->src_reg); - if (ts == REG_64BIT || ts == REG_32BIT_ZERO_EX) { + if (ts == REG_64BIT) { int tmp_reg = MIPS_R_AT; if (bpf_op == BPF_MOV) { @@ -1257,8 +1255,7 @@ static int build_one_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, if (insn->imm == 64 && td == REG_32BIT) emit_instr(ctx, dinsu, dst, MIPS_R_ZERO, 32, 32); - if (insn->imm != 64 && - (td == REG_64BIT || td == REG_32BIT_ZERO_EX)) { + if (insn->imm != 64 && td == REG_64BIT) { /* sign extend */ emit_instr(ctx, sll, dst, dst, 0); }