Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2820702rwd; Fri, 26 May 2023 11:44:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ70uwA07Ysb+0VKMsbo6YDpeYNVNfRkDxmZV/LNe+PW7xZFqX9Q1Mf+RoCsyWi3GTNXsWgu X-Received: by 2002:a17:90a:ac06:b0:253:971b:dd1e with SMTP id o6-20020a17090aac0600b00253971bdd1emr3882862pjq.0.1685126658778; Fri, 26 May 2023 11:44:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685126658; cv=none; d=google.com; s=arc-20160816; b=UJs6rXvPrOvoi1xMZyMsEfMPIsaOKFpxEHqIqZuLhTkzI5mQoFMlMFzuO+EPNEKC+D QI1H2c6jUuT3S8U+Hl1W0h26NXGARwmuPdCeUOR/zatO1ADdBPIEI+KT46C+/LDPRm2g bl7B/JEXvbxRCnbeBCTk/eZ7JnowBr9NtfVXQp4wYga2njhepblVxRPxdZQVunxQZSVk 4AIXmj2njAfPSeqPP54FS3EYlMlukfoPbd8DTWaK4vR1WfACihz7uCDun5Fj15bcrxPd cQw0eymhCeBFejkB/Y+RDPl2P3TvrJr+b+kMaMZz8zL82SOg90Iz9ERpketjwsGiwnJp YgaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=rhs20KFbrBjMvIkaCaPHOIOyU5CqMAw5GkT0rX0TX0U=; b=KPK5Gs87EERgpA4vlbq9ephDfkLWV15alKVoZ3sCbWPeWN4ES7WBR9gmok8EbOaXX8 BMDrrTZpn04FIO1Z0PkovG47EEMaOYM1Zq8qg2DPLFsvIUTI32Pu5WidsAdng3AufeB0 5St6ytgkZJtM07h+mKEiFtg9Wn/iEAXVH3tH1Fl8SRGT2L6nsH/wt22QhciSCM2rM1YL w7czBODDv3f8T/5Z5XzdkFgNjU2Y68wyvxj90MfVr9cYKNqqO87/GNQvTsprxGxcEEcg GHYarnc4fj/FbYzlNiJJ5P0EIH+qV/3EQfqQrSKC3D3H84XlVPvCNeSqFtHPdBe4FAHY JWZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b="pDsfCR/q"; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mh7-20020a17090b4ac700b002536f332d07si3787604pjb.149.2023.05.26.11.44.05; Fri, 26 May 2023 11:44:18 -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=@google.com header.s=20221208 header.b="pDsfCR/q"; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242803AbjEZSe1 (ORCPT + 99 others); Fri, 26 May 2023 14:34:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237598AbjEZSeW (ORCPT ); Fri, 26 May 2023 14:34:22 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 531C21B7 for ; Fri, 26 May 2023 11:34:15 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-ba8337ade1cso2702455276.2 for ; Fri, 26 May 2023 11:34:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1685126054; x=1687718054; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=rhs20KFbrBjMvIkaCaPHOIOyU5CqMAw5GkT0rX0TX0U=; b=pDsfCR/qApd6BnNf5BC300XSLP2L05MlgSQ/+ZqWZ3VQmMjw4LHyrVtWRt03skSLoI 3ubDd7OwPnvf3CKmlqt9hJodEoCcRbQBzDr1oIaDNNewcZ5aJdnSGU1/LrGfohkCGu3u GMUW+z2+VWYhlPciW/c3oBk78a+bx0ItNwaXGGh+UCAaaAKMfOcKbYrdNO5/tdC0rDzK NU2qxy0/rSKHcTxt+lZuSrGE6rpmeqsegRhDeuXl0xf2VDShbDU1xAC+ba8Jpx2QFmQq Q4tph4YXASgoo+KuJVAuenGVuKWZAGR/AWDGO4v0pSa69npEyf0nMDiz4NcUU9enCocq TaFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685126054; x=1687718054; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=rhs20KFbrBjMvIkaCaPHOIOyU5CqMAw5GkT0rX0TX0U=; b=WPV8IVAX7vd8j5CJxjFGe1WmRRNqFjpgpe9phs+MR00eFYzlFqujMgt1Lg2atnm7cs vwExJn797ndpbCSbDIdfLDzsAQZIQIUZ4W+1CnMIEXEbfUBcBNFuw0sjk7f/OVsQhcPN VIMFf/ag/hTC2US4Z+MXTUO9+6dFIiiJj3/Go8PIKEOIvXRKxIPiTYMvXPktZUYUrrnO lc9SyFD47upEzxM/sA9CQ7NSl+sdHrV6ldIWTYZI0SOvvDwZ7FIYQNJA1C/hMcvY4RRj HYqNjwt3s7ZCLC6ljzRdomFQtoBlOnOYIKbX6nfx5IAKfmkJG36qhnIUSOsGK8MfmLCP aGnQ== X-Gm-Message-State: AC+VfDwV/emNGlytaPZTEK2asqEZvxEbpM3//q4rfLcn9oWK/1pvKyzR P6Ell7prYCdnj1KztRG/vK/9ILjV3DGY X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:3b4e:312c:644:a642]) (user=irogers job=sendgmr) by 2002:a25:8211:0:b0:bad:14ac:f22e with SMTP id q17-20020a258211000000b00bad14acf22emr999303ybk.5.1685126054570; Fri, 26 May 2023 11:34:14 -0700 (PDT) Date: Fri, 26 May 2023 11:33:47 -0700 In-Reply-To: <20230526183401.2326121-1-irogers@google.com> Message-Id: <20230526183401.2326121-3-irogers@google.com> Mime-Version: 1.0 References: <20230526183401.2326121-1-irogers@google.com> X-Mailer: git-send-email 2.41.0.rc0.172.g3f132b7071-goog Subject: [PATCH v2 02/16] perf test x86: insn-x86 test data is immutable so mark it const From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , "Masami Hiramatsu (Google)" , "Steven Rostedt (Google)" , Ross Zwisler , Leo Yan , Tiezhu Yang , Yang Jihong , Andi Kleen , Kan Liang , Ravi Bangoria , Sean Christopherson , K Prateek Nayak , Paolo Bonzini , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL 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 This allows the movement of some sizeable data arrays (168,624bytes) to .data.relro. Without PIE or the strings it could be moved to .rodata. Signed-off-by: Ian Rogers --- tools/perf/arch/x86/tests/insn-x86.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/perf/arch/x86/tests/insn-x86.c b/tools/perf/arch/x86/tests/insn-x86.c index 735257d205b5..7b5eb8baf0f2 100644 --- a/tools/perf/arch/x86/tests/insn-x86.c +++ b/tools/perf/arch/x86/tests/insn-x86.c @@ -18,14 +18,14 @@ struct test_data { const char *asm_rep; }; -struct test_data test_data_32[] = { +const struct test_data test_data_32[] = { #include "insn-x86-dat-32.c" {{0x0f, 0x01, 0xee}, 3, 0, NULL, NULL, "0f 01 ee \trdpkru"}, {{0x0f, 0x01, 0xef}, 3, 0, NULL, NULL, "0f 01 ef \twrpkru"}, {{0}, 0, 0, NULL, NULL, NULL}, }; -struct test_data test_data_64[] = { +const struct test_data test_data_64[] = { #include "insn-x86-dat-64.c" {{0x0f, 0x01, 0xee}, 3, 0, NULL, NULL, "0f 01 ee \trdpkru"}, {{0x0f, 0x01, 0xef}, 3, 0, NULL, NULL, "0f 01 ef \twrpkru"}, @@ -97,7 +97,7 @@ static int get_branch(const char *branch_str) return -1; } -static int test_data_item(struct test_data *dat, int x86_64) +static int test_data_item(const struct test_data *dat, int x86_64) { struct intel_pt_insn intel_pt_insn; int op, branch, ret; @@ -147,9 +147,9 @@ static int test_data_item(struct test_data *dat, int x86_64) return 0; } -static int test_data_set(struct test_data *dat_set, int x86_64) +static int test_data_set(const struct test_data *dat_set, int x86_64) { - struct test_data *dat; + const struct test_data *dat; int ret = 0; for (dat = dat_set; dat->expected_length; dat++) { -- 2.41.0.rc0.172.g3f132b7071-goog