From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on061a.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe45::61a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3E6D621AE30E8 for ; Thu, 1 Jun 2017 08:00: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=nzQBzry0aTRa8l2hknKKkiyUx1zLhOV/e3XPUaqwCg4=; b=sJ3CQPV2ErP6q+7ASWYSv5ywArG9/gGVRjysoYtK/RyEVZty8G3zDV6mVF4LsJr5PfW0Cg8HAWYwu5JH5PF+84YE2+ShyaTVAdX3ZCKDYyIp7MaJHZJzrLEv3FYrGU050+O0ql64zZLw2M9UsRulOUNlPh3ZtotlBTLQdMnqaic= 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 CY1PR12MB0150.namprd12.prod.outlook.com (10.161.173.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9; Thu, 1 Jun 2017 15:01:55 +0000 CC: , Jordan Justen , edk2-devel-01 , , , Jeff Fan , Liming Gao , Jiewen Yao To: Andrew Fish , Laszlo Ersek 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> <14301d64-9fa3-8231-42c1-52c2dcd9f96f@amd.com> <149630284935.10663.16670660897918560882@jljusten-skl> <181773F8-7C21-4CBD-A552-AEC02B57CEA0@apple.com> From: Brijesh Singh Message-ID: Date: Thu, 1 Jun 2017 10:01:51 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <181773F8-7C21-4CBD-A552-AEC02B57CEA0@apple.com> X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: DM5PR16CA0042.namprd16.prod.outlook.com (10.172.42.156) To CY1PR12MB0150.namprd12.prod.outlook.com (10.161.173.20) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY1PR12MB0150: X-MS-Office365-Filtering-Correlation-Id: f7e06650-33be-4f54-4824-08d4a8ff24f9 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(201703131423075)(201703031133081); SRVR:CY1PR12MB0150; X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0150; 3:ChRoW1gpNY29LaAaWlA0eHzfF7vAflh1hOsOsqZitP/8KaOwkDQKm76vgSvvDNb8PBELHdLHTU4RM5B9gB2kMsySHMJsIZNEektTpY8Gt2xaObsXYGIGG0nl1bEE2wGxiS4aQ2HHLn/pR0Bdg6GaPoOsKFnK1fzrZme/k//XtgfoNyBiismcdU0giLjLiaMyyMOQsty67PE+PQuxgMJVl6ov8U32qlvduxts1mU538CZA//rO8yrrXrFD7K6TntHTNeBEDdKYbpoIs7PMPClHIrEyFYt2f7bhSF++YlBtJqsQvLRvYDwkkNJ/1svFY752rzjSuFeDzMEUB7D3R5mvnGOmTdtso65ZbtP9XMPloY=; 25:eaWwWv4MO5pftgjIVw94MO/4+DBxFTJ7HK2vKwNlWICXuKICqfFfcpIgaJZXN4u25n4p86Mw5NMmaBknE5E3plQmpXRqa264Ff5+vtEPg8eiSR3ahpA9ln3lO6fnw7VaguQ1ReERyNt1+LceUeDDltPV/p2qnxb3FLiR5D6oFM8iNAu3HlYL6hoZoqJ7glBF0U1xdp7QbetPk6py3EYpR5Dt91Pbqo/Wo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-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(166708455590820)(162533806227266)(17755550239193); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700100)(100105000095)(100000701100)(100105300095)(100000702100)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(100000703100)(100105400095)(10201501046)(93006095)(93001095)(3002001)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(20161123555025)(20161123560025)(20161123558100)(6072148)(100000704100)(100105200095)(100000705100)(100105500095); SRVR:CY1PR12MB0150; BCL:0; PCL:0; RULEID:(100000800100)(100110000095)(100000801100)(100110300095)(100000802100)(100110100095)(100000803100)(100110400095)(100000804100)(100110200095)(100000805100)(100110500095); SRVR:CY1PR12MB0150; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; CY1PR12MB0150; 4:O+IDNd7tz4ELdFeAQIVqg7OtGhd2rX/mxdycHa?= =?Windows-1252?Q?E1MDhyxT2A3g93KkLBqBTF4BpzCwZN5Feaww2eEgLgxxL2vobl0rLkNO?= =?Windows-1252?Q?0RK8cgpuGgtW8RRAaiHZArs8N8hn9fuq4Zsyq5cPqohb8GIRWggLEOq9?= =?Windows-1252?Q?SB5/f1e50wPeBNp2yY6xyj5R1AOIHtllUexDs61Diyc+AW5BSnF4s6Qt?= =?Windows-1252?Q?bCQY0li7HjqaCL1CfmOPU4i/w/FrgRM2AhCNTq34gqJ6gayRirpC9qla?= =?Windows-1252?Q?xA0GCSH3pKm8KEt81CTjYHGgkpgy2OyUDQ996CrsVnR2ULdA+oywgHif?= =?Windows-1252?Q?Eqjm81T8gyAHjpYUc3WW0YwBXbiuepPsyFWKalrZ9CIGd+pT5Th3m77B?= =?Windows-1252?Q?L8SJbc85AlB/L587X+oZVunzVb7mwHXnlF63deq5lAOk8XM4u2o75TuV?= =?Windows-1252?Q?hZFGBJlTDae3SyWjgrxOrq5Zw684apu1VjFCBthNgW3rPdN2VBcK/Ei7?= =?Windows-1252?Q?CzTVD9WtHU0eTyBRwVCJp2dsOUqEkByrZRqYQ/NVzBX7olh276WdY+8H?= =?Windows-1252?Q?3rMdIgeTtF9JAYsKOXsSbzSX6ZilLdeSlwjQJ90XcxkmSRPkIO53Axdi?= =?Windows-1252?Q?TltrX/SaxRchz4vslDSv0tMSlviJAoud3YL7rEzjYEZ7yHaNl+ZlEPAg?= =?Windows-1252?Q?2yyP0StL/yl6TYCeP1WPCaFtoIqPL6RZJjoJVDc8a8JtJrjwHpfeTUST?= =?Windows-1252?Q?G6CmouULI4tcoNM+2VIdK+XdLVGIeJudlMP3sos4Iw0eehFhhfffvAQG?= =?Windows-1252?Q?zCnxEVed5lJ4ZGkBKmd95tFjqjgmbCjBZjCc+aO21rJlIwDUEpn3p2pH?= =?Windows-1252?Q?0FELpLJMhyeXckHItk7kf1mCviDntlvxj+51p8YlcJyeFsCBZgwfurj2?= =?Windows-1252?Q?HehZsz0OoE5uX3RPFf58b/VwgBM2ByE/YP1ZNTag15Zh/ZKwTVkAo2A9?= =?Windows-1252?Q?YCo4thbonvP6sgzs40TtQs6B4wGTcEbhhwbc1tb5L5jk53xYLkT+ejqM?= =?Windows-1252?Q?OWiGWpszypAShEMOfTBsw/0eN96BiWz8WQ2lLCfKITvIMqdST+HPLRXk?= =?Windows-1252?Q?PM90yf7i/rRfN1vhoBiEiQrtjCcWGbBWJ5efJRHgPUYgrA7Z8sbGomvh?= =?Windows-1252?Q?vJoK47PNC5SR3VgrMiA4rubahyRxOX8XAu+a916i5bm3JC/ux63svKLY?= =?Windows-1252?Q?PBuRfsTUy0ftEG2NkjxXrbgH/ji3qj2hOFXXdh+DPfcHZkaQN0e7r04y?= =?Windows-1252?Q?AoR+4ILwMQo1xsNC6taCZvpDD8G4uOeEsThP6xgnvrsJuV2sIu6KWsky?= =?Windows-1252?Q?tVU/3jh1oY?= X-Forefront-PRVS: 0325F6C77B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6049001)(39860400002)(39840400002)(39850400002)(39400400002)(39450400003)(24454002)(377454003)(377424004)(47776003)(6246003)(6666003)(93886004)(189998001)(38730400002)(229853002)(4326008)(65956001)(66066001)(65806001)(4001350100001)(7736002)(53546009)(50466002)(53936002)(83506001)(86362001)(478600001)(25786009)(305945005)(31696002)(8676002)(230700001)(81166006)(33646002)(31686004)(6486002)(6116002)(90366009)(3846002)(42186005)(966005)(54906002)(2950100002)(23746002)(5660300001)(2906002)(77096006)(50986999)(6306002)(76176999)(8666007)(54356999)(65826007)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR12MB0150; H:[10.236.136.62]; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; CY1PR12MB0150; 23:HrIKeHFD2n/aezK2+QiYUp3t+xnnN7rp6Z+py?= =?Windows-1252?Q?U94/qSS9JsZmA4uEowjk2qmp645QY74tl5Ikm7l89d08hrW+GGW7JurZ?= =?Windows-1252?Q?gjYmH2PvvlE10IwjkQBrXkA5Z3ntaoaTyYr+EGTQogzyFf7h8OLsTgqt?= =?Windows-1252?Q?oQ0Qc0bIaIFAs8Ojd9UUfmTyDUVdk6sUI7Ekgci7mQOjlKMedicGXq1Y?= =?Windows-1252?Q?sQYnL6Bhs5UGoIW4g5PW1sSMzYNAybygFlOvkPsxYEAEjnRwaCTmgkZQ?= =?Windows-1252?Q?F3deYRk1uG/NUz/RnAHT87S4c32Oh4SehdoX3X7BZr8b8Oay/g2mGI/U?= =?Windows-1252?Q?ezXziqpN7IJRW9JAe3bohl5LbGze5hRf9aY0MWUm2oCiXZ2bv79Q9os7?= =?Windows-1252?Q?Sg7NBNbP7leD1D5/oOMgEoeOagMAi9/H6Or1ldz3s5zFeLsBJGHMOdC9?= =?Windows-1252?Q?Ljt49aR1f6JJegexvZT2DsAhXqFJrRhhAGf4U82mv3vqx9TSfUyKA9KX?= =?Windows-1252?Q?lelmHmloDTH97VN0lTszCx8jSZfRriR9bea6J+DhsfrBbQP3aaAkj4ZC?= =?Windows-1252?Q?PcRvhihOa7fMEP4mZ6aah0nBosnDhuMpfaL53xcS767FOormZaLe05wI?= =?Windows-1252?Q?xi4L0yT8IoDKVWe52keOhittvLn2KjzyalHZ97ilU1/l7xIjUFkKlUMA?= =?Windows-1252?Q?gfOQH8s67LS3PBrZKvBYRFZY04e+45JRcoUR8s0i6wPPvWPTZbf84JGP?= =?Windows-1252?Q?EmOTN1OL8zV8GzJVCuFxgzE6QFSzcJCaOoafJZmTT74Iy4GV0zPmaenP?= =?Windows-1252?Q?/9uuG8xJ5iQGubdQlEmTJqv4WXf892TqPNMlQ3QN7yJE2zw0Pi0iA0GD?= =?Windows-1252?Q?VAA1hFcHvKN52PaeUIfmOGd/DT8um0N0Kky8MJZ2hXJykFyVFJ6G8jKd?= =?Windows-1252?Q?sngbqC9qWdZDy523Qj78AzulR5Om43DKr497e18b7xW3kR3lBLocRa+S?= =?Windows-1252?Q?q5EtFrDV04JkbtXE7NRbx8YJ47TFY29jUkKDYsZqh2Icchayd0aTs/bA?= =?Windows-1252?Q?Ap7MViIcZV31/lgLIajKektwS/3fiI68IrVRcIBzXvqwjjKQg2S8/lBR?= =?Windows-1252?Q?xq7g3YZofZkQavEjhJl1Y5/LoLEXkIat7+2ID7rBSUM3TBYUJnL3oTA0?= =?Windows-1252?Q?qNN9TUE2QoRuePRrg14aWw4/bPmBbcvuTLGgWao0OCpMVBZqiJvY/SW/?= =?Windows-1252?Q?jOtva/uub2V2XQiVln1KPxYk1Rgj4cNb73fwrIJbw6zz5g4O8IN2gtQG?= =?Windows-1252?Q?1eufLRIDhQVZLciqnjzqkLXo7Geazi6kVcrqUARfLAapJj5G9bqNDTr5?= =?Windows-1252?Q?5A/QU/S1YEd5xgRioeh1dOnCcVZ9qnqUbL2kMSaFCLMRzENHM7j41KVZ?= =?Windows-1252?Q?eUJHj14kYINvM59wXjeexnKRhLhFn3jmHpmxwY8KSIO+DXrk6FvSm3SJ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zURH9ZiXEfLnaSmTERkQJwyP39rqrzm/x2lbaOALXH7PX4urorTlBf7gPvjEzi9f3AC2rbZC7W4ZSGl3ZqQVJI5FbIniGbbNgulcb; 24:ql+S80RQ5ay6DGwT/uCZ9XcVdk11rejOmrzE8QSB/gBN+f1z2Zp7k8o0LXB0bamhPY3ZVj00xQGJYnSkSbvakF6opHFNuixci4MGX055zYg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0150; 7:1DIGsU4Zx82x8pWBlD/RERDPHmqOu33oHvpIvG8Ja1BMjZsZbVFHhWJLpMk21WRvLB7UIDzN5K+YVCfZar7aGIPZPF5rpIefDAs9/0fUMeFoUzBuIy7udAGToiqKwLG9bcJFk1P7JhoFDPphwJKLttPPePYwiGabNy+0trYWfxbgw/XSYGU5V+N3VnlcdHlryBkAPNFOdC20aoLGt5sWlKDrJxTgNWp5DS9swmPNhzH6a3KGhQ++/doycqyUJMOp1sRlltZjpBKtcbwfvxj72rk1jaOTCndENvSxEFB1BlkrrN2njEyEICZct3ffIsIyWFbQTqpBqPg6/gZjkD18NQ==; 20:XPQkvSP804CbOxMtVobNUEwe4rfLLqgVesYYkx27rKHzix9ZWHoSw2YKDYrMJmMe9xfHueHfWnPO0/TAoz7lsGqpYywhycOAkv8MyyavML+zrsPgm26CBLJlL2lThathdmPOFx54yrOBhZLVDiAXy2t8qe4GY7A5iDSW6kW79ZLlfQSkpkYvzyxUE5HfJ4g7Y9t/8rG2knuZk6scE3FbC7B1djow0iBMowDfuVVfWa48sV1puDLNX1oymHo/Cb4z X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jun 2017 15:01:55.1994 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR12MB0150 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: Thu, 01 Jun 2017 15:00:56 -0000 Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Hi Andrew, The goal is to clear the "C" bit in PTE for all the MMIO areas in the GCD memory space map. I think Leo looked at SetMemoryAttributes() based on Mike's feedback, but I believe SetMemoryAttribute may get called on any range without specifying types (we are interested in MMIO ranges, which are specified in ADD/REMOVE operations). -Brijesh On 06/01/2017 08:48 AM, Andrew Fish wrote: > Laszlo, > > The current design is DXE IPL and gEfiCpuArchProtocolGuid abstract the CPU specifics from the DXE Core. > > https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Core/Dxe/Gcd/Gcd.c#L866 > if (Operation == GCD_SET_ATTRIBUTES_MEMORY_OPERATION) { > // > // Call CPU Arch Protocol to attempt to set attributes on the range > // > CpuArchAttributes = ConverToCpuArchAttributes (Attributes); > if (CpuArchAttributes != INVALID_CPU_ARCH_ATTRIBUTES) { > if (gCpu == NULL) { > Status = EFI_NOT_AVAILABLE_YET; > } else { > Status = gCpu->SetMemoryAttributes ( > gCpu, > BaseAddress, > Length, > CpuArchAttributes > ); > } > if (EFI_ERROR (Status)) { > CoreFreePool (TopEntry); > CoreFreePool (BottomEntry); > goto Done; > } > } > } > > Maybe the issue is there is an attempt to change attributes too early and they currently get sent to the bit bucket? I guess they could get queued up and replayed after gEfiCpuArchProtocolGuid is preset? > > Thanks, > > Andrew Fish > > >> On Jun 1, 2017, at 2:10 AM, Laszlo Ersek > wrote: >> >> On 06/01/17 09:40, Jordan Justen wrote: >>> On 2017-05-29 14:59:46, Brijesh Singh wrote: >>>> >>>> >>>> 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. >>> >>> DxeCore doesn't build the page tables. DxeIpl builds them. I agree >>> that DxeCore is not the right place to handle this. In >>> https://lists.01.org/pipermail/edk2-devel/2017-March/008987.html >>> Jiewen suggested that DxeIpl could be updated during page table >>> creation time. >>> >>> In https://lists.01.org/pipermail/edk2-devel/2017-April/009883.html >>> Leo said that DxeIpl won't work because new I/O ranges might be added. >>> I don't understand this, because isn't DxeIpl and an early APRIORI >>> entry are roughly equivalent in the boot sequence? >> >> I think you are right. I believe a patch for this exact idea hasn't been >> posted yet. Jiewen's message that you linked above contains the expression >> >> always clear SEV mask for MMIO *and all rest* >> >> (emphasis mine), which I think we may have missed *in combination with* >> the DxeIpl. >> >> So the idea would be to iterate over all the HOBs in the DxeIpl PEIM. >> Keep the C bit set for system memory regions. Clear the C bit for MMIO >> regions that are known from the HOB list. Also clear the C bit >> everywhere else in the address space (known from the CPU HOB) where no >> coverage is provided by any memory resource descriptor HOB. >> >> This is going to be harder than the current approach, because: >> >> - The current approach can work off of the GCD memory space map, which >> provides explicit NonExistent entries, covering the entire address space >> (according to the CPU HOB). >> >> - However, the DxeIpl method would take place before entering DXE, so no >> GCD memory space map would be available -- the "NonExistent" entries >> would have to be synthesized manually from the address space size (known >> from the CPU HOB) and the lack of coverage by memory resource descriptor >> HOBs. >> >> Basically, in order to move the current GCD memory space map traversal >> from early DXE to late PEI, the memory space map building logic of the >> DXE Core would have to be duplicated in the DxeIpl PEIM. If I understand >> correctly. (The DxeIpl PEIM may already contain very similar code, for >> the page table building, which might not be difficult to extend like >> this -- I haven't looked.) >> >> Is this what you have in mind? >> >> Thanks >> Laszlo >> >>> -Jordan >>> >>>> 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 >>>> >> >> _______________________________________________ >> edk2-devel mailing list >> edk2-devel@lists.01.org >> https://lists.01.org/mailman/listinfo/edk2-devel >