From patchwork Sun Jan 30 21:18:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rick Edgecombe X-Patchwork-Id: 12730156 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E544C433F5 for ; Sun, 30 Jan 2022 21:22:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 496896B00B3; Sun, 30 Jan 2022 16:22:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3C7C16B00B5; Sun, 30 Jan 2022 16:22:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 266FC6B00B6; Sun, 30 Jan 2022 16:22:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0153.hostedemail.com [216.40.44.153]) by kanga.kvack.org (Postfix) with ESMTP id 16F3F6B00B3 for ; Sun, 30 Jan 2022 16:22:09 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id D231695295 for ; Sun, 30 Jan 2022 21:22:08 +0000 (UTC) X-FDA: 79088226336.07.58C3D74 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by imf28.hostedemail.com (Postfix) with ESMTP id 10254C0002 for ; Sun, 30 Jan 2022 21:22:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643577728; x=1675113728; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=iszGpgXYExAyyOaulmbapPJ8Xs6AdZ3T2R4pfVKChQc=; b=hXyd0neO3hdl3ZE5Fotfgria6uzKq1yjJ8v3215nBW7/51TVLaF6G7VE UImKTXr0+H97+daxMlrPkptNcuuY7zzl32R1pzv6YQz540F+46+93DHkK A8f4AL188D9Gz42ggs+J8E7sILJaSccT1tEfuePXDCL4xsa8xMWVmOLEO QiyBi/aTk8fmYtB7YNea8QYqE1F6GjW5SDDP0O+OYpBGy5cvvxA9btPSw coWi6/2DFRppB0A5HrC5lba/Kv+jK/7Y2nLZjduDHaa5B8T6++2utAai6 uDsT6mo477B4TkPQyK7KuzWB+1fADnydgZ8LCCMTTf3GwgvPQF0WefYYd Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10243"; a="244970225" X-IronPort-AV: E=Sophos;i="5.88,329,1635231600"; d="scan'208";a="244970225" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2022 13:22:07 -0800 X-IronPort-AV: E=Sophos;i="5.88,329,1635231600"; d="scan'208";a="536856908" Received: from avmallar-mobl1.amr.corp.intel.com (HELO rpedgeco-desk.amr.corp.intel.com) ([10.209.123.171]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2022 13:22:06 -0800 From: Rick Edgecombe To: x86@kernel.org, "H . Peter Anvin" , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , Andy Lutomirski , Balbir Singh , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , "H . J . Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V . Shankar" , Dave Martin , Weijiang Yang , "Kirill A . Shutemov" , joao.moreira@intel.com, John Allen , kcc@google.com, eranian@google.com Cc: rick.p.edgecombe@intel.com, Yu-cheng Yu Subject: [PATCH 26/35] x86/process: Change copy_thread() argument 'arg' to 'stack_size' Date: Sun, 30 Jan 2022 13:18:29 -0800 Message-Id: <20220130211838.8382-27-rick.p.edgecombe@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220130211838.8382-1-rick.p.edgecombe@intel.com> References: <20220130211838.8382-1-rick.p.edgecombe@intel.com> X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 10254C0002 X-Stat-Signature: fz8a4jfxsxkkzmbk4mcbf9caam1cemfz X-Rspam-User: nil Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=hXyd0neO; spf=none (imf28.hostedemail.com: domain of rick.p.edgecombe@intel.com has no SPF policy when checking 192.55.52.93) smtp.mailfrom=rick.p.edgecombe@intel.com; dmarc=pass (policy=none) header.from=intel.com X-HE-Tag: 1643577727-628565 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Yu-cheng Yu The single call site of copy_thread() passes stack size in 'arg'. To make this clear and in preparation of using this argument for shadow stack allocation, change 'arg' to 'stack_size'. No functional changes. Signed-off-by: Yu-cheng Yu Signed-off-by: Rick Edgecombe --- arch/x86/kernel/process.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index 81d8ef036637..82a816178e7f 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c @@ -130,8 +130,9 @@ static int set_new_tls(struct task_struct *p, unsigned long tls) return do_set_thread_area_64(p, ARCH_SET_FS, tls); } -int copy_thread(unsigned long clone_flags, unsigned long sp, unsigned long arg, - struct task_struct *p, unsigned long tls) +int copy_thread(unsigned long clone_flags, unsigned long sp, + unsigned long stack_size, struct task_struct *p, + unsigned long tls) { struct inactive_task_frame *frame; struct fork_frame *fork_frame; @@ -175,7 +176,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, unsigned long arg, if (unlikely(p->flags & PF_KTHREAD)) { p->thread.pkru = pkru_get_init_value(); memset(childregs, 0, sizeof(struct pt_regs)); - kthread_frame_init(frame, sp, arg); + kthread_frame_init(frame, sp, stack_size); return 0; } @@ -208,7 +209,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, unsigned long arg, */ childregs->sp = 0; childregs->ip = 0; - kthread_frame_init(frame, sp, arg); + kthread_frame_init(frame, sp, stack_size); return 0; }