From patchwork Fri Jun 30 08:30:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Ghiti X-Patchwork-Id: 114626 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp10211316vqr; Fri, 30 Jun 2023 02:05:06 -0700 (PDT) X-Google-Smtp-Source: APBJJlFAHiCgqAl4GMC+z6YfZYfjyoB374d7xYNCyoncVUU8K/z2zy80C/XMklL0Ax+sXDSvPgPv X-Received: by 2002:a05:6a00:138a:b0:675:8521:ddc7 with SMTP id t10-20020a056a00138a00b006758521ddc7mr2677062pfg.0.1688115906286; Fri, 30 Jun 2023 02:05:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688115906; cv=none; d=google.com; s=arc-20160816; b=G6GvjOKai1Ox1yYjL2Ftjt8RdXD/1mVOy+mkYcliYr7oL9d2sdHfcPFbEF6PCm78x8 fOUYNLXg9OWMqNbs6n3rqlUQ8KWMrfq+QE4+qC+PpjrW2Z1eeT7pd+8Mhen2RfxP9Vmz lo52Qi/+FsC4IOu2yabjVkoFWPCfiN6S0xGVnVxQIGYyQFZ1Jtbi1OFNw9H9F+PYXHIy dlkJfh4XV23TUubiuL9+8Q3zZ/Dbr4WvODtVlP1V6WfM6TH3NR9n82quAGQo3MLPVjT0 2/yEezoK219IvWr9rkkkl5/x1qNVv1HnV/zCZZaQSPKlxWo4mnPyLw1tGWHlV3M4lIjW M4aw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uDd0P6Z6Y37kRPaqqHaNAC3kQrjxk6Pu8HaK2zooeKg=; fh=hmFTrdz0WFr12osTIIcQLHDbvk92COvsNanUuMWqfoU=; b=elRBI2uZpZ36QlVoqqfuS3GlLtQAwEvU0cgmzbJIAk8q6PPCMx0b44t3w4PxUxjYrk V4/yAl9czmY3txG3YjF3k2YPS6acZrFC+nchnnnYK+yVFE2OyN6QmdYQJIzbClqVQuhU nGnH01mKVTl+sfyp69vAIAdVxngfIlrM6nv7WkaAtpi5hrJ54+wBurG1BbNhynbetjSh ojqHvV2DA9caROXu7pX412edHVgfolNuJrJ1CEAOlfqinAwAt2iuYp1/uIRuC30/qnpw +06SG9TxniDQzlFmJuzh/LdEZ/VTJG50p5O11UiYJqLhC1ce7O/2W6YabM46jDkhLSZE n3zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b="Y41VrW8/"; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bv12-20020a056a00414c00b00676fd3ad23dsi9312516pfb.384.2023.06.30.02.04.51; Fri, 30 Jun 2023 02:05:06 -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="Y41VrW8/"; 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 S231979AbjF3Imr (ORCPT + 99 others); Fri, 30 Jun 2023 04:42:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232738AbjF3ImT (ORCPT ); Fri, 30 Jun 2023 04:42:19 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C31B3C04 for ; Fri, 30 Jun 2023 01:41:55 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-4faaaa476a9so2625483e87.2 for ; Fri, 30 Jun 2023 01:41:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20221208.gappssmtp.com; s=20221208; t=1688114513; x=1690706513; 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=uDd0P6Z6Y37kRPaqqHaNAC3kQrjxk6Pu8HaK2zooeKg=; b=Y41VrW8/WSTU5UZ0jha3wwL0Ej0Tqd3A2qkgrwAyZodUC/Uz8mWxFXPieMXCL9Qgkc aCxnf9L5pPkNT/eeVpj05gNJZy/aSu0i+l4K1alIFaVSt15uuOkO1E6tqT2Jw85snBkt eBMVD67kXwSAZmYJxN6xoMJp0H+pOyoW3QN4+hUahcRJSus8PGYrRNm9+d7On6kDNC7b g3jjB7S7COhraUHuWtlOaXR0UlBpzLL2bWINQ2J4KfkEAXDJXOOk2OggifnX6rcvyHeG nXSybsUY3tIMMztv3/UeobmrRZ0vqFQvg+NAjIoAuQfRago5a4TDxH3y3gIH4MfF24+s PliA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688114513; x=1690706513; 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=uDd0P6Z6Y37kRPaqqHaNAC3kQrjxk6Pu8HaK2zooeKg=; b=aeIhEgUTBHfeX0DU3rGbUNQ01QdhC/NQ8uPogl3KJN6pL1nccwn7riT+WbJvJLtJc3 goehSyghyAfR4j8fA3+6DqDxZn8Pvo5/KuUfI/sm43MZbbevj6hlOD7KzM6bYSFwqnjX mPWQgUFW7IWSTbzTEMlL2GnVhBRc3BZjRQvzP0U9J5oLeZOtpu8yN4Lrlii+VtkCHz2o s05681n1fk51qpfIiSHT4Eoq7GfhYiUmms/bJTSodDOHwfwbvZaroO+9lyxSp+rgqMH4 g99cuoHYNHg2pWTFvBCV76q3iHR0zNkgpQOjiehpLdoZ80mC0oJO+Z37UN633XgAY/V8 LIXg== X-Gm-Message-State: ABy/qLbxhxfeWLzhJtGeRs8ude2+02rpAgBj7GVV0AokZiLKRLTYzGSE z5djh+yd3lv72p1eJChc5dy1Bg== X-Received: by 2002:a19:8c19:0:b0:4f1:4cdc:ec03 with SMTP id o25-20020a198c19000000b004f14cdcec03mr1476845lfd.18.1688114513557; Fri, 30 Jun 2023 01:41:53 -0700 (PDT) Received: from alex-rivos.ba.rivosinc.com (amontpellier-656-1-456-62.w92-145.abo.wanadoo.fr. [92.145.124.62]) by smtp.gmail.com with ESMTPSA id v11-20020adff68b000000b0031424950a99sm649850wrp.81.2023.06.30.01.41.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 01:41:53 -0700 (PDT) From: Alexandre Ghiti To: Jonathan Corbet , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Paul Walmsley , Palmer Dabbelt , Albert Ou , Atish Patra , Anup Patel , Will Deacon , Rob Herring , Andrew Jones , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org Cc: Alexandre Ghiti Subject: [PATCH v3 10/10] perf: tests: Adapt mmap-basic.c for riscv Date: Fri, 30 Jun 2023 10:30:13 +0200 Message-Id: <20230630083013.102334-11-alexghiti@rivosinc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630083013.102334-1-alexghiti@rivosinc.com> References: <20230630083013.102334-1-alexghiti@rivosinc.com> MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770117824384550946?= X-GMAIL-MSGID: =?utf-8?q?1770117824384550946?= riscv now supports mmaping hardware counters to userspace so adapt the test to run on this architecture. Signed-off-by: Alexandre Ghiti Reviewed-by: Andrew Jones --- tools/perf/tests/mmap-basic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/tests/mmap-basic.c b/tools/perf/tests/mmap-basic.c index e68ca6229756..f5075ca774f8 100644 --- a/tools/perf/tests/mmap-basic.c +++ b/tools/perf/tests/mmap-basic.c @@ -284,7 +284,7 @@ static struct test_case tests__basic_mmap[] = { "permissions"), TEST_CASE_REASON("User space counter reading of instructions", mmap_user_read_instr, -#if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) +#if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || __riscv_xlen == 64 "permissions" #else "unsupported" @@ -292,7 +292,7 @@ static struct test_case tests__basic_mmap[] = { ), TEST_CASE_REASON("User space counter reading of cycles", mmap_user_read_cycles, -#if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) +#if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || __riscv_xlen == 64 "permissions" #else "unsupported"