Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp254555ybb; Tue, 7 Apr 2020 22:08:42 -0700 (PDT) X-Google-Smtp-Source: APiQypKYc/IOoUARWNEY4gVUwkrAa3YNPNHJO9oy+pJo+tT660GtVT2kthWVABnzaNb8cjK4RSZg X-Received: by 2002:a4a:c315:: with SMTP id c21mr4668869ooq.13.1586322521895; Tue, 07 Apr 2020 22:08:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586322521; cv=none; d=google.com; s=arc-20160816; b=o+cm9Tgykgc6Go+wpJE3FuJwu3NxgeUAaaYnjZd81jLJPSy5XZTimAkUVbB9ie0s8v MJTPm+HkmjQNVS9kIobnsqaPX6fB914L/Y/mpYXVJZ8AT6auMdFFq3dRY4ulFRYU2fX+ IDTHyip1vpIgdrS8YQbV9Q9ydbMizc9bXUEkm39348zgepUOlEpqqulYneN7XHEv7K/0 NvtrUyEjBkPjN/qBBsF6r98EKG5hq6T+LdrZkl9r93/ocXOXQlwkbfcIjqrzqrw76V7A jv7bvZDAmW0ZrtiFfW7CtUlVGGRFTxzpfItDkP4jkGpJVqGSdTPzyhKQtZUcyU3Mu/0K PFMg== 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:date:subject:cc:to:from :dkim-signature; bh=kG41Wdi3xZl8bLDCQdMVBGXBcfy0aVqVcUlxPKtO2Qo=; b=JSNKV8iONfx7mPMSF9PfFSIL3aX/lYflfzoc6sheOz4+lHt3JgIPRnVbthJ3MSVVhX ymbm9VtDsuJmWrDj8qrEWN4cHUDSdkGwK//T6kg4MWZEf3jaMmm4uZ+Fctgbd775yHbi kARlAovwMaGt7KUWE7H7xiMvvMXQA3hZM03/rnLHhd1Fw6kMJUjb1HFeZe0YY1Oz6TGP AGcv4Qw+n9MfdiwFe7w1YeKQACdDNS/tntRhmnGpF7BgaURabchcLcMa00Ikjdp0OvC+ HnkH5c84Ln/prpo512BFsIjk/jJ9PQY8XlRC9SY6l5T5U1kqQaxvffCSE1yacOYDhuuU Q9hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=xWXrvfUd; 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=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j9si1494090oif.164.2020.04.07.22.08.28; Tue, 07 Apr 2020 22:08:41 -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=@oracle.com header.s=corp-2020-01-29 header.b=xWXrvfUd; 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=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726595AbgDHFFa (ORCPT + 99 others); Wed, 8 Apr 2020 01:05:30 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:38010 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726409AbgDHFF3 (ORCPT ); Wed, 8 Apr 2020 01:05:29 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 03853GBi179620; Wed, 8 Apr 2020 05:05:16 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=corp-2020-01-29; bh=kG41Wdi3xZl8bLDCQdMVBGXBcfy0aVqVcUlxPKtO2Qo=; b=xWXrvfUdB9tuJuQ2V9qdp8V5Bz/bz2ImxUQMZguPeBGwXxeXQYy1NSxRzY5PefUFgpCi DE348mVzKuUk1tMCueBWHccBpShi3itMcbUNJlD7HQhzAmsa08nAPhzy6973ZKTzTfVQ WbbNP2PNksH1Xt5HpceILIVsYBjThZn8GmaQPXJ7/cVAn3dWpMcXfJ+nzcncLVFMkK/s LunZLiI+/yDjmOTe811yfyRavy6AoS80i5en5ECYf7zgvFKOwGItBp1etljPK9ypTOOE WlgQIgH+NA20KP2M/zAXvrlZiP8WfH2UQlOeF4HKb5cnflfwZj4/IurCxH++yE9rr9eR uA== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2120.oracle.com with ESMTP id 3091mnh14d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 08 Apr 2020 05:05:16 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 03853Lv7159055; Wed, 8 Apr 2020 05:05:16 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3030.oracle.com with ESMTP id 3091m01fwa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 08 Apr 2020 05:05:16 +0000 Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 03855FqY030510; Wed, 8 Apr 2020 05:05:15 GMT Received: from monad.ca.oracle.com (/10.156.75.81) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 07 Apr 2020 22:05:14 -0700 From: Ankur Arora To: linux-kernel@vger.kernel.org, x86@kernel.org Cc: peterz@infradead.org, hpa@zytor.com, jpoimboe@redhat.com, namit@vmware.com, mhiramat@kernel.org, jgross@suse.com, bp@alien8.de, vkuznets@redhat.com, pbonzini@redhat.com, boris.ostrovsky@oracle.com, mihai.carabas@oracle.com, kvm@vger.kernel.org, xen-devel@lists.xenproject.org, virtualization@lists.linux-foundation.org, Ankur Arora Subject: [RFC PATCH 11/26] x86/alternatives: Remove return value of text_poke*() Date: Tue, 7 Apr 2020 22:03:08 -0700 Message-Id: <20200408050323.4237-12-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200408050323.4237-1-ankur.a.arora@oracle.com> References: <20200408050323.4237-1-ankur.a.arora@oracle.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9584 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 malwarescore=0 mlxlogscore=813 phishscore=0 spamscore=0 adultscore=0 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004080037 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9584 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 mlxlogscore=873 mlxscore=0 priorityscore=1501 bulkscore=0 adultscore=0 impostorscore=0 phishscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004080037 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Various text_poke() variants don't return a useful value. Remove it. Signed-off-by: Ankur Arora --- arch/x86/include/asm/text-patching.h | 4 ++-- arch/x86/kernel/alternative.c | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/arch/x86/include/asm/text-patching.h b/arch/x86/include/asm/text-patching.h index 706e61e6967d..04778c2bc34e 100644 --- a/arch/x86/include/asm/text-patching.h +++ b/arch/x86/include/asm/text-patching.h @@ -46,9 +46,9 @@ extern void text_poke_early(void *addr, const void *opcode, size_t len); * On the local CPU you need to be protected against 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 void text_poke_sync(void); -extern void *text_poke_kgdb(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, const void *emulate); diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 0c335af9ee28..8c79a3dc5e72 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -805,7 +805,7 @@ void __init_or_module text_poke_early(void *addr, const void *opcode, __ro_after_init struct mm_struct *poking_mm; __ro_after_init unsigned long poking_addr; -static void *__text_poke(void *addr, const void *opcode, size_t len) +static 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] = {NULL}; @@ -906,7 +906,6 @@ static void *__text_poke(void *addr, const void *opcode, size_t len) pte_unmap_unlock(ptep, ptl); local_irq_restore(flags); - return addr; } /** @@ -925,11 +924,11 @@ static void *__text_poke(void *addr, const void *opcode, size_t len) * by registering a module notifier, and ordering module removal and patching * trough a mutex. */ -void *text_poke(void *addr, const void *opcode, size_t len) +void text_poke(void *addr, const void *opcode, size_t len) { lockdep_assert_held(&text_mutex); - return __text_poke(addr, opcode, len); + __text_poke(addr, opcode, len); } /** @@ -946,9 +945,9 @@ void *text_poke(void *addr, const void *opcode, size_t len) * Context: should only be used by kgdb, which ensures no other core is running, * despite the fact it does not hold the text_mutex. */ -void *text_poke_kgdb(void *addr, const void *opcode, size_t len) +void text_poke_kgdb(void *addr, const void *opcode, size_t len) { - return __text_poke(addr, opcode, len); + __text_poke(addr, opcode, len); } static void do_sync_core(void *info) -- 2.20.1