Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F01AC433E0 for ; Wed, 1 Jul 2020 11:59:43 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 19CE82067D for ; Wed, 1 Jul 2020 11:59:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="OEJeuCOk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 19CE82067D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=V7jX31DBqzDie42FK7VLHIdT+x4Df/TmbAdOHyvKJJQ=; b=OEJeuCOk2hVTL67AALwB1SRKv /rZYjNKt/gLosT5aAG7WcPGUUJ356MUCVDt60AIq7t5xeP2oz7+XfU32rJl12Gk/L/QVSNaAtJtAf o/mxQx36cIpGUM4lSZk9FT4zdiDZ3nrqmaR8pp6NvVqag3tYoTMVi5Yc5WmFoxZZ6uz8k8im8kW+O mVndN/O65brJF1pOguhgFaTBFcWeFlN5xEcR4TX1OfrO37Su2qbTBRfxQ4YJ7HKXHq06AHZkYlIvT zuaPJ/dJDsxDKi4uaVQTktCJGNp3zcdszVoByKVaaCa2e+I5J6UUTHgd/9keh9MH62OsUNd00TPpL m4heig9ow==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jqbN3-0007mo-Tp; Wed, 01 Jul 2020 11:57:45 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jqbN1-0007lc-IT for linux-arm-kernel@lists.infradead.org; Wed, 01 Jul 2020 11:57:44 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 156FA30E; Wed, 1 Jul 2020 04:57:41 -0700 (PDT) Received: from [192.168.0.14] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 968623F73C; Wed, 1 Jul 2020 04:57:40 -0700 (PDT) Subject: Re: [Question] How to testing SDEI client driver To: Gavin Shan , linux-arm-kernel@lists.infradead.org References: <8cdef8ea-e550-ccff-2041-526d6f6fcda0@redhat.com> From: James Morse Message-ID: Date: Wed, 1 Jul 2020 12:57:29 +0100 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <8cdef8ea-e550-ccff-2041-526d6f6fcda0@redhat.com> Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200701_075743_670029_1E40F0A2 X-CRM114-Status: GOOD ( 22.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Gavin, On 30/06/2020 06:17, Gavin Shan wrote: > I'm currently looking into SDEI client driver and reworking on it so that > it can provide capability/services to arm64/kvm to get it virtualized. What do you mean by virtualised? The expectation is the VMM would implement the 'firmware' side of this. 'events' are most likely to come from the VMM, and having to handshake with the kernel to work out if the event you want to inject is registered and enabled is over-complicated. Supporting it in the VMM means you can notify a different vCPU if that is appropriate, or take a different action if the event isn't registered. This was all blocked on finding a future-proof way for tools like Qemu to consume reference code from ATF. > The > primary reason is we want to use SDEI to deliver the asynchronous page fault > notification from host to guest. As an NMI?! Yuck! The SDEI handler reads memory, you'd need to stop it being re-entrant. It exits through the IRQ vector, (which is necessary for forward-progress given a synchronous RAS event, and for KVM to trigger guest-exit before the 'real' work that is offloaded to an irq handler can run), its going to be 'fun' to have any guarantee of forward-progress if this is involved with stage2. > The code of rework on SDEI client driver, including some cleanup, Cleanup is always welcome. > is almost > done. Currently, I have issues on how to test/verify the client driver. ... > Any suggestions regarding this are appreciated. > It seems that TRF (Trusted Firmware) is the only firmware with SDEI service > implemented and supported. This project calls itself TF-A. ATF is the other widely used name. (I've never seen TRF before) > If so, does it mean I need to install TRF on my bare metal machine? > I'm wandering how it can be installed and not sure if > there is any document about this. Firmware should come with the platform. You'd need to know intricate details about power management and initialising parts of the SoC to port it. ATF has a port for the fast-model/foundation model. I test this with ATF in the fast-model. > Besides, GHES seems the only user of SDEI in the linux kernel. If so, is > there a way to inject the relevant errors and how? It is, and unfortunately last time I checked, upstream ATF doesn't have the firmware-first stuff for this. Its too SoC specific. I test this by binding the fast-model's SP804 one-shot interrupt controller as an event, then plumbing that into GHES. Its more of case-study in why the bindable-irq stuff is nasty than usable error injection method. I can push the most recently rebased version of this, but you'd also need to hack-up a HEST table with GHES entries to actually get it running. But, unless you are working on EL3 firmare, or a VMM, I don't think SDEI is what you want. What problem are you trying to solve? Thanks, James _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel