Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5832676imu; Tue, 13 Nov 2018 12:26:53 -0800 (PST) X-Google-Smtp-Source: AJdET5c433+7BL3qTWRKVQ4a+lgt7i1myxJz3brQD6UgB1FIhz2HJCDuP/25L2VlHxbHURT/zaRF X-Received: by 2002:aa7:8348:: with SMTP id z8-v6mr6553398pfm.81.1542140813675; Tue, 13 Nov 2018 12:26:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542140813; cv=none; d=google.com; s=arc-20160816; b=Gpl9IJdY6NFzLnZQfLs3dz1jhc7iZdCpkzwBqNVeEKtKa7z44mTwFMM5AWxcH52lP+ aTKqL1LFkRRBRzkgS5QahLPN1LzPMl/A4/UqcALIFkpwLql20VsmdgXIV/ltw3IO3ruj vshyovP88o8ziMHAWYUeYW5gfbdA3dCN6dmfteiu/kIGH1LIVVf9X96tXh6oNoOZpyNQ rEtYhA9lgfOJQV8aO2k3u0wzk0peR+hVpp+yLil5if8xTPt1TWBpA/M9LUZryhqdXbJK t768EqG/6Nqt/iybkC7IUVQFuloFkR9LENB9R61Nt+s8NYRnvGJSMS4koRwze4P6ItqF d3iQ== 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=1JdG8sR0q7GdzEURypm3iXs63yUa/omx/0+wp+uiOq08Hi2LyBJeyptPMCXfkcwsyO xEcjDNohDDkLnMj/RThLKN3brtucTlqDjNApThoRC7+YwsrkkyAdehBdYcn7xKDTpH+5 OvefbjSUV77BfVtK4/PNWRW6v9YmssK1W3oyaSD/QJktaUx/OaHnWIdp4W1Kv8I2Zxuc 45Nttj/B1ShmBD5sqaCfTIdb9qJxni/+UcISTADDnVjvUKku05fQ/mOluLeb8zBD/wdy OsbnZIMeXrarryu1BFz0m5EIUvwNao89JCsDIjhT5kAN7Qm3DYXPVTyjMbcUk2ckYrcm QWiw== 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 i9-v6si20647970pgd.17.2018.11.13.12.26.38; Tue, 13 Nov 2018 12:26:53 -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 S1731287AbeKNGZr (ORCPT + 99 others); Wed, 14 Nov 2018 01:25:47 -0500 Received: from ex13-edg-ou-002.vmware.com ([208.91.0.190]:45045 "EHLO EX13-EDG-OU-002.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725892AbeKNGZ3 (ORCPT ); Wed, 14 Nov 2018 01:25:29 -0500 Received: from sc9-mailhost2.vmware.com (10.113.161.72) by EX13-EDG-OU-002.vmware.com (10.113.208.156) with Microsoft SMTP Server id 15.0.1156.6; Tue, 13 Nov 2018 12:25:16 -0800 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 E22CDB1A5B; Tue, 13 Nov 2018 15:25:38 -0500 (EST) From: Nadav Amit To: Ingo Molnar CC: , , "H. Peter Anvin" , Thomas Gleixner , Borislav Petkov , Dave Hansen , Peter Zijlstra , , , , Nadav Amit , Andy Lutomirski , Kees Cook , Dave Hansen , Masami Hiramatsu Subject: [PATCH v5 10/10] x86/alternative: remove the return value of text_poke_*() Date: Tue, 13 Nov 2018 05:07:30 -0800 Message-ID: <20181113130730.44844-11-namit@vmware.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181113130730.44844-1-namit@vmware.com> References: <20181113130730.44844-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 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