Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp398420imm; Wed, 29 Aug 2018 02:53:45 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZbLExnUzMMgFCUhV0QMc9b4f0qMZEGdsWahmdTCbbgqJcARXc4rfcbCKQhias1QwjDCKjy X-Received: by 2002:a63:9c19:: with SMTP id f25-v6mr5016446pge.447.1535536425403; Wed, 29 Aug 2018 02:53:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535536425; cv=none; d=google.com; s=arc-20160816; b=vJoCYb3ho9YlCSAkf4radskw6OCHBzvh+BJa547ASC2z8UC7FuXGXlaCbT5xzAvdhK Ca8xAzgOnv5vmHJKCU2dTVbLGux1iL37bZg1rn59lxzukRFQqIJNp4VO1ynun2IZeMNT eXNjj1pfpf8QAtIZsSdmo1KwSxm/tpgk5UIChhC9eVzoFI3mOSbC4RH+OT9+xH1Zi/+O I8XMI6M7U4hRta+ms0I0poxHT57jwKFZ/suEWwltt/+OeLkoa7gDyBvhqHrkJYyJeiGj Jo7n87KVBDq0vidd0WXc6eMnT4Inf5FrxrILFgpKeqYKkXxcuCvplKseTJIN6voqhmE8 zkqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=pneHSrFtHJSU2SE9atg1T0/zbuUCGy81bMFqgzgNbr8=; b=IItOU52064M1NtNz3Y5zrqJHWoObgbFTWcH25nkGUDcQJ/NxdYRXlcTwvhhlZXl7uf J0cnwChjM3e9KoZQjin+IZmXEI80gtDMgve7iUW/PJYRD+ji/3ZKmH6q6BKQgEargk5J wIpH4UHnaa/IQrD98kkuJXPoXAi9hyfh25f2DgS9+yE/pbkezDWKLIT8XWtzREzRQejD mPwOumQFjCT1LOMd+xGfTDc4ip0+l6+8ynSYGHJ3Or/V88zNfg4ZqScQkn8CsFg0IT2s IVfIoh+sydSler8/p3rr+HeoTMvNp3dYF8tmKF4rbgUvMY6dCgWII+arblZnI0CV/OfZ 86Og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FZeAIA0c; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a1-v6si3338342pfd.273.2018.08.29.02.53.30; Wed, 29 Aug 2018 02:53:45 -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; dkim=pass header.i=@kernel.org header.s=default header.b=FZeAIA0c; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727510AbeH2Nsb (ORCPT + 99 others); Wed, 29 Aug 2018 09:48:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:47808 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727099AbeH2Nsa (ORCPT ); Wed, 29 Aug 2018 09:48:30 -0400 Received: from devbox (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C12B920645; Wed, 29 Aug 2018 09:52:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1535536345; bh=eXfkrGNnSa8GlmLTe1iNsL1ROSlGgAN3SvCk4ZO4Usk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=FZeAIA0c8ByRVFbt6fFF7pbNbKzk2Cicv5GdG0zIaQpajqg2jGldLyPw3dIKubM85 Vlk8M1jofMrpt0lNA9mda/0+koGUhr636MuRMhVwetwpU4ZRoe6PIjsL3ebTNZZIQP fZebHR/KszKSEmwnHVyjhNb2dRYf2VMj9XnAFDN8= Date: Wed, 29 Aug 2018 18:52:22 +0900 From: Masami Hiramatsu To: Nadav Amit Cc: Thomas Gleixner , , Ingo Molnar , , Arnd Bergmann , , Andy Lutomirski , Masami Hiramatsu , Kees Cook , Peter Zijlstra Subject: Re: [RFC PATCH 6/6] x86/alternatives: remove text_poke() return value Message-Id: <20180829185222.e85026ff22638002a1df70e0@kernel.org> In-Reply-To: <20180829081147.184610-7-namit@vmware.com> References: <20180829081147.184610-1-namit@vmware.com> <20180829081147.184610-7-namit@vmware.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 29 Aug 2018 01:11:47 -0700 Nadav Amit wrote: > 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 | 2 +- > 2 files changed, 2 insertions(+), 2 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 0feac3dfabe9..45b7fdeaed90 100644 > --- a/arch/x86/kernel/alternative.c > +++ b/arch/x86/kernel/alternative.c > @@ -795,7 +795,7 @@ static void text_poke_safe(void *addr, const void *opcode, size_t len, > * > * Note: Must be called under text_mutex. > */ > -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}; Could you also remove "return addr;" in this patch ? Thank you, > -- > 2.17.1 > -- Masami Hiramatsu