Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755283AbdC1NY4 (ORCPT ); Tue, 28 Mar 2017 09:24:56 -0400 Received: from mail-eopbgr20045.outbound.protection.outlook.com ([40.107.2.45]:34246 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755044AbdC1NYv (ORCPT ); Tue, 28 Mar 2017 09:24:51 -0400 Authentication-Results: linaro.org; dkim=none (message not signed) header.d=none;linaro.org; dmarc=none action=none header.from=arm.com; Date: Tue, 28 Mar 2017 14:24:55 +0100 From: Achin Gupta To: Christoffer Dall CC: James Morse , gengdongjiu , , Marc Zyngier , , , , , , , , , , , , , , , , , Subject: Re: [PATCH] kvm: pass the virtual SEI syndrome to guest OS Message-ID: <20170328132455.GK23682@e104320-lin> References: <22fb583f-a33e-15f8-a059-fb112b27dd4f@arm.com> <58CFF058.8020205@arm.com> <76795e20-2f20-1e54-cfa5-7444f28b18ee@huawei.com> <20170321113428.GC15920@cbox> <58D17AF0.2010802@arm.com> <20170321193933.GB31111@cbox> <58DA3F68.6090901@arm.com> <20170328112328.GA31156@cbox> <20170328115413.GJ23682@e104320-lin> <20170328122229.GA31789@cbox> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20170328122229.GA31789@cbox> User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [217.140.96.140] X-ClientProxiedBy: AM5PR04CA0009.eurprd04.prod.outlook.com (10.167.167.150) To AM4PR08MB1076.eurprd08.prod.outlook.com (10.167.91.142) X-MS-Office365-Filtering-Correlation-Id: 7ab45116-dbe8-4138-d1a7-08d475ddc241 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(48565401081)(201703131423061)(201703031133067);SRVR:AM4PR08MB1076; X-Microsoft-Exchange-Diagnostics: 1;AM4PR08MB1076;3:5tCHBbSi/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5nkLsHxUgmwsIIEk=;20:FR0irIsEX9re1Vnmd2UmLY2TZuCYH9jfd7PB6TzJMkOnyrGVtQD9LE2LD9PhW2904kkcsaC4uNcK6JPdpzVgNUOodz7nRwsVc466cDbcd7me+KrrGTDPmN7wlW56GIUkE6RswsaAJ/5Lo2PiU1k95uR6hMTx06+8mzWFBInKqlI= NoDisclaimer: True X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(20558992708506)(211171220733660); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040436)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6041248)(20161123555025)(201703131423060)(201702281528061)(201703061421060)(201703061406060)(20161123558025)(20161123560025)(20161123564025)(20161123562025)(6072148);SRVR:AM4PR08MB1076;BCL:0;PCL:0;RULEID:;SRVR:AM4PR08MB1076; X-Microsoft-Exchange-Diagnostics: 1;AM4PR08MB1076;4:g+lYKv+NM6m3SsqrFwbdf6vEut9XHtQDAmuxz204XOxDER99FTxqAx3rFFRWxZQ2+6j8fa7vslg553JmkCG/WBvErdX7iF6K96W42WREGp6Pf0sWRCJeGSu31IRYRpO6fFJpY5LF3MPftuXqzsbIUTh7yV1RTxDblKtlo8aSLK1e4KyMhVWwOpf/iqLEjbrsrnt5//I5823GswSBcnBy9kZ30gmugcGuaO+9dFG+Rqlj1vvMX58EkO1UQN8qg7eAQmh8mO1zblW1NFVx424zstUTek/cN2sCXMpiLoK+N6Dyy5o0JjbM20p2TO35FiOO7Rx5B6Bx8gxN8UChyUZBTzN1SL85/Q/W5Yx4zGhmTisUyVQy0+o8XxCKQusbMQRUz8fysx11yrLZu1YoM61UrmLgufVXWNOhZEwdiWLms0ECIKuafGau+yMOaCj3jIpbvhY2Ti3WhZ+ZOgSyvIhpNwXOI6k1fF+RvZk7teeywNeQCssTDWCmnK93vmQ9b3ZMPqmftAxBdDwEM355jZYljb3IT9CF4M+sBLTd0z2Qhf1whYjvME7xl5/gXvXQvTHHBUHcSzAMJ+nl1M4DW72AZ6CW3ATEYr0cGdoPUaWFu32nP56QpdxJ72ZPVwVfd1Xi/HuU/dw3DrWfCfdz93+es30kRJIepGEsTbST+tjZ43idCgOCQ/zPwBpXAs13f5FJj3ZYOQGaxJaH4351sN9OLEmSkGwr27oe0AFM5FSMtS0O3UYgIeRbc5TsTEZlmmLnfG6pQywTmlThv+Q8nJCF6EpIxqxPPRWTXYECvI7JB8CylQKwKKHOoFn0K4akjAFuw0GKMgSk+aqHayrOt/YPSA== X-Forefront-PRVS: 0260457E99 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(39400400002)(39410400002)(39860400002)(39850400002)(39840400002)(39450400003)(51914003)(24454002)(6916009)(7416002)(81166006)(2950100002)(38730400002)(50466002)(25786009)(66066001)(50986999)(4326008)(54356999)(76176999)(42186005)(6496005)(110136004)(189998001)(6246003)(97756001)(5660300001)(47776003)(4001350100001)(8676002)(53546009)(33656002)(83506001)(46406003)(2906002)(9686003)(86362001)(1076002)(55016002)(305945005)(23726003)(53936002)(6666003)(33716001)(229853002)(54906002)(3846002)(6116002)(7736002)(18370500001)(107986001);DIR:OUT;SFP:1101;SCL:1;SRVR:AM4PR08MB1076;H:e104320-lin;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;AM4PR08MB1076;23:YJRyM9AuiVl/Ok1AQv/FQt8sxf35Ivxs7jIC91TPZ?= =?us-ascii?Q?dZt8UqNAxA2pJrZvO+paWWAZ0XdvsIPeMwDf/eXgK6262tks3YUwlM5ax05V?= =?us-ascii?Q?JpifMUDNZ7Q3U9yyaC7+CNJUjb236ExcC4GDav0o+mSBl6NgbGRxgfCOzraM?= =?us-ascii?Q?u9JQESOLXdIN5ws+I0krnYRPdjNmq6GJcs3/mUmGS5le0bHFaCM6cVgBqvzf?= =?us-ascii?Q?gKrJkzVix6QeZ3qpjx3mP3ng1dbBrgiRJG8cOllsFQ+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EjWFKDYQg1J9f2SDs517GQm6EiNfjU7Pqc?= =?us-ascii?Q?R7gTs2CM6edeMsUoCwN3G9Wfduv5WKG/LJ3nATXmfzWNP+666H4SnGdqKvPl?= =?us-ascii?Q?sgM1oHLAeRt9qZ8xfTKjL4DYyD91XdnYLuAbNu2J0T5W1qW1plA+hufUJsoo?= =?us-ascii?Q?FFj5g/eIJLMOQ9TnmPWSAU=3D?= X-Microsoft-Exchange-Diagnostics: 1;AM4PR08MB1076;6:hzKqHgiJ214Z+aDVpPMW8tRoeJOp1oRxxGajTY4vtVoFLBChJ3xu7LWKR+3Lsq7gYmy6JkdemZqkcHTHl4A0gJs1nDK9GGUVVrZHRXxmCCOlgobQnWo/tUBOuUDwABf9xsqrIQtV0jvosgpk6PcXwH2TrzKG5ZrF7HV3q0u8e/zN8W/q5sOkTlb2S7biMTeT2UWWxU49GB6DCtIC24igiAdABmJ6yc8aBgFUASIHqt2Na+tpPo8UJ+biuoc29iK/p0yUIKxsjsgckLR4KKvkbxHSL5ZB70L3MEakkbF993Uv+J4jdKCCvTNNFEJ6UQndPhz9i+y1gLuVs2CPskX98A/ZpCIj6LPwguiFJwCw0ll2T71ZxgjpqnWq7K1uTHMYNUq08flf0J12xcycd4H9oxw2iGLNNh6DJVQzzRfRouQ=;5:XLR0Bus49OoFRKrlXKfTRc8qxxnNu5UExBZPSxLznNfYM4WvcBLH4GuCLKI5L4x0kDqHlunr2ySEykWS32KrjNKwqTBwP57hkfyTMlgwKb+Z67FXR4nGlsr3JNqwnkSyfqheYowKQUdvOUIvqUrgyA==;24:cFeYhNA9aZH9LZNs+R4kL2IyrHkm2TCXgSKzICcRoR0e/mg3iW9B5EtF7nnZjxkIa/BGP9HW8Bs0yyNMA71TghtGAEZei6VoacOII4j12C0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;AM4PR08MB1076;7:pwtG45Qwin/x+jKVGu4wbwjz7XL6Dq9MWsyioyFn0XrKnpv/S9TIIaSCm8cMe6aHRiIA80BbHlveHQaQhMV3j3v8kvG3KChBlicrGpBRBz9YbEBsQLzFGdt6ekh2kNvQdUv5fev/qzT9WLKqgX9qAA+k5lH7INCSKsOkvUv20bJ4MZ0+TABDu1E2cfHunxom3eZab/+ln5o7h/gBiW20QduPkZGkfS+W/uClaKn/dJNM5ZkFBpUM7biyNahnn4vA1E5sfLdpeHpU5Chepv0dh2gny5SmF8z41lsGO6ny9Tc4YN0CcsQh4cIF8Tli8ShHV+d8rynvvh23MMl5d5gIeg== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Mar 2017 13:24:26.7423 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR08MB1076 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4406 Lines: 92 On Tue, Mar 28, 2017 at 02:22:29PM +0200, Christoffer Dall wrote: > On Tue, Mar 28, 2017 at 12:54:13PM +0100, Achin Gupta wrote: > > On Tue, Mar 28, 2017 at 01:23:28PM +0200, Christoffer Dall wrote: > > > On Tue, Mar 28, 2017 at 11:48:08AM +0100, James Morse wrote: > > > > Hi Christoffer, > > > > > > > > (CC: Leif and Achin who know more about how UEFI fits into this picture) > > > > > > > > On 21/03/17 19:39, Christoffer Dall wrote: > > > > > On Tue, Mar 21, 2017 at 07:11:44PM +0000, James Morse wrote: > > > > >> On 21/03/17 11:34, Christoffer Dall wrote: > > > > >>> On Tue, Mar 21, 2017 at 02:32:29PM +0800, gengdongjiu wrote: > > > > >>>> On 2017/3/20 23:08, James Morse wrote: > > > > >>>>>>>> On 20/03/17 07:55, Dongjiu Geng wrote: > > > > >>>>>>>>> In the RAS implementation, hardware pass the virtual SEI > > > > >>>>>>>>> syndrome information through the VSESR_EL2, so set the virtual > > > > >>>>>>>>> SEI syndrome using physical SEI syndrome el2_elr to pass to > > > > >>>>>>>>> the guest OS > > > > >>>>> > > > > >>>>> How does this work with firmware first? > > > > >>>> > > > > >>>> I explained it in previous mail about the work flow. > > > > >>> > > > > >>> When delivering and reporting SEIs to the VM, should this happen > > > > >>> directly to the OS running in the VM, or to the guest firmware (e.g. > > > > >>> UEFI) running in the VM as well? > > > > >> > > > > >> 'firmware first' is the ACPI specs name for x86's BIOS or management-mode > > > > >> handling the error. On arm64 we have multiple things called firmware, so the > > > > >> name might be more confusing than helpful. > > > > >> > > > > >> As far as I understand it, firmware here refers to the secure-world and EL3. > > > > >> Something like ATF can use SCR_EL3.EA to claim SErrors and external aborts, > > > > >> routing them to EL3 where secure platform specific firmware generates CPER records. > > > > >> For a guest, Qemu takes the role of this EL3-firmware. > > > > +1 > > > > > > >> > > > > > Thanks for the clarification. So UEFI in the VM would not be involved > > > > > in this at all? > > > > > > > > On the host, part of UEFI is involved to generate the CPER records. > > > > In a guest?, I don't know. > > > > Qemu could generate the records, or drive some other component to do it. > > > > > > I think I am beginning to understand this a bit. Since the guet UEFI > > > instance is specifically built for the machine it runs on, QEMU's virt > > > machine in this case, they could simply agree (by some contract) to > > > place the records at some specific location in memory, and if the guest > > > kernel asks its guest UEFI for that location, things should just work by > > > having logic in QEMU to process error reports and populate guest memory. > > > > > > Is this how others see the world too? > > > > I think so! > > > > AFAIU, the memory where CPERs will reside should be specified in a GHES entry in > > the HEST. Is this not the case with a guest kernel i.e. the guest UEFI creates a > > HEST for the guest Kernel? > > > > If so, then the question is how the guest UEFI finds out where QEMU (acting as > > EL3 firmware) will populate the CPERs. This could either be a contract between > > the two or a guest DXE driver uses the MM_COMMUNICATE call (see [1]) to ask QEMU > > where the memory is. > > > > This is the way I expect it to work at the EL3/EL2 boundary. So I am > > extrapolating it to the guest/hypervisor boundary. Do shout if I am missing > > anything. > > No that sounds like a resonable comparison. > > I'm not entirely sure what a HEST or GHES is, but I think the only place > where I'm still not clear is if when the guest kernel is notified of > errors does it (a) just traverse memory by following some pointers > (which it may have pre-loaded at boot from UEFI), or (b) run UEFI code > which can call into QEMU and generate error records on demand? So HEST is the ACPI Harware Error Source Table. It has entries in it for Generic HW Error Sources (GHES) amongst other types of error sources (x86 MCE etc). Each Error source specifies an address where the address of the CPER created by firmware will be populated. OS upon receipt of an error reads the CPERs to find the error source. It uses the addresses specified in the GHES entries of the HEST. This is closer to (a) above. HEST has the pointers preloaded at boot by UEFI. hth, Achin > > Thanks, > -Christoffer