From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 236C92F3608 for ; Thu, 12 Feb 2026 16:20:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770913248; cv=none; b=GRii5ScsvjptjVxOq5n8rUpbMq/Wz6471+gvxouH6McrsVT9saDGr771cS0vObXnKu542rc5vxyn8ZPVJrw5PQfucDEArXEDPsqD0y1/G4PDZzWDdhlB4HjAjgm4xU9gKfNnnQ/NtoOKmprUSscJ/MWFIYQIFg9RNi4i+rgaxPI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770913248; c=relaxed/simple; bh=9BB6hZX1iF6BsiAGlgfEBLQ+iWWBQ3NItsKk/BF1zGg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sqoBxw+u/FP/4ECweZ5MV2DqPjM5b38+vlgTWFeZrFKJI2Cguq96iBq4roRU8kj0MW0aVR2Yk6fohRBvTHAHMkLqoHscuO4IGKG17qLuZF8sCFM1+M6IqCjhcFa5arBD2gu9DnXQiWHQem3kpFo7fWq/FOSrrTBOIWdPPJTw9FE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=UHzqdh5q; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=F3vvNLvx; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="UHzqdh5q"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="F3vvNLvx" Date: Thu, 12 Feb 2026 17:20:41 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1770913243; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=a5XlrfEe6vkfD+RQCnpxpWQZ9mV4ZqVYBC7f4C/wFYg=; b=UHzqdh5qhHC2FBxvExFSecdAkTjAfd/9PfGLCINtnBtLqIjGHXeCqA9rYF5npW4AZwhQyI jOfnwZc4Vg5GrdfJQ21YLB6XSZy6f1dOJTwQEe0AWx7tsiFnDUZ6yTIZS1wGRuPkwicF+n 7bFwoKvWXX1tAjOmg2aGM2S4fbVWQtKWkdlEcKK5Zre2bdEOpQKpMibD1RNGL4xhvW1btM e5r2xUQzJdqXsFzWKYDd/Y9C7BcbOJ6Tq8Fcv8nwpYMc4CD1C4hb10qlmC0nX+uyR8kQZs qLSsza+lmOsrS10dcYgMe+jdn87S5z8RA7TMF0jH5DPwAXRiaRD7Nozmquj3hA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1770913243; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=a5XlrfEe6vkfD+RQCnpxpWQZ9mV4ZqVYBC7f4C/wFYg=; b=F3vvNLvxd8frH24xPYi9Pl8wkLfd4zhz+mdl4DqrXg3vT2M8PxQuJOyqovIvZimsRVv/WD fHHRuE37+dngQ4DQ== From: Sebastian Andrzej Siewior To: Ilias Apalodimas Cc: "Luis Claudio R. Goncalves" , linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev, Ard Biesheuvel , John Ogness , Lai Jiangshan , Tejun Heo Subject: Re: [PATCH 0/2] efi: Expose the runtime-services workqueue via sysfs Message-ID: <20260212162041.acU_rljT@linutronix.de> References: <20260205115559.1625236-1-bigeasy@linutronix.de> <20260209155528.k7RMRPVD@linutronix.de> Precedence: bulk X-Mailing-List: linux-rt-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: On 2026-02-12 09:09:51 [+0200], Ilias Apalodimas wrote: > Hi Sebastian, Hi Ilias, > Late to the party but ... glad to have you. > On Mon, 9 Feb 2026 at 17:55, Sebastian Andrzej Siewior > > What I don't know is if this is a problem, i.e. is it possible to > > interrupt the secure monitor and continue in Linux before heading back > > to the secure environment or not. > > In theory yes. In practice, at least for arm & OP-TEE, the > communication between the TEE and the secure-world app doing the > variable chekcs & authentication is via the MM protocol [0]. > IIRC that requires to run to completion. So what happens is that you > enter OP-TEE and right before the StMM is invoked (the app that > handles EFI variables) all exceptions are masked and it must run to > completion. > The period of masking does not include writing the variables to > storage. That's handled differently and is interruptible. There it RTC and variables which is the most common thing. If you can somehow outsource variable read/ write then fine but I guess you need to wait somehow to ensure the data is written. Anyway. That referenced document describes the protocol but not the implementation of how communication works. What I found is that most interfaces in the TEE world end up either in "SMCCC_1_2 hvc" or "SMCCC_1_2 smc". The smc command in terms of arguments is described in https://documentation-service.arm.com/static/5f8ea482f86e16515cdbe3c6 but it does not say if the interrupts are masked. I would assume that it transfers the execution control to the secure monitor which is then entered with disabled interrupts similar to an exception on the linux side. In that case it would mandate a workqueue kind of solution so it can be pinned to a CPU. The only exception here seems to be the amdtee driver (psp_tee_process_cmd()) which sends a command and waits for an answer. Sebastian