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 mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03513C433F5 for ; Wed, 2 Mar 2022 17:09:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 784E849F11; Wed, 2 Mar 2022 12:09:46 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EQSWO1t1OIYX; Wed, 2 Mar 2022 12:09:44 -0500 (EST) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 3E8A349F0E; Wed, 2 Mar 2022 12:09:44 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 98AC649F0E for ; Wed, 2 Mar 2022 12:09:42 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SI7XwdOgO7Aq for ; Wed, 2 Mar 2022 12:09:41 -0500 (EST) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 7048649F04 for ; Wed, 2 Mar 2022 12:09:41 -0500 (EST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 00CBCB82106; Wed, 2 Mar 2022 17:09:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9D45C004E1; Wed, 2 Mar 2022 17:09:35 +0000 (UTC) Date: Wed, 2 Mar 2022 17:09:32 +0000 From: Catalin Marinas To: Mark Brown Subject: Re: [PATCH v12 20/40] arm64/sme: Implement streaming SVE signal handling Message-ID: References: <20220225165923.1474372-1-broonie@kernel.org> <20220225165923.1474372-21-broonie@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220225165923.1474372-21-broonie@kernel.org> Cc: Basant Kumar Dwivedi , Will Deacon , Luis Machado , Szabolcs Nagy , Marc Zyngier , Shuah Khan , linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, Alan Hayward , Shuah Khan , kvmarm@lists.cs.columbia.edu, Salil Akerkar X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Fri, Feb 25, 2022 at 04:59:03PM +0000, Mark Brown wrote: > When in streaming mode we have the same set of SVE registers as we do in > regular SVE mode with the exception of FFR and the use of the SME vector > length. Provide signal handling for these registers by taking one of the > reserved words in the SVE signal context as a flags field and defining a > flag which is set for streaming mode. When the flag is set the vector > length is set to the streaming mode vector length and we save and > restore streaming mode data. We support entering or leaving streaming > mode based on the value of the flag but do not support changing the > vector length, this is not currently supported SVE signal handling. > > We could instead allocate a separate record in the signal frame for the > streaming mode SVE context but this inflates the size of the maximal signal > frame required and adds complication when validating signal frames from > userspace, especially given the current structure of the code. > > Any implementation of support for streaming mode vectors in signals will > have some potential for causing issues for applications that attempt to > handle SVE vectors in signals, use streaming mode but do not understand > streaming mode in their signal handling code, it is hard to identify a > case that is clearly better than any other - they all have cases where > they could cause unexpected register corruption or faults. > > Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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 EAC87C433F5 for ; Wed, 2 Mar 2022 17:09:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235582AbiCBRKY (ORCPT ); Wed, 2 Mar 2022 12:10:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231790AbiCBRKX (ORCPT ); Wed, 2 Mar 2022 12:10:23 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C37D53BBC9 for ; Wed, 2 Mar 2022 09:09:39 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5E6836195A for ; Wed, 2 Mar 2022 17:09:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9D45C004E1; Wed, 2 Mar 2022 17:09:35 +0000 (UTC) Date: Wed, 2 Mar 2022 17:09:32 +0000 From: Catalin Marinas To: Mark Brown Cc: Will Deacon , Marc Zyngier , Shuah Khan , Shuah Khan , Alan Hayward , Luis Machado , Salil Akerkar , Basant Kumar Dwivedi , Szabolcs Nagy , James Morse , Alexandru Elisei , Suzuki K Poulose , linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, kvmarm@lists.cs.columbia.edu Subject: Re: [PATCH v12 20/40] arm64/sme: Implement streaming SVE signal handling Message-ID: References: <20220225165923.1474372-1-broonie@kernel.org> <20220225165923.1474372-21-broonie@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220225165923.1474372-21-broonie@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org On Fri, Feb 25, 2022 at 04:59:03PM +0000, Mark Brown wrote: > When in streaming mode we have the same set of SVE registers as we do in > regular SVE mode with the exception of FFR and the use of the SME vector > length. Provide signal handling for these registers by taking one of the > reserved words in the SVE signal context as a flags field and defining a > flag which is set for streaming mode. When the flag is set the vector > length is set to the streaming mode vector length and we save and > restore streaming mode data. We support entering or leaving streaming > mode based on the value of the flag but do not support changing the > vector length, this is not currently supported SVE signal handling. > > We could instead allocate a separate record in the signal frame for the > streaming mode SVE context but this inflates the size of the maximal signal > frame required and adds complication when validating signal frames from > userspace, especially given the current structure of the code. > > Any implementation of support for streaming mode vectors in signals will > have some potential for causing issues for applications that attempt to > handle SVE vectors in signals, use streaming mode but do not understand > streaming mode in their signal handling code, it is hard to identify a > case that is clearly better than any other - they all have cases where > they could cause unexpected register corruption or faults. > > Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 597E9C433F5 for ; Wed, 2 Mar 2022 17:10:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TjGdV3pZ2/fg1pdRkukgkJrIij7ohHPXsklPfgmkL6U=; b=lcUn/2X8M4F/Lg +QybbqFLXHOXFz7PwMfpkcMjY/Ihw2E79QUuCP20FuigIa2CpdWIeHFIDoyPo43gaUa0FxgRUWB34 5TLCxifdjGXiwqCvlmOAw/yPHdmyqOx7h1GYGrfIvm7L5UsBryrUpXGvRGYHEK3cpehgmZO2OkFpc JirzJe0q84CAvQZiiSoqAYVUaCS9i06WIk0I35pPqj5IlLDnV6d/wzvV+714RZNs3DTSY2+nwLFUh 6g6rFh+Kf0jrmTy6O2suKy7mFdeQLbmfW5f2yKMY65zhA1+GbIhYzcuP5y3zfS8KYJwlhyKuGaEkS DrA1Gs83IbuGiC9Xt88w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPSTx-003TRA-9D; Wed, 02 Mar 2022 17:09:45 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPSTt-003TQ8-An for linux-arm-kernel@lists.infradead.org; Wed, 02 Mar 2022 17:09:42 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 00CBCB82106; Wed, 2 Mar 2022 17:09:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9D45C004E1; Wed, 2 Mar 2022 17:09:35 +0000 (UTC) Date: Wed, 2 Mar 2022 17:09:32 +0000 From: Catalin Marinas To: Mark Brown Cc: Will Deacon , Marc Zyngier , Shuah Khan , Shuah Khan , Alan Hayward , Luis Machado , Salil Akerkar , Basant Kumar Dwivedi , Szabolcs Nagy , James Morse , Alexandru Elisei , Suzuki K Poulose , linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, kvmarm@lists.cs.columbia.edu Subject: Re: [PATCH v12 20/40] arm64/sme: Implement streaming SVE signal handling Message-ID: References: <20220225165923.1474372-1-broonie@kernel.org> <20220225165923.1474372-21-broonie@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220225165923.1474372-21-broonie@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220302_090941_540797_6363D0C5 X-CRM114-Status: GOOD ( 20.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Feb 25, 2022 at 04:59:03PM +0000, Mark Brown wrote: > When in streaming mode we have the same set of SVE registers as we do in > regular SVE mode with the exception of FFR and the use of the SME vector > length. Provide signal handling for these registers by taking one of the > reserved words in the SVE signal context as a flags field and defining a > flag which is set for streaming mode. When the flag is set the vector > length is set to the streaming mode vector length and we save and > restore streaming mode data. We support entering or leaving streaming > mode based on the value of the flag but do not support changing the > vector length, this is not currently supported SVE signal handling. > > We could instead allocate a separate record in the signal frame for the > streaming mode SVE context but this inflates the size of the maximal signal > frame required and adds complication when validating signal frames from > userspace, especially given the current structure of the code. > > Any implementation of support for streaming mode vectors in signals will > have some potential for causing issues for applications that attempt to > handle SVE vectors in signals, use streaming mode but do not understand > streaming mode in their signal handling code, it is hard to identify a > case that is clearly better than any other - they all have cases where > they could cause unexpected register corruption or faults. > > Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel