Skip to contentSkip to conversation

Add optional ACPI device for Windows Continuum

PATCH In review Owen Smith 2 participants 3 messages Jul 13, 2016 – Jul 14, 2016

lore
Share & tools
lore

Owen Smith

author
#0 lore raw

PATCH 1/1 Add optional ACPI device for Windows Continuum

Windows 10 supports a specific ACPI device for handling the switch between tablet mode and desktop mode. The meer existance of this device is the mimimum to allow tablet/desktop mode to be switched.
Tablet mode referes to the "undocked" state where all applications are forced full screen and additional touch screen elements are added, such as touch keyboard, larger icons and menus, and touch gestures for ease of use.

---
 tools/firmware/hvmloader/acpi/Makefile      |  4 ++--
 tools/firmware/hvmloader/acpi/build.c       | 11 ++++++++++
 tools/firmware/hvmloader/acpi/ssdt_conv.asl | 31 +++++++++++++++++++++++++++++
 tools/libxl/libxl_types.idl                 |  1 +
 tools/libxl/xl_cmdimpl.c                    |  1 +
 5 files changed, 46 insertions(+), 2 deletions(-)
 create mode 100644 tools/firmware/hvmloader/acpi/ssdt_conv.asl
tools/firmware/hvmloader/acpi/Makefile +2 -2
index d3e882a..d75c7af 100644
@@ -25,7 +25,7 @@ CFLAGS += $(CFLAGS_xeninclude)
 vpath iasl $(PATH)
 all: acpi.a
 
-ssdt_s3.h ssdt_s4.h ssdt_pm.h ssdt_tpm.h: %.h: %.asl iasl
+ssdt_s3.h ssdt_s4.h ssdt_conv.h ssdt_pm.h ssdt_tpm.h: %.h: %.asl iasl
 	iasl -vs -p $* -tc $<
 	sed -e 's/AmlCode/$*/g' $*.hex >$@
 	rm -f $*.hex $*.aml
@@ -56,7 +56,7 @@ iasl:
 	@echo 
 	@exit 1
 
-build.o: ssdt_s3.h ssdt_s4.h ssdt_pm.h ssdt_tpm.h
+build.o: ssdt_s3.h ssdt_s4.h ssdt_conv.h ssdt_pm.h ssdt_tpm.h
 
 acpi.a: $(OBJS)
 	$(AR) rc $@ $(OBJS)
tools/firmware/hvmloader/acpi/build.c +11 -0
index 1f7103e..6485ac8 100644
@@ -18,6 +18,7 @@
 #include "acpi2_0.h"
 #include "ssdt_s3.h"
 #include "ssdt_s4.h"
+#include "ssdt_conv.h"
 #include "ssdt_tpm.h"
 #include "ssdt_pm.h"
 #include "../config.h"
@@ -398,6 +399,16 @@ static int construct_secondary_tables(unsigned long *table_ptrs,
         printf("S4 disabled\n");
     }
 
