Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2713632imu; Sat, 10 Nov 2018 22:37:19 -0800 (PST) X-Google-Smtp-Source: AJdET5fxHLc6jhwS9OlCFNvkwl18u5pKVAEJP9ZSGnDMZ0hFUr7dpjvY4tVR5PQa8YX7/rdSbkuX X-Received: by 2002:a63:6f0d:: with SMTP id k13mr2997489pgc.42.1541918239644; Sat, 10 Nov 2018 22:37:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541918239; cv=none; d=google.com; s=arc-20160816; b=fSyjHpfVf/DNTBE8cvt15uVF4MO6qcdpWTDt9247/3ANYKVdqfcS6ItGU+Hye13qvK 8k2vHolv8MlgeRDyHPnbsT5sb99V74rFTdXhU8Gp1WGB5mHKZkJ/pXUJP20qwJxqlpuA xPSik91WKCOdW6eccdc4tKCUcvzcONbFgM8oQcNI9/EWsCgXNxW1CkbwDN5KW2yZJzVW ADO/CIdiZRVZ+MQU5XLSTDE8IqKojFcESt9jVunWVlC4luCli9aL0sHHO+HPyvrle7Lu v4b5Q3ThJ5p6KLBV4u4TKCBwEGvTrQjgSfLsQM7xPgme3Hhtpycqy10C8uzDAbvzrrPd iEow== 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; bh=DYg9qzlSmLKmfnxMLw1pDfGZMYAA+9+6M124geFCHCQ=; b=Rag09mpP0EznrCro7AGQvg6vL9nhAOCTCJA1LOM2jVD+PG4TUqJd5cB3iMENC1dk77 bGEB3yZ9EdF35yO6OilLazgrnOCUUbBPo5+2BkzcjchNpAlxCkCOWFOtTxGhFXeJLjrk enwNw3bYiD0NoVBlEFnts2PE+ChMmm57+sjk2rCKP+x1pAphy3aGzqX1YduOg5rDIJn/ XWd98qslSyWHl7GHW50YqWiCGUB9TDwj6HEzEWODX8OGAz7XIKB2CQPiaIocw7sgjGwK iEWBVRAyDGHtGR1KrHl8IMmzhxFkQJE2IknoxxzFwzqQ5JBB8TLxredye0a6G8hkmYOX nlIg== 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 69-v6si14623052pft.177.2018.11.10.22.36.25; Sat, 10 Nov 2018 22:37:19 -0800 (PST) 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 S1728044AbeKKQXL (ORCPT + 99 others); Sun, 11 Nov 2018 11:23:11 -0500 Received: from ex13-edg-ou-001.vmware.com ([208.91.0.189]:25452 "EHLO EX13-EDG-OU-001.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727764AbeKKQXK (ORCPT ); Sun, 11 Nov 2018 11:23:10 -0500 Received: from sc9-mailhost3.vmware.com (10.113.161.73) by EX13-EDG-OU-001.vmware.com (10.113.208.155) with Microsoft SMTP Server id 15.0.1156.6; Sat, 10 Nov 2018 22:35:01 -0800 Received: from sc2-haas01-esx0118.eng.vmware.com (sc2-haas01-esx0118.eng.vmware.com [10.172.44.118]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id 9F9324077A; Sat, 10 Nov 2018 22:35:24 -0800 (PST) From: Nadav Amit To: Ingo Molnar CC: , , "H. Peter Anvin" , Thomas Gleixner , Borislav Petkov , Dave Hansen , Nadav Amit , Andy Lutomirski , Kees Cook , Peter Zijlstra , Dave Hansen , Masami Hiramatsu Subject: [PATCH v4 10/10] x86/alternative: remove the return value of text_poke_*() Date: Sat, 10 Nov 2018 15:17:32 -0800 Message-ID: <20181110231732.15060-11-namit@vmware.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181110231732.15060-1-namit@vmware.com> References: <20181110231732.15060-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_early() and text_poke_bp() is useless. Remove it. Cc: Andy Lutomirski Cc: Kees Cook Cc: Peter Zijlstra Cc: Dave Hansen Cc: Masami Hiramatsu Signed-off-by: Nadav Amit --- arch/x86/include/asm/text-patching.h | 4 ++-- arch/x86/kernel/alternative.c | 11 ++++------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/arch/x86/include/asm/text-patching.h b/arch/x86/include/asm/text-patching.h index e5716ef9a721..a7234cd435d2 100644 --- a/arch/x86/include/asm/text-patching.h +++ b/arch/x86/include/asm/text-patching.h @@ -18,7 +18,7 @@ static inline void apply_paravirt(struct paravirt_patch_site *start, #define __parainstructions_end NULL #endif -extern void *text_poke_early(void *addr, const void *opcode, size_t len); +extern void text_poke_early(void *addr, const void *opcode, size_t len); /* * Clear and restore the kernel write-protection flag on the local CPU. @@ -37,7 +37,7 @@ extern void *text_poke_early(void *addr, const void *opcode, size_t len); extern int text_poke(void *addr, const void *opcode, size_t len); extern int text_poke_kgdb(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 void text_poke_bp(void *addr, const void *opcode, size_t len, void *handler); extern int after_bootmem; extern __ro_after_init struct mm_struct *poking_mm; extern __ro_after_init unsigned long poking_addr; diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 70827332da0f..ab0278c7ecfa 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -264,7 +264,7 @@ static void __init_or_module add_nops(void *insns, unsigned int len) extern struct alt_instr __alt_instructions[], __alt_instructions_end[]; extern s32 __smp_locks[], __smp_locks_end[]; -void *text_poke_early(void *addr, const void *opcode, size_t len); +void text_poke_early(void *addr, const void *opcode, size_t len); /* * Are we looking at a near JMP with a 1 or 4-byte displacement. @@ -666,8 +666,8 @@ void __init alternative_instructions(void) * instructions. And on the local CPU you need to be protected again NMI or MCE * handlers seeing an inconsistent instruction while you patch. */ -void *__init_or_module text_poke_early(void *addr, const void *opcode, - size_t len) +void __init_or_module text_poke_early(void *addr, const void *opcode, + size_t len) { unsigned long flags; @@ -690,7 +690,6 @@ void *__init_or_module text_poke_early(void *addr, const void *opcode, * that causes hangs on some VIA CPUs. */ } - return addr; } __ro_after_init struct mm_struct *poking_mm; @@ -906,7 +905,7 @@ int poke_int3_handler(struct pt_regs *regs) * replacing opcode * - sync cores */ -void *text_poke_bp(void *addr, const void *opcode, size_t len, void *handler) +void text_poke_bp(void *addr, const void *opcode, size_t len, void *handler) { unsigned char int3 = 0xcc; @@ -948,7 +947,5 @@ void *text_poke_bp(void *addr, const void *opcode, size_t len, void *handler) * the writing of the new instruction. */ bp_patching_in_progress = false; - - return addr; } -- 2.17.1