From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5DD0642932; Thu, 13 Apr 2023 13:54:07 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 36AAF4021F; Thu, 13 Apr 2023 13:54:07 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2077.outbound.protection.outlook.com [40.107.96.77]) by mails.dpdk.org (Postfix) with ESMTP id BDDB84014F for ; Thu, 13 Apr 2023 13:54:05 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=INg500qkPNHBb8jwEoOFtveQMi7TvWrURicSJDXYBdvau4fdZmmSquVhhazztBG5MKJKdSTTLh2NT0XhX6Z2Ni5gdBxmIZyBMM9jAX6tn5uYk4MTejorLBnFWPGM854pdC8EjSS6aJXFNhKtMTPQ7QDinm43LCWdNEuSVty/tHKddIN6YZlAsMMjt1Pni7p6oI6k2uUB3vXm/WRuzrCi8YnFAkUJvaq2WoKGSKckwWtAhSUQp3H5pwiMItoNK5UCXsz2CujHDWzcnxFDcEps9TLJ1I8Tq8Z+OJeMxCtXVOC3QEEP4buhmPriv3gEbqXTmutGRVGsoXJCWav+yAUXqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zW3IiS5EZbYMunycmcXFjZLWJ9FMZloiRZ7DV9x9B38=; b=lc1pkJYOubHMc0qWXcrkUWMrKFzo7addEZvPQEYAex//86kvEey0//7OWogiRJE4dRp7Iw23g79vLr11AwMsXNgihesxWC5jwUUbPSusOBlwz199Z0tXQ5hQgFh2pQTdQKFb2efLRG0eUAQZArzGXdnPjaJ8/VvkSymRRv4kyzUSH1BxIUkXqkl67qD0sFRZC4HTvqAgy2EN/AH9k9iOxGrICAP/lc73hpA4H3oq8AdxsSx2kWGBsMGcXwWJoA6oDtv3O9kVmdxlmIuxOw8jHW22jKsmE6XOkKgcrmc9FMcdqXZaAC4unXZ1SA6FYChRBQ8IOTkIGkonx/lADiUOGQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zW3IiS5EZbYMunycmcXFjZLWJ9FMZloiRZ7DV9x9B38=; b=G6/6/gnNNr/L+KzYMUHh9+mE047LG3jPPzoB9O01HyG8uMXS79APfk3Kpqa5y2YPkNpdcRSsBwNLdTLKRBYi8JaodKXcyVRXzM6bYnCR9F5s305Z5leDQi4VcCgM2EvGKBJrSwBPKnmfPKoCOT7TF4Vf8aUiAFHZVYsBG+iIUKM= Received: from DM6PR03CA0066.namprd03.prod.outlook.com (2603:10b6:5:100::43) by DS7PR12MB5720.namprd12.prod.outlook.com (2603:10b6:8:73::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 11:54:01 +0000 Received: from DM6NAM11FT038.eop-nam11.prod.protection.outlook.com (2603:10b6:5:100:cafe::a3) by DM6PR03CA0066.outlook.office365.com (2603:10b6:5:100::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.35 via Frontend Transport; Thu, 13 Apr 2023 11:54:01 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT038.mail.protection.outlook.com (10.13.173.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 11:54:01 +0000 Received: from telco-siena.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Thu, 13 Apr 2023 06:54:00 -0500 From: Sivaprasad Tummala To: CC: Subject: [PATCH v2 1/3] eal: add x86 cpuid support for monitorx Date: Thu, 13 Apr 2023 04:53:32 -0700 Message-ID: <20230413115334.43172-1-sivaprasad.tummala@amd.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT038:EE_|DS7PR12MB5720:EE_ X-MS-Office365-Filtering-Correlation-Id: cb462967-d9b8-4ad2-f8d8-08db3c15c5f0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: h2iFh60ZvPw1Ob2WmjTE4vyJyARmw6F0tR3KT5nhuqWghWrUz68OeM9A23mJPS8t39YLWUi5LaIT+hXhccUR0PBbXkL9YV8eW/6hYM7TYKTpbCQk31pQDaRkpFI+kdgIfQDdjT9nKZscW9iq0h2r7JKQDfmk42HQBrZPfQdI63Cz1bppODa3lPBzr1qhPws6tjJBWBUQ6RAKeNRqNlxkjDNfzUkYcQ2cUrT+kb3wpnauzgHdheYz48dl1FP/Ddv1MrzlBXo8cG+6FI25KO/ygQIjay3w48s01DjdMVWU0x8omzo/s7nSNgHALbaK4NBieqpcXClTWoogJKYedXz2ggEktInCFvHoDNS1RfYDkh9iyK+XkrxQVQyuRvNcnugzHwc9YNX+VAzaFWM0drvcIY98oOVjGoR2rvaLU6H0hbKgbMHaXdh6U10rUN/snfWOGKN0/pGuD+se6x8V6NAlk4SfswrTS9q2eRfk2MTPxiSzk1c7vsqjn6HLf811rKr83D1FejNX9Z7B9jzzmrqiZNKuUUfnfC1foBA80n77BGrHQN+Q7xASNSIfyEQhsKPkmUbGeec5wuXraN9Yu0jhCv75K1Yr/Dvd6SdHIkQfncD8BhLmuYuY5H8MJA3tCh6c5lRqVJwh2Mrz47Y4EcxkyUct8aocVnlVYgQcC31DcFFSkLzsDmjM64Jh9v7gIOK9LglGD178CuxUdvaotJ/p9uTYMhpn8wLe8r9W5Sd6p4c= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230028)(4636009)(136003)(396003)(346002)(376002)(39860400002)(451199021)(40470700004)(36840700001)(46966006)(6666004)(7696005)(40460700003)(6916009)(70206006)(70586007)(4326008)(36756003)(2906002)(44832011)(86362001)(81166007)(82740400003)(356005)(41300700001)(5660300002)(82310400005)(8676002)(8936002)(316002)(478600001)(40480700001)(1076003)(26005)(336012)(426003)(36860700001)(2616005)(186003)(16526019)(47076005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 11:54:01.5159 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cb462967-d9b8-4ad2-f8d8-08db3c15c5f0 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT038.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5720 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Add a new CPUID flag to indicate support for monitorx instruction on AMD Epyc processors. Signed-off-by: Sivaprasad Tummala --- lib/eal/include/generic/rte_cpuflags.h | 2 ++ lib/eal/x86/include/rte_cpuflags.h | 1 + lib/eal/x86/rte_cpuflags.c | 3 +++ 3 files changed, 6 insertions(+) diff --git a/lib/eal/include/generic/rte_cpuflags.h b/lib/eal/include/generic/rte_cpuflags.h index d35551e931..db653a8dd7 100644 --- a/lib/eal/include/generic/rte_cpuflags.h +++ b/lib/eal/include/generic/rte_cpuflags.h @@ -26,6 +26,8 @@ struct rte_cpu_intrinsics { /**< indicates support for rte_power_pause function */ uint32_t power_monitor_multi : 1; /**< indicates support for rte_power_monitor_multi function */ + uint32_t amd_power_monitorx : 1; + /**< indicates amd support for rte_power_monitor function */ }; /** diff --git a/lib/eal/x86/include/rte_cpuflags.h b/lib/eal/x86/include/rte_cpuflags.h index 92e90fb6e0..d3e608533a 100644 --- a/lib/eal/x86/include/rte_cpuflags.h +++ b/lib/eal/x86/include/rte_cpuflags.h @@ -133,6 +133,7 @@ enum rte_cpu_flag_t { RTE_CPUFLAG_AVX512VP2INTERSECT, /**< AVX512 Two Register Intersection */ RTE_CPUFLAG_WAITPKG, /**< UMONITOR/UMWAIT/TPAUSE */ + RTE_CPUFLAG_MONITORX, /**< MONITORX */ /* The last item */ RTE_CPUFLAG_NUMFLAGS, /**< This should always be the last! */ diff --git a/lib/eal/x86/rte_cpuflags.c b/lib/eal/x86/rte_cpuflags.c index d6b518251b..ae2e0a8470 100644 --- a/lib/eal/x86/rte_cpuflags.c +++ b/lib/eal/x86/rte_cpuflags.c @@ -133,6 +133,7 @@ const struct feature_entry rte_cpu_feature_table[] = { FEAT_DEF(LAHF_SAHF, 0x80000001, 0, RTE_REG_ECX, 0) FEAT_DEF(LZCNT, 0x80000001, 0, RTE_REG_ECX, 4) + FEAT_DEF(MONITORX, 0x80000001, 0, RTE_REG_ECX, 29) FEAT_DEF(SYSCALL, 0x80000001, 0, RTE_REG_EDX, 11) FEAT_DEF(XD, 0x80000001, 0, RTE_REG_EDX, 20) @@ -191,5 +192,7 @@ rte_cpu_get_intrinsics_support(struct rte_cpu_intrinsics *intrinsics) intrinsics->power_pause = 1; if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_RTM)) intrinsics->power_monitor_multi = 1; + } else if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_MONITORX)) { + intrinsics->amd_power_monitorx = 1; } } -- 2.34.1