rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Using Rust on non-Rust side of kernel
@ 2025-08-23 12:12 Jarkko Sakkinen
  2025-08-23 12:22 ` Jarkko Sakkinen
  2025-08-25 12:04 ` Jonathan McDowell
  0 siblings, 2 replies; 17+ messages in thread
From: Jarkko Sakkinen @ 2025-08-23 12:12 UTC (permalink / raw)
  To: rust-for-linux; +Cc: linux-integrity

Hi

As of today can we possibly do this:

1. drivers/char/tpm (C code)
2. drivers/char/tpm/protocol (imported tpm2_protocol)

?

And then build FFI from C to Rust for building commands that we need
today etc.

There's one particular challenge where this could help: early boot code
for D-RTM (i.e., Trenchboot) as given my crate is just a thing in stack
with no deps, it could be linked also to that payload.

This would be much better integration step for TPM2 than having a
separate driver on Rust side. We could start with tpm2-cmd1/cmd2, then
move on to tpm2-space.c i.e. get all structural processing inside Rust.

tpm2_protocol is light on definitions and should not need any kernel
specific Rust shenanigans.

Consider it as value like integer but just a bit more complex internaal
represention but in the end it is just a value on stack.

My goal with tpm2_protocol is to have ACPICA alike model of imports as
the crate is driven by TCG spec updates and it is very likely to be
also used by TPM-RS (also via import style process).

BR, Jarkko


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2025-08-26  9:13 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-23 12:12 Using Rust on non-Rust side of kernel Jarkko Sakkinen
2025-08-23 12:22 ` Jarkko Sakkinen
     [not found]   ` <BE42A51A-60C4-4E79-8459-CADEAB8DC3BA@collabora.com>
2025-08-23 23:06     ` Jarkko Sakkinen
2025-08-23 23:12       ` Jarkko Sakkinen
2025-08-24  1:12         ` Daniel Almeida
2025-08-24  7:15           ` Jarkko Sakkinen
2025-08-24  9:21             ` Jarkko Sakkinen
2025-08-23 23:41     ` Jarkko Sakkinen
2025-08-23 23:50       ` Jarkko Sakkinen
2025-08-25 12:04 ` Jonathan McDowell
2025-08-25 19:30   ` Jarkko Sakkinen
2025-08-25 19:42     ` Jarkko Sakkinen
2025-08-25 22:29       ` Jarkko Sakkinen
2025-08-25 23:23         ` Jarkko Sakkinen
2025-08-26  8:35     ` Jonathan McDowell
2025-08-26  8:56       ` Jarkko Sakkinen
2025-08-26  9:13         ` Jarkko Sakkinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).