Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp2983668rwo; Thu, 3 Aug 2023 19:33:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFM2MiNH6cWo1GwRZ3+UkKcRSe/6pqH72jj8UpURTMI9pgP2LCw4ycUHhC37hg/zHH7zNBB X-Received: by 2002:a05:6358:c08:b0:139:bbae:1f3 with SMTP id f8-20020a0563580c0800b00139bbae01f3mr716631rwj.3.1691116405798; Thu, 03 Aug 2023 19:33:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691116405; cv=none; d=google.com; s=arc-20160816; b=xP7qISyQUmi3D7/YdcC75BBK+3FgWpfp+H4w/We/zHa3bpSPSiBRco0XNxRSXDPWSW aRTdKsadC7GlvesAa1wGmsVt+m7+ZYl7fiNN7tZzkQl/L7I/b+gwOrHCwPa7jzZpcLjA 8PqsqqKBhTYHBXZRbrI9jFSsXf8QcVKDGAcdtf0EFCsFNicj77AGNaQ0GE8XscPW+FEl fvExgbPZtANSsTH5APXhrklPvrXyF0Ck3e91OZ5AJBKB7kNMNUNYud87Kwsa1hJkdHMM KWL8TXh9SHLFRrYuVKHNXB/GmTBvXuDbNhd46rWcSf88YY6V0ueRRE5IixXUwWLdh4yb smIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=efS36dkbCzja1DEoOkKk5twnSGIQYzSPz7GFgwV0rps=; fh=C/sT03bfou/Jz5QuFE/+sRxLlugyhMwMBpibogIGu0w=; b=Rv4F6eYS+kMzabtwe66W9EmmZIZw5qVKK/wuntq/n8BgXZJAdsVtkLEHjwFTfjt8Rz JTXn9dxmZj1bKOxCubuXPjyOfMJF69VGYX7vEnoN/UfLDV2bczlTiFJukWHy5tz44OcS tStWmuHiD87SGIV+TNmH14Q+z9G6ystDhIYVvRym9kWRklSdN4nW+UGxS3TRFz3koffi HhedW28EnVnWZFqxNs+GF3/VXT2+R7OyGE3tyrGGYPHhpapQJyufsmGSG6nCf9hjSirq R3Q+YGVDCj6xQ8nIj/e8N95eQI6PFTn8HYwyCsOWsIrxgrBvPGqRlQCwnVmiM5obHJLL fnJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=sL5L+XGZ; 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 n28-20020a634d5c000000b00563de19ff56si987084pgl.427.2023.08.03.19.33.13; Thu, 03 Aug 2023 19:33: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=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=sL5L+XGZ; 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 S233006AbjHDCLx (ORCPT + 99 others); Thu, 3 Aug 2023 22:11:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233461AbjHDCL3 (ORCPT ); Thu, 3 Aug 2023 22:11:29 -0400 Received: from mail-oo1-xc33.google.com (mail-oo1-xc33.google.com [IPv6:2607:f8b0:4864:20::c33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44F2C448F for ; Thu, 3 Aug 2023 19:10:58 -0700 (PDT) Received: by mail-oo1-xc33.google.com with SMTP id 006d021491bc7-56ca1eebcd7so1061374eaf.0 for ; Thu, 03 Aug 2023 19:10:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20221208.gappssmtp.com; s=20221208; t=1691115054; x=1691719854; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=efS36dkbCzja1DEoOkKk5twnSGIQYzSPz7GFgwV0rps=; b=sL5L+XGZXxz3uilHLZ9996rABpzv96OCLn70c9kreiKgPg+WH3KJroL9cVLj2fBjI4 NQe8+w7CLAox+ot9c6Sx0ktR3iYP5P+c8pN85u54Rsy06KDa4GcfJccDlv6X4vB+zHUn fOSxh1hOUBlo6UgFcJDC47IQVz1f4EDcD0TlBOGU/8cvax961M2jcrcuGJPlBRjyBApH Yr9yABf/BnVF1c20z4GgGSV/40DAWyj5SVhDT+9mC7k6UVziYmYdgL3moyY6QrCvZd73 4FZ3hUQCNUuO/ok3JHJqIRfA/yxktc+meR9K37rZmH55b5iR6aKlCC4Gg1xr0MwsaNDG Pekw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691115054; x=1691719854; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=efS36dkbCzja1DEoOkKk5twnSGIQYzSPz7GFgwV0rps=; b=JcAli0b57o5S71i7If/LsYIUsdc+XauQ1M9WeRHP49agjextQfpcNMXrB6PZVN9KKA o5FTwcM6oLsasNUp/zRxY2m4f5x3cu+rDjI8gIYNldJg3oe6Ey8+tZX4XV+li8vvZW+D ZJWYCq0Qn/Ux0J38qwH2mGcTp9GHdBDIqpmHGuq/yH3lqVMOm5cHdqIwn/0UPdiRDDjc ovPtbKXrB+vNspLS2515CEURCRjQQ+eM1HFUtQ/wF1MxU4cq9atUNgBcLwhChJ7ki+Cu 0sCapJaN0XDOl8ojsDqoDY0QQpGRCoNv9cSHMA6PFGeArHGQ+embwW43Y/kjleg7vQUg Nozg== X-Gm-Message-State: AOJu0Yw4jmLlnLQN8JIr2tHlO40Jj3z4eGO/5y5oaKQTEOVdZTjnxZhv 4CzN3h9EjFq6Jd04b8F7Kj/GXg== X-Received: by 2002:a05:6358:c603:b0:134:ded4:294 with SMTP id fd3-20020a056358c60300b00134ded40294mr441125rwb.17.1691115054417; Thu, 03 Aug 2023 19:10:54 -0700 (PDT) Received: from charlie.ba.rivosinc.com ([66.220.2.162]) by smtp.gmail.com with ESMTPSA id g6-20020a655806000000b0055c558ac4edsm369499pgr.46.2023.08.03.19.10.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 19:10:53 -0700 (PDT) From: Charlie Jenkins Date: Thu, 03 Aug 2023 19:10:27 -0700 Subject: [PATCH 02/10] RISC-V: vector: Refactor instructions MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230803-master-refactor-instructions-v4-v1-2-2128e61fa4ff@rivosinc.com> References: <20230803-master-refactor-instructions-v4-v1-0-2128e61fa4ff@rivosinc.com> In-Reply-To: <20230803-master-refactor-instructions-v4-v1-0-2128e61fa4ff@rivosinc.com> To: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, bpf@vger.kernel.org Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Peter Zijlstra , Josh Poimboeuf , Jason Baron , Steven Rostedt , Ard Biesheuvel , Anup Patel , Atish Patra , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , =?utf-8?q?Bj=C3=B6rn_T=C3=B6pel?= , Luke Nelson , Xi Wang , Nam Cao , Charlie Jenkins X-Mailer: b4 0.12.3 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Use instructions in insn.h Signed-off-by: Charlie Jenkins --- arch/riscv/kernel/vector.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/riscv/kernel/vector.c b/arch/riscv/kernel/vector.c index d67a60369e02..1433d70abdd7 100644 --- a/arch/riscv/kernel/vector.c +++ b/arch/riscv/kernel/vector.c @@ -18,7 +18,6 @@ #include #include #include -#include static bool riscv_v_implicit_uacc = IS_ENABLED(CONFIG_RISCV_ISA_V_DEFAULT_ENABLE); @@ -56,7 +55,7 @@ static bool insn_is_vector(u32 insn_buf) * All V-related instructions, including CSR operations are 4-Byte. So, * do not handle if the instruction length is not 4-Byte. */ - if (unlikely(GET_INSN_LENGTH(insn_buf) != 4)) + if (unlikely(INSN_LEN(insn_buf) != 4)) return false; switch (opcode) { -- 2.34.1