Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp338325yba; Fri, 26 Apr 2019 00:33:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqxor1P3uvQOlcnXV1FqqEATVLY5vvWLV2RQlU/3QTMWFsvcc6E6PcVJWwge0Qv72ayRxCDX X-Received: by 2002:a17:902:4827:: with SMTP id s36mr45331771pld.296.1556264012277; Fri, 26 Apr 2019 00:33:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556264012; cv=none; d=google.com; s=arc-20160816; b=0SeLppYYQ/uULglpzvvldVoz+g3dyYa1HGeaBwjv/1fTtthSu1Mi4nWAaKL2axLVDj tKznjIP2gU7KxOdQ2lgWutcm4XJoRKdpbuJ3pe7PKSEuh1XWMwm7zTrBSgvEtMz3sL0a Jszuqa26G7tLlgaRd9kqGWV1+pXDp6y2RcPHPzBRINfvOk099U/BFN6dNbjmbjkAD4cH qZzRqvqSLp5+DX1H3WmPXksiCRixGkUzcu7IbOHSYjLLSkhvG4DUBQgSpaUn5VQ9gHkb mhswI6VeDBwemSqbyNKg4+ZE9t6qTsKZ81sKMg+HN1xfDKhVyP59TNCtuSuaHhAjkKVy KBBA== 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=kjKVRKltof8mlgZuDLjB7nrEkQ/mRzwiPTIy69QpyZ8=; b=bnVbhuc2lVqbpApkcvpG517O5ZWE5r8lpizxcKMsh160GLAF7VBONrFuZUPUY4LlIU iLDVmcud8A96r3sZHdmowCZQjxOfVxEY6CvE95/4tmk9bqtDMay21f3X9OgHNN9WCN/N 6d+h0q8k3UIwlIzvGg7jHAPEOHSJjF03xC4+QGKe95mPTbZDv1iYtxc8aHBF8lRXQ7Ej VwgAj0d7YCX2C4jIJVozHO1fvYsu/arlgCvIn94kwDek/JY7X0s8TtEuv1WXKJs4ju5i UjDuUhIEAKiO0XiW7kLEmxHGHTCIc2Aq1OvPHbZXISWh0dLGIVqtevws9gGlv01CMgQn Ev4A== 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=QUARANTINE 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 a3si24561947pfc.276.2019.04.26.00.33.17; Fri, 26 Apr 2019 00:33:32 -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=QUARANTINE sp=NONE dis=NONE) header.from=vmware.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726423AbfDZHcM (ORCPT + 99 others); Fri, 26 Apr 2019 03:32:12 -0400 Received: from ex13-edg-ou-002.vmware.com ([208.91.0.190]:29121 "EHLO EX13-EDG-OU-002.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726379AbfDZHcE (ORCPT ); Fri, 26 Apr 2019 03:32:04 -0400 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; Fri, 26 Apr 2019 00:31:44 -0700 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 CF76F41298; Fri, 26 Apr 2019 00:31:45 -0700 (PDT) From: Nadav Amit To: Peter Zijlstra , Borislav Petkov , Andy Lutomirski , Ingo Molnar CC: , , , Thomas Gleixner , Nadav Amit , Dave Hansen , , , , , , , , , , , Rick Edgecombe , Nadav Amit , Kees Cook , Dave Hansen , Masami Hiramatsu Subject: [PATCH v5 13/23] x86/alternative: Remove the return value of text_poke_*() Date: Thu, 25 Apr 2019 17:11:33 -0700 Message-ID: <20190426001143.4983-14-namit@vmware.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190426001143.4983-1-namit@vmware.com> References: <20190426001143.4983-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: Dave Hansen Cc: Masami Hiramatsu Acked-by: Peter Zijlstra (Intel) Signed-off-by: Nadav Amit Signed-off-by: Rick Edgecombe --- 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 3d2b6b6fb20c..18f959975ea0 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -265,7 +265,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. @@ -667,8 +667,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; @@ -691,7 +691,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 @@ NOKPROBE_SYMBOL(poke_int3_handler); * 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