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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9CA58EB64D7 for ; Mon, 26 Jun 2023 18:04:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230096AbjFZSEV (ORCPT ); Mon, 26 Jun 2023 14:04:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229714AbjFZSES (ORCPT ); Mon, 26 Jun 2023 14:04:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF64E130 for ; Mon, 26 Jun 2023 11:04:17 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 50CD760F1B for ; Mon, 26 Jun 2023 18:04:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31CD7C433C8; Mon, 26 Jun 2023 18:04:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687802656; bh=WsiKkTM73mtAmQ00ugazGG4W0HkOJmDHHpGv9mYa+/E=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=AounBPoyrIYC8tj7GGEruylVt9XIaWqGJ/RxL5wRls1pWn/s/8is3nNnLf7ugNk6e NUReI1leY2p9+1wp2L1WcPq9dO7QpRIFKkoi2DDaxPIah1LWHp0Bie2/8Moc86g+pm CEdCgj1na0IsDDyuvc5ixeNqr/lnM0fNpPByNAKBotkFprb4HuKt2tus/jCJnakzNA A8ZzIHCVZqBxuESs/zX8uTXdSCwOGZvFyh1pP+sGol9EO+RGX6NBShA7Frp17/XEdi p6tDQvHcpUvwXIR9Kswn5YlJAPSBe/LdATxMZwVqYiQA7khrmHdczws9DWYs+xcWiq CWpCGJTzGJlqA== From: =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= To: Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv@lists.infradead.org Cc: =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= , linux-kernel@vger.kernel.org, linux@rivosinc.com, Palmer Dabbelt , =?utf-8?Q?R?= =?utf-8?Q?=C3=A9mi?= Denis-Courmont , Darius Rad , Andy Chiu Subject: Re: [PATCH v2] riscv: Discard vector state on syscalls In-Reply-To: <87y1k6m827.fsf@all.your.base.are.belong.to.us> References: <20230626165736.65927-1-bjorn@kernel.org> <87y1k6m827.fsf@all.your.base.are.belong.to.us> Date: Mon, 26 Jun 2023 20:04:13 +0200 Message-ID: <87sfaem76q.fsf@all.your.base.are.belong.to.us> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Bj=C3=B6rn T=C3=B6pel writes: > Bj=C3=B6rn T=C3=B6pel writes: > >> From: Bj=C3=B6rn T=C3=B6pel >> >> The RISC-V vector specification states: >> Executing a system call causes all caller-saved vector registers >> (v0-v31, vl, vtype) and vstart to become unspecified. > > A bit of a corner case, but this will make sigreturn syscalls discard > the vector state as well. > > Is that an issue? E.g. a user cannot build userspace context switching > application. Does arm64 SVE handle sigreturn in a special way? NVM; My bad. The vector state is cleared on *entry*, but then the registers passed on signal stack is restored as usual. Sorry for the noise! We're all good! Bj=C3=B6rn