+    if ( !strncmp(xenstore_read("platform/acpi_conv", "1"), "1", 1) )
+    {
+        ssdt = mem_alloc(sizeof(ssdt_conv), 16);
+        if (!ssdt) return -1;
+        memcpy(ssdt, ssdt_conv, sizeof(ssdt_conv));
+        table_ptrs[nr_tables++] = (unsigned long)ssdt;
+    } else {
+        printf("Conv disabled\n");
+    }
+
     /* TPM TCPA and SSDT. */
     tis_hdr = (uint16_t *)0xFED40F00;
     if ( (tis_hdr[0] == tis_signature[0]) &&
tools/firmware/hvmloader/acpi/ssdt_conv.asl new file +31 -0
new file mode 100644
index 0000000..6e20340
@@ -0,0 +1,31 @@
+/*
+ * ssdt_conv.asl
+ *
+ * Copyright (c) 2015  Citrix Systems, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; If not, see <http://www.gnu.org/licenses/>.
+ */
+
+DefinitionBlock ("SSDT_CONV.aml", "SSDT", 2, "Xen", "HVM", 0)
+{
+    Device(CONV)
+    {
+        Method(_HID, 0x0, NotSerialized)
+        {
+            Return("ID9001")
+        }
+        Name(_CID, "PNP0C60")
+    }
+}
+
tools/libxl/libxl_types.idl +1 -0
index ef614be..01c7c61 100644
@@ -502,6 +502,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
                                        ("acpi",             libxl_defbool),
                                        ("acpi_s3",          libxl_defbool),
                                        ("acpi_s4",          libxl_defbool),
+                                       ("acpi_conv",        libxl_defbool),
                                        ("nx",               libxl_defbool),
                                        ("viridian",         libxl_defbool),
                                        ("viridian_enable",  libxl_bitmap),
tools/libxl/xl_cmdimpl.c +1 -0
index d1fcfa4..2db76bf 100644
@@ -1574,6 +1574,7 @@ static void parse_config_data(const char *config_source,
         xlu_cfg_get_defbool(config, "acpi", &b_info->u.hvm.acpi, 0);
         xlu_cfg_get_defbool(config, "acpi_s3", &b_info->u.hvm.acpi_s3, 0);
         xlu_cfg_get_defbool(config, "acpi_s4", &b_info->u.hvm.acpi_s4, 0);
+        xlu_cfg_get_defbool(config, "acpi_conv", &b_info->u.hvm.acpi_conv, 0);
         xlu_cfg_get_defbool(config, "nx", &b_info->u.hvm.nx, 0);
         xlu_cfg_get_defbool(config, "hpet", &b_info->u.hvm.hpet, 0);
         xlu_cfg_get_defbool(config, "vpt_align", &b_info->u.hvm.vpt_align, 0);
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#1 lore raw
Quoted 10 lines · Owen Smith

Windows 10 supports a specific ACPI device for handling the switch between tablet mode and desktop mode. The meer existance of this device is the mimimum to allow tablet/desktop mode to be switched.
Tablet mode referes to the "undocked" state where all applications are forced full screen and additional touch screen elements are added, such as touch keyboard, larger icons and menus, and touch gestures for ease of use.

Are there any docs which can be referenced about this device?

Quoted 46 lines
---
 tools/firmware/hvmloader/acpi/Makefile      |  4 ++--
 tools/firmware/hvmloader/acpi/build.c       | 11 ++++++++++
 tools/firmware/hvmloader/acpi/ssdt_conv.asl | 31 +++++++++++++++++++++++++++++
 tools/libxl/libxl_types.idl                 |  1 +
 tools/libxl/xl_cmdimpl.c                    |  1 +
 5 files changed, 46 insertions(+), 2 deletions(-)
 create mode 100644 tools/firmware/hvmloader/acpi/ssdt_conv.asl
tools/firmware/hvmloader/acpi/Makefile +2 -2
index d3e882a..d75c7af 100644
@@ -25,7 +25,7 @@ CFLAGS += $(CFLAGS_xeninclude)
 vpath iasl $(PATH)
 all: acpi.a
 
-ssdt_s3.h ssdt_s4.h ssdt_pm.h ssdt_tpm.h: %.h: %.asl iasl
+ssdt_s3.h ssdt_s4.h ssdt_conv.h ssdt_pm.h ssdt_tpm.h: %.h: %.asl iasl
 	iasl -vs -p $* -tc $<
 	sed -e 's/AmlCode/$*/g' $*.hex >$@
 	rm -f $*.hex $*.aml
@@ -56,7 +56,7 @@ iasl:
 	@echo 
 	@exit 1
 
-build.o: ssdt_s3.h ssdt_s4.h ssdt_pm.h ssdt_tpm.h
+build.o: ssdt_s3.h ssdt_s4.h ssdt_conv.h ssdt_pm.h ssdt_tpm.h
 
 acpi.a: $(OBJS)
 	$(AR) rc $@ $(OBJS)
tools/firmware/hvmloader/acpi/build.c +1 -0
index 1f7103e..6485ac8 100644
@@ -18,6 +18,7 @@
 #include "acpi2_0.h"
 #include "ssdt_s3.h"
 #include "ssdt_s4.h"
+#include "ssdt_conv.h"
 #include "ssdt_tpm.h"
 #include "ssdt_pm.h"
 #include "../config.h"
@@ -398,6 +399,16 @@ static int construct_secondary_tables(unsigned long *table_ptrs,
         printf("S4 disabled\n");
     }

tools/firmware/hvmloader/acpi/build.c static int construct_secondary_tables(unsigned long *table_ptrs, · line 410

Quoted 10 lines
tools/firmware/hvmloader/acpi/build.c +9 -0
 
+    if ( !strncmp(xenstore_read("platform/acpi_conv", "1"), "1", 1) )
+    {
+        ssdt = mem_alloc(sizeof(ssdt_conv), 16);
+        if (!ssdt) return -1;
+        memcpy(ssdt, ssdt_conv, sizeof(ssdt_conv));
+        table_ptrs[nr_tables++] = (unsigned long)ssdt;
+    } else {
+        printf("Conv disabled\n");
+    }

I would drop this else clause. It isn't interesting in the general case, and anyone who doesn't know exactly what Conv is will be confused by it.

Quoted 10 lines
tools/firmware/hvmloader/acpi/build.c +1 -0
+
     /* TPM TCPA and SSDT. */
     tis_hdr = (uint16_t *)0xFED40F00;
     if ( (tis_hdr[0] == tis_signature[0]) &&
tools/firmware/hvmloader/acpi/ssdt_conv.asl new file +0 -0
new file mode 100644
index 0000000..6e20340

tools/firmware/hvmloader/acpi/ssdt_conv.asl line 4

Quoted 4 lines
tools/firmware/hvmloader/acpi/ssdt_conv.asl new file +4 -0
@@ -0,0 +1,31 @@
+/*
+ * ssdt_conv.asl
+ *
+ * Copyright (c) 2015  Citrix Systems, Inc.

Year.

tools/firmware/hvmloader/acpi/ssdt_conv.asl line 17

Quoted 13 lines
tools/firmware/hvmloader/acpi/ssdt_conv.asl new file +13 -0
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; If not, see <http://www.gnu.org/licenses/>.

Be aware that there is currently an ongoing effort to re-licence all the apci work as LGPL, and move the acpi/ subdirectory into being a separate standalone library.

~Andrew

Quoted 4 lines
tools/firmware/hvmloader/acpi/ssdt_conv.asl new file +4 -0
+ */
+
+DefinitionBlock ("SSDT_CONV.aml", "SSDT", 2, "Xen", "HVM", 0)
+{

tools/firmware/hvmloader/acpi/ssdt_conv.asl line 31

Quoted 10 lines
tools/firmware/hvmloader/acpi/ssdt_conv.asl new file +10 -0
+    Device(CONV)
+    {
+        Method(_HID, 0x0, NotSerialized)
+        {
+            Return("ID9001")
+        }
+        Name(_CID, "PNP0C60")
+    }
+}
+

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

author
#2 lore raw
Quoted 17 lines

-----Original Message-----
From: Andrew Cooper [mailto:[email protected]]
Sent: 14 July 2016 14:21
To: Owen Smith; [email protected]
Subject: Re: [Xen-devel] [PATCH] Add optional ACPI device for Windows Continuum

Quoted 8 lines · Owen Smith

Windows 10 supports a specific ACPI device for handling the switch between tablet mode and desktop mode. The meer existance of this device is the mimimum to allow tablet/desktop mode to be switched. Tablet mode referes to the "undocked" state where all applications are forced full screen and additional touch screen elements are added, such as touch keyboard, larger icons and menus, and touch gestures for ease of use.

Quoted 4 lines
Quoted 1 line

Are there any docs which can be referenced about this device?

I must have missed the links from the comment
https://msdn.microsoft.com/en-us/library/windows/hardware/dn917883(v=vs.85).aspx
https://msdn.microsoft.com/en-us/library/windows/hardware/dn457868(v=vs.85).aspx

Quoted 60 lines
Quoted 4 lines
---
 tools/firmware/hvmloader/acpi/Makefile      |  4 ++--
 tools/firmware/hvmloader/acpi/build.c       | 11 ++++++++++
 tools/firmware/hvmloader/acpi/ssdt_conv.asl | 31

+++++++++++++++++++++++++++++

tools/firmware/hvmloader/acpi/build.c static int construct_secondary_tables(unsigned

Quoted 41 lines
 tools/libxl/libxl_types.idl                 |  1 +
 tools/libxl/xl_cmdimpl.c                    |  1 +
 5 files changed, 46 insertions(+), 2 deletions(-)  create mode 100644

tools/firmware/hvmloader/acpi/ssdt_conv.asl

tools/firmware/hvmloader/acpi/Makefile +2 -2
index d3e882a..d75c7af 100644
@@ -25,7 +25,7 @@ CFLAGS += $(CFLAGS_xeninclude)  vpath iasl $(PATH)
 all: acpi.a
 
-ssdt_s3.h ssdt_s4.h ssdt_pm.h ssdt_tpm.h: %.h: %.asl iasl
+ssdt_s3.h ssdt_s4.h ssdt_conv.h ssdt_pm.h ssdt_tpm.h: %.h: %.asl iasl
 	iasl -vs -p $* -tc $<
 	sed -e 's/AmlCode/$*/g' $*.hex >$@
 	rm -f $*.hex $*.aml
@@ -56,7 +56,7 @@ iasl:
 	@echo
 	@exit 1
 
-build.o: ssdt_s3.h ssdt_s4.h ssdt_pm.h ssdt_tpm.h
+build.o: ssdt_s3.h ssdt_s4.h ssdt_conv.h ssdt_pm.h ssdt_tpm.h
 
 acpi.a: $(OBJS)
 	$(AR) rc $@ $(OBJS)
tools/firmware/hvmloader/acpi/build.c +1 -0
index 1f7103e..6485ac8 100644
@@ -18,6 +18,7 @@
 #include "acpi2_0.h"
 #include "ssdt_s3.h"
 #include "ssdt_s4.h"
+#include "ssdt_conv.h"
 #include "ssdt_tpm.h"
 #include "ssdt_pm.h"
 #include "../config.h"
@@ -398,6 +399,16 @@ static int construct_secondary_tables(unsigned

long *table_ptrs,

tools/firmware/hvmloader/acpi/build.c static int construct_secondary_tables(unsigned long *table_ptrs, · line 410

Quoted 12 lines
tools/firmware/hvmloader/acpi/build.c +9 -0
         printf("S4 disabled\n");
     }
 
+    if ( !strncmp(xenstore_read("platform/acpi_conv", "1"), "1", 1) )
+    {
+        ssdt = mem_alloc(sizeof(ssdt_conv), 16);
+        if (!ssdt) return -1;
+        memcpy(ssdt, ssdt_conv, sizeof(ssdt_conv));
+        table_ptrs[nr_tables++] = (unsigned long)ssdt;
+    } else {
+        printf("Conv disabled\n");
+    }
Quoted 3 lines

I would drop this else clause. It isn't interesting in the general case, and anyone who doesn't know exactly what Conv is will be confused by it.

Sure

Quoted 9 lines
Quoted 9 lines
tools/firmware/hvmloader/acpi/build.c +1 -0
+
     /* TPM TCPA and SSDT. */
     tis_hdr = (uint16_t *)0xFED40F00;
     if ( (tis_hdr[0] == tis_signature[0]) && diff --git

a/tools/firmware/hvmloader/acpi/ssdt_conv.asl
b/tools/firmware/hvmloader/acpi/ssdt_conv.asl
new file mode 100644
index 0000000..6e20340
--- /dev/null

Quoted 9 lines

tools/firmware/hvmloader/acpi/build.c line 4

Quoted 6 lines

+++ b/tools/firmware/hvmloader/acpi/ssdt_conv.asl

tools/firmware/hvmloader/acpi/build.c +4 -0
@@ -0,0 +1,31 @@
+/*
+ * ssdt_conv.asl
+ *
+ * Copyright (c) 2015  Citrix Systems, Inc.

Year.

Ok

Quoted 22 lines
Quoted 5 lines
tools/firmware/hvmloader/acpi/build.c +5 -0
+ *
+ * This program is free software; you can redistribute it and/or
+ modify
+ * it under the terms of the GNU General Public License as published
+ by

tools/firmware/hvmloader/acpi/build.c line 19

Quoted 10 lines
tools/firmware/hvmloader/acpi/build.c +10 -0
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; If not, see <http://www.gnu.org/licenses/>.

Be aware that there is currently an ongoing effort to re-licence all the apci work as LGPL, and move the acpi/ subdirectory into being a separate standalone library.

~Andrew

Quoted 13 lines

tools/firmware/hvmloader/acpi/build.c

Quoted 13 lines
tools/firmware/hvmloader/acpi/build.c +13 -0
+ */
+
+DefinitionBlock ("SSDT_CONV.aml", "SSDT", 2, "Xen", "HVM", 0) {
+    Device(CONV)
+    {
+        Method(_HID, 0x0, NotSerialized)
+        {
+            Return("ID9001")
+        }
+        Name(_CID, "PNP0C60")
+    }
+}
+

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel