Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp147665lqp; Tue, 21 May 2024 23:12:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWy1BNkt36oV7pYKdo42yU5uXcawlBRDfc97b3y98u5QEk2MYfqZ2I2BF2TQ/msCDmIRqqG20HBjk3QpfIlH3lAJoD/y/0y15IAU2CNpg== X-Google-Smtp-Source: AGHT+IG9L/NCCUCjnT9nlSZA/fVUMxeNEXh5jG52lUIG+SZruR2+uTU5xstQmuDVQE1YgQFn1lCH X-Received: by 2002:a17:90a:db87:b0:2b3:c011:d28c with SMTP id 98e67ed59e1d1-2bd9f5a716cmr1115015a91.48.1716358349694; Tue, 21 May 2024 23:12:29 -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 98e67ed59e1d1-2bd8d90b5aasi3143212a91.104.2024.05.21.23.12.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 23:12:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-185796-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=QwrUg0t0; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-185796-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185796-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 4E5FE282CAA for ; Wed, 22 May 2024 06:12:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D1BDF78C6E; Wed, 22 May 2024 06:12:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="QwrUg0t0" Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2057.outbound.protection.outlook.com [40.107.244.57]) (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 21C981C6B4; Wed, 22 May 2024 06:12:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.57 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716358336; cv=fail; b=tZlBLanGfTZsSuvBkRIeoKGDNYV37SPcNlQSA6eiRX08pFgqO+ADw1axs+8GW2MpgIvnOwStfPAcMrRStPFOEVThnRmGkn2pP8bT/RUllyCNKb2gQTfzQ2IOZpSPXeFoCfHXgHM8aVrMoWlk0g2mYWVmo6ggJDendcS5+5m+x5A= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716358336; c=relaxed/simple; bh=zGuSVw3mYcG8TfxLU0bsgM4WkeklL67AZMF1aBJUQSo=; h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To: Content-Type:MIME-Version; b=kTqoChabe1Oc/NJRy3XjKRnI733uZ+V2FR6eXwgFmv5ZKeBcl7F2Jd8u4x8ErCXNl5l4jLSBaLn/AyGH+gl/z6VRnoKRsnd4jgjlLPqmDd/bNdjSG9ZBmj6wuY/DRlx22l3DX+nqrFtQlFWlU1Rv6JiVjYVQRyaG8Nc8S2pI+WU= 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=QwrUg0t0; arc=fail smtp.client-ip=40.107.244.57 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=UILAYXHkkkPT84Bw7egzgeZrOwv9buplKWTPqdhlk6HCAQuSuMUqdZmqRFcyqDM48LXXBYPoFmYey8xxY22d7tHFEl3XwYKqZIxEwrZGaXMpwW4WaGz0IpaCZLKDOGUOrJEEMRTDMd9mq0/b1GRNdg8NQG7aPGHg3aMKqDz5CN00WbliNUTM5WdrtnFy20AlQnM3OmbVSExNFT1/HqK00Yo3yY3s2C394g4U2ZQ1JUppXrERdUXO4rdTB5/sFDZO828pB1apT1BltDxqmv8IWb+m5pkjJbtu1Qc+hwIKfBUb/QQ9vGe+QOtyAnf9PNtpWuWdMWXDsqyNeWPHuH3yZQ== 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=cx6BMfu8SDxWDdjuyMxw2BRfJk0iUUTNlbdnhCWXidE=; b=WN90FfeLRgt9QZIWAXFbC4VC+zgOuP04tlszbYryetd2OLrL348EfofFfPKjJIZE1B9sZhwTTGPCCy5WIQS0DdHIS9MHiq5iDchRGpkJD67VHQtuW9pbFgeXCWzjR9vMrGb5QvROqvWV+6OQJVhnUoF/Y8mjxgFiDhv2Y3Kgvu2Cnfvrjyv0xQ0PVnkiYkfEuomxDJvAqgwsfYfPgDlOdXhlH1SaxsnePoUAo98E3z+g2T1Yq5aIdL4C6OoPwdWgoa1QYxHtWEJpBMcL4ir6xJGatU8QU1KR/4Wt1szGxdpmGY1UBXy5jVkG8wH5A+CdqN9p8voPnG5kMqdLpRxkyg== 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=cx6BMfu8SDxWDdjuyMxw2BRfJk0iUUTNlbdnhCWXidE=; b=QwrUg0t0OJGqRhjLA77Yt8hjT2lB5gLf8sbwVnmdkalkqiRx91XVSSLI7ubF+ovSfDGC+IoSVJ1bbCeSCO7Ocj+PsW/GeNylfSsvTPG/FN3+EUPIEHmSLle5Nu71hAmbqq4b8+Msql2XGwlqL/0JqDqge+ddnDAAmsRHaWjZCAE= 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:12:13 +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:12:13 +0000 Message-ID: <9dd51971-9df1-48ce-8e64-b2600a7b0467@amd.com> Date: Wed, 22 May 2024 11:42:02 +0530 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] KVM: SEV-ES: Don't intercept MSR_IA32_DEBUGCTLMSR for SEV-ES guests To: Sean Christopherson , Paolo Bonzini 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: PN3PR01CA0127.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:bf::17) 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: 1847cdd7-b2de-4fee-ce37-08dc7a261eef 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?UFkwODVYNld4aDN4M3ppQi9xd093ZWNuTU9IdTk2enVWekhJVkdZcjBNelBJ?= =?utf-8?B?K1pQbG81ck9zaC9iTERZeHlmZFVTRW03L0hTZDlTYUN4N2Zyam04ckR1Z2c3?= =?utf-8?B?Ym11bjUyQXZ4bzM5dTROeW5RbC90V09yVU00ZXIxR3AzejZ0bHdlM2JzTWFa?= =?utf-8?B?azRjN1Q4b3JLT0txY2JDSTVYOGlIMUFjeVNOSkloUHZURXgrTEpVSHJCY0VL?= =?utf-8?B?Qzk4M2M3MlFEbFpxVXk2eE5vZnF2V3c3VlptQVNuNmRFQm8waWw4SnptQlI4?= =?utf-8?B?Tks4NndoUGpRekZsUm5SU1VMUFE4NFczZj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NPRklmdzRpeHJNUFdXU1NseS9xUzZVNHU2UVpW?= =?utf-8?B?QXBqaUVRanRhc09SWU1CWEovdzQ3YXFCYjJHVk5hWW96Mjg3L2J1ZkFST2My?= =?utf-8?B?RVRpeEV5a0krVlkzNkduQXpCUDlaNVN5N3JTWDBwUnNxdkx4VlJ0Ry96S3NC?= =?utf-8?B?MGdBUFdFOGFSU2tJYmxpM0M2TnRhV05RWmJ5WnAzVmkvbWQxa29WV2hhQi95?= =?utf-8?B?S1VHdSs2QnpTa3l3QTdTWndoa01jcXpTN24zRlhLbysxOGlLMW5naEVWeC8z?= =?utf-8?B?dEtnQ1RPRXI0ZDZFdjdzSkttR1g1SUNtdjZxYjVicnNaQ0ZzS2ZONk40MmdL?= =?utf-8?B?Z0NRRGNNTzVjQzBkWWN1SXcvZEtkSlZuV01PSzMxTFJNVnpEaG9mV3Z2cjdN?= =?utf-8?B?bkxyelNscGpkc2RrbTgxdDQ0ZGNpczdCTmVQck4vWGdUT3BPdStIV2RqRHN0?= =?utf-8?B?bVhRN1V1blFremdSK1FnQWcrR0hzTng4NlBXa3BlLzBGQTBUVWJldVJ3PT0=?= 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?UHdTYTVvcUVSTDE4RUlidW0rZ2lWd0VrdXJmb1BDZkw3OHhkNGg3dmhIQzlk?= =?utf-8?B?cW1vazcybXdSS2FsWGZxZ25YZzZYcWVjSUxQWGd0L2NGMEs4blNKM0tWN28v?= =?utf-8?B?NzRYUnBkeVNwcTBvU21JVGxFd0o0NEE0SzJuWm1lMG0vOU1hSEtGOGs0cURY?= =?utf-8?B?VVNEMjQ3bHl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21iNVFSZzVWcWNkQ1FVeVpJSjhN?= =?utf-8?B?YnNnMmZBcXdxdHl0aDVJbzJ5WmQxeUNZRG9PVGh5OFpvQVVsNWF4blU1dG8y?= =?utf-8?B?WDFUNVFrL1VIeXhGeFhVTFJQeVZZcXdPamJ2T1o3dk9CYTQ0V1U4aW5vR2lx?= =?utf-8?Q?EKvSqPetbAyqFGYE45YkUJQfN?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1847cdd7-b2de-4fee-ce37-08dc7a261eef 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:12:12.9273 (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: m7GkNLZZS1jkxk+5+s+pP0BczYIasTj3zqBGcwzXrN2sxEPDUrXJ1hhxBTEVKFGZo1H819t1c+zziS32Aw+gBA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6177 On 5/22/2024 3:52 AM, Sean Christopherson wrote: > On Tue, May 21, 2024, 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? >> >>> Anyways, I agree that we need to keep the dynamic toggling. >>> But I still think we should delete the "lbrv" module param. LBR Stack support has >>> a CPUID feature flag, i.e. userspace can disable LBR support via CPUID in order >>> to avoid the overhead on CPUs with LBR Stack. >> >> The "lbrv" module parameter is only there to test the logic for >> processors (including nested virt) that don't have LBR virtualization. >> But the only effect it has is to drop writes to >> MSR_IA32_DEBUGCTL_MSR... >> >>> if (kvm_cpu_cap_has(X86_FEATURE_LBR_STACK) && >>> !guest_cpuid_has(vcpu, X86_FEATURE_LBR_STACK)) { >>> kvm_pr_unimpl_wrmsr(vcpu, ecx, data); >>> break; >>> } >> >> ... and if you have this, adding an "!lbrv ||" is not a big deal, and >> allows testing the code on machines without LBR stack. > > Yeah, but keeping lbrv also requires tying KVM's X86_FEATURE_LBR_STACK capability > to lbrv, i.e. KVM shouldn't advetise X86_FEATURE_LBR_STACK if lbrv=false. And > KVM needs to condition SEV-ES on lbrv=true. Neither of those are difficult to > handle, e.g. svm_set_cpu_caps() already checks plenty of module params, I'm just > not convinced legacy LRB virtualization is interesting enough to warrant a module > param. > > That said, I'm ok keeping the param if folks prefer that approach. Sure, will keep it. I'll respin with all these feedback addressed. Thanks, Ravi