Re: [PATCH] misc: open-dice: add ACPI device discovery support

From: Song Guo

Date: Wed Jul 15 2026 - 08:00:37 EST


On Wed, Jul 15, 2026 at 12:07 PM Greg Kroah-Hartman
<gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
>
> On Wed, Jul 15, 2026 at 08:18:20AM +0000, Song Guo wrote:
> > OpenDICE can also used on x86 platforms for attestation, one of the
> > usecase is Android's protected VM.
> >
> > The OpenDICE device driver only supports device tree, adding ACPI
> > support so it can also be used on x86 environments easily.
> >
> > The patch is verified using crosvm, with the following ACPI table passed
> > using --acpi-table, with --file-backed-mapping for the corresponding
> > memory region.
> >
> > DefinitionBlock (
> > "opendice.aml", "SSDT", 2, "GOOGLE", "OpenDICE", 0x00000001
> > )
> > {
> > Scope (\_SB)
> > {
> > Device (DICE)
> > {
> > Name (_HID, "PRP0001")
> >
> > Name (_DSD, Package () {
> > ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
> > Package () {
> > Package () {
> > "compatible",
> > Package () { "google,open-dice" }
> > }
> > }
> > })
> >
> > Name (_CRS, ResourceTemplate () {
> > Memory32Fixed (ReadOnly, 0x9D1C3000, 0x00001000)
> > })
> > }
> > }
> > }
> >
> > Signed-off-by: Song Guo <songguo@xxxxxxxxxx>
> > ---
> > drivers/misc/open-dice.c | 51 +++++++++++++++++++++++++++++-----------
> > 1 file changed, 37 insertions(+), 14 deletions(-)
> >
> > diff --git a/drivers/misc/open-dice.c b/drivers/misc/open-dice.c
> > index 45060fb4ea27..303b35b03cb4 100644
> > --- a/drivers/misc/open-dice.c
> > +++ b/drivers/misc/open-dice.c
> > @@ -2,6 +2,7 @@
> > /*
> > * Copyright (C) 2021 - Google LLC
> > * Author: David Brazdil <dbrazdil@xxxxxxxxxx>
> > + * Author: Song Guo <songguo@xxxxxxxxxx>
> > *
> > * Driver for Open Profile for DICE.
> > *
> > @@ -19,6 +20,7 @@
> > * close(fd);
> > */
> >
> > +#include <linux/acpi.h>
> > #include <linux/io.h>
> > #include <linux/miscdevice.h>
> > #include <linux/mm.h>
> > @@ -31,7 +33,8 @@
> > struct open_dice_drvdata {
> > struct mutex lock;
> > char name[16];
> > - struct reserved_mem *rmem;
> > + phys_addr_t mem_base;
> > + resource_size_t mem_size;
>
> Shouldn't this be a 2 patch series, the first converting to use these
> two variables instead of reserved_mem, and the second adding ACPI
> support? Otherwise you are mixing the two different things here and
> it's a bit hard to follow.

Thanks for the quick comment!

After reviewing the changes, I feel it's better to have three instead
of two. To make the changes atomic, and have clearer commit messages
for each commit.

I'm splitting it into:
- check nullness of of_node
- use two variables instead of reserved_mem
- add ACPI support

I'm updating it and will send the updated changes.

>
> thanks,
>
> greg k-h

Regards,
Song