From patchwork Sun Mar 31 18:31:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Abramov X-Patchwork-Id: 1071916 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=yandex.ru Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="AX8fPTcY"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=yandex.ru header.i=@yandex.ru header.b="Tq2IecAe"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44XPFk5LPvz9sR0 for ; Mon, 1 Apr 2019 05:31:54 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:MIME-Version:Subject: References:In-Reply-To:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5UEysCumtHlcgpT6xKsf9GFiZO6/Yu6N2imzH0rpm88=; b=AX8fPTcYy0a3dy tDiRg6ozvHphxnggSHYUD94cOSDyKmdL/5/EWDMl5JuKlEm5XA3Fyrb7OeaD80qWa2g93IgE0v0mW /rqnDJPuKJmsQ72sHwbh3jkS8B5MCE2jU8EGET8Q9f29xsuZ/GuUDx5fmvzG/kV/+zeiBcWlScqbb HFn0keP0DjmGuy/kc3phBJj5VGZVT9rEHmausc1SXVYHc+0xTovnVNZV+0driVIfxz1ieB0oMX6Td 92TfLPTkvS7YciiZ1TXVZ6Jgt2y+mOssogME8HuOKipVl4nKt/P1ni+T0E21JiarnQmYNYUoMHzGM LPBAkpu9NUGsl5x9xtuw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hAfFI-0005uS-FK; Sun, 31 Mar 2019 18:31:52 +0000 Received: from forward501p.mail.yandex.net ([77.88.28.111]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hAfF9-0005m2-9v; Sun, 31 Mar 2019 18:31:45 +0000 Received: from mxback18j.mail.yandex.net (mxback18j.mail.yandex.net [IPv6:2a02:6b8:0:1619::94]) by forward501p.mail.yandex.net (Yandex) with ESMTP id 7E6BF3500140; Sun, 31 Mar 2019 21:31:36 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback18j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id jc8dDLBLhd-VUKKwjcn; Sun, 31 Mar 2019 21:31:35 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1554057095; bh=fydpW7sE0qNPR0QK8LJT4visyYe1Ot/MgCn9V3EsNbk=; h=Message-Id:Cc:Subject:In-Reply-To:Date:References:To:From; b=Tq2IecAerfSsuYLXvUtsJtTAKwJppXpQX+XlEdQKq1xgCba30TJrXAxRDCNYl/dnq V0GV0fye8zpJe9PiHmX+qOJZ7cMknZXirSwP012mQb34yw7za/65lS+PITNsNB1u22 qHsEi79ebWghv3DMunOdMqRBUYv4g9Vgp1PiG5co= Authentication-Results: mxback18j.mail.yandex.net; dkim=pass header.i=@yandex.ru Received: by iva8-b333b7f98ab0.qloud-c.yandex.net with HTTP; Sun, 31 Mar 2019 21:31:30 +0300 From: Andrey Abramov To: vgupta , benh , paulus , mpe , tglx , mingo , bp , hpa , x86 , mark , jlbec , richard , dedekind1 , adrian.hunter , gregkh , naveen.n.rao , jpoimboe , Dave Chinner , darrick.wong , ard.biesheuvel , George Spelvin , linux-snps-arc , Linux Kernel Mailing List , linuxppc-dev , ocfs2-devel , linux-mtd , sfr In-Reply-To: <19606671554056883@myt3-1179f584969c.qloud-c.yandex.net> References: <19606671554056883@myt3-1179f584969c.qloud-c.yandex.net> Subject: [PATCH v2 1/5] arch/arc: unwind.c: replace swap function with built-in one MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sun, 31 Mar 2019 21:31:30 +0300 Message-Id: <23405591554057090@iva8-b333b7f98ab0.qloud-c.yandex.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190331_113143_703625_36F77190 X-CRM114-Status: UNSURE ( 7.20 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.9 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [77.88.28.111 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (st5pub[at]yandex.ru) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mhocko , rppt Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Replace swap_eh_frame_hdr_table_entries with built-in one, because swap_eh_frame_hdr_table_entries does a simple byte to byte swap. Since Spectre mitigations have made indirect function calls more expensive, and the default simple byte copies swap is implemented without them, an "optimized" custom swap function is now a waste of time as well as code. Signed-off-by: Andrey Abramov Reviewed by: George Spelvin Acked-by: Vineet Gupta --- arch/arc/kernel/unwind.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/arch/arc/kernel/unwind.c b/arch/arc/kernel/unwind.c index 271e9fafa479..7610fe84afea 100644 --- a/arch/arc/kernel/unwind.c +++ b/arch/arc/kernel/unwind.c @@ -248,20 +248,6 @@ static int cmp_eh_frame_hdr_table_entries(const void *p1, const void *p2) return (e1->start > e2->start) - (e1->start < e2->start); } -static void swap_eh_frame_hdr_table_entries(void *p1, void *p2, int size) -{ - struct eh_frame_hdr_table_entry *e1 = p1; - struct eh_frame_hdr_table_entry *e2 = p2; - unsigned long v; - - v = e1->start; - e1->start = e2->start; - e2->start = v; - v = e1->fde; - e1->fde = e2->fde; - e2->fde = v; -} - static void init_unwind_hdr(struct unwind_table *table, void *(*alloc) (unsigned long)) { @@ -354,10 +340,8 @@ static void init_unwind_hdr(struct unwind_table *table, } WARN_ON(n != header->fde_count); - sort(header->table, - n, - sizeof(*header->table), - cmp_eh_frame_hdr_table_entries, swap_eh_frame_hdr_table_entries); + sort(header->table, n, + sizeof(*header->table), cmp_eh_frame_hdr_table_entries, NULL); table->hdrsz = hdrSize; smp_wmb();