From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0609.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe48::609]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 13B9E21A18AA9 for ; Mon, 29 May 2017 14:58:56 -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=EzjXSOW43J9/9ULuRlSNGhYofGeSbbvNGqQjUP7h5Ow=; b=ZhfByy9+Hov0Bl/vTB0f3wcLHzxjqOP3vykFUTHVx5wi2kyckgPz3cRUgfdoT22Y5VmlXYulO/IJOyCAKw/uIiX6SQTvvEeWb4Mbhn0TOsrB24uR8PBe41yTpf+2wxk+ktSpwOePCkF/7EZEyLfSZM2A5/0FomxNVL9QIbO+K2E= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=amd.com; Received: from wsp094000wss.amd.com (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.1124.9; Mon, 29 May 2017 21:59:50 +0000 To: Jordan Justen , Laszlo Ersek , CC: , , Jeff Fan , Liming Gao , Jiewen Yao References: <1495809845-32472-1-git-send-email-brijesh.singh@amd.com> <149583274037.25973.13062338567511386932@jljusten-skl> <6ecd0138-454e-6a6e-d034-beaf63466120@redhat.com> <149609029319.5770.13917390389219314003@jljusten-skl> From: Brijesh Singh Message-ID: <14301d64-9fa3-8231-42c1-52c2dcd9f96f@amd.com> Date: Mon, 29 May 2017 16:59:46 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <149609029319.5770.13917390389219314003@jljusten-skl> X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: MWHPR14CA0017.namprd14.prod.outlook.com (10.173.227.27) To SN1PR12MB0158.namprd12.prod.outlook.com (10.162.3.145) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PR12MB0158: X-MS-Office365-Filtering-Correlation-Id: fd4d07e5-fed5-4247-7050-08d4a6de082b 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:K/aPl64U3IA2LIjVUmn4o6WvSB77t/vwVDmTuaeRYLYflDd7yBml122LQpW09cPWcsa2HPwy0qIjkwFqI95cN3KWTBgfbrhucwkRNM4hI53fpBpO1bg57kxM6z8ZrVWddlFZ+LFR32c1ITp75Ce/JfoYhLu8gGwct4MfzSafR7efDMHXy8tcg+4GzgvXXCc2mVR5rtEoLVlDGk23Zf0iRtgeF9cFEJ0Ha2NHJEhMpmU1+74dyy70PXCfyYHnOH1BZTtC55fIcsUFGOYM0dXMQTLI4Fi3BF8uiCsv/20etodzTLoo3dDxJJcUGl38xUS3OZLzzT9lZekIT3p/yYg3AV3fKOOioxzgQzroGDIlJpY=; 25:lCC4xpDBy3cQrYwGlZ/loSd9fT1InSHsJLYGLc4JfIzx+H5e+m/4h+9szEmB50UVSRkCFR4D2lGVqGOt0oPU8YKTcBU4lHzQBLvIDcmrts322ybS/HRSrSoTJcKAhBytzpiWKKFzBTrHx3fiHW0xzRQT/3ipnM5HrxSUmnu7EEeVh0u7Y70ShRK1lP7VD37wbnwEY+hxe5aqSOv5YTuaXsFHYZsPOugMD/66gunsS0MZeGDA1MPCZs+dTQ745rVU5TVnhazJ4YiHzlpDnNBy3jPMRgXmdbp5yiYL3je41CETer0oA1ybNqZlLQAI/7V4Mpf5xTVti1izpt3omOxB/J1cnyPh+GMJdcxE0wY01FjkHKDFy1rboNHXG0M2g6ABUMvD0ZOOtXKlqaMSGNYQW8D+kDqz6wcCJsnjaqzImOSTtGSw1QM0h5rZ0OyZGGEFPjhPs+2e+V3cQ2JOHD04p6pp6v65EfC32/86mzfsgLc= X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 31:4oP6vPvLkpg4BvjGDuWG7jLxYKyO+M19RAQ+iIQhckoTdIFFD9f6bPGTFNO5lSanxjPjPnlICsSsuASWEaX80caoBm3J7JJL9+vRKflTGJbgYWG7anNa44v/IJeroKBA606joqkVz5jnemlYcnFXcavo8gcHIenvr11yBo876Ac47VnB28rGrs+PRHoBZ32YnhYEM+Q/DK2Abs+QeSN8Ze1d4u8fJdlAPvigj6BaEQM=; 20:AtJBjmhRB4wVuJFthOzPuEDQy6g2qZBs8FuwGLa6gYeE6Z/YAdT9Zoy+l5M1afI032fTqsnZwlFM59gUh1Huo+GkQ2EBkKDBNWaa8WmJOd/0nCdvZNA/mP/5z1/Mrdujeqev+foMTj54hX9wUmZV21IU3Ee5phVvWZpVccnJHbISVii8PaQEMHpFJ2Rid/6+bbQqP4F3OcH2ZxeVaNarqNVnCOr4nZ/lPRPeJj151+yBIfhLSrj4/OFEf23GHDw1j8mOjZEZAxXkHcqd1/UbsLKamN6u8A+2bJXIGNIuBHSCHz0H4PoPEufHKIABR+9QtPAzTKebRj/HGNZiHQHDy6P+oKFOWClXkdtvKI9G5zp6MshidtCJxLKkatW1jRoPXZntm5R9J5CgjvHCDaWvFoLEieW8S98eAKO94mToIAXMhferW1MPoH6ucEEgCZk4hmREeoklhH2GHJYZTtRmKo+CfgT5xSCUtYtCp//l3tZ/ZvCZgUHPCOz6O++tWBsp X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(162533806227266)(17755550239193); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(6055026)(6041248)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123555025)(20161123560025)(20161123562025)(6072148); SRVR:SN1PR12MB0158; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0158; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 4:axt82/aWY3U/86mErFOCnLmmeZF3EsWI5iMtNOqd6usghL1w/LCVRddnamm6Tvn4DZGwn7MSybAbHPQCwgHz/oM80vNmVe8uQ7gbp88XdoVicN82Ia1Xl5l7ChPTot0N83I6vpO+tEQcladzRPRNkG7WIrFfUXLQMn/62+qjFz2C79x4xAI4sQ/SoDuDx3gHVYAF9cCCZVcGYOeWeyPGM9xy0/CvmJ2JyAse0WTb39zv7qFjxpWQf+CpgwcRJI5JHrJ87CXRu9Fg4kP7np0eX98A/B4MLzxebkWaoIiXvHTVOptmgeH62RNCb6QbWmFG5da+jZX4F7pDWO028xP1C2RHvH/bXt7ygUgjS7UZ0NlFgS/wm19FKhb4lmlLyjwINdmVaQsJX8K6dwKamE8mf5cX8mMg+eRR/eLokMPIk1gwYGHHhYB/BK3AQ/HHD3rGBfKliQNsPh/9IImt9GIqNnqDQfUSHVApwGHDYx8DsEzukaEuPN4Kl21JV3g0WvV/Xr/FYYRzQu5rMDPWMvBA4H6RI1PE5YRNoCG8YoHbCbPvNmnqdANx6tM8KI8/rJS0OAzo9GqqbS3y3H3s53dIn/WjFYF0O7By4i0uzjlV2J05Ikz7mo98FDNYzgjoSWBgYd/kDk7EzZGFUXwTZ0G0egH7QpddkULQ42uRRoV5F8TgKmHZNO0OMz5ejpz7aiWgRw/K2RmkbTbxDURis3rS1WD5JQpBOm20UfHqtcIz8i+IdHFx0mLv8UZrE1XZ1gjWIOZWtCJGGflPvxZcSNDC+HiMUvv1bZBZN+zecm1Avug7jerjJyJAGJnOziuugtMokMxYU+V+kKcTpC/5SvXd/dLZ15rxqhTOwOW7XryqVO/egYy4MoT0X2ilGnz5DzY2 X-Forefront-PRVS: 0322B4EDE1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39840400002)(39400400002)(39410400002)(39850400002)(39860400002)(39450400003)(24454002)(377424004)(377454003)(305945005)(6486002)(93886004)(2906002)(7736002)(83506001)(229853002)(53546009)(54906002)(54356999)(86362001)(76176999)(6306002)(81166006)(3846002)(53936002)(6116002)(50986999)(53416004)(25786009)(50466002)(65826007)(5660300001)(33646002)(42186005)(38730400002)(8676002)(31686004)(189998001)(6666003)(2950100002)(6246003)(23676002)(966005)(36756003)(64126003)(4001350100001)(478600001)(4326008)(66066001)(230700001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0158; H:wsp094000wss.amd.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtTTjFQUjEyTUIwMTU4OzIzOld4Z3VxeHRHRUhkY1FIanc4alduU2JaOWdY?= =?utf-8?B?TzdudkZqMk9Zb3c0SitNc2tWQXFTYkNoT2w2ZGs3MUIrTW5DYlFGNkxBS2R1?= =?utf-8?B?RmhkV3ZsQUFrdjdxZFMxbFd1RmROSGwyYUd5MHVrWXhaQlBuRzczak15MlJs?= =?utf-8?B?aE5xMlRiWVJNY3ZhNWNyQVhtcnFFSUJLZk9ULzc3dnJldndIZGNSVGxSaUsw?= =?utf-8?B?c3ZjWUNhY1ZwT2tTVjhnQm5PWWhNNk1obWNaYTRmZHlSQmc5bTY0WEhWSHpa?= =?utf-8?B?Nmx0KzA1eDFTQW1haXBsSGlVcHZ5THlycXUyQkhkeUovb0pBQWg5NmkxUjYw?= =?utf-8?B?ay80Y3pKRVVqeXRncVB5cTBSclFvWnQwaEdKWTgxbVpXM083MDhyQlN6NERO?= =?utf-8?B?b3Y4YkpYU0RScFBrMVN5VW56UFNleElIaHRoek10SGsvaGNjWTZYSG1ORC9u?= =?utf-8?B?S3RaTjh2TH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PBfBIzG3/X4IrGD8QyX6qPvkHmp+pJlZzND0kSexG1ju5xV8Tg56NaAqY8hriqFdb9QourQqhLwda3k+9IQVLD36PEpJgaWE7++mTq1PemFxFMtvXAdyGNvSK7VaFUITlwLwK3EY2jA==; 24:ll6wAp+fi1DOMq7q7DoNaecbeSK0+R0zRB5RheLjG7Yex1ok/w5AV7ouxFDyHfLryHNVhvgATFS4SkvwB5PJinoUSkrg9ij2Y9QL6A3VyFg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 7:YpJkSuJxKnOE/T5HelCRyp6412ySFWVBK04eEBuYwzdvbXEUfINwOJVB3TK4ik5PBjC0V5fEaZHEsv38nwjnKyRSO4euvN9SBhkeuieWNtciEGxb/g11QqwxPMf3rsiPtMbwOxSeLDHwvaSF4W72F2DSgT0YEZmD3mii+tAA3nFy+h0ZbwOhGK9BFCwHEs0nATElTCB0zaQX/SfS2A2XLBdQjAbf02t2WB5Ss6xh7ashFRY03v21NvbHXmOQS0V7xYHj3RUe2G3Aj/KO1EJOzAJ08SDxAwgzCJhegr8PhJ4s/ClWmKA6aRZTVWlRs5lUHeWzbz3j8yKAFkcjgHl3kA==; 20:7lndJB7MGMwo0ErRa6RTVb9PanWJlYJmZmkFKzMXw3GEjB0BIMt9Pk5Ajdn4aeTVwr1XSZqyyZ5MA1DyU7/aGUkC9+yW/jwesCNkiLvtzRMkc4BOqBZOutuXOH62xmze294Yx0sT0wFr7at+nnHi9JErw/3aowqezXpwaqfO97B+HhOORAK3+qKt4Vg2tZx66O/jE7Bv9rtKzEFVd6N3KpND4OkC7s076n95Z30EQt33xYC3h958uxfAnTUqmpkb X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 May 2017 21:59:50.2816 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0158 Subject: Re: [PATCH v6 00/17] x86: Secure Encrypted Virtualization (AMD) 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: Mon, 29 May 2017 21:58:56 -0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Language: en-US On 5/29/17 3:38 PM, Jordan Justen wrote: > On 2017-05-29 04:16:15, Laszlo Ersek wrote: >> (looks like I was the one to comment as second reviewer after all :) ) >> >> On 05/26/17 23:05, Jordan Justen wrote: >>> On 2017-05-26 07:43:48, Brijesh Singh wrote: >>>> Changes since v4: >>>> - decouple IoMmu protocol implementation from AmdSevDxe into a seperate >>>> IoMmuDxe driver. And introduce a placeholder protocol to provide the >>>> dependency support for the dependent modules. >>> I think you split IoMmuDxe out from AmdSevDxe based on my feedback >>> regarding APRIORI, but I don't think this helped. >>> >>> Ideally I would like to see one driver named IoMmuDxe that is *not* in >>> APRIORI. >> There are two separate goals here: >> >> (1) Make sure that any driver that adds MMIO ranges will automatically >> add those ranges with the C bit cleared in the PTEs, without actually >> knowing about SEV. > Ok, this sounds reasonable. > > The APRIORI method looks like a hack. Why is this not being handled at > the time the page tables are being built, in DxeIpl? Couldn't we > define a platform Page Tables library to allow a platform to somehow > modify the page tables as they are built? Or, maybe just after? This > would also make sure it happens before DXE runs. Before introducing AmdSevDxe driver, we did proposed patches to clear the C-bit during the page table creation time. In the first patch [1], Leo tried to teach gcd.c to clear the C-bit from MMIO. IIRC, the main concern was -- typically Dxecore does not do any CPU specific thing hence we should try to find some alternative approach. In second patch [2], Leo tried to introduce a new notify protocol to get MMIO add/remove events. During discussion Jiewen suggested to look into adding a new platform driver into APRIORI to avoid the need for any modifications inside the Gcdcore - this seems workable solution which did not require adding any CPU specific code inside the Gcd. [1] https://lists.01.org/pipermail/edk2-devel/2017-March/008974.html [2] https://lists.01.org/pipermail/edk2-devel/2017-April/009852.html