From patchwork Tue May 28 04:19:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Manali Shukla X-Patchwork-Id: 13676089 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2063.outbound.protection.outlook.com [40.107.92.63]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 832C0442C; Tue, 28 May 2024 04:19:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.63 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716869986; cv=fail; b=uHjnaHtjnZMJRjP6v1IZD5IV+8wqkAHkFqCNZSHex4wzzgmxRRFwpzS3wX/9NO8VisXFPbdJeUelEa0sIIinVXk66oCPydn6dk0KHSdMpMTkczI4+JgLIrxJ48zFmf+uGkTZDQjAyS22pDK6BLDl6PRHNbbv6nVBXVnZju44caQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716869986; c=relaxed/simple; bh=QigwGiAo6it6zUdtue6alaHEgr0OFO7JUGjv4KgpzR4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=r+EoKICoAuR9gYmkJp8fcmFLAgGSiAf0l5qhjYijZrEoGJP9D+ls+JVhtHv0/hHAdl9gTuhfFjjuxRvjTsyqUPkGYLdDST/0MiIOJv0/6eLTZQzRRdBavbyw1g//NhwjXniLiNYmrv/z5Nj3bohhMwuqhjjbpOHOgvdXuMtPu0M= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=B6vUffjb; arc=fail smtp.client-ip=40.107.92.63 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="B6vUffjb" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H6TMIf4ZJuudhFsQtfYCEla/Iq+mdEwUyG3EsyXko8MEgwAA3mFF92SataBRt/yrjYip4V20d+3mvTMUDwji7r4r1vnAbtBGqxv6EIYfqmrNrhWJnmT4TTd+BvOLpb74O0RsD6wf0wYxa2ZSo+xizmCoXMS8VvsR9jh9Swu5hDe/wZP8dnrGDi/0ifnQLII09xzwhEIq4D6xxb3fto0im+/Yn2x6CClI2xm/rFBQped4vbSzLLnEZ1Y+s6YLX0DKAMvWOG02SSzr3RXdy5ib+SqrhMkr+GsCxACMlXrSXKlRgljgQID1PjOMZ42p4qhtJOf9B3QYk5PSlULfxGwrrQ== 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=zgZCoOnHZATsQYnzsBa1FDCDXWeL2/cS6zDFGCgSotQ=; b=N5j9tHCKA50Ad04Y9Adi2xhrqEUF1wqUR92i0iPV6JGbNOyYQ5/seLbdooedIGdMI8B4S+OCpp95odCht11976K4gmCno8RcQfXYIrCMBED5rc0s2Dxv0EPDk/f+JinX7Za7bi0Kp5I1qnFw6QK30hI2NAlktFPXVGG+vdJFKXU1ZXZTzpcPdt4QOFQQOaG9lqq5OiQ8/OKyD+BtrMLQYgVfrgsGASC0aXUn/S1pzN93CfJev3/9MAiuc/M/rprcc3P6PNmkjq9asuay21Q4CrMOG2E0sAQ2zMY/tZAQZCcUbqtZJh94fMIkGBnF/pPt0dzvXEjDL5gP3wKxBuFJmA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org 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 (0) 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=zgZCoOnHZATsQYnzsBa1FDCDXWeL2/cS6zDFGCgSotQ=; b=B6vUffjbslsg47SPHr4kahdU0JHfhGcvfCsRa1VEeALlIX7Q0qZaQVHXOJ13bjUHcH0jOJ1Wve/mBOIKTAn6tnif76PNj9x/xXxZIn7Oag8b8YOT+x11eSmnd9vDRW9XczzykAS2qECQAkyHhxUe01l5TmFPvL+TvjR6BKu4CvU= Received: from BN9PR03CA0853.namprd03.prod.outlook.com (2603:10b6:408:13d::18) by CH3PR12MB7596.namprd12.prod.outlook.com (2603:10b6:610:14b::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30; Tue, 28 May 2024 04:19:41 +0000 Received: from BN2PEPF0000449E.namprd02.prod.outlook.com (2603:10b6:408:13d:cafe::2d) by BN9PR03CA0853.outlook.office365.com (2603:10b6:408:13d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.28 via Frontend Transport; Tue, 28 May 2024 04:19:41 +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 BN2PEPF0000449E.mail.protection.outlook.com (10.167.243.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7633.15 via Frontend Transport; Tue, 28 May 2024 04:19:41 +0000 Received: from chalupa-4a00host.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.2507.35; Mon, 27 May 2024 23:19:38 -0500 From: Manali Shukla To: , CC: , , , , , , , , Subject: [PATCH v3 1/5] x86/cpufeatures: Add CPUID feature bit for Idle HLT intercept Date: Tue, 28 May 2024 04:19:22 +0000 Message-ID: <20240528041926.3989-2-manali.shukla@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240528041926.3989-1-manali.shukla@amd.com> References: <20240528041926.3989-1-manali.shukla@amd.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN2PEPF0000449E:EE_|CH3PR12MB7596:EE_ X-MS-Office365-Filtering-Correlation-Id: 230df140-dda7-4a68-f462-08dc7ecd6599 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|1800799015|82310400017|36860700004; X-Microsoft-Antispam-Message-Info: =?utf-8?q?8flugDLgXNVjhtW87dQxpV9eY1JG7Sj?= =?utf-8?q?jLe+9hJ2YjCV7NUXClhh1V1Ar2DLZ9OW1FIYpXAYow5ax/+/44nrEVhbaluLbxf+D?= =?utf-8?q?toA6uWiJHhnDZim7/T+Ydj6ASWAJc5xb5xBqzbtVyxPO8hL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OtCEbv/Pgs724j1lSTmZd9?= =?utf-8?q?rvxTje3Iqk2Qv7SUxFIsqNTkRAYa7HsmsIOVjTfZ1Jt8+2t7G4V0+39w/m+TJzqV5?= =?utf-8?q?iSi98xupFmGa2AzmNgqpHFpodnAT9ChDUmvKeUGqF20PinV3LJZN4IdX6l49nrpUt?= =?utf-8?q?My6H8I+GC4xtSgpxYIygRDzwP7PERIIgktOjTikP78ibr/f9em3HQ4pvR3cLc3o4K?= =?utf-8?q?88H/8szLvAwrQnMWijKb805mPBuE0rHLb8j/wTo0MGvmLEPjaVZmv+dBpchRcD/wl?= =?utf-8?q?rHggWJySVKlAtb7sIAUWGXYXUcOsoT6wZNegL6MCKH41XEhCTSitgsy89h1gX7Gm6?= =?utf-8?q?uSK+vY8XNW7S?= 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:(13230031)(376005)(1800799015)(82310400017)(36860700004);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 04:19:41.7282 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 230df140-dda7-4a68-f462-08dc7ecd6599 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: BN2PEPF0000449E.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7596 From: Manali Shukla The Idle HLT Intercept feature allows for the HLT instruction execution by a vCPU to be intercepted by the hypervisor only if there are no pending events (V_INTR and V_NMI) for the vCPU. When the vCPU is expected to service the pending events (V_INTR and V_NMI), the Idle HLT intercept won’t trigger. The feature allows the hypervisor to determine if the vCPU is idle and reduces wasteful VMEXITs. Presence of Idle HLT intercept feature for guests is indicated via CPUID function 0x8000000A_EDX[30]. Signed-off-by: Manali Shukla Acked-by: Borislav Petkov (AMD) --- arch/x86/include/asm/cpufeatures.h | 1 + 1 file changed, 1 insertion(+) base-commit: d91a9cc16417b8247213a0144a1f0fd61dc855dd diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h index a38f8f9ba657..a8c5dec042dc 100644 --- a/arch/x86/include/asm/cpufeatures.h +++ b/arch/x86/include/asm/cpufeatures.h @@ -381,6 +381,7 @@ #define X86_FEATURE_V_SPEC_CTRL (15*32+20) /* Virtual SPEC_CTRL */ #define X86_FEATURE_VNMI (15*32+25) /* Virtual NMI */ #define X86_FEATURE_SVME_ADDR_CHK (15*32+28) /* "" SVME addr check */ +#define X86_FEATURE_IDLE_HLT (15*32+30) /* "" IDLE HLT intercept */ /* Intel-defined CPU features, CPUID level 0x00000007:0 (ECX), word 16 */ #define X86_FEATURE_AVX512VBMI (16*32+ 1) /* AVX512 Vector Bit Manipulation instructions*/