From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (NAM10-DM6-obe.outbound.protection.outlook.com [40.107.93.52]) by mx.groups.io with SMTP id smtpd.web09.1815.1620242867202920755 for ; Wed, 05 May 2021 12:27:47 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=TbFFawTz; 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.93.52, mailfrom: brijesh.singh@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I7E62xPWVbE/oFrxP7OMtkyECPA0eanTXh0px8kuG9MJtbcHftB7afwwD3OtsZeVIZQpBY2OUltfYHmLd8z5lRRkF2hJMxboDuj86+kR+4AxrqbvloBLM/dMdDmDV9jELvpC7pPnjeCpg6U53odVGQQLHZGknJ7KXp/K3cwF00FqrnGv7xp1pNOrH6ExtxcLxoHy6pwcMvpDiTSxtFp5f4GlR9rXEcCvA4dJv/Uo7AchQErJRCKnXujjqOhZUlArEYkrJuY4+ZLvYb5xk0KinYmN8iiqpk4ZOWS8Ubjt8gu/Wj5Qn48k3HaFq6gOPR8wivp2vcPOb2dHoGYhlMavvw== 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=0H1b4uSapEz0NmBQ2r5sha/ZgO8dXAjA0X6Mpv/5Dxg=; b=kq3d62G6Otc/Qt0K9DMCwcxxHU5lQeZL6dp0uI2ztH8/AULxKrqT2vgZOx/r4A37sbicOTrSAmkMU6nXDtyxZ6wT0UF+jzW09dKVx/Us1QM5JVNDA12wlkQaMmvJ37q6G0223zzmRkiQtJJavwqB+jOak9LGaKO7gW4zL4S1Ky8WQeEbu/wMNUUfyPhtXGGDzhC5ft44C6sqxegOeCv/V5OhhHdp0SgN++0p9aUv0S9F/n6AS/+zqwtRP68ySYqM/ZnJSlihFLV13C0mAi/OPX+4freVcbgNDsf5zaMGvAEzBgqAn8QMZvR9uTtygSxb+4+rluLwbmX5nNJCgizy3g== 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=0H1b4uSapEz0NmBQ2r5sha/ZgO8dXAjA0X6Mpv/5Dxg=; b=TbFFawTzS6ONF8bqpe4BvsOjcljeP2Vgx3xKPrav2XV+AJ2/5VXnsB1el7egha4ReofKwl1/QJT/lWsdXtLgovPqzG2ZvaE5oim0bo+PaF1dTz7XUUlUBoLrozY3EiZ5j8v551vnWWXS09i6MwjNJANHE7ZKQj7u3AcpehfpGhw= Authentication-Results: google.com; dkim=none (message not signed) header.d=none;google.com; dmarc=none action=none header.from=amd.com; Received: from SN6PR12MB2718.namprd12.prod.outlook.com (2603:10b6:805:6f::22) by SA0PR12MB4574.namprd12.prod.outlook.com (2603:10b6:806:94::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.40; Wed, 5 May 2021 19:27:45 +0000 Received: from SN6PR12MB2718.namprd12.prod.outlook.com ([fe80::9898:5b48:a062:db94]) by SN6PR12MB2718.namprd12.prod.outlook.com ([fe80::9898:5b48:a062:db94%6]) with mapi id 15.20.4108.025; Wed, 5 May 2021 19:27:45 +0000 Cc: brijesh.singh@amd.com, James Bottomley , Min Xu , Jiewen Yao , Tom Lendacky , Jordan Justen , Ard Biesheuvel , Erdem Aktas Subject: Re: [edk2-devel] [PATCH RFC v2 04/28] MdePkg: Define the Page State Change VMGEXIT structures To: Laszlo Ersek , devel@edk2.groups.io References: <20210430115148.22267-1-brijesh.singh@amd.com> <20210430115148.22267-5-brijesh.singh@amd.com> <47d74104-dd86-8bb9-ba5e-6c0e7371d5e4@redhat.com> <1a6adb61-54d4-68bd-fca7-8e67a034e11f@amd.com> <117c9e77-3f36-7a78-4ccb-2c4caa2bced7@redhat.com> From: "Brijesh Singh" Message-ID: <2003f5a6-a42e-e9d6-e0a5-fa9edd336846@amd.com> Date: Wed, 5 May 2021 14:27:42 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 In-Reply-To: <117c9e77-3f36-7a78-4ccb-2c4caa2bced7@redhat.com> X-Originating-IP: [70.112.153.56] X-ClientProxiedBy: SN6PR2101CA0026.namprd21.prod.outlook.com (2603:10b6:805:106::36) To SN6PR12MB2718.namprd12.prod.outlook.com (2603:10b6:805:6f::22) Return-Path: brijesh.singh@amd.com MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from Brijeshs-MacBook-Pro.local (70.112.153.56) by SN6PR2101CA0026.namprd21.prod.outlook.com (2603:10b6:805:106::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.1 via Frontend Transport; Wed, 5 May 2021 19:27:43 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a4ca6883-899c-4bb2-f6c8-08d90ffbdb7d X-MS-TrafficTypeDiagnostic: SA0PR12MB4574: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wpzB6k3mtaObUGBjzjTRVS5FyIzewk27Sz+EXGmiSKm27SwDob8USL3ToJgFpxzPcP7+YkFGHIRAS36cU9IjhACQX/z9xadAlL0ogedysQaSOoo3Jl06wJVmZnkqnxujqlrbgfNGL6hyVgt20LZr/n9rLXglACffjlCx85uyRO4dlJkiSZYGzcRwHclM4V+xl8EhWYVyK5eYTJvy0uBTgX5qdOU3Z+NgYcc68wdaqPyFpv64RjnWYwX3oA5DgMtQZCwjbma9eT+nrrNlUrI5iCH6oGB2SqHsVARi7a8m1ZiFBs8ENxtJQqaakAo+51BSIOeIneKgOwtO2kxeETvA9DiXbBEHXbIdOOA13TOQS9GwdLHumE3GJlL18Jd8SKFGoNeibYnnN/olQUF7+0l1Cu1TngIytsmf4/rVTd1IWZWFTEh0SoeOF2kLUG/2h+a2bqZw32Zjf2Zu+6XKpKJxTSB3yH7BjSGaj5gysZ8kiPnPvNsKGOCMb4/UJ7VS7fiw/49suyIIRoL57+tPIqJQz/8cF08JFtwAm9FBbiq1VOyL4x34gfIrcCjbZNWEc3PDBZfle5vdFITisaGp96ee0KzAEyfos4I9YpzYDHmIiy8BNCWWHNV+VKM9Z7MjlPyYAeRuxhjQjc8/Dx3wTORseaSJOG8c0+UMN6jpA4tb7oBVFOPEsxRFK2Lz+rifjKVESWIYj6P49D8h6t3aoPUeemOXNkROSKUFdsBut68+8jKXdiyH9WBeiaWbuvtD5K754DXPs8CYBqPPQ4brMXvE9nl8yPziOGQftSySeD6FS4A= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR12MB2718.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(346002)(39860400002)(366004)(396003)(136003)(376002)(8676002)(44832011)(478600001)(36756003)(86362001)(2906002)(31696002)(53546011)(5660300002)(4326008)(6506007)(66556008)(66476007)(8936002)(66946007)(6486002)(38350700002)(316002)(2616005)(83380400001)(31686004)(54906003)(966005)(16526019)(38100700002)(52116002)(45080400002)(956004)(26005)(6512007)(186003)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?B?WE0yc05EMmF6VzNEQWpr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ant-Network-Message-Id: a4ca6883-899c-4bb2-f6c8-08d90ffbdb7d X-MS-Exchange-CrossTenant-AuthSource: SN6PR12MB2718.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 May 2021 19:27:45.5832 (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: lGzMC4PiwS8MnRkq+f75+Mo94p1BGXg4G+UpYnxF3T3Ad+pwKG49s8jv0PwQ5T9+kh+FMfYgOEvCF1wlViQpRw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4574 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US On 5/5/21 1:24 PM, Laszlo Ersek wrote: > On 05/04/21 20:53, Brijesh Singh wrote: >> On 5/4/21 7:33 AM, Laszlo Ersek wrote: >>> On 04/30/21 13:51, Brijesh Singh wrote: >>>> +typedef PACKED struct { >>>> + UINT16 CurrentEntry; >>>> + UINT16 EndEntry; >>>> + UINT32 Rsvd; >>>> +} SNP_PAGE_STATE_HEADER; >>> (9) If my understanding of the spec is correct, "EndEntry" has >>> *inclusive* meaning. That's unusual. Any particular reason for not >>> making "EndEntry" exclusive (in the spec)? >> Sometimes guest may need to fill only few entries. The "EndEntry" will >> give hint to hypervisor that it should stop processing after it reached >> to the EndEntry. > I understood the purpose of EndEntry. > > My question is why the entry identified by EndEntry *itself* needs to be > processed. > > Put differently, I'm asking why your loop controlling expression is > > Info->Header.CurrentEntry <= Info->Header.EndEntry [1] > > and why not > > Info->Header.CurrentEntry < Info->Header.EndEntry [2] > > in patch #21 ("OvmfPkg/MemEncryptSevLib: Add support to validate system > RAM"). > > In case [1], EndEntry is an inclusive limit. > > In case [2], EndEntry would be an exclusive limit. > > My question is why the spec defines EndEntry with inclusive rather than > exclusive meaning. > > Using inclusive low bounds with exclusive high bounds has mental advantages: > > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.cs.utexas.edu%2Fusers%2FEWD%2Ftranscriptions%2FEWD08xx%2FEWD831.html&data=04%7C01%7Cbrijesh.singh%40amd.com%7Ce837bb9a71bd47a8337b08d90ff303ae%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637558358685096067%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=uhtfVW6Q%2FIpHwI%2BfNM3DVur92b2KFB5pjaL1dgZtLC8%3D&reserved=0 > > Is there a specific reason for which the spec chose the inclusive high > bound? Tom and I talked to see if one of us remembers the reason for choosing the EndEntry inclusive. Unfortunately, we were not able to recall or trace from where this request came in, but now it is in the spec, and we have to live with it :( -Brijesh