Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp147535lqp; Tue, 21 May 2024 23:12:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCULHgm6zdasQYfXdzeRuh6fcoawWU7Cz4/kQ36p35g4HI0rkniM7XxrmKNGWsVj0MOaR0JESnapDd9sOm+61jzKiDW7bkbDvTbTbje9xg== X-Google-Smtp-Source: AGHT+IFqvbK9Ok1aEOfcw0hlAI1WLT7D5LciExUprO6Iyl0RXimK5rj2D3qFz86NaKE+f3EvhMki X-Received: by 2002:a17:903:32d2:b0:1f3:1482:5fe with SMTP id d9443c01a7336-1f31c95c14dmr11427315ad.5.1716358328286; Tue, 21 May 2024 23:12:08 -0700 (PDT) Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f2f3c8e1bfsi26771205ad.102.2024.05.21.23.12.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 23:12:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-185795-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=a5S5pP0Y; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-185795-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185795-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B2E83282E47 for ; Wed, 22 May 2024 06:12:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B6E1978C88; Wed, 22 May 2024 06:11:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="a5S5pP0Y" Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2076.outbound.protection.outlook.com [40.107.93.76]) (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 191D178C67; Wed, 22 May 2024 06:11:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.76 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716358313; cv=fail; b=oB+lWJkMLQBSME/dbwqmNrpaxfijtAICN3VQPsXIRs3P253t8n2Ma7TiZkdJAtxzkbRkvhwje0q/k+LPUIGvr2Z90i8UdBzlPHtPY1+fX8hX1nOHPI4uNx1RGVKao6ZKC46ov3v8N4r3syc850kgyvVz1wx2w3dl+2AYjxSjJak= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716358313; c=relaxed/simple; bh=Abz44vHOl1DHz7JEKeWiYpW738PdjJ80V71Q7m+0htM=; h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To: Content-Type:MIME-Version; b=f3pABTqlhOqlri3EaTKTA5QLwNVRvF+ivXwcc3qKwJmQboY2oxp40pmUgeBQEJFj3ojyP2id1pppDVIlirA7iM8ttS4Fqt3bWKdWFcQA41/N2aaGNZ0aHGqN36Q74pQ+dcof9l9JrKcdQMbJwRu9dVkCbMYAlg9QYoplwm4F3oQ= 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=a5S5pP0Y; arc=fail smtp.client-ip=40.107.93.76 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 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VLK6Kdya1gjJZZWAuvr3IsYmLfFXLj9ccHAd3CHokji99qYHeTeyumIf9a9pqwzQfpimAi37yy4hL3xRSluQY9cuRqogF1cJuCgd+5vywt+J7yeVWehP96IwNvi6vbn0pNlc5/15u6UqSs8kzm5uwIMapUUDSrM+6BTLKrWN4dDtYKZiQzzFWLhS3IO1CPGwxemRme0eHZbUEsorS2xhfM2voyrwbFilFVW6AIIoW51WUbnCO0Nw3Y1UXWUcXnfDikgWbExBJcJC4qqob80L71GhB8Q3O9IaBq1OG2JwQHJF3ZtIF2lg23nqEmexQQwbFhguJvAo+FN9NLQS41wH2g== 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=4FW0ZwSjrx17FzzuM4hptid+MOBRTesM4kM2AsE4ad0=; b=B+Qgjwk3gzNIdR4ZvAFXSVkBeMEd05wTgizyy3/ARH4kj7k4BkjDuDorct2vvyYExIVaBePcv1Jy/43VnMpMx5tPP9vx+5Sbtd8hxpetVR4oqFP5EZP16bS97af4ToRpWLMWI7Y9V7ysc878Mw//FkNctEjYfkcnbIpGlOdymPdY+LJ5HNbZCp4PuelE651b/GVwVKovRG8PPCubTdGioYr12GVz6yDduV/kELTiSzK45giqHJulIIHTDOl9bpvqdUCebBQgM0cUO9tO1jd5KVsnQ+Il9oagGAuy1CVva/bNQwliPRSCWnva8hnu8sCHNHqD4m4fkaytzlbWLuLpTw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; 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=4FW0ZwSjrx17FzzuM4hptid+MOBRTesM4kM2AsE4ad0=; b=a5S5pP0YHdejwgIQaqbb5TEycKbVp5hDPTNjeig48bldeDR/r/9N4T9QVYqmNT6gAKj0SzbR+ymZbEP5Gr5I7u+MsZv4rkkRs6RN3NEEKeJwpWjumCIlngdcfl4C2BGI5U3Tkeh8T70cAS6pmWplXX+p59f06JmnzkPYTxzz9Gk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from PH7PR12MB6588.namprd12.prod.outlook.com (2603:10b6:510:210::10) by CY5PR12MB6177.namprd12.prod.outlook.com (2603:10b6:930:26::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.36; Wed, 22 May 2024 06:11:49 +0000 Received: from PH7PR12MB6588.namprd12.prod.outlook.com ([fe80::5e9c:4117:b5e0:cf39]) by PH7PR12MB6588.namprd12.prod.outlook.com ([fe80::5e9c:4117:b5e0:cf39%6]) with mapi id 15.20.7587.035; Wed, 22 May 2024 06:11:49 +0000 Message-ID: Date: Wed, 22 May 2024 11:41:38 +0530 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] KVM: SEV-ES: Don't intercept MSR_IA32_DEBUGCTLMSR for SEV-ES guests To: Paolo Bonzini , Sean Christopherson Cc: thomas.lendacky@amd.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, michael.roth@amd.com, nikunj.dadhania@amd.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, santosh.shukla@amd.com, ravi.bangoria@amd.com References: <20240416050338.517-1-ravi.bangoria@amd.com> <9252b68e-2b6a-6173-2e13-20154903097d@amd.com> <305b84aa-3897-40f4-873b-dc512a2da61f@amd.com> Content-Language: en-US From: Ravi Bangoria In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: PN3PR01CA0019.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:97::10) To PH7PR12MB6588.namprd12.prod.outlook.com (2603:10b6:510:210::10) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR12MB6588:EE_|CY5PR12MB6177:EE_ X-MS-Office365-Filtering-Correlation-Id: 1d5a532a-0c10-4444-e9af-08dc7a261118 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|366007|1800799015|7416005; X-Microsoft-Antispam-Message-Info: =?utf-8?B?UWJNbkNrYVh5QnZFSjhaZlNkdU9BMGQxczhDOVgwT2cwUFdUdVhJVjhZTTVn?= =?utf-8?B?Y0ZEQ0lFWm45eVRST0FNdlZTUkQ0bFlZa3RBdDVxbXFVS3hRcFhQbE5UbklJ?= =?utf-8?B?VDhwdHpVa3Arb0FCeDFmN2J3RTJLUWxZdkZQVzJ4Qm0zRTFvU3IwSityczVr?= =?utf-8?B?NkVoWlhhdWNTTm5yMVdrMjVoN1diSHVTZTFUT3NUeFk5SVVhcVhlcDVKeGRP?= =?utf-8?B?aDNmejNHcnp3Ti9DeUthWFJBUUZhN3R4QjBDdEUrelZTVGZpVkxiSjcrVG1D?= =?utf-8?B?eFBPVFNrRXcyRlA1QVNEUG1TTkg2bVpYYXkrbjRRTVJUdyswNGRSUjh3TWx0?= =?utf-8?B?VHFSN1p5NUtlZzAvdERZSnpYRjlMY1lyTnZLc2Iydnp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VGd2VUdrTkdhc2E1OXBZdXlSMnlHSm9DcmdJ?= =?utf-8?B?Zk1sUXRsbHkwU2NtaDFWQ0FNK2F4YkhoWjcvRHdab2VpT1NNM1FEYUFPRjgy?= =?utf-8?B?TDN6allXSVA4OE9nOUVhb3V6dmk3YUtuQUR4NlpNVnlrdGJmUm41bllKOWN3?= =?utf-8?B?ZkN3ZXpJc2tnVkh6ZGpKWnFCd2JTRDdaVHhzYi81S0psM0VpMHFTY1NNdEtk?= =?utf-8?B?RzIrdlh2ZEdTK29tQ3NITkl5YkpuRDJTWnV3V08va1hTNnJ2YU1xWGFTTXFZ?= =?utf-8?B?VWx2bExZZ3RsSXBrUVpRQVRuK1VHNUIxY013QVpNVHpjZjBpY2JaSDZMd0VO?= =?utf-8?B?aXBTQ1VnV0pNRitPL1ZQWFNuRk1yWmJEWXBVNXRaQUVWc3FQL2o2ZDF4bDVs?= =?utf-8?B?ZzNjVmhzVkF1NldxaW5tWUFZVGh2aXhiYythK2M1MjJQZ3NMeFMvVGtnPT0=?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH7PR12MB6588.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(366007)(1800799015)(7416005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Ykl4ZlIvVisyQjRoSisza3lSUFdjcWlKbng0S2VOYWJpZUwzbE9LUlpUbkRO?= =?utf-8?B?WWkvTXFuV2hQRGJ2NG1CdGdCeHdPL3pTMkN1RTZzVlZrSVB2MjYyc2FrMzRk?= =?utf-8?B?VUk5TjQ1VnZsZzN1VENFRmhhbmZMbFYwSjRwS3pLSEVDNnZxSGRBUlNLK0R6?= =?utf-8?B?ME5JWlFlS28zL2dnRHllRk14akhpa0h5dUdMRFBBZHE1dWp5R3pXRWJRb3NG?= =?utf-8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VVEwb2hIS1VEd3U2Y0QyKzcwTHZlUUlZVlh6?= =?utf-8?B?Z0ZZTnZuSGlISHRDaDQxSkgxVlA2UU5NOHU3blVJOS82Zk5TcVR1ZEJXRTh3?= =?utf-8?Q?udIrI4zOt/WYsB9/JmllRljVB?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1d5a532a-0c10-4444-e9af-08dc7a261118 X-MS-Exchange-CrossTenant-AuthSource: PH7PR12MB6588.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2024 06:11:49.7250 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: WSBuOa7Sp6BJPm3fWwuOtlGylTs+XhZCCALKAh6lOIr1IEOJtXwANHKOudqTMd0EI6xER/e4zYt/BGSAIIUJbg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6177 On 5/22/2024 2:17 AM, Paolo Bonzini wrote: > On Tue, May 21, 2024 at 10:31 PM Sean Christopherson wrote: >> >> On Mon, May 20, 2024, Ravi Bangoria wrote: >>> On 17-May-24 8:01 PM, Sean Christopherson wrote: >>>> On Fri, May 17, 2024, Ravi Bangoria wrote: >>>>> On 08-May-24 12:37 AM, Sean Christopherson wrote: >>>>>> So unless I'm missing something, the only reason to ever disable LBRV would be >>>>>> for performance reasons. Indeed the original commits more or less says as much: >>>>>> >>>>>> commit 24e09cbf480a72f9c952af4ca77b159503dca44b >>>>>> Author: Joerg Roedel >>>>>> AuthorDate: Wed Feb 13 18:58:47 2008 +0100 >>>>>> >>>>>> KVM: SVM: enable LBR virtualization >>>>>> >>>>>> This patch implements the Last Branch Record Virtualization (LBRV) feature of >>>>>> the AMD Barcelona and Phenom processors into the kvm-amd module. It will only >>>>>> be enabled if the guest enables last branch recording in the DEBUG_CTL MSR. So >>>>>> there is no increased world switch overhead when the guest doesn't use these >>>>>> MSRs. >>>>>> >>>>>> but what it _doesn't_ say is what the world switch overhead is when LBRV is >>>>>> enabled. If the overhead is small, e.g. 20 cycles?, then I see no reason to >>>>>> keep the dynamically toggling. >>>>>> >>>>>> And if we ditch the dynamic toggling, then this patch is unnecessary to fix the >>>>>> LBRV issue. It _is_ necessary to actually let the guest use the LBRs, but that's >>>>>> a wildly different changelog and justification. >>>>> >>>>> The overhead might be less for legacy LBR. But upcoming hw also supports >>>>> LBR Stack Virtualization[1]. LBR Stack has total 34 MSRs (two control and >>>>> 16*2 stack). Also, Legacy and Stack LBR virtualization both are controlled >>>>> through the same VMCB bit. So I think I still need to keep the dynamic >>>>> toggling for LBR Stack virtualization. >>>> >>>> Please get performance number so that we can make an informed decision. I don't >>>> want to carry complexity because we _think_ the overhead would be too high. >>> >>> LBR Virtualization overhead for guest entry + exit roundtrip is ~450 cycles* on >> >> Ouch. Just to clearify, that's for LBR Stack Virtualization, correct? > > And they are all in the VMSA, triggered by LBR_CTL_ENABLE_MASK, for > non SEV-ES guests? Not sure I follow. LBR_CTL_ENABLE_MASK works same for all types of guests. Just that, it's mandatory for SEV-ES guests and optional for SVM and SEV guests. Thanks, Ravi