From mboxrd@z Thu Jan 1 00:00:00 1970 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.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,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 51E94C76191 for ; Mon, 15 Jul 2019 14:44:57 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 2A89320861 for ; Mon, 15 Jul 2019 14:44:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="lJdwUfpY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2A89320861 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+infradead-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=bombadil.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:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UTShwk7vSoWilIQcw6atI6xThfOdCjSQ7Nstzu/rDC4=; b=lJdwUfpYTX6/xh OiXq+LM0ZbGkjYJE5qWqIEj1hINWzTuXfJtxnN0o9HpJreRJXRq6VB5S1msUAO47eIFcW0FnNLV9R DZpGNdbM537BuUcScXVMAx+3Ehb1TeZOvTkxV8EVcqtekrHNGDVt2SwZMWVrjSuan7Pu5iSvj/+0P LDNxJ+BewKb3rxaMX6KpOY0gfJG6DU9mRhEzA0GVhGXP/k3PToGDOPhy+ztD0k1lvKxB/3dwk6E5+ PReicypL/0/rxhWJ0aYHnX8cmrQoRzZVIiISZHfceKKOsy/huOvT+u5WUf9NLdopGO4po0PESFSnF kK6/oeSlK+SyU1+QZ7Og==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hn2Dl-0001BA-90; Mon, 15 Jul 2019 14:44:53 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hn2Di-0001AG-Lh for linux-arm-kernel@lists.infradead.org; Mon, 15 Jul 2019 14:44:52 +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 90D3C28; Mon, 15 Jul 2019 07:44:49 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 714D23F59C; Mon, 15 Jul 2019 07:44:48 -0700 (PDT) Date: Mon, 15 Jul 2019 15:44:46 +0100 From: Mark Rutland To: James Morse Subject: Re: [RFC] Add virtual SDEI support in qemu Message-ID: <20190715144446.GK56232@lakrids.cambridge.arm.com> References: <1b0aa6b2-80b1-a72e-6849-7323c3b9c6bc@huawei.com> <20190715134059.GJ2790@e103592.cambridge.arm.com> <20190715134848.GI56232@lakrids.cambridge.arm.com> <4daefb19-6c15-f82c-31e9-1ae035d45bd5@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4daefb19-6c15-f82c-31e9-1ae035d45bd5@arm.com> User-Agent: Mutt/1.11.1+11 (2f07cb52) (2018-12-01) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190715_074450_762619_CCEB692C X-CRM114-Status: GOOD ( 20.44 ) 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: Marc Zyngier , qemu-devel@nongnu.org, Dave Martin , qemu-arm@nongnu.org, Guoheyi , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jul 15, 2019 at 03:26:39PM +0100, James Morse wrote: > On 15/07/2019 14:48, Mark Rutland wrote: > > On Mon, Jul 15, 2019 at 02:41:00PM +0100, Dave Martin wrote: > >> One option (suggested to me by James Morse) would be to allow userspace > >> to disable in the in-kernel PSCI implementation and provide its own > >> PSCI to the guest via SMC -- in which case userspace that wants to > >> implement SDEI would have to implement PSCI as well. > > > > I think this would be the best approach, since it puts userspace in > > charge of everything. > > > > However, this interacts poorly with FW-based mitigations that we > > implement in hyp. I suspect we'd probably need a mechanism to delegate > > that responsibility back to the kernel, and figure out if that has any > > interaction with thigns that got punted to userspace... > > This has come up before: > https://lore.kernel.org/r/59C139D0.3040507@arm.com > > I agree Qemu should opt-in to this, it needs to be a feature that is enabled. > > I had an early version of something like this for testing SDEI before > there was firmware available. The review feedback from Christoffer was > that it should include HVC and SMC, their immediates, and shouldn't be > tied to SMC-CC ranges. > > I think this should be a catch-all as Heyi describes to deliver > 'unhandled SMC/HVC' to user-space as hypercall exits. We should > include the immediate in the struct. > > We can allow Qemu to disable the in-kernel PSCI implementation, which > would let it be done in user-space via this catch-all mechanism. (PSCI > in user-space has come up on another thread recently). The in-kernel > PSCI needs to be default-on for backwards compatibility. > > As Mark points out, the piece that's left is the 'arch workaround' > stuff. We always need to handle these in the kernel. I don't think > these should be routed-back, they should be un-obtainable by > user-space. Sure; I meant that those should be handled in the kernel rather than going to host userspace and back. I was suggesting was that userspace would opt into taking ownership of all HVC calls, then explicitly opt-in to the kernel handling specific (sets of) calls. There are probably issues with that, but I suspect defining "all undandled calls" will be problematic otherwise. Thanks, Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel