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 0C83BC05027 for ; Fri, 20 Jan 2023 12:21:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4AAD26B0072; Fri, 20 Jan 2023 07:21:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 45ACA6B0073; Fri, 20 Jan 2023 07:21:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3225F6B0074; Fri, 20 Jan 2023 07:21:41 -0500 (EST) 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 243116B0072 for ; Fri, 20 Jan 2023 07:21:41 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id E0286C0D3E for ; Fri, 20 Jan 2023 12:21:40 +0000 (UTC) X-FDA: 80375088360.15.ECC33CF Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) by imf09.hostedemail.com (Postfix) with ESMTP id CA29B140003 for ; Fri, 20 Jan 2023 12:21:38 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=sntech.de; spf=pass (imf09.hostedemail.com: domain of heiko@sntech.de designates 185.11.138.130 as permitted sender) smtp.mailfrom=heiko@sntech.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674217299; 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; bh=hgz0YycZqXjsTFr84HbNrYAi57hU0rXTBmXUSg8kZ3k=; b=MGoIHZn/NDLulsnSU3Qi7pU34F7J+FvlDCXLAq79zheFjkk5B83As8TLobo6Nba16L9V4Z WAyYmPAMdufRaFRmf85+bvbC84FzI7EhIfSFO+t6OmrpFgHJG2lTddulH28kvKaT4UEJvJ RFHHBRxpOvCrq08AZkZpZ7XcI6J16Fw= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=sntech.de; spf=pass (imf09.hostedemail.com: domain of heiko@sntech.de designates 185.11.138.130 as permitted sender) smtp.mailfrom=heiko@sntech.de ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674217299; a=rsa-sha256; cv=none; b=act6hJ03L4BTVqNW9J8DPmzMXXF8T98L5EZAXCHBBhU1hatk+5oe7MBAqZJKxA/FfvwIpd gEi0wO2ciIyTtrXMfzvaxT+SDm5gEMWxx9U9AO0R1uYJSBCV4F9oR29R7U5sxrJDlDCLEZ FiUJdGKkWrQbJ2ExpY72APWnktjzQRI= Received: from ip5b412258.dynamic.kabel-deutschland.de ([91.65.34.88] helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pIqNP-0003oi-Vu; Fri, 20 Jan 2023 13:20:12 +0100 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: linux-riscv@lists.infradead.org Cc: Guo Ren , Vincent Chen , Han-Kuan Chen , Greentime Hu , Palmer Dabbelt , Paul Walmsley , Palmer Dabbelt , Albert Ou , Eric Biederman , Kees Cook , Anup Patel , Atish Patra , Oleg Nesterov , Heinrich Schuchardt , Guo Ren , Chris Stillson , Mayuresh Chitale , Paolo Bonzini , Alexandre Ghiti , Qinglin Pan , Arnd Bergmann , Jisheng Zhang , Dao Lu , "Peter Zijlstra (Intel)" , Sunil V L , Ruinland Tsai , Li Zhengyu , Alexander Graf , Ard Biesheuvel , Tsukasa OI , Yury Norov , Nicolas Saenz Julienne , Mark Rutland , Frederic Weisbecker , Changbin Du , Vitaly Wool , Myrtle Shah , Catalin Marinas , Will Deacon , Mark Brown , Alexey Dobriyan , Huacai Chen , Janosch Frank , Christian Brauner , Peter Collingbourne , Eugene Syromiatnikov , Colin Cross , Andrew Morton , Barret Rhoden , Suren Baghdasaryan , Davidlohr Bueso , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, Chris Stillson Subject: Re: [PATCH v12 06/17] riscv: Reset vector register Date: Fri, 20 Jan 2023 13:20:09 +0100 Message-ID: <2331455.NG923GbCHz@diego> In-Reply-To: <20220921214439.1491510-6-stillson@rivosinc.com> References: <20220921214439.1491510-1-stillson@rivosinc.com> <20220921214439.1491510-6-stillson@rivosinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Rspamd-Queue-Id: CA29B140003 X-Stat-Signature: qsssikgpmu19441i8snux7fa6ryz97yq X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1674217298-703117 X-HE-Meta: U2FsdGVkX18+YRSS8mGWzDdDJ7WxLTOiYzHo2QapcL4+Zs95YMYSHFtoG4KkE+0N6luciVk9bMs2gwqKMjl3ivkRK1RZoehweGlXfryDOa1gtrffozMY9RJrAaEZ1YoCYgkhkY3wtflov8OqtmcpRI5c1fZ/6eHNpoX2u44NF1gJGd1RxhvQatfC8JIUAohF1JIkcIxiT1k1f6eChnBtXP9UqdRtF5BkPT5NHV5ruLX18aNYdYaqSqZMQ7XXFCyxMJARlHSeTR1EjpOW8Q27JsciOrrcsA5gidIUer/7a8U9d4uavQQScPGw4q31BSmH0xNmv1n68eHE3vrvAJtMTcxQaMLnM/Una1zDNlui5bXmGLRw2FoeLWrCDJYluHN8FaD3BylJzVz40hYdFRLWnDdZRMMBUPDzwoyxGzDcys2/XpFAenV8WKnPO5ZFUWskxG3bOknE940sprfRVq6lRE+jbZF5xyaYEsS/8z4XKlVQModDS/AeGuJvaJQNAobkVgrPcs5h4N4oiB2jCD2xsptUw0dI7JAtBiDnDOZPwdtlmQUiCLVeYGjE8yB2VG9g8YkA4ALkc01tidscDnj8PjyUmLwvxhvKY9X36FVJNMSKlDDz+Eu6AERBvsOBfp+wBuhK4kkcDYsMG9sMFRZEjc+0x3fuD8H/9+fwjbObn4b4/SUqt3KxUGngLqEOYiu4uZcETDENBp1Yd4+JFB9GglVTJBQWk+XAdnTO/vjeANLOIB1EwV7KCmYTeJJQXmS3y2XwSfBbQKLntBDqrd380o5LgV713j9cL/WDL9ws0fOs23fB9GHo6R5CcHyo/eIoYKDe1y03Yk3gBbxobJeLu/m3fbYWkGSm47rTycMz61G45lYo/wBWt3QQh3bKXy1W97MadOdzVkTtc6079ly0+5B3ekwkoPUrMgpvk69BRo9HlyoTIPiAnbBh562SgVZpqJf06v56eRTNcB1VJ5p ZWKGgMCQ 92rjtBtyRwMJIhChb2w/y5UvHHbvnpM/1y5Kk/buLZVB+pLwNyi6TW46/KT/zb7KZ8Ws6zK6zJdjTRI4RrcluceUyzL0ypt9S69bp8KToCrXtzxEncz/udX5gjz0Lui9bXSh/deKEM2oqvsbGXuBGPJhZ26kV9xdHx8aRSg8mkwuwPH5P1EuIeNtLgK9ndKOuw3eCLus3d9mjjz5gppPtfua8AvqzTA8txpoC4M0CI2M+MH96cmCKy0BuiQ== 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: Am Mittwoch, 21. September 2022, 23:43:48 CET schrieb Chris Stillson: > @@ -431,6 +431,29 @@ ENTRY(reset_regs) > csrw fcsr, 0 > /* note that the caller must clear SR_FS */ > #endif /* CONFIG_FPU */ > + > +#ifdef CONFIG_VECTOR > + csrr t0, CSR_MISA > + li t1, COMPAT_HWCAP_ISA_V > + and t0, t0, t1 > + beqz t0, .Lreset_regs_done > + > + /* > + * Clear vector registers and reset vcsr > + * VLMAX has a defined value, VLEN is a constant, > + * and this form of vsetvli is defined to set vl to VLMAX. > + */ > + li t1, SR_VS > + csrs CSR_STATUS, t1 > + csrs CSR_VCSR, x0 > + vsetvli t1, x0, e8, m8, ta, ma > + vmv.v.i v0, 0 > + vmv.v.i v8, 0 > + vmv.v.i v16, 0 > + vmv.v.i v24, 0 > + /* note that the caller must clear SR_VS */ > +#endif /* CONFIG_VECTOR */ > + > .Lreset_regs_done: Not sure how much they go together, but the #ifdef CONFIG_FPU block above your new VECTOR block also jumps to the same .Lreset_regs_done, so with the patch as is the vector-reset block is never reached in the !FPU case. So maybe making them independent of each other might prevent issues down the roead.