From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on061d.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe48::61d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6BED921A13493 for ; Thu, 11 May 2017 11:03:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=e/+7jBHMsyq+F2a7VdUUWw+1Fju4rwHpX3veuJoYpi8=; b=FcYzN/FsmusJMf7UlrpmcnA4IURarRN27VnxcDMcdU3rWKcS0ZdI+cMBDAogyVP1YftAnYT1LQqqz8PbzyHxaNHDDlMU75P/hZM4q4jlAJZbuwAlE3pC8KlMPMSdGBUOjSa3IMEv/UZXkAkvb3R/8EpaWtzEp8wvRzEI9UyQewg= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=amd.com; Received: from [10.236.136.62] (165.204.77.1) by SN1PR12MB0158.namprd12.prod.outlook.com (10.162.3.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1084.16; Thu, 11 May 2017 18:03:53 +0000 To: Laszlo Ersek , References: <1494454162-9940-1-git-send-email-brijesh.singh@amd.com> <1494454162-9940-5-git-send-email-brijesh.singh@amd.com> <1d04baaa-95c4-492a-57a0-3d91aea02c36@redhat.com> CC: , , , Jordan Justen From: Brijesh Singh Message-ID: Date: Thu, 11 May 2017 13:03:48 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1d04baaa-95c4-492a-57a0-3d91aea02c36@redhat.com> X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: MWHPR2201CA0043.namprd22.prod.outlook.com (10.172.59.17) To SN1PR12MB0158.namprd12.prod.outlook.com (10.162.3.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 93bd9218-8ca3-44c3-c45c-08d49898160a X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(201703131423075)(201703031133081); SRVR:SN1PR12MB0158; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 3:QZAfHmEGhUEYuvf/YjAzmgsGr9JJNxSKZiW9a6/dBQERg0fLxANPHvojp1HBlfNK9KdRLJDcTTg41WJ5i9P+pxclYAjrn3D46TBiKXhyYmnaSVbIJOu4jJOfaxoFMyEuAPhtzMiV34g85HFLXpJEEuq9d4bQdBWUfEW/rqthQdrlY1y3hJRCc/Q9mqGYAyo/8D/4x02VS0KkLqQzFjZWJT2YJy2bBcKhaS2GMMKAJUZlV2GAMfD25mBK/oKTlEAYu7kgFGdr/ctnnsSFwtWQHGDN04/ve9JP9HOaziWiKb4P13NTZ5ctXldIq20KwOyzCxU5YCRcEszt5n07F/LdfD9RaVuWZTqJuIAJML/S9ss=; 25:QxSWdIq3si9yvME8y8y9ZTD4erVeEvIZEwpYRUVJBYOdv3YeNP0mNNq5vt5oQLK9cnijE/BP+yY55HzZBa9/1y+HgA/L5yQfGtregQvtxC8C4QQ7c3dY431TO+WqA+zgjEWpRP9vQrcPHlC6E76q8lD3gUe5aS8Gx+sgPVHxRnUD3kz+fyePhz69y0I6OofeyViRodUfuv+0ywuKVvZcCbU4lUaskQI8lMeVbv5+znM7fNM2F0tuCH2P7CaiBBx7JgzVA76oLoWZo11d9EXRIGF0RbX+gZzxH+JF2n5XY8W144Tp7HTiUh/maTxvQbO462sBkvOdGlp7dMKYo39+0aA9dHfumkPVjS8F3KpR2yOvOWXFIPP/q76qNi4TmAuGXvpRJvah02CkjXt0NIGtU/xrpCKyMYCr1sLai6moFELjGTf/pINccfahQYdM7AfUXekEygfvbDFRcwxQR9ml3dQZOeiuGiJUE65YVSpO/lc= X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 31:9ap5aAF368tPghjX0RgY9fD5txWjC3i2WD1tLu812b7fnbjtg6ejQjRboN3V6Zt+w3in4DjChODXyBlCqdi0Neo6tyIsajSSC+85Fa4g3oH30v6vrRAZbeBbOWRYpGjC6Kh9y8DUjSYYKrRgXFC6C+mcdcskVQREkIndfWRYqifIMlFtAnl0b/h1Y3KeZgUhUrRBQVYXslTT7xYPygBf2s4k16P2Cang5LgvhruPbuI=; 20:f5I81IaapN+vvFjEeDh29+wPw3d7WbFlrbLNAWCsNg3fstbHJXWekXPxNBGWrFszVT9AKWeVh9PwazDx6FALTvKTOBJToa2xCQF5RunDvhUoTSK8L7H7Nt9JNFTFBFVbOIxwJDpwnj3kLTw1SJ6ldfF48RNPSODadECnne+E+EUP1wN4tjElfJFIewj+3LAl85HLicdUF/FJH8dUKDbiZNj44s5fB++YLvtR9j7Ezl4LzEDKziGVYIpZ5NgRbeh82QiTgrTI8GBvAQeuS7b44HK7s3crJhowUE9KsGhnSu4wkfavYbGE1XTWqsCaYUCuemE39gOr8QrQIffU79qjvYLlu03GEdqkdHRwUrqhTSlG/JH77+2YUl4znCAeCgy8hMXno15nUDNV8LJpVRQO46du+QxvCLyCqWhpGb9/mL+7efTjCE26JBJI4y+E31Sjn7RIC5fyWzZ499ZxlAhGNIJCE5AdyB4lFFDQz9wJGfiyxr0/XQbyCM8bAo1nkDZ8 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(6055026)(6041248)(20161123555025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123564025)(20161123562025)(6072148); SRVR:SN1PR12MB0158; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0158; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 4:7vlXmHx8md2D/+DjkucvabIAtma1kV26ztOo3/kHVitgBBeE9wV0uSFATzQ8diskjcFNceHLt0dV0j0BYAjPGz2iBPYC0TlAhMqkTXYVvs+8mBw2yHySGGfNOFNQ8fRCnEqaXRnmwLt/FzswTvjS32UXpr0F/zfqtolLlTOPmegJNFQMGF73E/ThIADHQfhA2xHO042bzb4Sd8lZlwJnJJAJpYIbpT4ds9xujaNzauyD0xwafPCoOHTUXAP5vah/66NdQDyYMz4cRbkZiEoteMp8Be3bf/41E/khDxx9JcxOTsKYchgjpSvSAb20sSeh621zpU7OZw6xI/kLrWmagQaRetMIno1QbBY8T/kuo6p7cRtxOjUqTveMzqDTUWOy0VmoRvxNiLIdOiywzpjGCMsipBwjbmqjeYQGIEzLImH0ZZvBLtcSqrMsa8ZSR1oqIaDvpQ9Fy34JCnxkPl+C7slg7LNVwb29BlaYXqBlSsv/PhIcasqiRGQoARybUIPvguRyKdSSfNVr40NRPdzDVSzx7n96fvpoksOQc8/ejlYgAHZgyiqVHiWiclVnX/jk5XCr9LUeUH5XQJbMVjlslZeXbzb/+JQ5IBc5asikG0+S+p9eEJ8+/opYg0KuYeTJ03alpYeN5sIJIA8y5jU1QyOhr7OkVeEMmNRJoO/humVoWhkGQAS1UWNUhtajnfjw/3nv6U72BU9CVeMCiLHnCxqFrhhn9w52g9bvoN2asaNDzXU/E8SASH3+psDHd2l8NgyDKNl0Qeo2Mc94w6gAkqkNu1qkIPO/6C7LVQN56LPGqlqCSLEwS/CscfZXw9kb X-Forefront-PRVS: 0304E36CA3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6049001)(6009001)(39450400003)(39860400002)(39840400002)(39850400002)(39400400002)(39410400002)(377454003)(24454002)(4001350100001)(230700001)(42186005)(50986999)(76176999)(54356999)(31686004)(36756003)(64126003)(2906002)(50466002)(23746002)(33646002)(90366009)(2950100002)(189998001)(6666003)(8676002)(81166006)(6486002)(229853002)(31696002)(77096006)(83506001)(54906002)(25786009)(53546009)(7736002)(6246003)(65826007)(86362001)(5660300001)(66066001)(4326008)(6116002)(3846002)(65956001)(478600001)(65806001)(38730400002)(47776003)(53936002)(305945005)(21314002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0158; H:[10.236.136.62]; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; SN1PR12MB0158; 23:kQnNNkjNh713AtuutR5RAFITlKV+7eyw4ESyY?= =?Windows-1252?Q?R1tzuWCBYUtIsERVQ2zfD9BOUfkvaiUehSRWAg6aiGoNfH253R6Kppn5?= =?Windows-1252?Q?6utfMI0/Bc1Pbyr/QsbA6BWLBRTQ0Ukne01ASL8T0jnT1wVt5k/ewKE4?= =?Windows-1252?Q?dFxW+cjVYD9bYXgc1YTvbwrcs2xYYiIZqvdd7+K041ztdl4JAXMOD4ZL?= =?Windows-1252?Q?F3VixTEn230EgT1/lo8vFYLlRwEcpmuCukCmzfWRUl89oV3zBobfHejS?= =?Windows-1252?Q?rkrCVrCdjsv368x5rESIHoD1bWGbA5fvGkyd+fpWijJU6KsZDSvE9SMm?= =?Windows-1252?Q?ga27kwz0CllNL2QztyhKRrfHzQF7KQdrhuMEWdAx9U1SXqLv+7mnn29R?= =?Windows-1252?Q?pU6Mn9MyR5mwEHtzEBERu2shfzZnonxEjxGuwwR9I2tGz/Hwnv9P7bK4?= =?Windows-1252?Q?dIKAo7abbpus6DYsKrI5bNxoXR7wOQzTEHLCoEY/XvTAe0O0Knl+x31d?= =?Windows-1252?Q?gfGUzRpgNF8DGwg7O3xbAUdRkX/JgK01ek2VISBle6q83XsHfJatS9xR?= =?Windows-1252?Q?QIckZYbf5e5HmnXFSQ4rYomMg2xdIijxjBY6l8RwO11mAL0xGiH8uiL7?= =?Windows-1252?Q?6vSsnFBXbD3rzzb6UlGjIjyKtohhGUKc12M8jmQVOgTUkYiDWNrMWxrQ?= =?Windows-1252?Q?azrgmKKH3j3hb9hvvilKnCtraifwgt9nhM+ICITflORzzuVKMROs2sxW?= =?Windows-1252?Q?NUT1bwF/42qNTgZhBedKLr8D8esKDWt37FWCFg4nvM0Vvs9b8yRIxByB?= =?Windows-1252?Q?YkrelRgvyB3gYHmpqV4QcAGXGACi5Uw0DFWzQRH4XhHJQlWCaK6O/uKK?= =?Windows-1252?Q?bUPzeJK8AkQKH6QeUWWnSlX0iTT+LuLaLIo/s13ZGKdrLAZgTjg/xGmk?= =?Windows-1252?Q?V2O/QLhi7fAahJYkeizK84fVRKzq60bgkif+UIMcH/K+cKoEI3IrfRfB?= =?Windows-1252?Q?VqQxvemxMVwwW0Hd6LndDaAypXyFhisVffCCCawL+C/qcaqlaJchr+Qr?= =?Windows-1252?Q?yEor39589TpDE5DpKDsqwuQngURnUWs17O6/5DwJS2zFPCgltMG0Wb8J?= =?Windows-1252?Q?nqOTsh80Cz+kH/AFDvsyBj3+ntRjudzSdioYUV1xSEk0RAFHd3VQc+Zf?= =?Windows-1252?Q?ET+rSM/bgSsyH7F3EXvVmKCbtfszzX8nsxr4N1BMEFi8ZATKb8ZjIWZZ?= =?Windows-1252?Q?5YYKf0Lnjl3lpspMIZa7rQnsFY2ubd5CyGdQoEkwxCxIE0mLdw68ufAZ?= =?Windows-1252?Q?PSB4s+7tNwsoc/4sodGQFMGWGZZlAyOxBLEIjKCpGD9CPtaUBRgYxffz?= =?Windows-1252?Q?ecUpvk8xkTRoZrMBdmm6nWHOwIhfZkLyZWuET3BgsXX0F+m3cljsh6kN?= =?Windows-1252?Q?AJRwU3ML9ulMRPjnZIU2mSIBJ4j2cwhh8Ve5aIlew=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 6:xP4OHW/cdA8LmiDWqgITcli69rcNcJtldeDcgUkcOW3p49feZJlzlcB1JPh9lkjgk6OtHUntCfp4B6UEO03Z3dWlP3p+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3etjbZx87skYHXMqWl+jQ2iJrD3IfYNRDXytYEyzrHA4kJ6kn5X1cyABS6gxAgKMVA==; 20:qhNbE1mvU0XyGV6hFUhxwlXuF7GB8MnzVhTb+D6WnLrVFdIXd2bSSb8/TfiWqVXcazc3RYLPY4ht4QXk075yfAcrHLUgf8iI46goE2mxoxW2HBbv09I17X0sKv/nzelEazlb6WfGyfHIqk6CXIZP57Xfjqce20QKTIKd+t+x1d58GMskHm8T3cRV5lBDXB2S+qEclXgRh/Xri27G3DunvRvWaIfX30UVslSXKm9ZWbpXhbxkkJb/pupi1T6DG65P X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2017 18:03:53.0212 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0158 Subject: Re: [RFC v4 04/13] OvmfPkg/BaseMemcryptSevLib: Add SEV helper library X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 May 2017 18:03:56 -0000 Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit On 05/11/2017 09:04 AM, Laszlo Ersek wrote: > > I have the following suggestions for this patch: > > (1) The InternalMemEncryptSevIsEnabled() function is identical between > "Ia32/MemEncryptSevLib.c" and "X64/MemEncryptSevLib.c". In addition, > that function is the only one exported by "MemEncryptSevLibInternal.h". > > I suggest to eliminate "MemEncryptSevLibInternal.h", and to move the > common implementation of InternalMemEncryptSevIsEnabled() into > "MemEncryptSevLibInternal.c". The moved function should be made STATIC. > > This decreases code duplication and removes an internal header file. > > (2) Please prefix the names of the extern functions SetMemoryDecrypted() > and SetMemoryEncrypted() with "InternalMemEncryptSev". > > (3) Since this is a BASE library, please don't use EFI_STATUS, > EFI_INVALID_PARAMETER, EFI_NO_MAPPING, EFI_SUCCESS; use RETURN_xxx instead. > > (4) Since this library is going to be linked into multiple modules > (presumably), please consider modifying all the debug messages as > follows: the format strings should start with "%a: %a: ", and the > arguments to pass in should be gEfiCallerBaseName and __FUNCTION__. > > The former arg will make the library print the BASE_NAME of the > containing driver module (from its INF). And __FUNCTION__ helps jumping > to the location more quickly. I was not aware of built-in gEfiCallerBaseName, it will be really handy. I agree with all your comments and will update the patch to remove the code duplication. -Brijesh