Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9226538imu; Wed, 5 Dec 2018 00:53:26 -0800 (PST) X-Google-Smtp-Source: AFSGD/XoZZfkspEiOLZX1fhK1Cg7SmrMvRoT6BJPhhOTDzVOiUHvpTDqEPBQQV9SlWXoweD/Q9Wc X-Received: by 2002:a62:4181:: with SMTP id g1mr23381425pfd.45.1544000006061; Wed, 05 Dec 2018 00:53:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544000006; cv=none; d=google.com; s=arc-20160816; b=U99Dhp9G+rhtb+uPwhrZjXQ7tSVNJAdV965zG3wHKj93LRbIg8ZFXgZIlANWrfq8YL +Bxmc1Q1GhV4rtldWChpDXz4SKZpzATiAyrUdJ/pWiSRoi0yXGT/40ZDmzUBwW79acG/ ig+RAMAxVfG3h1lp1DKZDO8+aqQ+BoKJhE1dh4rP/MeTGHeNRICTq9Vxk8okLrcjLrgD ReZwor0nixQCkJ+bVvyeFHO30/Yoj6CSz2216rsQbD2FbOHFOF2fecQeK9R27c78KNYt Knp/h8h2juW9J43ZdjGLy/bMDLn80UKw6909eIpje3zJC/gvvgxhXePoeaYqxUoAr6Vm 3nbA== 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=G7B9/cr7yjF70SE4Gi2i62kayiWYGYup/iY0cxJEQ8o=; b=w5OlGtloX+OVIhqYaovjayud/etidPZunSF09KfGTU+Gsvpz2OWBYqgnFN5SJih5EE 49kLGRMQLPLhF5VjwuYk5vi0DvtgwQE7S40uM0zYonH7IjCjHRageWD4wpGahBswCDtW IS5JedveQZaHIEIobOD/UK6ShK4eN5fkTgrn0RQDPQn5PW0GKWPa55G5zP3IThK6I69I wI2h433wBIa5s0N47Llt/I+7ajkRrgVWnrwp6zer/FTBsO9v/Qb0YFzJf8gXxtM0YWc2 wkB0H3/z323USNYQnFrKpI0MJhnjFcdaZHoGBpRuCtdmLxIidlZ/6VlFWfi2iQ2hCn5r Otpw== 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 9si17088671pgm.112.2018.12.05.00.53.11; Wed, 05 Dec 2018 00:53:26 -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 S1727538AbeLEIwZ (ORCPT + 99 others); Wed, 5 Dec 2018 03:52:25 -0500 Received: from ex13-edg-ou-002.vmware.com ([208.91.0.190]:46460 "EHLO EX13-EDG-OU-002.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727458AbeLEIwN (ORCPT ); Wed, 5 Dec 2018 03:52:13 -0500 Received: from sc9-mailhost3.vmware.com (10.113.161.73) by EX13-EDG-OU-002.vmware.com (10.113.208.156) with Microsoft SMTP Server id 15.0.1156.6; Wed, 5 Dec 2018 00:52:03 -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 37C1841390; Wed, 5 Dec 2018 00:52:05 -0800 (PST) From: Nadav Amit To: Ingo Molnar CC: , , "H. Peter Anvin" , Thomas Gleixner , Borislav Petkov , Andy Lutomirski , Nadav Amit , Dave Hansen , Peter Zijlstra , , , , Nadav Amit , Kees Cook , Dave Hansen , Masami Hiramatsu Subject: [PATCH v7 12/14] x86/alternative: Remove the return value of text_poke_*() Date: Tue, 4 Dec 2018 17:34:06 -0800 Message-ID: <20181205013408.47725-13-namit@vmware.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181205013408.47725-1-namit@vmware.com> References: <20181205013408.47725-1-namit@vmware.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: None (EX13-EDG-OU-002.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 a75eed841eed..c90678fd391a 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 void *text_poke(void *addr, const void *opcode, size_t len); extern void *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 18415e3b6000..2740ad2c6f21 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; @@ -893,7 +892,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; @@ -935,7 +934,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