From patchwork Tue Jul 10 00:01:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 941757 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41PjC247Ngz9s0W for ; Tue, 10 Jul 2018 10:05:33 +1000 (AEST) Received: from localhost ([::1]:44968 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcg9m-0003pC-Qe for incoming@patchwork.ozlabs.org; Mon, 09 Jul 2018 20:05:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36027) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcg62-00018C-Mh for qemu-devel@nongnu.org; Mon, 09 Jul 2018 20:01:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fcg5z-0001nR-LV for qemu-devel@nongnu.org; Mon, 09 Jul 2018 20:01:34 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:51376 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fcg5z-0001nK-G3 for qemu-devel@nongnu.org; Mon, 09 Jul 2018 20:01:31 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EB2DC808255B for ; Tue, 10 Jul 2018 00:01:30 +0000 (UTC) Received: from redhat.com (ovpn-120-239.rdu2.redhat.com [10.10.120.239]) by smtp.corp.redhat.com (Postfix) with SMTP id A96A016873; Tue, 10 Jul 2018 00:01:30 +0000 (UTC) Date: Tue, 10 Jul 2018 03:01:30 +0300 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <20180710000024.542612-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 10 Jul 2018 00:01:30 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 10 Jul 2018 00:01:30 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mst@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH hack dontapply v2 0/7] Dynamic _CST generation X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: imammedo@redhat.com, ehabkost@redhat.com, pbonzini@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Now that basic support for guest CPU PM is upstream, I started looking for making it migrateable. Since a VM can be migrated between different hosts, PM info needs to change each time with move the VM to a different host. This adds infrastructure - based on Load/Unload - to support exactly that: QEMU generates AML (changing it on migration) and stores it in reserved memory, OSPM loads _CST from there on demand. This is a partially functional prototype. What works: loading _CST dynamically and reporting it to OSPM What doesn't: detecting host configuration and generating correct _CST package notifying guest about the change to trigger _CST re-evaluation disabling mwait/halt exists as appropriate Michael S. Tsirkin (6): acpi: aml: add aml_register() acpi: generalize aml_package / aml_varpackage acpi: aml_load/aml_unload acpi: export acpi_checksum acpi: init header without linking acpi: aml generation for _CST pc: HACK: acpi: tie in _CST object to Processor include/hw/acpi/acpi.h | 2 + include/hw/acpi/aml-build.h | 14 ++- include/hw/acpi/cst.h | 8 ++ include/hw/i386/pc.h | 5 ++ hw/acpi/aml-build.c | 81 ++++++++++++++--- hw/acpi/core.c | 2 +- hw/acpi/cpu.c | 5 ++ hw/acpi/cpu_hotplug.c | 11 +-- hw/acpi/cst.c | 173 ++++++++++++++++++++++++++++++++++++ hw/arm/virt-acpi-build.c | 2 +- hw/i386/acpi-build.c | 10 ++- hw/acpi/Makefile.objs | 2 +- 12 files changed, 290 insertions(+), 25 deletions(-) create mode 100644 include/hw/acpi/cst.h create mode 100644 hw/acpi/cst.c