From mboxrd@z Thu Jan 1 00:00:00 1970 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 E95A4CF34DC for ; Fri, 4 Oct 2024 01:21:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 414B36B0426; Thu, 3 Oct 2024 21:21:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3C3F46B0427; Thu, 3 Oct 2024 21:21:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 265836B0428; Thu, 3 Oct 2024 21:21:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 076216B0426 for ; Thu, 3 Oct 2024 21:21:11 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 812A340F6E for ; Fri, 4 Oct 2024 01:21:10 +0000 (UTC) X-FDA: 82634166300.12.7A56D0D Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) by imf16.hostedemail.com (Postfix) with ESMTP id 63C07180002 for ; Fri, 4 Oct 2024 01:21:07 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=MJv+bESA; spf=pass (imf16.hostedemail.com: domain of lkp@intel.com designates 192.198.163.18 as permitted sender) smtp.mailfrom=lkp@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1728004696; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=/vFE3r64NPftRIzUPLXyZyX7TUfdE75qnEOJ5iUABcE=; b=1e8iJf9m6aGgtG36YflViQtzu9neqY7vwytebDeCj6g3txgvGQBJQGCthh8Fc5aCb4GYbS 7dJFWJOMYtXAbFR2hKwaImUQ2byzUoL3mQ07LzKVmK9GL1QyULoe+bv0erd62ChmIdulg1 qDrMeO5K7//cb357mWc9QLF1B6XyBkA= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=MJv+bESA; spf=pass (imf16.hostedemail.com: domain of lkp@intel.com designates 192.198.163.18 as permitted sender) smtp.mailfrom=lkp@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1728004696; a=rsa-sha256; cv=none; b=41WFYoXeb2AF4DqKFIEAz43cwLYLvRWiDts5m+uHg33eWlQoiw2kIVXpU1AmXQ7YGFZ2hU w3NlCJTRm4VtU84c+FTrdb5bgmDiOqdP4sYjT0TvT5kn3VENy5eUs3jMt1s3ZLny718WGH PFJpyikpbvYH4agPhCV49WDBvVlwhnE= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728004868; x=1759540868; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=XAwp1HajigedLWPNyvDA2B/OVsp5lSLx9eQxfxT3RdA=; b=MJv+bESAHC6mJ+Gg59Qr1gOI8AuLRmb8UYzMPz6LHyy9vm51rur09eOI 0ufeoZETIy5TtE6fsSHBReVOpiYHk5H3t6WeQDoguTZFU1JdOQ04AVrgn +PRh9YisRiTc8KAO8/Ub6ifzPJuDvCjG1zF/vRwFLwdltnsL6I7yaHmQT mdDH3WaIBAvTM4st7nRB2EGWvNAEX8LlswxysPXkhDkv2I+KFnOPUw4r5 /RDYOuMWNtgejp7lrYHMn2rFDldJpUS1sLHgj74rn1QtrB14YP0BQlqf+ JR7ePeUvtNi/WWq+b43bzfw4z/yIGSppQjfCeJeMkAD1odv3ItGJExazB g==; X-CSE-ConnectionGUID: OooZoVL3SkGNwM+v6QvOHg== X-CSE-MsgGUID: Ppxm/33PSzG0j6KhdhqVVA== X-IronPort-AV: E=McAfee;i="6700,10204,11214"; a="26689243" X-IronPort-AV: E=Sophos;i="6.11,176,1725346800"; d="scan'208";a="26689243" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2024 18:21:06 -0700 X-CSE-ConnectionGUID: 1PmMfVzDQZqzvxQvcU6udQ== X-CSE-MsgGUID: fxKs9q26TUComuwqMFdUkw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,176,1725346800"; d="scan'208";a="74234010" Received: from lkp-server01.sh.intel.com (HELO a48cf1aa22e8) ([10.239.97.150]) by fmviesa007.fm.intel.com with ESMTP; 03 Oct 2024 18:20:58 -0700 Received: from kbuild by a48cf1aa22e8 with local (Exim 4.96) (envelope-from ) id 1swX04-000160-07; Fri, 04 Oct 2024 01:20:56 +0000 Date: Fri, 4 Oct 2024 09:20:32 +0800 From: kernel test robot To: Deepak Gupta , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Andrew Morton , "Liam R. Howlett" , Vlastimil Babka , Lorenzo Stoakes , Paul Walmsley , Palmer Dabbelt , Albert Ou , Conor Dooley , Rob Herring , Krzysztof Kozlowski , Arnd Bergmann , Christian Brauner , Peter Zijlstra , Oleg Nesterov , Eric Biederman , Kees Cook , Jonathan Corbet , Shuah Khan Cc: oe-kbuild-all@lists.linux.dev, Linux Memory Management List , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-arch@vger.kernel.org Subject: Re: [PATCH 22/33] riscv: signal: abstract header saving for setup_sigcontext Message-ID: <202410040912.4TpCD7iU-lkp@intel.com> References: <20241001-v5_user_cfi_series-v1-22-3ba65b6e550f@rivosinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20241001-v5_user_cfi_series-v1-22-3ba65b6e550f@rivosinc.com> X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 63C07180002 X-Stat-Signature: 9xkfb4jcibzwqsy3oon7juftq7q17pwi X-Rspam-User: X-HE-Tag: 1728004867-842852 X-HE-Meta: U2FsdGVkX1+1XOUq+subLIho3V1zF1g+JZ2sa2/q0SBdDTAnhWB1Tbt/ZYZC4L/EwxH73i0GS62kW8UpwVrnEjg0erU1lkiMUmIKH7KxaE+GrkL+HEO8qKwMrXfbcObmQeJCHRR1RORE+6gSttKkbwGthJItDns6ABV2r4J7f9ISpdihbCLaOpftxLxkxcti3JztDg85/bkc9Zl/oiUT/hjyLWvvieL4WSYZy/vjLAttW0AwrILNZbP1Erv2NBoQlop/A1RcWLnM5BQUPSJV+VF4GoEOP20Sp7AoBSIm4FTRI3IF/AdyrF88K324NYN8zbXhT1l54Os62XudAyhv4tcGXkEMfodmGeFp5kQFEPn64RNGlcTbdxT7YnpHQ/YUI0v/vg5wqChBEK/4jVibQlb3re09NOQHToz73E9hjF/MXjnHaIFcXB17vTzbF6rmuqiCIls0ucyqjLVgUqhgV+mqK0P3Pr2LmgCsGOp86Z04xDwM/0j7BsMK5MWgBLCwg7udXHw2X8zTx+C5uKg106uApqSPNnSVhYfbmY2N3MVjn+yyzinudh5XPVyifVhoZPd/9ksyjFmEwUe2IegX9a154Y0u3coKLFDdK3TYs3KzzNcbmtA8Jw1eilT5kowQ9zglu0OBeCY5MWu6WwLec6nXKpGNH4gTT/BBbQx8w849u+gMiU35SwT7SzNZbxK5569gisk1emleSZuTz+yPZ9NZoIL5NUrwgIYXxQLJy36X5hd5zKrzYwxQXXERZZn1XhR/H+oC0tgkML0Jbq6esxuQt+g9YlnFiRlwJyiQP6CaB/nKMCH3CKGqpJSvA9aytknsF5xUilpztx4RG0kL6wlud2RhkLKUkeZBJ2zYALSgcqG3U2ryDhBJmDm/Y6Rn8Fi4WRWa6nmm0KFwCrYzSMSaCb3av9uX68BOOCS7dzHRp2HUHiplZ8O6Bj1rfKJRW7PHqw9Lt53yMdIjiJC 8TxunucI IUXg0v88kaI552mOb8bgiF79XSnE1WvnWvMkiI3oQKiHYknRuR6wzz3YG1oBgHCZiic9YIotvnHiar5qpCla+9Iw7ExlbWx5sG1C1W80M/2fZJchA31wxQE7lAzVRJykKvEOXIuX5FEedtOM9+ZxRdyqJVElDBDBjA8hAgM3y33J1Wjyaxd67OwyNEIqwe7iXgKspXL0UcQLF3TYWcgt0SKGvFPLxvXhYUnaCtLoAO9sfs25KlSOP6yI86zdz7DP1qEcFXEV7EznLfPNjYixzXmwQy1FZ2sSKLa76B+jZiCeYpjavQKLNtJ9K2YfI6HfWpWiUaaPWzi07GsFV601jI8in2qyOC2s6Wvi9jnIjDGQsRLqiWaP5QIwsJS2G1Kd4vPhHUxKtlQCmNdJT9SxpkdQ7EdTQbGm+C7Vqc78GzeByO1zoHhvbDDkFlKXkhdxz8b4RM7yP0BSeb9rqb32oVQ7qzg== 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: List-Subscribe: List-Unsubscribe: Hi Deepak, kernel test robot noticed the following build errors: [auto build test ERROR on 9852d85ec9d492ebef56dc5f229416c925758edc] url: https://github.com/intel-lab-lkp/linux/commits/Deepak-Gupta/mm-Introduce-ARCH_HAS_USER_SHADOW_STACK/20241002-000937 base: 9852d85ec9d492ebef56dc5f229416c925758edc patch link: https://lore.kernel.org/r/20241001-v5_user_cfi_series-v1-22-3ba65b6e550f%40rivosinc.com patch subject: [PATCH 22/33] riscv: signal: abstract header saving for setup_sigcontext config: riscv-allnoconfig (https://download.01.org/0day-ci/archive/20241004/202410040912.4TpCD7iU-lkp@intel.com/config) compiler: riscv64-linux-gcc (GCC) 14.1.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241004/202410040912.4TpCD7iU-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Closes: https://lore.kernel.org/oe-kbuild-all/202410040912.4TpCD7iU-lkp@intel.com/ All errors (new ones prefixed by >>): arch/riscv/kernel/signal.c: In function 'save_v_state': >> arch/riscv/kernel/signal.c:89:9: error: implicit declaration of function 'get_cpu_vector_context' [-Wimplicit-function-declaration] 89 | get_cpu_vector_context(); | ^~~~~~~~~~~~~~~~~~~~~~ >> arch/riscv/kernel/signal.c:91:9: error: implicit declaration of function 'put_cpu_vector_context' [-Wimplicit-function-declaration] 91 | put_cpu_vector_context(); | ^~~~~~~~~~~~~~~~~~~~~~ arch/riscv/kernel/signal.c: In function '__restore_v_state': >> arch/riscv/kernel/signal.c:123:9: error: implicit declaration of function 'riscv_v_vstate_set_restore'; did you mean 'riscv_v_vstate_restore'? [-Wimplicit-function-declaration] 123 | riscv_v_vstate_set_restore(current, regs); | ^~~~~~~~~~~~~~~~~~~~~~~~~~ | riscv_v_vstate_restore vim +/get_cpu_vector_context +89 arch/riscv/kernel/signal.c e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 70 3fad3080e143f7 Andy Chiu 2024-10-01 71 static long save_v_state(struct pt_regs *regs, void __user *sc_vec) 8ee0b41898fa26 Greentime Hu 2023-06-05 72 { 8ee0b41898fa26 Greentime Hu 2023-06-05 73 struct __sc_riscv_v_state __user *state; 8ee0b41898fa26 Greentime Hu 2023-06-05 74 void __user *datap; 8ee0b41898fa26 Greentime Hu 2023-06-05 75 long err; 8ee0b41898fa26 Greentime Hu 2023-06-05 76 3fad3080e143f7 Andy Chiu 2024-10-01 77 if (!IS_ENABLED(CONFIG_RISCV_ISA_V) || 3fad3080e143f7 Andy Chiu 2024-10-01 78 !(has_vector() && riscv_v_vstate_query(regs))) 3fad3080e143f7 Andy Chiu 2024-10-01 79 return 0; 3fad3080e143f7 Andy Chiu 2024-10-01 80 3fad3080e143f7 Andy Chiu 2024-10-01 81 /* Place state to the user's signal context spac */ 3fad3080e143f7 Andy Chiu 2024-10-01 82 state = (struct __sc_riscv_v_state __user *)sc_vec; 8ee0b41898fa26 Greentime Hu 2023-06-05 83 /* Point datap right after the end of __sc_riscv_v_state */ 8ee0b41898fa26 Greentime Hu 2023-06-05 84 datap = state + 1; 8ee0b41898fa26 Greentime Hu 2023-06-05 85 8ee0b41898fa26 Greentime Hu 2023-06-05 86 /* datap is designed to be 16 byte aligned for better performance */ 1d20e5d437cfeb Zhongqiu Han 2024-06-20 87 WARN_ON(!IS_ALIGNED((unsigned long)datap, 16)); 8ee0b41898fa26 Greentime Hu 2023-06-05 88 7df56cbc27e423 Andy Chiu 2024-01-15 @89 get_cpu_vector_context(); d6c78f1ca3e8ec Andy Chiu 2024-01-15 90 riscv_v_vstate_save(¤t->thread.vstate, regs); 7df56cbc27e423 Andy Chiu 2024-01-15 @91 put_cpu_vector_context(); 7df56cbc27e423 Andy Chiu 2024-01-15 92 8ee0b41898fa26 Greentime Hu 2023-06-05 93 /* Copy everything of vstate but datap. */ 8ee0b41898fa26 Greentime Hu 2023-06-05 94 err = __copy_to_user(&state->v_state, ¤t->thread.vstate, 8ee0b41898fa26 Greentime Hu 2023-06-05 95 offsetof(struct __riscv_v_ext_state, datap)); 8ee0b41898fa26 Greentime Hu 2023-06-05 96 /* Copy the pointer datap itself. */ 869436dae72acf Ben Dooks 2023-11-23 97 err |= __put_user((__force void *)datap, &state->v_state.datap); 8ee0b41898fa26 Greentime Hu 2023-06-05 98 /* Copy the whole vector content to user space datap. */ 8ee0b41898fa26 Greentime Hu 2023-06-05 99 err |= __copy_to_user(datap, current->thread.vstate.datap, riscv_v_vsize); 8ee0b41898fa26 Greentime Hu 2023-06-05 100 if (unlikely(err)) 3fad3080e143f7 Andy Chiu 2024-10-01 101 return -EFAULT; 8ee0b41898fa26 Greentime Hu 2023-06-05 102 3fad3080e143f7 Andy Chiu 2024-10-01 103 /* Only return the size if everything has done successfully */ 3fad3080e143f7 Andy Chiu 2024-10-01 104 return riscv_v_sc_size; 8ee0b41898fa26 Greentime Hu 2023-06-05 105 } 8ee0b41898fa26 Greentime Hu 2023-06-05 106 8ee0b41898fa26 Greentime Hu 2023-06-05 107 /* 8ee0b41898fa26 Greentime Hu 2023-06-05 108 * Restore Vector extension context from the user's signal frame. This function 8ee0b41898fa26 Greentime Hu 2023-06-05 109 * assumes a valid extension header. So magic and size checking must be done by 8ee0b41898fa26 Greentime Hu 2023-06-05 110 * the caller. 8ee0b41898fa26 Greentime Hu 2023-06-05 111 */ 8ee0b41898fa26 Greentime Hu 2023-06-05 112 static long __restore_v_state(struct pt_regs *regs, void __user *sc_vec) 8ee0b41898fa26 Greentime Hu 2023-06-05 113 { 8ee0b41898fa26 Greentime Hu 2023-06-05 114 long err; 8ee0b41898fa26 Greentime Hu 2023-06-05 115 struct __sc_riscv_v_state __user *state = sc_vec; 8ee0b41898fa26 Greentime Hu 2023-06-05 116 void __user *datap; 8ee0b41898fa26 Greentime Hu 2023-06-05 117 c27fa53b858b4e Björn Töpel 2024-04-03 118 /* c27fa53b858b4e Björn Töpel 2024-04-03 119 * Mark the vstate as clean prior performing the actual copy, c27fa53b858b4e Björn Töpel 2024-04-03 120 * to avoid getting the vstate incorrectly clobbered by the c27fa53b858b4e Björn Töpel 2024-04-03 121 * discarded vector state. c27fa53b858b4e Björn Töpel 2024-04-03 122 */ c27fa53b858b4e Björn Töpel 2024-04-03 @123 riscv_v_vstate_set_restore(current, regs); c27fa53b858b4e Björn Töpel 2024-04-03 124 8ee0b41898fa26 Greentime Hu 2023-06-05 125 /* Copy everything of __sc_riscv_v_state except datap. */ 8ee0b41898fa26 Greentime Hu 2023-06-05 126 err = __copy_from_user(¤t->thread.vstate, &state->v_state, 8ee0b41898fa26 Greentime Hu 2023-06-05 127 offsetof(struct __riscv_v_ext_state, datap)); 8ee0b41898fa26 Greentime Hu 2023-06-05 128 if (unlikely(err)) 8ee0b41898fa26 Greentime Hu 2023-06-05 129 return err; 8ee0b41898fa26 Greentime Hu 2023-06-05 130 8ee0b41898fa26 Greentime Hu 2023-06-05 131 /* Copy the pointer datap itself. */ 8ee0b41898fa26 Greentime Hu 2023-06-05 132 err = __get_user(datap, &state->v_state.datap); 8ee0b41898fa26 Greentime Hu 2023-06-05 133 if (unlikely(err)) 8ee0b41898fa26 Greentime Hu 2023-06-05 134 return err; 8ee0b41898fa26 Greentime Hu 2023-06-05 135 /* 8ee0b41898fa26 Greentime Hu 2023-06-05 136 * Copy the whole vector content from user space datap. Use 8ee0b41898fa26 Greentime Hu 2023-06-05 137 * copy_from_user to prevent information leak. 8ee0b41898fa26 Greentime Hu 2023-06-05 138 */ c27fa53b858b4e Björn Töpel 2024-04-03 139 return copy_from_user(current->thread.vstate.datap, datap, riscv_v_vsize); 8ee0b41898fa26 Greentime Hu 2023-06-05 140 } 3fad3080e143f7 Andy Chiu 2024-10-01 141 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki