Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5740410rwd; Mon, 12 Jun 2023 09:02:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ542YZsH+UhUivSe6a/AfCbvxw9YZ3xw0jNFvyMiuHDODzm7L1l4AgHwKWi49o3xInrU8uF X-Received: by 2002:a17:902:ecc9:b0:1b0:fe9:e57e with SMTP id a9-20020a170902ecc900b001b00fe9e57emr8374806plh.0.1686585745946; Mon, 12 Jun 2023 09:02:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686585745; cv=none; d=google.com; s=arc-20160816; b=aL4cLmkHLim/i66ntWPmHzjdqg95lwzXik1UwFD+b7LFPIvq8o3RHRZHYi39ibemB5 EN/B12NZl/zesw3f98/JGvoF35+iOUKvx3C8A6Zjhpvm2akXVMC/hzQrSwCi+hqZOAty 4cWe93PtlB76WHOkNtwip3h44U/2S/jqH2RHUVzjl08MHfv8BLue9gOSgvNT+KCauKJo praragCO9lc20ukmLFDd2Njik0S4m+tVzvvxoR/+mLcH1ruLefprnJtsOZngzffmJZal D/dSIrjmaTKgeM9V7t58iwLxsEEUBmCH1AWQ8I66ASGK4aPFExNpR50VE0MV8RbIUQCg toqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=+L3sNBGkEDm+nY+O6ThdBKE7WdymZq4deKq6djroJ+4=; b=E27IKCkZtK9lQ3c3k8vt3uk7/yltlfpbeJpTfl+3aap93zjT6e5cvb4XyCgj84m5xD s0xTgZVp4wPIsbRi2yOJabJOOqEkkssD72w3WQGwdUQWcKr8RRwNrzMcEuDqgLtkdcic EDPxqRMXqa0opCGd0stGRT8rqHOgxLg0kVEf7L3NoWwQ6FCi8qoTY9jaqHZPPDTDYVi4 IbPEPYo+69LkZbvYPnQOouPcBdJNr7UbMJ5mCj8IhHfe0QFQY5wY2B2w9h3+0HNMZa87 7REcOYZx6pd368B2mj1x/CH22N9en7i0hVbNBy6a11IDPFf8WSng4tN4zZ1OAQOTaiuU OCYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dabbelt-com.20221208.gappssmtp.com header.s=20221208 header.b=go09bCif; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q4-20020a170902dac400b001ae5fe35b78si4134967plx.497.2023.06.12.09.02.03; Mon, 12 Jun 2023 09:02:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@dabbelt-com.20221208.gappssmtp.com header.s=20221208 header.b=go09bCif; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236393AbjFLPaH (ORCPT + 99 others); Mon, 12 Jun 2023 11:30:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238752AbjFLP3w (ORCPT ); Mon, 12 Jun 2023 11:29:52 -0400 Received: from mail-oi1-x22f.google.com (mail-oi1-x22f.google.com [IPv6:2607:f8b0:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E2B91B8 for ; Mon, 12 Jun 2023 08:29:51 -0700 (PDT) Received: by mail-oi1-x22f.google.com with SMTP id 5614622812f47-3942c6584f0so1632474b6e.3 for ; Mon, 12 Jun 2023 08:29:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20221208.gappssmtp.com; s=20221208; t=1686583791; x=1689175791; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:from:to:cc:subject:date:message-id :reply-to; bh=+L3sNBGkEDm+nY+O6ThdBKE7WdymZq4deKq6djroJ+4=; b=go09bCif4ImXiCWgjVptfkS9gXEy0+VB5/+YiVIIRg/UaF0J/xL24VDZEuptVDNfL1 TrKC73Qm8r/vjS4Dp1y7404UdPFirmviByLME8pnKRyqb4YDCW63IpUOf642JoPHe6bj APrd9Nse/u+hCdTqF61XybXoApKjTARMyWt8tjlL6fu6estIpaQhGDh0SEmtdRd2Ja88 c5kKfKXmD3BKOwYJlqaYos0cL435spWC59lFgnIQbC2gpYTnhA+qnFMw3cfyRwK0Q48p ONlTAEDfPvkyMx7opPf3w0a7TeNZJ3ePeKlgU/Fc/GmQfGTlA5fGoxqFZ78zyQ0sRjQp EYwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686583791; x=1689175791; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=+L3sNBGkEDm+nY+O6ThdBKE7WdymZq4deKq6djroJ+4=; b=YAv35Y8UzaRKQpRMmARh2yJnJTRthQgAICmgsYodDZwNn61bR1vtE7e+2GrvMnsYUE zYJ4uqSM4CSTqDwqZelOB/5UnVE4pQXse0jO4b5fESKM2Iyv2b1bdB4u3FyC091VNymz 3KkTF/GElkteLZKy06jyNRKXkev/lX4Z9UfT00H9U6ovG7kxQi3c+njJPzwhhjrF0BkO G3abEfVxL85svkHjIWMg4e+5H21URmx60vfPmMHUm7KxED0PGlOsYkFmJ4NXF8SVPdLU k2ayZIT9JoGQc8rAf3VIoTzvsOYVSLM094GlpxTMC1tcJU4uvSlVRZsyvOINDfXeY9Sg Rgew== X-Gm-Message-State: AC+VfDzqSXjgDQ3XOVlk8xvzHcX+vxyFpdac1LrDIrZXEYlXcGoFwm9O pThQj8gnjIthY55U25lmopnmw3MAW+SMwc04kB8= X-Received: by 2002:aca:230b:0:b0:394:4642:7148 with SMTP id e11-20020aca230b000000b0039446427148mr4426563oie.48.1686583790671; Mon, 12 Jun 2023 08:29:50 -0700 (PDT) Received: from localhost ([135.180.227.0]) by smtp.gmail.com with ESMTPSA id rj6-20020a17090b3e8600b002599ef80ab9sm9418417pjb.3.2023.06.12.08.29.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 08:29:49 -0700 (PDT) Date: Mon, 12 Jun 2023 08:29:49 -0700 (PDT) X-Google-Original-Date: Mon, 12 Jun 2023 08:29:45 PDT (-0700) Subject: Re: [PATCH RFC 0/2] RISC-V: T-Head vector handling In-Reply-To: CC: linux-riscv@lists.infradead.org, samuel@sholland.org, christoph.muellner@vrull.eu, heiko@sntech.de, Conor Dooley , linux-kernel@vger.kernel.org, heiko.stuebner@vrull.eu From: Palmer Dabbelt To: heiko@sntech.de, guoren@kernel.org Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 14 Mar 2023 22:29:41 PDT (-0700), Palmer Dabbelt wrote: > On Tue, 28 Feb 2023 13:54:33 PST (-0800), heiko@sntech.de wrote: >> From: Heiko Stuebner >> >> As is widely known the T-Head C9xx cores used for example in the >> Allwinner D1 implement an older non-ratified variant of the vector spec. >> >> While userspace will probably have a lot more problems implementing >> support for both, on the kernel side the needed changes are actually >> somewhat small'ish and can be handled via alternatives somewhat nicely. >> >> With this patchset I could run the same userspace program (picked from >> some riscv-vector-test repository) that does some vector additions on >> both qemu and a d1-nezha board. On both platforms it ran sucessfully and >> even produced the same results. >> >> >> As can be seen in the todo list, there are 2 places where the changed >> SR_VS location still needs to be handled in the next revision >> (assembly + ALTERNATIVES + constants + probably stringify resulted in >> some grey hair so far already) >> >> >> ToDo: >> - follow along with the base vector patchset >> - handle SR_VS access in _save_context and _secondary_start_sbi >> >> >> Heiko Stuebner (2): >> RISC-V: define the elements of the VCSR vector CSR >> RISC-V: add T-Head vector errata handling >> >> arch/riscv/Kconfig.erratas | 13 +++ >> arch/riscv/errata/thead/errata.c | 32 ++++++ >> arch/riscv/include/asm/csr.h | 31 +++++- >> arch/riscv/include/asm/errata_list.h | 62 +++++++++++- >> arch/riscv/include/asm/vector.h | 139 +++++++++++++++++++++++++-- >> 5 files changed, 261 insertions(+), 16 deletions(-) > > I have no opposition to calling the T-Head vector stuff an errata > against V, the RISC-V folks have already made it quite apparent that > anything goes here. I would like to get the standard V uABI sorted out > first, though, as there's still a lot of moving pieces there. It's kind > of hard here as T-Head got thrown under the bus, but I'm not sure what > else to do about it. The V-1.0 support has been merged, so I think we're good to go. Does someone mind re-spinning this against for-next so it lines up with all the new user interfaces?