From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (NAM12-MW2-obe.outbound.protection.outlook.com [40.107.244.61]) by mx.groups.io with SMTP id smtpd.web09.7662.1628600696294306082 for ; Tue, 10 Aug 2021 06:04:56 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=D7yveC4T; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: amd.com, ip: 40.107.244.61, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TULw3TrSKRFLuKhDZUY6p0QzqGB5wzCksLNHjZCsLjTt+EHao/67ZAxAjo97+0D+w5/7+5poMzUBlmnggJWoXPQIuD0GNEvrze9pZQTMKuAI4QxhGGvlRkmdB/Q+VqQwiEqxYuoAQiFH5OK3ZnkZNgjWhKKFzJ2+uuBqrT8gZuJ0o6rBDBf+aOMlup/33UmDosWq+Grcw8KI3zjNPM5mEm/mGbgAaUGDKLaMfCccf+xa8bwpZl4mT+GF7lIOl6nllXnu43M6zQY1rF16kXiUGlAH/TRcipCnNm0MazHl0MnB86jU27fthYch6ef0MwcoGmMfQYicRtPSRY9K2bPqcw== 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-SenderADCheck; bh=AOrCziMAqzc5cOjScK9I1jDmX35leHX6ms/zFq0gpEw=; b=MrwF1gWgTrHlhhIBhhh56lJstM/r3SrR5sXQzJx7OGMCzfE57V1GlHK1lHZcTM/e/BfOmgGEHGTV3mjWdLC5+Ewf/zoUG1Ay2hur0/kusuOS01mzY1sj6ZN33K7OebuXHiL0pdrcji4AnOHWqNKhZjmS1lnXIhKgw66yGfIVgjBIoyiA3Y/cGD+pnJUtIvedHfw5VoZdu4iiniT97TSYfjb+I3zhnTkS3FyVMaKfplyeWLxhRpvIUR7WKLahh/0MCGWNQS/FkQHLjQMmNdTM4dCkuWxR+7eF2L+izO8re/0dFb9mBH7cktpooiF2xMHa+sSc+nWo5ikco4N2wtKWAQ== 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=AOrCziMAqzc5cOjScK9I1jDmX35leHX6ms/zFq0gpEw=; b=D7yveC4T6tWgUMfX68rHI39+mCrGk1dete0tAfjpk+Q4hhItQFVMuiDku9ixg8B5vO9E33Wfg5bJdp1oHsFPeM+ZYvBIOmT9+My2PtOW8YOpf+xz+EM5KM5LAOrjnxJP1rv9aENr0Z0p1HT3/XM+Q8cRwaHAlmWNnAMf4IQmLj0= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=amd.com; Received: from DM4PR12MB5229.namprd12.prod.outlook.com (2603:10b6:5:398::12) by DM6PR12MB5520.namprd12.prod.outlook.com (2603:10b6:5:208::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14; Tue, 10 Aug 2021 13:04:54 +0000 Received: from DM4PR12MB5229.namprd12.prod.outlook.com ([fe80::73:2581:970b:3208]) by DM4PR12MB5229.namprd12.prod.outlook.com ([fe80::73:2581:970b:3208%3]) with mapi id 15.20.4394.023; Tue, 10 Aug 2021 13:04:54 +0000 Subject: Re: [edk2-devel] [PATCH v6 1/6] OvmfPkg/BaseMemEncryptLib: Detect SEV live migration feature. To: Gerd Hoffmann , devel@edk2.groups.io, ashish.kalra@amd.com Cc: dovmurik@linux.vnet.ibm.com, brijesh.singh@amd.com, tobin@ibm.com, jejb@linux.ibm.com, jordan.l.justen@intel.com, ard.biesheuvel@arm.com, erdemaktas@google.com, jiewen.yao@intel.com, min.m.xu@intel.com References: <812023de6c20a9d8fc62a561cedefb93640effab.1627906232.git.ashish.kalra@amd.com> <172fa9d6-6edb-41b1-c827-03b04d964469@amd.com> <20210809143714.GA7990@ashkalra_ubuntu_server> <20210810060510.tez2lx2uetr4plkh@sirius.home.kraxel.org> From: "Lendacky, Thomas" Message-ID: Date: Tue, 10 Aug 2021 08:04:52 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 In-Reply-To: <20210810060510.tez2lx2uetr4plkh@sirius.home.kraxel.org> X-ClientProxiedBy: SA0PR13CA0030.namprd13.prod.outlook.com (2603:10b6:806:130::35) To DM4PR12MB5229.namprd12.prod.outlook.com (2603:10b6:5:398::12) Return-Path: thomas.lendacky@amd.com MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [10.236.30.241] (165.204.77.1) by SA0PR13CA0030.namprd13.prod.outlook.com (2603:10b6:806:130::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.7 via Frontend Transport; Tue, 10 Aug 2021 13:04:53 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7004198c-a718-43f8-e71f-08d95bff7289 X-MS-TrafficTypeDiagnostic: DM6PR12MB5520: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2449; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6V8C/+N5O7AQJDDh7EFUgQVUoT+Xjtq2ZbEyIMuTs6oB+wSWh6rN917iSWvkAora88MzZMUUIvW2FVKwEGyvtKijnH9W2Mx2C/Ws9r2/JpCKov/qhEe/Me6qnPnzEgDRkvcvSYiSUvgJ4KQ+4lM+bsIFdhE6TxGMIN3312QCbRwH+J9hNXg2B/QavBdMoqS9Q7kqctD+fJ02lq3GmpejmUjbOvyKa+vAcCkMmDs+T2EzlxaJXiZaO+oIu3k8a+N8mYPBvP+SLEaP44HUS/j5xNazgpPaB2QifN5DhauxuZfOWtmQiaAvU+JbPqt/HrqR0P8shbxh6ItwRlSJtp2b23AYRWGBdgWl02vS3bR+kFRZemmGq6qQdLepe56mxEDkzvZB85lPocQIxlQ/1ETDWNFjeiM/tkO15TzShnbvZCg7R+uj1KKeK7k5gvdVE59baOjuSMKV2YHp4fu/yF7FaGa3KawqxilqdiCM/GKZfIy37yjmqmmMS3C/pe0gkb4EhqBnk2Hn43CZw6KO6GCIdvUYXORR8QfPGHJIU0gFMC93RpJAlyy8t3OvJeAqObteUPBc57EvjQW0Rari5Jnk4NIb+UARoJki/r805LGIC+ud1nmeNMiv7BLaxRbbtlDY+AvzE3oZ40MWzjTSeyMC+OjjJiSd3xv9Tk4fNKqv35lYIwOy5jAfdV6iJjOQooEU4VJb1mM81wnViVUwQ/9W5iFi0wzFU/T3LXOOn+0qcDJf2B2Tmpw2IB0/K23Fb6uT X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR12MB5229.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(346002)(376002)(136003)(39860400002)(396003)(66946007)(66556008)(66476007)(186003)(31686004)(956004)(26005)(7416002)(2906002)(31696002)(36756003)(86362001)(38100700002)(2616005)(16576012)(316002)(478600001)(4744005)(5660300002)(6486002)(8676002)(6636002)(8936002)(4326008)(53546011)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?N1o1dS9YdEo4ZW8vUkhnYkJaTXd1eEcrSUovelJsYzM2R1RtRl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-a718-43f8-e71f-08d95bff7289 X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5229.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Aug 2021 13:04:54.7298 (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: zMbVvXDlfcYB+/Y+Yq8eKwuBaYQZt3+kbJVbiuE7VQE2OBZJKDG86AoPDjeMkTAckOubylmjVicQsox2Wn9B3Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB5520 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 8/10/21 1:05 AM, Gerd Hoffmann wrote: > Hi, > >>> I still really don't understand the need for the CPUID loop. KVM only ever >>> programs CPUID function 0x40000000, right? > > Nope. When you enable hyper-v emulation features you'll go find the kvm > cpuid @ 0x40000000 and the hyper-v cpuid @ 0x40000100 (or the other way > around, not sure). Ah, thanks. I just saw the comment above get_out_of_range_cpuid_entry() in arch/x86/kvm/cpuid.c where HyperV would get the 0x40000000-0x400000ff range and KVM would then get the 0x40000100-0x400001ff range (basically each hypervisor class gets their own 0x100 range). Thanks, Tom > > take care, > Gerd >