Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1349341rdh; Mon, 25 Sep 2023 09:57:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEyFA3L8PR7V/aDsVdutkG28ejoQNnIozjSl+GnrXPnBr8Hbx7V8bsofHmiTwxf/700LdZt X-Received: by 2002:a05:6808:1450:b0:3a7:3ce0:1ad7 with SMTP id x16-20020a056808145000b003a73ce01ad7mr10519801oiv.20.1695661036804; Mon, 25 Sep 2023 09:57:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1695661036; cv=pass; d=google.com; s=arc-20160816; b=I7HvMq4NpPlzZJSERDOWbvrGD00DwFuYDq/ITBE9atGGnv9zRiUaeF2kPdnHhu3WtI LRCqr0txmYL6SZWvmqNwMb0YOxNJNvqAYy2I6m4KUjOMKZ6gK1srvF7T+M1uaHJp1t87 rWGg9R+/fVSOvqZ7NGkqLS8Rzog1uf4KH2/oRyxzVdPdCyULToQJvtyoWW/GcX+dcXdU BCrj/VjcxaUPyUR1qswYwiOZwx/5Lz8CBzW1ShwDG8BcmsFHEbTku93YO1HHpYaNBDKz /AkEZtI5EGpM6tcio/rw1SQK94KLSN9K7wSpdElPmHkcLKYzSCm68Sn41CZUwxDQLxAT N3iw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:content-language:references:cc:to:subject :user-agent:date:message-id:dkim-signature; bh=3jm+4hziJFwHwqmJx1+lk8AlDdnwBU/NiGDpVvPivYQ=; fh=3DMfc0WwT6ipiDrzR0r5r9dNbLpMd/HrCCcqgn44Ogg=; b=ota9XJ1mz52xIPduoxnoDmEW8huUbGQPsntxgNJyLDUy9CiZNz92To3d5qPzBOt496 Yp6XA9VsTYj0+0uF9nQyMEqP4k63l71Tx1Azk7JxXDptzr4lO+zEtD0w3RlgfYg8BsBt hVsEyqxR5mrT+xgM1kO+5xVpaEvgq9xHCQKWXMJDYeJ7vncrns00XUHv8V3Ue05ZUTll ZTTxNhT7Fna8EnOW6uUBNGWvAkKGQM/gEMtquz5hWn/oF/KLDhaEyaALcj7n8+G3HRyM Ut+Q+ZdruOlu1xesWGXJaq6o8dnFie1uMV68+p4l7KoZZE46lk/SKNgtWPK/A8eelPYX TvZg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=mpiDrDx4; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id cq12-20020a056a00330c00b0068a54cfcd74si10196507pfb.192.2023.09.25.09.57.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 09:57:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=mpiDrDx4; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id BC6FD81E7829; Mon, 25 Sep 2023 08:24:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232702AbjIYPXy (ORCPT + 99 others); Mon, 25 Sep 2023 11:23:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230076AbjIYPXx (ORCPT ); Mon, 25 Sep 2023 11:23:53 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2078.outbound.protection.outlook.com [40.107.220.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E02549C; Mon, 25 Sep 2023 08:23:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lAzv208Fkb2r4SXkuN+HqyIqw5MDURpdlE5IK9FZ7rdfffTkZH6lZsNO+PfbD1o6JLreYBl8bVWdGjU0LXn8U0moSslJcOX3pqu136mmndrfmIP5zChCKvE996RAu0f+YrIFWc+ahXZlcGa2TeufjPV3qcNjp51fhuispkSVG70sFaCWAfpbtUdiekxsswuAIgz0bhoceMYUzkw9aVpIrJyDTyhdpADEA+X31GClIcMHxKjJ3z++5L7fHVoEFP0sXczN7GNN5pzRnhykVcZ20HjAxUhQOVC7TdQ2KZDA3JbjuXAgw27l/K7MDENMRdk/ovfTb9HJfpVRTdveHlu40A== 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=3jm+4hziJFwHwqmJx1+lk8AlDdnwBU/NiGDpVvPivYQ=; b=De4G7tXQNfY+3hKCO80c/bnu7Ee8GTkLMR7QhZ/idglOdQ58CxZT0Nncn5CY12zY9uvQ5E5ItcOzDJAyYfgZS2Wh80Md0cKomxugqAwEeE08RBT5HUq8O6fVNnGJmrJkmbEZQriONqFrYs0++DkoTaXoRXVyNQh6UqZ8kq1FdsdWKZ1Q8Et1KYEYR6GwcW33oc4ZWlHqpH6LVgVDte0aOpBUBc03sP3Zmw8wZ4g6emsmdnqfy2NKfwsYde0B0aOlo/HaROcSjzX0PDBPGF1uDDufHZPXIITFxGuRNUYIxvtwxLmh5H14NeWMxLZg+/WVh3MRzlsUqchMe7bds1C6hg== 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=3jm+4hziJFwHwqmJx1+lk8AlDdnwBU/NiGDpVvPivYQ=; b=mpiDrDx4t1TO1ORk1Qos67FRcYoznhYqyKahPyu2OhFFSomfWa1iv0nU5oihLV81QQd1HMd1P0oc1FFjDjEVyA3FgKRTeNxu5ySkQldavqhuluxvUaY5dGetzdCSdPFOo3ZkpBhATGal1OnhrWpVX0nS0GIzHlP1d8Df/Ajfp7M= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from BL1PR12MB5221.namprd12.prod.outlook.com (2603:10b6:208:30b::9) by DS0PR12MB8561.namprd12.prod.outlook.com (2603:10b6:8:166::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.20; Mon, 25 Sep 2023 15:23:44 +0000 Received: from BL1PR12MB5221.namprd12.prod.outlook.com ([fe80::29d3:8fd9:55f0:aee9]) by BL1PR12MB5221.namprd12.prod.outlook.com ([fe80::29d3:8fd9:55f0:aee9%6]) with mapi id 15.20.6813.017; Mon, 25 Sep 2023 15:23:44 +0000 Message-ID: Date: Mon, 25 Sep 2023 10:23:42 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH v2 0/3] SEV-ES TSC_AUX virtualization fix and optimization To: Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, Sean Christopherson , Borislav Petkov , Dave Hansen , Ingo Molnar , Thomas Gleixner , Babu Moger References: <20230922212453.1115016-1-pbonzini@redhat.com> Content-Language: en-US From: Tom Lendacky In-Reply-To: <20230922212453.1115016-1-pbonzini@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SN4PR0501CA0042.namprd05.prod.outlook.com (2603:10b6:803:41::19) To BL1PR12MB5221.namprd12.prod.outlook.com (2603:10b6:208:30b::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL1PR12MB5221:EE_|DS0PR12MB8561:EE_ X-MS-Office365-Filtering-Correlation-Id: 2f88860d-6385-4cb0-b7c3-08dbbddb67f5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tRjXl6ZgcwVHosYBr7BUfMdbfsh+cg6vpIuFROVernUcWBkVtVTXDn+OL081mSOPMITXKK/BD00SVdFsZ4W8muWIxrsqvpFkQ7xtydRoMeAGsAwRjU4/mf/MEc6mHqPAJJPZOTgiF2mt2ztkNNF+AfNX7upDeubmpBHEqPLjID3nxJCuwd9kDf574eYX4CpuW2NrkBPQA1XoRv92huWOxeoGAZv8dyZmtcIbXblYulJxKtNBIur2U+VdAG+ybKf35Xvsocli9Cvxn0vOAAQKQxfLsYfuZTDDp9oH/9xuk5eiGePn25MZPpzx5Yt6xRExMH8ParTTAeWyb0BMO599Ob1v2si70FsR3WnYIQk94ptxzAVtxEPkhpx028PK+6Qz/jAY5j8R96by2VAV3LHkQth60+9/HHAcKGOh/rqNEjCZIAPt9v/3a63W1sg3CBHeEVjuojVqWy1tkC1It5Yn8AKpcbX4rK2gpFpBV0Kw6+f+DiTQZvWRkn2qR9rgG12FD8AAVp0BSjP4Mk6RMNJyf8EhbqPXYtnDSUVz3UIn8K7tLejljR0pDyZCxkSCLbMyCshgxU/ExZPe+PkPfmNU9QKSxEIGRxpbZrCLOmIDNexCu5+MPVwtp+u3JO3COE86ZJ1Xk5PAXdRBI9ZwDqgVkg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL1PR12MB5221.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(396003)(346002)(39860400002)(376002)(366004)(230922051799003)(451199024)(1800799009)(186009)(2616005)(6486002)(6506007)(53546011)(4326008)(5660300002)(8676002)(2906002)(66946007)(26005)(478600001)(4744005)(66476007)(316002)(66556008)(54906003)(6916009)(8936002)(41300700001)(36756003)(6512007)(31696002)(86362001)(38100700002)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZCtPUXc0d0doZHVGQTJuVll5OGJScFNhVUh1NnZvT0kyTk9Rai85M21vSUJ6?= =?utf-8?B?a1AzTjlQbVdXR0VWeWFRV08xUkhXWHA3VW5FYlhGemlUSkwxQkxzNlZFNi91?= =?utf-8?B?OWVFOER2QzFNbkQ2ekk1THREbnR0QUFkU1JNQ2RCVHY4Wlh4TXJScXpEY1FM?= =?utf-8?B?U3BaRndPL3pZY25laXpTdnJHTVh3TVFidHZLUmdGL3RQQmM3SWprSFQyRWJp?= =?utf-8?B?aU9NNUJGRzdXZHJwbVhkYXdBb0JIUGNna3FSYk0rM0dMMVgxU3VQeHpMZlpx?= =?utf-8?B?Wi9xR3krT1RHVDRXMEJDWGFKV3pBd09IK1FmVDNDKy9iMFk3NDVSVXJlenBr?= =?utf-8?B?K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OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2f88860d-6385-4cb0-b7c3-08dbbddb67f5 X-MS-Exchange-CrossTenant-AuthSource: BL1PR12MB5221.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2023 15:23:44.4125 (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: K9xpkZDz8QY6SDcJV5ahvRr8cEfyacvkVYk3wWlj7IOjguF3i+ACYlInDxugF4feUtVH1pZA7CVfIItNocn8nw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8561 X-Spam-Status: No, score=-2.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 25 Sep 2023 08:24:02 -0700 (PDT) On 9/22/23 16:24, Paolo Bonzini wrote: > Queued, thanks. The part that stood out in patch 2 is the removal of > svm_clr_intercept(), which also applies when the initialization is done > in the wrong place. Either way, svm_clr_intercept() is always going > to be called by svm_recalc_instruction_intercepts() if guest has the > RDTSC bit in its CPUID. > > So I extracted that into a separate patch and squashed the rest of > patch 2 into patch 1. Works for me. Thanks, Paolo! > > Paolo > >