From nobody Thu Nov 28 10:46:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1694153676; cv=none; d=zohomail.com; s=zohoarc; b=aDVaQn4kc1JuPD8Qh83F5fzU7+dudpyFc+/clsnFBmAPtE2akT6CJoODL/iZ33QsICayqsEwdn/GnOTsrwzZ2ZOCD8l5KUIGOPeKlSsV2IH8yKmJ4tPegDtgFtQ/WSBp0HvkkkVaVdvHI3Xof6Vp/A38h5QoBUw+q/qoBjJBpq4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1694153676; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=BNko/n7sZ+Pauuo1Y0kdsEEem9IIq4A/xXv8veLPZZU=; b=RSZLRHuxASZQ64YIl9tFZqARDNzxG6JL4X9lXkimRT9WJEDkVVYZwauLVuyUQfAbKzJk70HwCYDl6anzJ77pGSK3UnVpnltIsqPUnOTFCTetUjvSAoArLO7MwMBWbbSwSkFItqfKWsbxpJ4hUOs0Jd4NCo6dz40WFir9pQuyKB0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1694153676570584.8190376004234; Thu, 7 Sep 2023 23:14:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qeUec-0008Ga-St; Fri, 08 Sep 2023 02:07:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qeUea-00083B-2a for qemu-devel@nongnu.org; Fri, 08 Sep 2023 02:07:41 -0400 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qeUeQ-0007gl-67 for qemu-devel@nongnu.org; Fri, 08 Sep 2023 02:07:39 -0400 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1bdc19b782aso13625395ad.0 for ; Thu, 07 Sep 2023 23:07:29 -0700 (PDT) Received: from toolbox.alistair23.me (2403-580b-97e8-0-321-6fb2-58f1-a1b1.ip6.aussiebb.net. [2403:580b:97e8:0:321:6fb2:58f1:a1b1]) by smtp.gmail.com with ESMTPSA id q1-20020a170902dac100b001c3267ae31bsm715231plx.301.2023.09.07.23.07.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Sep 2023 23:07:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694153248; x=1694758048; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BNko/n7sZ+Pauuo1Y0kdsEEem9IIq4A/xXv8veLPZZU=; b=ru7QXXje3TO7Invb/34bDMr8FvB3V42QYcAl8VoKg2XcSPeyVSn9zc2Op6Ow8StnfH T9Eia3O/nEDiYooAAQpsBO2C7l0gm3Jru6nEW1lGu2va6rc/OqOv/rwvXSd1rlaz+KzL I9AufhPaGUEeeu5Bjf68Kt8kLGS1Y+e5eOmuD1cRTkmpEy7+6fj6bhaG/MUfvg3ioIWo CqCU6SF6dBRS/eolB+bbB/RWY1civWznPpoc+//KGqLmrryFliEoeP0UFUX8SjF+xWEY LAw/C3B4APBkW3oxldRJ0M1y0aDun8CxAwQaMHG+UfaptZ6FHkzBeJLGQXhRAg1XP0xq KvPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694153248; x=1694758048; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BNko/n7sZ+Pauuo1Y0kdsEEem9IIq4A/xXv8veLPZZU=; b=A8wZUpU/p2xlCKx6QSCcDQseVuNWdmEQwOZ5fQN5L8TfjNdgZJMetFjvNHkOi0YHeo HV+J/NlvB/4Xy60FDLJzdSFRUUdVr3rYqt9HBZieQpHBssh7lobM/2eDg0rs7Ji2E58K l2G+JiMqHFJZ4CCSx9poWHDZ4LzaUeX4683cXrXh1osTMSN+joP7g8tzzVBZmyU8h3jC 7Am2QBvkaHM/Rim3nS9ugL6SZA41R8So2Kblp1uqr5N1HRXneLMErYvqmrEiFDLYl939 KqpPq6r32UVDWd2VlV7ZRE/95/Y2BqXiZ9hpB23My2tyDN/h8nx3x9ik9QGtuCaz70JR DY3Q== X-Gm-Message-State: AOJu0YwLuoxUbhie9bnqk3r7tYr7L0iy5edCPRF0J7W2mlBWlMcBpQfB KPXiSvcBvTzemfNGTUjt4I6u1BaIJxpjYCGp X-Google-Smtp-Source: AGHT+IF+ctQ8LOrwMOuhn33LtjrZEYHZwQzW6W/JQ0wnXRQE/7TDhMnxRmHK+UmbGp7mbxPc2/MYYg== X-Received: by 2002:a17:902:da92:b0:1b6:6b90:7c2f with SMTP id j18-20020a170902da9200b001b66b907c2fmr1685214plx.55.1694153248577; Thu, 07 Sep 2023 23:07:28 -0700 (PDT) From: Alistair Francis X-Google-Original-From: Alistair Francis To: qemu-devel@nongnu.org Cc: alistair23@gmail.com, Robbin Ehn , Richard Henderson , Alistair Francis Subject: [PULL 40/65] linux-user/riscv: Add new extensions to hwprobe Date: Fri, 8 Sep 2023 16:04:06 +1000 Message-ID: <20230908060431.1903919-41-alistair.francis@wdc.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230908060431.1903919-1-alistair.francis@wdc.com> References: <20230908060431.1903919-1-alistair.francis@wdc.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=alistair23@gmail.com; helo=mail-pl1-x62e.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1694153677708100001 Content-Type: text/plain; charset="utf-8" From: Robbin Ehn This patch adds the new extensions in linux 6.5 to the hwprobe syscall. And fixes RVC check to OR with correct value. The previous variable contains 0 therefore it did work. Signed-off-by: Robbin Ehn Acked-by: Richard Henderson Acked-by: Alistair Francis Message-ID: Signed-off-by: Alistair Francis --- linux-user/syscall.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index dac0641bab..3521a2d70b 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -8793,6 +8793,10 @@ static int do_getdents64(abi_long dirfd, abi_long ar= g2, abi_long count) #define RISCV_HWPROBE_KEY_IMA_EXT_0 4 #define RISCV_HWPROBE_IMA_FD (1 << 0) #define RISCV_HWPROBE_IMA_C (1 << 1) +#define RISCV_HWPROBE_IMA_V (1 << 2) +#define RISCV_HWPROBE_EXT_ZBA (1 << 3) +#define RISCV_HWPROBE_EXT_ZBB (1 << 4) +#define RISCV_HWPROBE_EXT_ZBS (1 << 5) =20 #define RISCV_HWPROBE_KEY_CPUPERF_0 5 #define RISCV_HWPROBE_MISALIGNED_UNKNOWN (0 << 0) @@ -8840,7 +8844,15 @@ static void risc_hwprobe_fill_pairs(CPURISCVState *e= nv, riscv_has_ext(env, RVD) ? RISCV_HWPROBE_IMA_FD : 0; value |=3D riscv_has_ext(env, RVC) ? - RISCV_HWPROBE_IMA_C : pair->value; + RISCV_HWPROBE_IMA_C : 0; + value |=3D riscv_has_ext(env, RVV) ? + RISCV_HWPROBE_IMA_V : 0; + value |=3D cfg->ext_zba ? + RISCV_HWPROBE_EXT_ZBA : 0; + value |=3D cfg->ext_zbb ? + RISCV_HWPROBE_EXT_ZBB : 0; + value |=3D cfg->ext_zbs ? + RISCV_HWPROBE_EXT_ZBS : 0; __put_user(value, &pair->value); break; case RISCV_HWPROBE_KEY_CPUPERF_0: --=20 2.41.0