From patchwork Tue Feb 6 20:30:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Kagan X-Patchwork-Id: 10204119 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 D100560327 for ; Tue, 6 Feb 2018 21:10:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B6BF228D8F for ; Tue, 6 Feb 2018 21:10:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B107B28D59; Tue, 6 Feb 2018 21:10:25 +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=-6.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5881428DA2 for ; Tue, 6 Feb 2018 21:10:09 +0000 (UTC) Received: from localhost ([::1]:34420 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ejAVF-0005oG-5D for patchwork-qemu-devel@patchwork.kernel.org; Tue, 06 Feb 2018 16:10:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44905) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej9uA-00018d-RS for qemu-devel@nongnu.org; Tue, 06 Feb 2018 15:31:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ej9u8-0003I2-2u for qemu-devel@nongnu.org; Tue, 06 Feb 2018 15:31:50 -0500 Received: from mail-eopbgr00098.outbound.protection.outlook.com ([40.107.0.98]:32000 helo=EUR02-AM5-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ej9u7-0003GM-SC for qemu-devel@nongnu.org; Tue, 06 Feb 2018 15:31:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=7Zeco3xCxjdx2pw4cRdXAXBi3YLtPvx39HDdBxl/HBI=; b=AiD0JewafHKGaDdi68A7bybzod9px6QtbNS8YdKIKnIHIa7OtQ//plZ9hU2moc0O2mjhV5Rbsk5rqX32VaX3zTKA9oPjxw1L7nHotVDqmZNEuISlKgqCYJ7rMoSucYWF1bWbYsiEF7HfZC5R6Rp5ufB1tmWTqQgfgbklAkCNgIo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=rkagan@virtuozzo.com; Received: from rkaganb.sw.ru (195.214.232.6) by VI1PR0801MB1983.eurprd08.prod.outlook.com (2603:10a6:800:8a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.464.11; Tue, 6 Feb 2018 20:31:45 +0000 From: Roman Kagan To: qemu-devel@nongnu.org Date: Tue, 6 Feb 2018 23:30:36 +0300 Message-Id: <20180206203048.11096-23-rkagan@virtuozzo.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180206203048.11096-1-rkagan@virtuozzo.com> References: <20180206203048.11096-1-rkagan@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: HE1PR0301CA0008.eurprd03.prod.outlook.com (2603:10a6:3:76::18) To VI1PR0801MB1983.eurprd08.prod.outlook.com (2603:10a6:800:8a::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 39af4b7d-baff-4e04-7a8e-08d56da0a459 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:VI1PR0801MB1983; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1983; 3:FpQFVyC4L5IvxazrM9XKhbvo8UKwKRKw6i0SCK7fL+E1ka5mnxXc4xLnbPAMydEzJ0/3iFabXhtFmkOA5kTGxZlbgw37rnKCGjKXRAej8dy6xIL0dGwKsHAKoZFXhoFs66ggnEgIVX+CApULtaux1T5UV7pQQ/eIRdZdUFV5w6e3QH/XpXDVKlwY0RRiwbyea0+96hA4PPYSlMmTphxV34yA1pZE6WnZNIzNRZY0qvtG7t3MCIHVKjQkUWAp5qmx; 25:ZHa5y3s1RUGF3zov2QU4ecwt1NHydvG03Ga/JUkXFJQfRej9v/fR8rh9ryQDHEaenuyryhsaBGKcqA5LcTOV9yfbVYKJy2SOKl5MY7N9BZ+WqNbdlq2Qesl378PyX10euqtUc9w8QU5P3vBplBbUhKwNj+g2K7QdINDsImK8nkDXJooBHxRb1atkCIu5DORe/OXOyqzzguCusLZd6Z6VXuI4mxuZ+2j8z4NW9OIIRK+6JprvWCpmPh3EGxuLJod2qhW18bHD9J93PKU2ll65BRHsfg59ihJ2ffVnClrJLFzQTOc3smthKvsh6SADSB3tCD/7VNwJlvZQsTUHM1F6IQ==; 31:2GBPVuqKnuv9cO0xOnTJRb7DFvwcdShPks0Z1g5RuTzAmJfamOkD+R+r8Pd5C7wdCnyfLmZLDzgceVtUoO6sXL8FTZ5C4B50zDxAM2Z65AS14ZgyLl0ww9Gn99T3g9Q8E+bnbsceIUlsunUr3hsp3z0lUv9j4p6JT3iIlbmXqPIryS9a2qtfIuJVQaZlQTM+4Ed+p9y7JFSzii8RnFf9MYkPq50A4INzxzKojnJpnMA= X-MS-TrafficTypeDiagnostic: VI1PR0801MB1983: X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1983; 20:fsMJvonrh9Hm6B6uj6/iHXP2DaQhEkXMaG0D7CNZHUvBeMD+Ad4ZbutOA0xQ6JN/SeUfHBIztIFaEpXCC3nh0kmccUeHbm5ZCXjkqqSTFVqVXy/UyXYIUDqNju6LTvap3klHb0cUxOikGH+Sd3XUacMxJYVWZ6rKDDu9AzhSFZMWdL2F37IC0NqeBgnlbNLHhvlp8HwYU0YktD71oG5U/x7CD4z2NsYbsb0XMb0Q47QDA/fm+R6MYAgwXP0frBb7ixLG9UisSF+1wlSfRXkADz77EVy5l+QUDtnHfh5Eg+IOAcI99xHHkRDULKnqZ+K4jkdc2dqw7BOdTI7rhvzruq9Df8Kodil4Pqi2bCLA+vgRbX4k7sRW1rQPl5r49aVjz78j6vOKmF2L5Fw4c6Oo0nE/6zFOfL+z5R/XAm9LLcM=; 4:h52WQ0E1U0C+UYIFJhwkrzaLvo14W4pon8AKh0C2WKMJiz3tPGtxql6MgKiWDWp4zjZd0Vo/2NsyGVEX7MRerC2d/UhgTpOg4CqhZreMYFQ0Jbg2zzwGGqZjYGK3oypA6RiDdlNFarsZPMAZaLkNqWsBTY+UEGwHffC+oGH577AmH08SjJWuuU4GObqtBYn08nP+Ef/MNLdOKbyEKjhQhQ3V/8waq/Rtp4MpmQtcvtkb6pq/OfILe8TUHqEvwkkpHpuHFHrlBqpvjLtyw2rl0A== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(3231101)(2400082)(944501161)(10201501046)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(6072148)(201708071742011); SRVR:VI1PR0801MB1983; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0801MB1983; X-Forefront-PRVS: 0575F81B58 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(1496009)(396003)(366004)(376002)(39380400002)(39850400004)(346002)(189003)(199004)(16586007)(53936002)(305945005)(54906003)(7736002)(3846002)(316002)(105586002)(2361001)(106356001)(2351001)(6116002)(1076002)(50226002)(8936002)(81156014)(5660300001)(8676002)(81166006)(7416002)(2950100002)(6666003)(6916009)(76176011)(86362001)(68736007)(66066001)(16526019)(47776003)(50466002)(4326008)(97736004)(26005)(6512007)(51416003)(2906002)(52116002)(386003)(6506007)(48376002)(55236004)(36756003)(53416004)(69596002)(6486002)(478600001)(186003)(25786009)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR0801MB1983; H:rkaganb.sw.ru; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0801MB1983; 23:Bt6X2lVtA1AraHoGIw3fZfXgbL4ALRPsmRgkBTg?= =?us-ascii?Q?RgU/PZuCEL89Te2Xn5CaWGya4qzRWVpZjW4eX4WEH61MQnxcbvWQvMksB3vL?= =?us-ascii?Q?s1tZLOHBDkqmPS4lEo2LhE4DXun0OiW/Pqr3agretLus6bI5Hfzv60rcshZv?= =?us-ascii?Q?iWv5qdpQ+Mq6JBkQgLRs0JeJOKJgM3+40RZmFryl4eOAf74cgj9Tq7yG1oUg?= =?us-ascii?Q?AgpBNn56ATBUdWX2MplgqCWqLub9FyIMSLwzoEMDSod66ANC42opyGCo42+H?= =?us-ascii?Q?fFyR9bmdnTnD446g4YuLqex/pn9cf4GUOj/JkjiGgl5nPVH9yCG2DhtHrXVm?= =?us-ascii?Q?Le1C3Q9PaTaadzPKiKSiFaRUvaV2lPSnTXgx+oOwrFTCU0KVza3wU7eS3A1i?= =?us-ascii?Q?P8EyHYlFZnZOdVpeNfTBrugIcCYtslHUWBhJwi5g8KxhPf16+MUkXA8LkFiw?= =?us-ascii?Q?E3WisHvQ6PekiXm2a7f186hTcdjXhK+PCG2GBRSU1ZnolybhzY19C7L3TvaW?= =?us-ascii?Q?I95v7xhjGjUdIcsx6yDd8CbmdEg0g4+bxEF49aZ2RlgP08AoTNhn0hy6iVPn?= =?us-ascii?Q?EEA6Pu1CCfZF58LfdvRo39aQhFJRbNZWuhUkh91d27hNV5wO/Z0ZrtoAk59n?= =?us-ascii?Q?3qW50JwKbJQPIh00JDjRWR65B5Q9IkVPurlC+Fq2ysXhEZ4UU0P4lp2MdnaK?= =?us-ascii?Q?FGx1ReyUnRZOylyukJRYVjL5zZbKwOORCt9iU/jN7ezohREcOuUQ9Qgr5RJs?= =?us-ascii?Q?DFGd0YkUB2uz6NBiuabXNVFsYyt+GqvnnoNS9BlPHzfsYtqC31MH4RSyu+yT?= =?us-ascii?Q?AERq2EqpYhTAHO69if5omBa1KEESmSpjkyVc8eocHJWYmPx2k3f7GJmTY6ys?= =?us-ascii?Q?vTdseVlfRFUW6frZTpv6tw3GqQEwP4pbWNvEeQnneDN9D+44e3wA4ex4wL3D?= =?us-ascii?Q?6S78x4rfVOes15+Qrs1IAOMvBJSsxCqhn3rbkQjjRfKgdao+nGUpOFHGng1V?= =?us-ascii?Q?r8+ivXI9g3Mat8Ufq54PEm7i4tkAP1c5ROAZA2FgotGnLhYXiHI7B1cyqeUi?= =?us-ascii?Q?v6RfD8y7E0d/2fGJB600X08DWx4bNlunoucLcDleTimkAtF403oSiI1qg8CV?= =?us-ascii?Q?NrReNvBqT/1s075ayfQVlQQekB9cXm+LKgtpEr9uGlUkMT4L4O0SDG49lm0v?= =?us-ascii?Q?n7pdabWCyZD6Cg0KE0+egQJhYg4QwtAjeGRUd8CrPz/cL8l1fvgdiz5RaUwX?= =?us-ascii?Q?5vkxaMeZ2PAEPbs8bISumMXL7rPwGucPY7wTsLJzti/kRVD3mUxpsBeFC4Wm?= =?us-ascii?Q?ehw=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; VI1PR0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QGmApgyVRD5DsoriSkqh6h1NDFKScbU69IimPPQI8j6AF0GiyMZBuR047ATltMOfz9AcQ8+nfL/2JP9v4quB968ZmzbQjYppo/7IQ= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2018 20:31:45.0284 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 39af4b7d-baff-4e04-7a8e-08d56da0a459 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB1983 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.0.98 Subject: [Qemu-devel] [RFC PATCH 22/34] i386: Hyper-V VMBus ACPI DSDT entry 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: Ben Warren , Konrad Rzeszutek Wilk , Krish Sadhukhan , "Marcos E. Matsunaga" , Jan Dakinevich , Vadim Rozenfeld , "Denis V. Lunev" , si-wei liu , Paolo Bonzini , Vitaly Kuznetsov , Cathy Avery Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Andrey Smetanin Guest OS uses ACPI to discover vmbus presence. Add a corresponding entry to DSDT in case vmbus has been enabled. Experimentally Windows guests were found to require this entry to include two IRQ resources, so this patch adds two semi-arbitrarily chosen ones (7 and 13). This results, in particular, in parallel port conflicting with vmbus. TODO: discover and use spare IRQs to avoid conflicts. Signed-off-by: Evgeny Yakovlev Signed-off-by: Roman Kagan --- hw/i386/acpi-build.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index ed78c4ed9f..6f8cd3eb41 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -46,6 +46,7 @@ #include "sysemu/tpm_backend.h" #include "hw/timer/mc146818rtc_regs.h" #include "sysemu/numa.h" +#include "hw/vmbus/vmbus.h" /* Supported chipsets: */ #include "hw/acpi/piix4.h" @@ -1317,6 +1318,43 @@ static Aml *build_com_device_aml(uint8_t uid) return dev; } +static Aml *build_vmbus_device_aml(void) +{ + Aml *dev; + Aml *method; + Aml *crs; + + dev = aml_device("VMBS"); + aml_append(dev, aml_name_decl("STA", aml_int(0xF))); + aml_append(dev, aml_name_decl("_HID", aml_string("VMBus"))); + aml_append(dev, aml_name_decl("_UID", aml_int(0x0))); + aml_append(dev, aml_name_decl("_DDN", aml_string("VMBUS"))); + + method = aml_method("_DIS", 0, AML_NOTSERIALIZED); + aml_append(method, aml_store(aml_and(aml_name("STA"), aml_int(0xD), NULL), + aml_name("STA"))); + aml_append(dev, method); + + method = aml_method("_PS0", 0, AML_NOTSERIALIZED); + aml_append(method, aml_store(aml_or(aml_name("STA"), aml_int(0xF), NULL), + aml_name("STA"))); + aml_append(dev, method); + + method = aml_method("_STA", 0, AML_NOTSERIALIZED); + aml_append(method, aml_store(aml_name("STA"), aml_local(0))); + aml_append(method, aml_return(aml_local(0))); + aml_append(dev, method); + + aml_append(dev, aml_name_decl("_PS3", aml_int(0x0))); + + crs = aml_resource_template(); + aml_append(crs, aml_irq_no_flags(7)); + aml_append(crs, aml_irq_no_flags(13)); + aml_append(dev, aml_name_decl("_CRS", crs)); + + return dev; +} + static void build_isa_devices_aml(Aml *table) { ISADevice *fdc = pc_find_fdc0(); @@ -1343,6 +1381,10 @@ static void build_isa_devices_aml(Aml *table) build_acpi_ipmi_devices(scope, BUS(obj)); } + if (vmbus_exists()) { + aml_append(scope, build_vmbus_device_aml()); + } + aml_append(table, scope); }