From patchwork Thu Jan 16 21:32:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fenghua Yu X-Patchwork-Id: 11337851 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E163114B7 for ; Thu, 16 Jan 2020 21:22:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C974B2077C for ; Thu, 16 Jan 2020 21:22:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387674AbgAPVWN (ORCPT ); Thu, 16 Jan 2020 16:22:13 -0500 Received: from mga02.intel.com ([134.134.136.20]:38728 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388907AbgAPVWL (ORCPT ); Thu, 16 Jan 2020 16:22:11 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jan 2020 13:22:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,327,1574150400"; d="scan'208";a="226870967" Received: from romley-ivt3.sc.intel.com ([172.25.110.60]) by orsmga006.jf.intel.com with ESMTP; 16 Jan 2020 13:22:10 -0800 From: Fenghua Yu To: "Shuah Khan" , "linux-kselftest" Cc: "Thomas Gleixner" , "Ingo Molnar" , "Borislav Petkov" , "Tony Luck" , "Reinette Chatre" , "Sai Praneeth Prakhya" , "Babu Moger" , "James Morse" , "Ravi V Shankar" , "x86" , Fenghua Yu Subject: [RESEND PATCH v9 11/13] selftests/resctrl: Use cache index3 id for AMD schemata masks Date: Thu, 16 Jan 2020 13:32:44 -0800 Message-Id: <1579210366-55429-12-git-send-email-fenghua.yu@intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1579210366-55429-1-git-send-email-fenghua.yu@intel.com> References: <1579210366-55429-1-git-send-email-fenghua.yu@intel.com> Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org From: Babu Moger AMD uses the cache l3 boundary for schemata masks. Update it accordigly. Signed-off-by: Babu Moger Co-developed-by: Fenghua Yu Signed-off-by: Fenghua Yu --- tools/testing/selftests/resctrl/resctrlfs.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/resctrl/resctrlfs.c b/tools/testing/selftests/resctrl/resctrlfs.c index 8772c8c4d5d0..19c0ec4045a4 100644 --- a/tools/testing/selftests/resctrl/resctrlfs.c +++ b/tools/testing/selftests/resctrl/resctrlfs.c @@ -113,8 +113,13 @@ int get_resource_id(int cpu_no, int *resource_id) char phys_pkg_path[1024]; FILE *fp; - sprintf(phys_pkg_path, "%s%d/topology/physical_package_id", - PHYS_ID_PATH, cpu_no); + if (is_amd) + sprintf(phys_pkg_path, "%s%d/cache/index3/id", + PHYS_ID_PATH, cpu_no); + else + sprintf(phys_pkg_path, "%s%d/topology/physical_package_id", + PHYS_ID_PATH, cpu_no); + fp = fopen(phys_pkg_path, "r"); if (!fp) { perror("Failed to open physical_package_id");