From patchwork Wed Jul 13 09:16:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Owen Smith X-Patchwork-Id: 9227279 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9741B6086B for ; Wed, 13 Jul 2016 09:19:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 872742793D for ; Wed, 13 Jul 2016 09:19:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7BD3627D85; Wed, 13 Jul 2016 09:19:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CC7F02793D for ; Wed, 13 Jul 2016 09:19:41 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bNGI1-0002FY-9f; Wed, 13 Jul 2016 09:17:09 +0000 Received: from mail6.bemta6.messagelabs.com ([85.158.143.247]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bNGHz-0002FR-Tk for xen-devel@lists.xenproject.org; Wed, 13 Jul 2016 09:17:08 +0000 Received: from [85.158.143.35] by server-1.bemta-6.messagelabs.com id C5/8A-09256-31706875; Wed, 13 Jul 2016 09:17:07 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpkkeJIrShJLcpLzFFi42JxWrohUleIvS3 c4OInHYvvWyYzOTB6HP5whSWAMYo1My8pvyKBNWPLe9WCrZoVj7q+sTQwLlPoYuTkkBDwl7h1 8yMbiM0moCExo3MxSxcjB4eIgIrE7b0GIGFmATWJ6/u7WEFsYQF7iSfr+9lBbBYBVYnGNeeZQ GxeAReJhoUzWCFGakhsapgBNlJIQEni2+IXzBA1ghInZz5hgZgpIXHwBUicA6ieW+Jvt/0ERp 5ZSKpmIalawMi0ilG9OLWoLLVI11AvqSgzPaMkNzEzR9fQwEwvN7W4ODE9NScxqVgvOT93EyM wOBiAYAfjzudOhxglOZiURHk757aGC/El5adUZiQWZ8QXleakFh9ilOHgUJLgZWJrCxcSLEpN T61Iy8wBhilMWoKDR0mE9zIrUJq3uCAxtzgzHSJ1ilGX49jcG2uZhFjy8vNSpcR5r4EUCYAUZ ZTmwY2AxcwlRlkpYV5GoKOEeApSi3IzS1DlXzGKczAqCfP+ApnCk5lXArfpFdARTEBH1Do0gx xRkoiQkmpgDLx0tUOwSTxygfpjGWFOic3pjK07yv8urVjqsJi5uEbv2htfRtXNq1wtpaue/Ol 5bdKtodPuxyb7cz/7PJ2yQ7MO7nw44/kv33MVZWL73rbUB615tULy7D9NjvmbDhzfzlpzNeHO 2p0H/591Ybje9Cbp9sofFXm1PfOEijteND8UmCR/W3KxgxJLcUaioRZzUXEiAPZ/oGKUAgAA X-Env-Sender: prvs=9959318b4=owen.smith@citrix.com X-Msg-Ref: server-9.tower-21.messagelabs.com!1468401425!23581241!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 8.77; banners=-,-,- X-VirusChecked: Checked Received: (qmail 6384 invoked from network); 13 Jul 2016 09:17:06 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-9.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 13 Jul 2016 09:17:06 -0000 X-IronPort-AV: E=Sophos;i="5.28,356,1464652800"; d="scan'208";a="365938471" From: Owen Smith To: Date: Wed, 13 Jul 2016 10:16:56 +0100 Message-ID: <1468401416-3116-1-git-send-email-owen.smith@citrix.com> X-Mailer: git-send-email 1.9.4.msysgit.1 MIME-Version: 1.0 X-DLP: MIA1 Cc: Owen Smith Subject: [Xen-devel] [PATCH] Add optional ACPI device for Windows Continuum X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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. Signed-off-by: Owen Smith --- 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 diff --git a/tools/firmware/hvmloader/acpi/Makefile b/tools/firmware/hvmloader/acpi/Makefile index d3e882a..d75c7af 100644 --- a/tools/firmware/hvmloader/acpi/Makefile +++ b/tools/firmware/hvmloader/acpi/Makefile @@ -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) diff --git a/tools/firmware/hvmloader/acpi/build.c b/tools/firmware/hvmloader/acpi/build.c index 1f7103e..6485ac8 100644 --- a/tools/firmware/hvmloader/acpi/build.c +++ b/tools/firmware/hvmloader/acpi/build.c @@ -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]) && 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 +++ b/tools/firmware/hvmloader/acpi/ssdt_conv.asl @@ -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 . + */ + +DefinitionBlock ("SSDT_CONV.aml", "SSDT", 2, "Xen", "HVM", 0) +{ + Device(CONV) + { + Method(_HID, 0x0, NotSerialized) + { + Return("ID9001") + } + Name(_CID, "PNP0C60") + } +} + diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl index ef614be..01c7c61 100644 --- a/tools/libxl/libxl_types.idl +++ b/tools/libxl/libxl_types.idl @@ -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), diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index d1fcfa4..2db76bf 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -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);