Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp155659imm; Thu, 30 Aug 2018 10:35:58 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbwBBGgBbuD/0PXDyOWJ8sNAm77vemIbT21e4/b5YD9kpQ/FwKWC4q8RiD7wP9/4+0acW2D X-Received: by 2002:a17:902:b78a:: with SMTP id e10-v6mr11326162pls.79.1535650558680; Thu, 30 Aug 2018 10:35:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535650558; cv=none; d=google.com; s=arc-20160816; b=gWNjWS9Q2uEZ+vDPQ+aJY+D8IJ7b9AjW65PRy8Jq0eouqRTkEvU4MX5TrBAfyx0XDv SJD4IMsOjaCfsq91U19iyWi3x3G0HuCohTskIUnvVnQZ2C5Fc6cKq2usa5e35kj9yUCC C17tBhwXn46p8+CMNq7jbmxCYVNSQehRvhS3GYAIwLH4T22ND4ZraHjONRnVGQVPj++T XakFJVqvev41UmOx8qlFNL+kIbVXbLBdtatI5eFAAxmdTln55PdSQQbaUtn1QsuJljaI tUYEWva0GJtuXghcKRPCompiygMczrEUy16q4vuNi+Ov2LO+8n1AyFX6XsNmv0mbOrTY IUWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=OqlLOnO0ICOnimcZESnPxadbv3KukaMMKi1lhX3sOSA=; b=iMiQb7CIcQ10wOJ3vc0yH2YExBwJdp71C00O/w5tECa2w1ADsEiXrwgXJU7gMeyBWQ K0wsH0fq+AKmVwnUy6TN1oYkvKOq3/o29i2QxjR5L2P9JIpF/PK4sWlp+PtP3Ypstac7 yaqilKiMAfG/d+6MQmXqHaegN0l6YzBswpAavLd+BKin/BBA0TsKzQYtSy6rwrHxDGWE y9bC2LrQ+gF7uVtJ5qa/X8AE2dvtt3TUUUgmzcymooSi70YKgBE3Ai0y1c0qDh08B5Go PbC+jNIyAfFtTO6Se0eEqgPXK9wb3BTpi8uYLpJC6iYbno2HNkUdFSX99Ijj7R5szq78 F95A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vmware.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u42-v6si7402588pgn.86.2018.08.30.10.35.44; Thu, 30 Aug 2018 10:35:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vmware.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727653AbeH3Vhh (ORCPT + 99 others); Thu, 30 Aug 2018 17:37:37 -0400 Received: from ex13-edg-ou-001.vmware.com ([208.91.0.189]:48535 "EHLO EX13-EDG-OU-001.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727406AbeH3VhU (ORCPT ); Thu, 30 Aug 2018 17:37:20 -0400 Received: from sc9-mailhost2.vmware.com (10.113.161.72) by EX13-EDG-OU-001.vmware.com (10.113.208.155) with Microsoft SMTP Server id 15.0.1156.6; Thu, 30 Aug 2018 10:33:48 -0700 Received: from sc2-haas01-esx0118.eng.vmware.com (sc2-haas01-esx0118.eng.vmware.com [10.172.44.118]) by sc9-mailhost2.vmware.com (Postfix) with ESMTP id D0F3EB05D4; Thu, 30 Aug 2018 13:34:06 -0400 (EDT) From: Nadav Amit To: Thomas Gleixner CC: , Ingo Molnar , , Arnd Bergmann , , Dave Hansen , Nadav Amit , Andy Lutomirski , Masami Hiramatsu , Kees Cook , Peter Zijlstra Subject: [PATCH 6/6] x86/alternatives: remove text_poke() return value Date: Thu, 30 Aug 2018 10:32:18 -0700 Message-ID: <20180830173218.238900-7-namit@vmware.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180830173218.238900-1-namit@vmware.com> References: <20180830173218.238900-1-namit@vmware.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: None (EX13-EDG-OU-001.vmware.com: namit@vmware.com does not designate permitted sender hosts) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The return value of text_poke() is meaningless - it is one of the function inputs. One day someone may allow the callers to deal with text_poke() failures, if those actually happen. In the meanwhile, remove the return value. Cc: Andy Lutomirski Cc: Masami Hiramatsu Cc: Kees Cook Cc: Peter Zijlstra Signed-off-by: Nadav Amit --- arch/x86/include/asm/text-patching.h | 2 +- arch/x86/kernel/alternative.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/x86/include/asm/text-patching.h b/arch/x86/include/asm/text-patching.h index ffe7902cc326..1f73f71b4de2 100644 --- a/arch/x86/include/asm/text-patching.h +++ b/arch/x86/include/asm/text-patching.h @@ -34,7 +34,7 @@ extern void *text_poke_early(void *addr, const void *opcode, size_t len); * On the local CPU you need to be protected again NMI or MCE handlers seeing an * inconsistent instruction while you patch. */ -extern void *text_poke(void *addr, const void *opcode, size_t len); +extern void text_poke(void *addr, const void *opcode, size_t len); extern int poke_int3_handler(struct pt_regs *regs); extern void *text_poke_bp(void *addr, const void *opcode, size_t len, void *handler); extern int after_bootmem; diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 2b976296c9f3..840448ca357e 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -809,7 +809,7 @@ static void text_poke_safe(void *addr, const void *opcode, size_t len, * holding the mutex and ensures that none of them will acquire the * mutex while the code runs. */ -void *text_poke(void *addr, const void *opcode, size_t len) +void text_poke(void *addr, const void *opcode, size_t len) { bool cross_page_boundary = offset_in_page(addr) + len > PAGE_SIZE; struct page *pages[2] = {0}; @@ -851,7 +851,6 @@ void *text_poke(void *addr, const void *opcode, size_t len) BUG_ON(memcmp(addr, opcode, len)); local_irq_restore(flags); - return addr; } static void do_sync_core(void *info) -- 2.17.1