From nobody Sat May 18 22:31:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1588169130; cv=none; d=zohomail.com; s=zohoarc; b=LBGJAWEzpzI3v7aLHkmCdFD4UgPaaW9ppj7KFFAvCEIWfKoi1kdiqVz7mxhbn+JVtDygv02YEYiHd7tfNzzvszEZEW/q/fs9K80pLPS5/p0v5wI8JJdobSGntvHlhh05dgFQR8YNO6qscmAz+NYhdOUNqnqbKsJdq9cWK1Ryfmk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588169130; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=kIA+ZY/aP5q6VvWDCeDsaYYp8cEiw2KsP3HhLwBiwSw=; b=eZBec2YhsPeeSaxmUmiCtCd+R1/q5WJk/O2Jg5i541pRg3/2EPw31+sI8TzuS1zyKZjbMFlyVOTQJL8JDhQtFuEIYJa9kNemM0+emHMe5llfPS/QpUCGapyNVpvZwm3s2f5OyvaQU9m1hfyf7Ooyih/Z0AbogHiH0DC8ZxkTTj8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588169130503933.8157169901376; Wed, 29 Apr 2020 07:05:30 -0700 (PDT) Received: from localhost ([::1]:42622 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTnL6-0008SK-Tg for importer@patchew.org; Wed, 29 Apr 2020 10:05:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42420) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTnGc-0002GE-SG for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:01:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jTnGA-0003rt-Tu for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:00:50 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:20564 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jTnGA-0003q9-Al for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:00:22 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-453-NoZAwNugMJWCa5KprF-WFg-1; Wed, 29 Apr 2020 10:00:17 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 49112100A61F; Wed, 29 Apr 2020 14:00:16 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-193.ams2.redhat.com [10.36.113.193]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2D7405C221; Wed, 29 Apr 2020 14:00:04 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 280F09D99; Wed, 29 Apr 2020 16:00:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588168821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kIA+ZY/aP5q6VvWDCeDsaYYp8cEiw2KsP3HhLwBiwSw=; b=AhUBFYgXYdfxkgb01j7uyQ64XlEIQb2vhosKTflcWEYuzbSir2tW0mlJYpan+jBGzvg22U DfJ0djLEZbn70syVzg2n5zwhQ1QuLz/MPEIWvYrG50z4l2wuBT51g1itg0+1OWBZUSjhFL VzPRX7ctaDFXBv+XgNjj9KKT1VNnbiA= X-MC-Unique: NoZAwNugMJWCa5KprF-WFg-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v3 01/15] move 'typedef Aml' to qemu/types.h Date: Wed, 29 Apr 2020 15:59:49 +0200 Message-Id: <20200429140003.7336-2-kraxel@redhat.com> In-Reply-To: <20200429140003.7336-1-kraxel@redhat.com> References: <20200429140003.7336-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.120; envelope-from=kraxel@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/29 01:18:10 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Laurent Vivier , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, "Michael S. Tsirkin" , Max Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , Paolo Bonzini , Igor Mammedov , John Snow , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann Reviewed-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/acpi/aml-build.h | 1 - include/qemu/typedefs.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h index 0f4ed53d7fbf..1539fe066714 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -33,7 +33,6 @@ struct Aml { uint8_t op; AmlBlockFlags block_flags; }; -typedef struct Aml Aml; =20 typedef enum { AML_COMPATIBILITY =3D 0, diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index 375770a80f06..ecf3cde26c3c 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -24,6 +24,7 @@ typedef struct AdapterInfo AdapterInfo; typedef struct AddressSpace AddressSpace; typedef struct AioContext AioContext; +typedef struct Aml Aml; typedef struct AnnounceTimer AnnounceTimer; typedef struct BdrvDirtyBitmap BdrvDirtyBitmap; typedef struct BdrvDirtyBitmapIter BdrvDirtyBitmapIter; --=20 2.18.2 From nobody Sat May 18 22:31:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1588169729; cv=none; d=zohomail.com; s=zohoarc; b=VttOTYndwG3jVK8vunN3oKVRMqFyylLjcd4aYocYrUF92JHnzVGasbA+8EioZ5m6aRVF7n/Gx4QSlOib6+QmyCYTrepwvVBaxpVXIwz340gbj9iTjPjHY3XlbBhzUpKNVqRhEBYiZVFcxjOZtaDOnM2V+SHhBeFVg4+uWzXNVtQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588169729; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=I5eleDN6DsLA6DYusavg7UDhHoUtm8pXBb0dPnybbnM=; b=iVDL0HWGsf+afv9/BSQbmW/DGMv9v1X8ylpUNMUinJ3gBd0LCV5ZQrPrKhq1RH71ARKK+/wQn5sDDqr9iDdcmW1A9EkuYiA7JrNIj+2z4e1tN/0sECSHCJZI9dNxN8S0W1vOOUilRkf/HOuV2DqgIb+95gE8oHEWk5GrwjJyWCE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588169729630138.38759017314817; Wed, 29 Apr 2020 07:15:29 -0700 (PDT) Received: from localhost ([::1]:55612 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTnUm-0002fL-3I for importer@patchew.org; Wed, 29 Apr 2020 10:15:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42544) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTnGp-0002Ov-Po for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:01:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jTnGL-00043f-QR for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:01:03 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:50077 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jTnGL-00043S-CK for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:00:33 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-107-18swSLtDOVOBHjqFohHjtA-1; Wed, 29 Apr 2020 10:00:20 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ECD128BEE85; Wed, 29 Apr 2020 14:00:18 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-193.ams2.redhat.com [10.36.113.193]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1B36F66070; Wed, 29 Apr 2020 14:00:04 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 325759D9B; Wed, 29 Apr 2020 16:00:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588168832; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=I5eleDN6DsLA6DYusavg7UDhHoUtm8pXBb0dPnybbnM=; b=J9PvuYpiwI6hup18z69b2i4Bm0cZ/NaXMw5Brvv3nMGYbBOtUdSTkgS/MgkBEQ/COpi5Ii 6J35VegP5nUKcLCiagofzrIXAI6b/YYgpWfNkL/4I4aDVplua8LkynVbe//e/7XT6HblMJ CBgS/r+Gl2thRH7BTgv2xbq5pmUrV6o= X-MC-Unique: 18swSLtDOVOBHjqFohHjtA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v3 02/15] acpi: add aml builder stubs Date: Wed, 29 Apr 2020 15:59:50 +0200 Message-Id: <20200429140003.7336-3-kraxel@redhat.com> In-Reply-To: <20200429140003.7336-1-kraxel@redhat.com> References: <20200429140003.7336-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.120; envelope-from=kraxel@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/29 01:18:10 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Laurent Vivier , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, "Michael S. Tsirkin" , Max Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , Paolo Bonzini , Igor Mammedov , John Snow , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Needed when moving aml builder code to devices. Signed-off-by: Gerd Hoffmann Reviewed-by: Igor Mammedov --- hw/acpi/aml-build-stub.c | 79 ++++++++++++++++++++++++++++++++++++++++ hw/acpi/Makefile.objs | 4 +- 2 files changed, 81 insertions(+), 2 deletions(-) create mode 100644 hw/acpi/aml-build-stub.c diff --git a/hw/acpi/aml-build-stub.c b/hw/acpi/aml-build-stub.c new file mode 100644 index 000000000000..58b2e162277f --- /dev/null +++ b/hw/acpi/aml-build-stub.c @@ -0,0 +1,79 @@ +/* + * ACPI aml builder stubs for platforms that don't support ACPI. + * + * Copyright (c) 2006 Fabrice Bellard + * Copyright (c) 2016 Red Hat, 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 . + */ + +#include "qemu/osdep.h" +#include "hw/acpi/acpi.h" +#include "hw/acpi/aml-build.h" + +void aml_append(Aml *parent_ctx, Aml *child) +{ +} + +Aml *aml_resource_template(void) +{ + return NULL; +} + +Aml *aml_device(const char *name_format, ...) +{ + return NULL; +} + +Aml *aml_eisaid(const char *str) +{ + return NULL; +} + +Aml *aml_name_decl(const char *name, Aml *val) +{ + return NULL; +} + +Aml *aml_io(AmlIODecode dec, uint16_t min_base, uint16_t max_base, + uint8_t aln, uint8_t len) +{ + return NULL; +} + +Aml *aml_irq_no_flags(uint8_t irq) +{ + return NULL; +} + +Aml *aml_int(const uint64_t val) +{ + return NULL; +} + +Aml *aml_package(uint8_t num_elements) +{ + return NULL; +} + +Aml *aml_dma(AmlDmaType typ, AmlDmaBusMaster bm, AmlTransferSize sz, + uint8_t channel) +{ + return NULL; +} + +Aml *aml_buffer(int buffer_size, uint8_t *byte_list) +{ + return NULL; +} diff --git a/hw/acpi/Makefile.objs b/hw/acpi/Makefile.objs index 777da07f4d70..cab9bcd457dc 100644 --- a/hw/acpi/Makefile.objs +++ b/hw/acpi/Makefile.objs @@ -20,6 +20,6 @@ common-obj-$(CONFIG_TPM) +=3D tpm.o common-obj-$(CONFIG_IPMI) +=3D ipmi.o common-obj-$(call lnot,$(CONFIG_IPMI)) +=3D ipmi-stub.o else -common-obj-y +=3D acpi-stub.o +common-obj-y +=3D acpi-stub.o aml-build-stub.o endif -common-obj-$(CONFIG_ALL) +=3D acpi-stub.o acpi-x86-stub.o ipmi-stub.o +common-obj-$(CONFIG_ALL) +=3D acpi-stub.o aml-build-stub.o acpi-x86-stub.o= ipmi-stub.o --=20 2.18.2 From nobody Sat May 18 22:31:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1588168974; cv=none; d=zohomail.com; s=zohoarc; b=OvaCk8BxbixN81F2APIiSFtqshqIh3k76NEaDhCfebqwADsRP8Rzw4pse2B6DM3IeGtQz5n5r/O9zDdhgEqxoBv+nWp5be7BtMW9/b9X4/wG/AgmJuC9E4XZFmp0YwTtRjtw+wRencskUVaCvVq5ua/qd0bDcqo6Zw1YAK+Tcwo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588168974; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=ggAitEfjJSZNRmgzJyL2JoXtjIZk8FTzPtWDlEwYa+0=; b=DLM/1TaUHXfFbLDa/ngKDr+KDdpT7AiDC7NA0uWseAiXoJSIKo3SRVO+ckZ7Yz7uZkYW5P9aPHTkHIu4jLT7ovooXawsCaIJpI+Oo5pNmMcRvo7QUPATmyiBTKckKJ4EeaeGALaTl+783dpp8ewFBJWiJKvHbc9BEZ1YOE4jRAM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588168974474842.093185460879; Wed, 29 Apr 2020 07:02:54 -0700 (PDT) Received: from localhost ([::1]:33630 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTnIa-0004Vo-5J for importer@patchew.org; Wed, 29 Apr 2020 10:02:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42354) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTnGR-0002DM-ST for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:01:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jTnG8-0003lk-GQ for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:00:39 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:47277 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jTnG7-0003f3-Sj for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:00:20 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-144-FEq59uSfNRePfuGgC4Oggg-1; Wed, 29 Apr 2020 10:00:16 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6FB0219067E0; Wed, 29 Apr 2020 14:00:15 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-193.ams2.redhat.com [10.36.113.193]) by smtp.corp.redhat.com (Postfix) with ESMTP id 154AF5D9C9; Wed, 29 Apr 2020 14:00:04 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 3AFC59D9C; Wed, 29 Apr 2020 16:00:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588168818; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ggAitEfjJSZNRmgzJyL2JoXtjIZk8FTzPtWDlEwYa+0=; b=LEeDXgWhmsB8h5RyPuxmRGwY33b2+Ze//xWw8szul/QtNwOrUe37wEhVHG7SMGaumhvANu EYdnV7R9PsYm/6845E/HvVVFFVmzP4eyAW3s9GzeLDafh1wMCVBa+wPBus8POneg2XoB5a 5s+23pAXLy8tYqbxXUbD2ihYUCcHUiw= X-MC-Unique: FEq59uSfNRePfuGgC4Oggg-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v3 03/15] qtest: allow DSDT acpi table changes Date: Wed, 29 Apr 2020 15:59:51 +0200 Message-Id: <20200429140003.7336-4-kraxel@redhat.com> In-Reply-To: <20200429140003.7336-1-kraxel@redhat.com> References: <20200429140003.7336-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.120; envelope-from=kraxel@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/29 01:42:37 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Laurent Vivier , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, "Michael S. Tsirkin" , Max Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , Paolo Bonzini , Igor Mammedov , John Snow , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann --- tests/qtest/bios-tables-test-allowed-diff.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index dfb8523c8bf4..6a052c50447a 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,18 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/pc/DSDT", +"tests/data/acpi/pc/DSDT.acpihmat", +"tests/data/acpi/pc/DSDT.bridge", +"tests/data/acpi/pc/DSDT.cphp", +"tests/data/acpi/pc/DSDT.dimmpxm", +"tests/data/acpi/pc/DSDT.ipmikcs", +"tests/data/acpi/pc/DSDT.memhp", +"tests/data/acpi/pc/DSDT.numamem", +"tests/data/acpi/q35/DSDT", +"tests/data/acpi/q35/DSDT.acpihmat", +"tests/data/acpi/q35/DSDT.bridge", +"tests/data/acpi/q35/DSDT.cphp", +"tests/data/acpi/q35/DSDT.dimmpxm", +"tests/data/acpi/q35/DSDT.ipmibt", +"tests/data/acpi/q35/DSDT.memhp", +"tests/data/acpi/q35/DSDT.mmio64", +"tests/data/acpi/q35/DSDT.numamem", --=20 2.18.2 From nobody Sat May 18 22:31:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1588168969; cv=none; d=zohomail.com; s=zohoarc; b=eor97G9zlZUC2o/6phBTrHA7XLrSOVjglUVU8FOmTyvV757cNYmQHUaVD2zjQrXeSm/YqA9Flr02I2IX3aQmjIEXvL+wTxZcmyO77Jph6Pq4LKVIb6574whmTIAszCB3XValPJhfwd/2o7otcRPz0sJb2qFILIYrtq1k0pv9xg0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588168969; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=aC0zQw/NnoGL/JhiojHL3INj+DHgvZROMxh43h66evM=; b=YUACoBBqRU0AOAAdH2kS+14xv3818VQO43nz5ptpvo67eb6Moo0dBzWneD9nRl0tzTMfnkKpWsom+QuVjbUSLAeG0j8gZtcZGI0aSsYcAo06qMunveNrTrQO7+Fe6NMbdypGsEEZdyWW1xejI8fs+/kq5WuWBuecTjgbofUUZPU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588168969874879.944174699061; Wed, 29 Apr 2020 07:02:49 -0700 (PDT) Received: from localhost ([::1]:33226 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTnIT-0004KN-KL for importer@patchew.org; Wed, 29 Apr 2020 10:02:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42378) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTnGW-0002E4-Dy for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:01:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jTnGA-0003qb-1v for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:00:44 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:44001 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jTnG9-0003oy-JO for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:00:21 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-322-zyXDUhxnN42CTqXnmmSrBQ-1; Wed, 29 Apr 2020 10:00:17 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3DEBE468; Wed, 29 Apr 2020 14:00:16 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-193.ams2.redhat.com [10.36.113.193]) by smtp.corp.redhat.com (Postfix) with ESMTP id 25E565C1BE; Wed, 29 Apr 2020 14:00:04 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 43E779D9D; Wed, 29 Apr 2020 16:00:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588168820; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aC0zQw/NnoGL/JhiojHL3INj+DHgvZROMxh43h66evM=; b=QxU+oFKwa0QEo2kaU+K8uxTilQBrSPPCnrptYi3cplIZ2e/PLP/L+WOit7Z/nb1XmkNXhs iCtO1mE/tJ/4OB7VTmyLHJWxgx+rbY0b3NTU3R4QEmO7lXh3nyMzUlpKtv4/TFllna73cO lOcItRMY477tFkqH5f75ho/TwUDGf2g= X-MC-Unique: zyXDUhxnN42CTqXnmmSrBQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v3 04/15] acpi: drop pointless _STA method Date: Wed, 29 Apr 2020 15:59:52 +0200 Message-Id: <20200429140003.7336-5-kraxel@redhat.com> In-Reply-To: <20200429140003.7336-1-kraxel@redhat.com> References: <20200429140003.7336-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.120; envelope-from=kraxel@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/29 01:42:37 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Laurent Vivier , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, "Michael S. Tsirkin" , Max Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , Paolo Bonzini , Igor Mammedov , John Snow , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" When returning a constant there is no point in having a method in the first place, _STA can be a simple integer instead. Signed-off-by: Gerd Hoffmann Reviewed-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/i386/acpi-build.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 23c77eeb95a9..3a046b03e4cd 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1151,14 +1151,11 @@ static Aml *build_kbd_device_aml(void) { Aml *dev; Aml *crs; - Aml *method; =20 dev =3D aml_device("KBD"); aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0303"))); =20 - method =3D aml_method("_STA", 0, AML_NOTSERIALIZED); - aml_append(method, aml_return(aml_int(0x0f))); - aml_append(dev, method); + aml_append(dev, aml_name_decl("_STA", aml_int(0xf))); =20 crs =3D aml_resource_template(); aml_append(crs, aml_io(AML_DECODE16, 0x0060, 0x0060, 0x01, 0x01)); @@ -1173,14 +1170,11 @@ static Aml *build_mouse_device_aml(void) { Aml *dev; Aml *crs; - Aml *method; =20 dev =3D aml_device("MOU"); aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0F13"))); =20 - method =3D aml_method("_STA", 0, AML_NOTSERIALIZED); - aml_append(method, aml_return(aml_int(0x0f))); - aml_append(dev, method); + aml_append(dev, aml_name_decl("_STA", aml_int(0xf))); =20 crs =3D aml_resource_template(); aml_append(crs, aml_irq_no_flags(12)); @@ -2238,9 +2232,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, TPM_CRB_ADDR_SIZE, AML_READ_WRI= TE)); aml_append(dev, aml_name_decl("_CRS", crs)); =20 - method =3D aml_method("_STA", 0, AML_NOTSERIALIZED); - aml_append(method, aml_return(aml_int(0x0f))); - aml_append(dev, method); + aml_append(dev, aml_name_decl("_STA", aml_int(0xf))); =20 tpm_build_ppi_acpi(tpm, dev); =20 --=20 2.18.2 From nobody Sat May 18 22:31:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1588169228; cv=none; d=zohomail.com; s=zohoarc; b=C8rJ0GxFDk8JQ1NQ8/pZtglbBeU4OOxqjBLiZr0sdKIKwv6Qau7j9OZ0nyiv4QYIQIehnq0KLWQVnihj0f4f91HshpL0IpGcTXiIVdseqCro/SFWv6OA//UCaam9tLe74TsP5jhwF5v4ezxwNFQy2Po5BooTd39HYN6Xxln0Kfg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588169228; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=Ns10TmOrrDyIyxSx6sKY7GiFbnXZHstnlbWiBISKw4g=; b=muJ2gFpq4qtsdNLpsXO+yleGhA4IXZttP9Bp7zXUjOLKqgQQ42O100x9yhQY/gHH7r4+9qtRZCFKxPXxPWmLhwesOIAiaub286TJoYBb/FEhUsf0EN6nNcoORF4VQoUJ7kMayx51hnsAJ9xEKKx5hHRkpqXpJYuT5NIj4rM1hto= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588169228708233.5115571306177; Wed, 29 Apr 2020 07:07:08 -0700 (PDT) Received: from localhost ([::1]:50026 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTnMg-0003OB-V5 for importer@patchew.org; Wed, 29 Apr 2020 10:07:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42436) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTnGe-0002GK-AR for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:01:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jTnGB-0003s6-0x for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:00:52 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:57245 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jTnGA-0003qL-Ge for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:00:22 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-480-vLy9JsC-PXmXvgt9G2oSIA-1; Wed, 29 Apr 2020 10:00:20 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CF38091165; Wed, 29 Apr 2020 14:00:18 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-193.ams2.redhat.com [10.36.113.193]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7C706648D2; Wed, 29 Apr 2020 14:00:16 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 4FAA99D9E; Wed, 29 Apr 2020 16:00:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588168821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ns10TmOrrDyIyxSx6sKY7GiFbnXZHstnlbWiBISKw4g=; b=RW9gdY45FENHQx4Uhf151Fa9tiye7MhrQGnfSoGC6OloABYi+jZXyQ5oZg/4w562HNcnGQ FczR3SRzceg/On2cPBZtx4k3iPjOLjxe7ZtSNIsXUAREfB2siAUbsaom/bQVp68mlA1tCp GILcgECNn6jhOPTVB5bE9kqHlmOwekE= X-MC-Unique: vLy9JsC-PXmXvgt9G2oSIA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v3 05/15] acpi: add ISADeviceClass->build_aml() Date: Wed, 29 Apr 2020 15:59:53 +0200 Message-Id: <20200429140003.7336-6-kraxel@redhat.com> In-Reply-To: <20200429140003.7336-1-kraxel@redhat.com> References: <20200429140003.7336-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.61; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/29 00:53:13 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Laurent Vivier , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, "Michael S. Tsirkin" , Max Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , Paolo Bonzini , Igor Mammedov , John Snow , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Also add isa_aml_build() function which walks all isa devices. This allows to move aml builder code to isa devices. Signed-off-by: Gerd Hoffmann Reviewed-by: Igor Mammedov --- include/hw/isa/isa.h | 2 ++ hw/i386/acpi-build.c | 1 + hw/isa/isa-bus.c | 15 +++++++++++++++ 3 files changed, 18 insertions(+) diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index 59a4d4b50a6d..02c235027484 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -69,6 +69,7 @@ typedef struct IsaDmaClass { =20 typedef struct ISADeviceClass { DeviceClass parent_class; + void (*build_aml)(ISADevice *dev, Aml *scope); } ISADeviceClass; =20 struct ISABus { @@ -107,6 +108,7 @@ ISADevice *isa_try_create(ISABus *bus, const char *name= ); ISADevice *isa_create_simple(ISABus *bus, const char *name); =20 ISADevice *isa_vga_init(ISABus *bus); +void isa_build_aml(ISABus *bus, Aml *scope); =20 /** * isa_register_ioport: Install an I/O port region on the ISA bus. diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 3a046b03e4cd..97f3c75cd995 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1288,6 +1288,7 @@ static void build_isa_devices_aml(Aml *table) error_report("No ISA bus, unable to define IPMI ACPI data"); } else { build_acpi_ipmi_devices(scope, BUS(obj), "\\_SB.PCI0.ISA"); + isa_build_aml(ISA_BUS(obj), scope); } =20 aml_append(table, scope); diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index 798dd9194e8f..1f2189f4d5db 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -207,6 +207,21 @@ ISADevice *isa_vga_init(ISABus *bus) } } =20 +void isa_build_aml(ISABus *bus, Aml *scope) +{ + BusChild *kid; + ISADevice *dev; + ISADeviceClass *dc; + + QTAILQ_FOREACH(kid, &bus->parent_obj.children, sibling) { + dev =3D ISA_DEVICE(kid->child); + dc =3D ISA_DEVICE_GET_CLASS(dev); + if (dc->build_aml) { + dc->build_aml(dev, scope); + } + } +} + static void isabus_dev_print(Monitor *mon, DeviceState *dev, int indent) { ISADevice *d =3D ISA_DEVICE(dev); --=20 2.18.2 From nobody Sat May 18 22:31:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1588169320; cv=none; d=zohomail.com; s=zohoarc; b=XWzlC54Uyfw36NK26G05EaUNoKDlCO1nc7sDPHreLfKzPDX0AU7fiBmJyO0d81UtrFWnGKVlDvizcZCa2YLghio5icpteu1Qv63kSF7CYfI+QLfAdZ/B2NB18VeoHtAGSr2x5srbQRz2GuGbqWOzMcKI26FB0MjLCT122DejJv4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588169320; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=wVia+kqi56m7fobc/F24sqeB+1njvSGFY4Ow1Djzbvw=; b=OuY1cp4WOwyS7WddcXzICUuJUfMUm4PADfeJp9XY1DjsyPR8m4Mbz7Sm7JR2NnisQd4ZECWjQCdz66H37ZMIx6pLnzc2PjE/NvWJIieYLu7bdSFTqx744Sfc9rqEKcsaAfJ6dey5P6CohRSVqvUpT/s41jlrjywrAjkhCXu8nX4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588169320426252.4014801131998; Wed, 29 Apr 2020 07:08:40 -0700 (PDT) Received: from localhost ([::1]:55704 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTnOA-0006Q3-KS for importer@patchew.org; Wed, 29 Apr 2020 10:08:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42506) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTnGm-0002Lh-BS for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:01:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jTnGH-0003zT-0S for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:01:00 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:55388 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jTnGG-0003yf-K8 for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:00:28 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-176-oQ03J7uhMVqDnkHldktIHA-1; Wed, 29 Apr 2020 10:00:26 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DA698100A633; Wed, 29 Apr 2020 14:00:24 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-193.ams2.redhat.com [10.36.113.193]) by smtp.corp.redhat.com (Postfix) with ESMTP id 82EF2605FB; Wed, 29 Apr 2020 14:00:16 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 59C0A9D9F; Wed, 29 Apr 2020 16:00:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588168827; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wVia+kqi56m7fobc/F24sqeB+1njvSGFY4Ow1Djzbvw=; b=NcFwWb5GLxu1VPy8tGzws7NblZk6Ca9bqLFFrDck9RMjOH+KABmrBBbDRI9cuOEey0z6id uj22AXfyfs770MGZO/P6QoimFpfsQPpi4BpXFjEWSIffV+hZ+PfMP3XV6+FCqV2Qy5FFlG GKbQu8QvGDkVIi88YJKu2Wr3gwu53rI= X-MC-Unique: oQ03J7uhMVqDnkHldktIHA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v3 06/15] rtc: add RTC_ISA_BASE Date: Wed, 29 Apr 2020 15:59:54 +0200 Message-Id: <20200429140003.7336-7-kraxel@redhat.com> In-Reply-To: <20200429140003.7336-1-kraxel@redhat.com> References: <20200429140003.7336-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.120; envelope-from=kraxel@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/29 01:42:37 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Laurent Vivier , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, "Michael S. Tsirkin" , Max Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , Paolo Bonzini , Igor Mammedov , John Snow , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add and use RTC_ISA_BASE define instead of hardcoding 0x70. Signed-off-by: Gerd Hoffmann Reviewed-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/rtc/mc146818rtc.h | 1 + hw/rtc/mc146818rtc.c | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/hw/rtc/mc146818rtc.h b/include/hw/rtc/mc146818rtc.h index 10c93a096a1d..3713181b56fe 100644 --- a/include/hw/rtc/mc146818rtc.h +++ b/include/hw/rtc/mc146818rtc.h @@ -47,6 +47,7 @@ typedef struct RTCState { } RTCState; =20 #define RTC_ISA_IRQ 8 +#define RTC_ISA_BASE 0x70 =20 ISADevice *mc146818_rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq); diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c index dc4269cc55cb..d18c09911be2 100644 --- a/hw/rtc/mc146818rtc.c +++ b/hw/rtc/mc146818rtc.c @@ -908,7 +908,6 @@ static void rtc_realizefn(DeviceState *dev, Error **err= p) { ISADevice *isadev =3D ISA_DEVICE(dev); RTCState *s =3D MC146818_RTC(dev); - int base =3D 0x70; =20 s->cmos_data[RTC_REG_A] =3D 0x26; s->cmos_data[RTC_REG_B] =3D 0x02; @@ -951,7 +950,7 @@ static void rtc_realizefn(DeviceState *dev, Error **err= p) qemu_register_suspend_notifier(&s->suspend_notifier); =20 memory_region_init_io(&s->io, OBJECT(s), &cmos_ops, s, "rtc", 2); - isa_register_ioport(isadev, &s->io, base); + isa_register_ioport(isadev, &s->io, RTC_ISA_BASE); =20 /* register rtc 0x70 port for coalesced_pio */ memory_region_set_flush_coalesced(&s->io); @@ -960,7 +959,7 @@ static void rtc_realizefn(DeviceState *dev, Error **err= p) memory_region_add_subregion(&s->io, 0, &s->coalesced_io); memory_region_add_coalescing(&s->coalesced_io, 0, 1); =20 - qdev_set_legacy_instance_id(dev, base, 3); + qdev_set_legacy_instance_id(dev, RTC_ISA_BASE, 3); qemu_register_reset(rtc_reset, s); =20 object_property_add_tm(OBJECT(s), "date", rtc_get_date, NULL); --=20 2.18.2 From nobody Sat May 18 22:31:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1588169238; cv=none; d=zohomail.com; s=zohoarc; b=V8YSiwrrLVJjuExdIRFOxw2Q7KXa3DbbDA2HHzqASneR0JvnrUC/Ldm1ZHa2g0tEm+8eb0KYS0ZwtNPKrw6Tm/s1gnQXfMogBtmNEmK8xZyOnFi71K2hVtoyAYhk//hvIfZsWM4tMWA0J86gfY6XEOPKQf30ofOtqODPy9an/tk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588169238; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=vL4QYNC1Utz73dg8QggHg2T9y20pbXAwRG0RK2n+1Yk=; b=byy7Np8S3mm0H6yCl1AsmGd2a4hlARSSZrsrmaMNrIg2VB09/GTzW62FZn9lbazkWA3VFp7BK5AuhWPnuUBhNNvqT5T0Gncbj3nxF6l9QFTTCgUVRgO4kV1jhrDwUSwCjtGdl+TuwHJ0RMUaD9kK3Uwpq21jtk4amzLkqH2h9/8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588169238799299.6491376432713; Wed, 29 Apr 2020 07:07:18 -0700 (PDT) Received: from localhost ([::1]:51028 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTnMr-0003mr-Ch for importer@patchew.org; Wed, 29 Apr 2020 10:07:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42472) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTnGj-0002IL-3S for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:01:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jTnGD-0003vf-Bw for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:00:56 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:33599 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jTnGC-0003u7-TN for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:00:24 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-309-kBxDakOlOWuCcZjVYvkvGA-1; Wed, 29 Apr 2020 10:00:20 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 11076107ACCA; Wed, 29 Apr 2020 14:00:19 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-193.ams2.redhat.com [10.36.113.193]) by smtp.corp.redhat.com (Postfix) with ESMTP id AEB9866069; Wed, 29 Apr 2020 14:00:16 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 645039DA0; Wed, 29 Apr 2020 16:00:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588168824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vL4QYNC1Utz73dg8QggHg2T9y20pbXAwRG0RK2n+1Yk=; b=c3mqF4AXQR+97jMWtbq4nZkOUdFVTJkPyeHPoFznCPowkG1VG0m1HEvs+h7ujqEOC4Rdiu 8H7ymcOoYPE5B4YnfOI+Kz1p2ytXpKKeOQmGqSfFLSTSy15xLynaX+HNcsI58RxkCmZGJB +N+zxNrYmUg9fx2OuKhZQEYCOEjUV48= X-MC-Unique: kBxDakOlOWuCcZjVYvkvGA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v3 07/15] acpi: move aml builder code for rtc device Date: Wed, 29 Apr 2020 15:59:55 +0200 Message-Id: <20200429140003.7336-8-kraxel@redhat.com> In-Reply-To: <20200429140003.7336-1-kraxel@redhat.com> References: <20200429140003.7336-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.81; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/29 01:28:11 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Laurent Vivier , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, "Michael S. Tsirkin" , Max Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , Paolo Bonzini , Igor Mammedov , John Snow , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Also use a single io range instead of two, following what real hardware does. Signed-off-by: Gerd Hoffmann --- hw/i386/acpi-build.c | 17 ----------------- hw/rtc/mc146818rtc.c | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 97f3c75cd995..f79e5eaf170d 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1131,22 +1131,6 @@ static Aml *build_fdc_device_aml(ISADevice *fdc) return dev; } =20 -static Aml *build_rtc_device_aml(void) -{ - Aml *dev; - Aml *crs; - - dev =3D aml_device("RTC"); - aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0B00"))); - crs =3D aml_resource_template(); - aml_append(crs, aml_io(AML_DECODE16, 0x0070, 0x0070, 0x10, 0x02)); - aml_append(crs, aml_irq_no_flags(8)); - aml_append(crs, aml_io(AML_DECODE16, 0x0072, 0x0072, 0x02, 0x06)); - aml_append(dev, aml_name_decl("_CRS", crs)); - - return dev; -} - static Aml *build_kbd_device_aml(void) { Aml *dev; @@ -1272,7 +1256,6 @@ static void build_isa_devices_aml(Aml *table) Aml *scope =3D aml_scope("_SB.PCI0.ISA"); Object *obj =3D object_resolve_path_type("", TYPE_ISA_BUS, &ambiguous); =20 - aml_append(scope, build_rtc_device_aml()); aml_append(scope, build_kbd_device_aml()); aml_append(scope, build_mouse_device_aml()); if (fdc) { diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c index d18c09911be2..47fafcfb7c1d 100644 --- a/hw/rtc/mc146818rtc.c +++ b/hw/rtc/mc146818rtc.c @@ -27,6 +27,7 @@ #include "qemu/cutils.h" #include "qemu/module.h" #include "qemu/bcd.h" +#include "hw/acpi/aml-build.h" #include "hw/irq.h" #include "hw/qdev-properties.h" #include "qemu/timer.h" @@ -1007,13 +1008,32 @@ static void rtc_resetdev(DeviceState *d) } } =20 +static void rtc_build_aml(ISADevice *isadev, Aml *scope) +{ + Aml *dev; + Aml *crs; + + crs =3D aml_resource_template(); + aml_append(crs, aml_io(AML_DECODE16, RTC_ISA_BASE, RTC_ISA_BASE, + 0x10, 0x08)); + aml_append(crs, aml_irq_no_flags(RTC_ISA_IRQ)); + + dev =3D aml_device("RTC"); + aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0B00"))); + aml_append(dev, aml_name_decl("_CRS", crs)); + + aml_append(scope, dev); +} + static void rtc_class_initfn(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); + ISADeviceClass *isa =3D ISA_DEVICE_CLASS(klass); =20 dc->realize =3D rtc_realizefn; dc->reset =3D rtc_resetdev; dc->vmsd =3D &vmstate_rtc; + isa->build_aml =3D rtc_build_aml; device_class_set_props(dc, mc146818rtc_properties); } =20 --=20 2.18.2 From nobody Sat May 18 22:31:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1588169616; cv=none; d=zohomail.com; s=zohoarc; b=O7U3AU+QdEyYoVsLGDG05uR5WXzjN80OxMOBcYRc+6OL9R1xOzzOlaOQcrCfdy8fr4oJWePiBwxyAfTqLmrM7Wn6zFUwmrLQEIsSyN77vqexCQudSKxJTvZvccBAzl8H/gkESHEqVLhdhOlC1etziQWvzycKKzhIa2eweLuDRQ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588169616; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=0yOenfebwnpVX6l3vwC13KeDvVoVS9CkDx3osunlcAo=; b=Hw3BbCR7j2xmSo1zmn+Sa0p7zDri8JWWSu9cmwtZkT6FxoGrP5ImZdhwNUhL2U7cvm+Q/6E1+W4goOKzq6Nbr0otIs9p+f+Qh+cMNEW7bUYWJ7RJtYOWzJ25XBPgIfeHgh7cSFUTrBFSo7W7mjQRaI5HZdPrFoddnQGmBi8aFxg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588169616527878.3761063701555; Wed, 29 Apr 2020 07:13:36 -0700 (PDT) Received: from localhost ([::1]:46954 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTnSx-00071q-3F for importer@patchew.org; Wed, 29 Apr 2020 10:13:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42540) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTnGp-0002OP-6p for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:01:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jTnGJ-00043D-Rn for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:01:02 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:33513 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jTnGJ-00042p-CJ for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:00:31 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-150-cQsdcgFANPOBFzFpzZjgCQ-1; Wed, 29 Apr 2020 10:00:27 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A3674835B5C; Wed, 29 Apr 2020 14:00:26 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-193.ams2.redhat.com [10.36.113.193]) by smtp.corp.redhat.com (Postfix) with ESMTP id B3FE95D76A; Wed, 29 Apr 2020 14:00:16 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 6D40E9DA1; Wed, 29 Apr 2020 16:00:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588168830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0yOenfebwnpVX6l3vwC13KeDvVoVS9CkDx3osunlcAo=; b=erpqD3+OO3nPUcmy7kFMIeUd5MOU9rnoaVO2LS1vCL1TPQIv3nbQn5zMTh/dnmOJlTb6f3 ZcS0Wr6o65ndmzQRqLWRh+edxe9hkYru+bwSgkElzSBi0FMVnB0Z/Io+zAlp67xySlvkiM WCdStOrLvst8orzUkvN+yW3b61xgzCE= X-MC-Unique: cQsdcgFANPOBFzFpzZjgCQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v3 08/15] acpi: serial: don't use _STA method Date: Wed, 29 Apr 2020 15:59:56 +0200 Message-Id: <20200429140003.7336-9-kraxel@redhat.com> In-Reply-To: <20200429140003.7336-1-kraxel@redhat.com> References: <20200429140003.7336-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.120; envelope-from=kraxel@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/29 01:42:37 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Laurent Vivier , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, "Michael S. Tsirkin" , Max Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , Paolo Bonzini , Igor Mammedov , John Snow , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The _STA method dates back to the days where we had a static DSDT. The device is listed in the DSDT table unconditionally and the _STA method checks a bit in the isa bridge pci config space to figure whenever a given is isa device is present or not, then evaluates to 0x0f (present) or 0x00 (absent). These days the DSDT is generated by qemu anyway, so if a device is not present we can simply drop it from the DSDT instead. Signed-off-by: Gerd Hoffmann Reviewed-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/i386/acpi-build.c | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index f79e5eaf170d..a99e5bbd1156 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1202,50 +1202,34 @@ static Aml *build_lpt_device_aml(void) return dev; } =20 -static Aml *build_com_device_aml(uint8_t uid) +static void build_com_device_aml(Aml *scope, uint8_t uid) { Aml *dev; Aml *crs; - Aml *method; - Aml *if_ctx; - Aml *else_ctx; - Aml *zero =3D aml_int(0); - Aml *is_present =3D aml_local(0); - const char *enabled_field =3D "CAEN"; uint8_t irq =3D 4; uint16_t io_port =3D 0x03F8; =20 assert(uid =3D=3D 1 || uid =3D=3D 2); if (uid =3D=3D 2) { - enabled_field =3D "CBEN"; irq =3D 3; io_port =3D 0x02F8; } + if (!memory_region_present(get_system_io(), io_port)) { + return; + } =20 dev =3D aml_device("COM%d", uid); aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0501"))); aml_append(dev, aml_name_decl("_UID", aml_int(uid))); =20 - method =3D aml_method("_STA", 0, AML_NOTSERIALIZED); - aml_append(method, aml_store(aml_name("%s", enabled_field), is_present= )); - if_ctx =3D aml_if(aml_equal(is_present, zero)); - { - aml_append(if_ctx, aml_return(aml_int(0x00))); - } - aml_append(method, if_ctx); - else_ctx =3D aml_else(); - { - aml_append(else_ctx, aml_return(aml_int(0x0f))); - } - aml_append(method, else_ctx); - aml_append(dev, method); + aml_append(dev, aml_name_decl("_STA", aml_int(0xf))); =20 crs =3D aml_resource_template(); aml_append(crs, aml_io(AML_DECODE16, io_port, io_port, 0x00, 0x08)); aml_append(crs, aml_irq_no_flags(irq)); aml_append(dev, aml_name_decl("_CRS", crs)); =20 - return dev; + aml_append(scope, dev); } =20 static void build_isa_devices_aml(Aml *table) @@ -1262,8 +1246,8 @@ static void build_isa_devices_aml(Aml *table) aml_append(scope, build_fdc_device_aml(fdc)); } aml_append(scope, build_lpt_device_aml()); - aml_append(scope, build_com_device_aml(1)); - aml_append(scope, build_com_device_aml(2)); + build_com_device_aml(scope, 1); + build_com_device_aml(scope, 2); =20 if (ambiguous) { error_report("Multiple ISA busses, unable to define IPMI ACPI data= "); --=20 2.18.2 From nobody Sat May 18 22:31:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1588169134; cv=none; d=zohomail.com; s=zohoarc; b=htf67Z3hLOtPd4RdegY1lWkBvHeDH0q7HLS/zIzkwQZXQyrDg1kEHYwukaPhJVX45JK6/76gTBB+U1llFrp09gbBsIJ7B7rcuwYKoJQ2yBgISulydJoaG2fSdagVoqKb4vMzpIJ63PxShkUeOpJLeuGLL8Q13yo5dt5Uf7DGH+0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588169134; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=B+GFEragVS80ptAKJBTWsePETywlC56dk7pNXnTkfMI=; b=aILFFOq5nngwUGAPnw4NBmfs1HVydiH/982I+wlJ9akW6Eum4p1r+ZFhJkQw4XMaEKN4ERADNqBvRTqZilxcZfUpoV0RrKrdivryExRaGLLubhEqD1hP6s7U6VEc1qrUe7reM6xUFyDLdyf73Zl5dRAuZ2F4EEEv3WobzHiu7rA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588169134124604.4372093121378; Wed, 29 Apr 2020 07:05:34 -0700 (PDT) Received: from localhost ([::1]:42880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTnLA-0000BJ-Lg for importer@patchew.org; Wed, 29 Apr 2020 10:05:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42448) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTnGf-0002GQ-Ap for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:01:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jTnGB-0003sY-FZ for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:00:53 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:24293 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jTnGB-0003rN-2z for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:00:23 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-434-Z_hLFL0oNbmG0DN-IUXODA-1; Wed, 29 Apr 2020 10:00:18 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CF4398BEE80; Wed, 29 Apr 2020 14:00:17 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-193.ams2.redhat.com [10.36.113.193]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1C8A838A; Wed, 29 Apr 2020 14:00:17 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 77D7C9DA2; Wed, 29 Apr 2020 16:00:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588168822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=B+GFEragVS80ptAKJBTWsePETywlC56dk7pNXnTkfMI=; b=b0FUreTs4yFoNOWwgkvtXRTWnqEFkcn6iA5Vmqgj/5SVOVa+wJs0Yh5GvK4reut5rmWG2w q7g6IRPlP9X8ziQ7cNa2bLU2tS+xar98vMjF4++KxyUEY3o51WzciA/jG1cFa57Sc8M6x+ +zSK+joZ5ZVFg+/004GtD3hn1lRmAwE= X-MC-Unique: Z_hLFL0oNbmG0DN-IUXODA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v3 09/15] acpi: move aml builder code for serial device Date: Wed, 29 Apr 2020 15:59:57 +0200 Message-Id: <20200429140003.7336-10-kraxel@redhat.com> In-Reply-To: <20200429140003.7336-1-kraxel@redhat.com> References: <20200429140003.7336-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.120; envelope-from=kraxel@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/29 01:42:37 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Laurent Vivier , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, "Michael S. Tsirkin" , Max Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , Paolo Bonzini , Igor Mammedov , John Snow , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The code uses the isa_serial_io array to figure what the device uid is. Side effect is that acpi antries are not limited to port 1+2 any more, we'll also get entries for ports 3+4. Signed-off-by: Gerd Hoffmann Reviewed-by: Igor Mammedov --- hw/char/serial-isa.c | 32 ++++++++++++++++++++++++++++++++ hw/i386/acpi-build.c | 32 -------------------------------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/hw/char/serial-isa.c b/hw/char/serial-isa.c index f9b6eed7833d..f7c19a398ced 100644 --- a/hw/char/serial-isa.c +++ b/hw/char/serial-isa.c @@ -27,6 +27,7 @@ #include "qapi/error.h" #include "qemu/module.h" #include "sysemu/sysemu.h" +#include "hw/acpi/aml-build.h" #include "hw/char/serial.h" #include "hw/isa/isa.h" #include "hw/qdev-properties.h" @@ -81,6 +82,35 @@ static void serial_isa_realizefn(DeviceState *dev, Error= **errp) isa_register_ioport(isadev, &s->io, isa->iobase); } =20 +static void serial_isa_build_aml(ISADevice *isadev, Aml *scope) +{ + ISASerialState *isa =3D ISA_SERIAL(isadev); + int i, uid =3D 0; + Aml *dev; + Aml *crs; + + for (i =3D 0; i < ARRAY_SIZE(isa_serial_io); i++) { + if (isa->iobase =3D=3D isa_serial_io[i]) { + uid =3D i + 1; + } + } + if (!uid) { + return; + } + + crs =3D aml_resource_template(); + aml_append(crs, aml_io(AML_DECODE16, isa->iobase, isa->iobase, 0x00, 0= x08)); + aml_append(crs, aml_irq_no_flags(isa->isairq)); + + dev =3D aml_device("COM%d", uid); + aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0501"))); + aml_append(dev, aml_name_decl("_UID", aml_int(uid))); + aml_append(dev, aml_name_decl("_STA", aml_int(0xf))); + aml_append(dev, aml_name_decl("_CRS", crs)); + + aml_append(scope, dev); +} + static const VMStateDescription vmstate_isa_serial =3D { .name =3D "serial", .version_id =3D 3, @@ -103,9 +133,11 @@ static Property serial_isa_properties[] =3D { static void serial_isa_class_initfn(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); + ISADeviceClass *isa =3D ISA_DEVICE_CLASS(klass); =20 dc->realize =3D serial_isa_realizefn; dc->vmsd =3D &vmstate_isa_serial; + isa->build_aml =3D serial_isa_build_aml; device_class_set_props(dc, serial_isa_properties); set_bit(DEVICE_CATEGORY_INPUT, dc->categories); } diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index a99e5bbd1156..fea83352e6ab 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1202,36 +1202,6 @@ static Aml *build_lpt_device_aml(void) return dev; } =20 -static void build_com_device_aml(Aml *scope, uint8_t uid) -{ - Aml *dev; - Aml *crs; - uint8_t irq =3D 4; - uint16_t io_port =3D 0x03F8; - - assert(uid =3D=3D 1 || uid =3D=3D 2); - if (uid =3D=3D 2) { - irq =3D 3; - io_port =3D 0x02F8; - } - if (!memory_region_present(get_system_io(), io_port)) { - return; - } - - dev =3D aml_device("COM%d", uid); - aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0501"))); - aml_append(dev, aml_name_decl("_UID", aml_int(uid))); - - aml_append(dev, aml_name_decl("_STA", aml_int(0xf))); - - crs =3D aml_resource_template(); - aml_append(crs, aml_io(AML_DECODE16, io_port, io_port, 0x00, 0x08)); - aml_append(crs, aml_irq_no_flags(irq)); - aml_append(dev, aml_name_decl("_CRS", crs)); - - aml_append(scope, dev); -} - static void build_isa_devices_aml(Aml *table) { ISADevice *fdc =3D pc_find_fdc0(); @@ -1246,8 +1216,6 @@ static void build_isa_devices_aml(Aml *table) aml_append(scope, build_fdc_device_aml(fdc)); } aml_append(scope, build_lpt_device_aml()); - build_com_device_aml(scope, 1); - build_com_device_aml(scope, 2); =20 if (ambiguous) { error_report("Multiple ISA busses, unable to define IPMI ACPI data= "); --=20 2.18.2 From nobody Sat May 18 22:31:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1588169274; cv=none; d=zohomail.com; s=zohoarc; b=h1m5f0nsKb7fAjOowebBilDEec7lHMX3ln8YtOrCde7pzmIo4Tk6yBqeMLc7k3h7XmRe2jGB+E+v80zP+lRJZ0Bmc8edkNjhcYayO2bHSZiFBB55VKELx5EHNJCkieISdQ93Jf0hsfRpH8noYD/zgaMzaJUn4u1nWMx7CxXeJYI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588169274; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=pZi0V42eFndZ+YKjEr8yBEyH88fyEYZmQ6EWCr9VMEY=; b=Qhsc7aC9cbzdsn3vaFQETkOC6rGBMLNJsE7trdzPqzpwvcFQ599WxFOWtRKNXbm9TsfxmJmENwJfyEaaF0FLDc6bBjoaOEDxIbd6NQD2drF9g3BWXmZLqeugEwlpceDnJffwfrP7RZsRC/3XaPPTxYVGqpqlKR7bpVxp3wwj4J0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588169274958569.3048010599639; Wed, 29 Apr 2020 07:07:54 -0700 (PDT) Received: from localhost ([::1]:53416 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTnNR-0004to-CM for importer@patchew.org; Wed, 29 Apr 2020 10:07:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42526) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTnGo-0002Ne-DE for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:01:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jTnGI-00042f-Tr for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:01:02 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:26144 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jTnGI-00041u-Bu for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:00:30 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-497-KzHl4OzKPZmEMmd-BcLjRg-1; Wed, 29 Apr 2020 10:00:27 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8C953100A630; Wed, 29 Apr 2020 14:00:26 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-193.ams2.redhat.com [10.36.113.193]) by smtp.corp.redhat.com (Postfix) with ESMTP id 22DF75D77B; Wed, 29 Apr 2020 14:00:17 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 80CA29DA4; Wed, 29 Apr 2020 16:00:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588168829; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pZi0V42eFndZ+YKjEr8yBEyH88fyEYZmQ6EWCr9VMEY=; b=hicx1F6ioxAFYeL3vQ3BZVAZ6DfM/AkHa8AeB4oegOYopO6ZCEtrzEXsvH7TXKg43r2cuc hb1mEeyGOP2Erqw474SavpReHRJm2UIwmszrLwbtUTD+e+qUw+iUXGMws5U1NqPdbwqmoz u/MP99RhvjSNF1sQ5gUJayP//ixfhlU= X-MC-Unique: KzHl4OzKPZmEMmd-BcLjRg-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v3 10/15] acpi: parallel: don't use _STA method Date: Wed, 29 Apr 2020 15:59:58 +0200 Message-Id: <20200429140003.7336-11-kraxel@redhat.com> In-Reply-To: <20200429140003.7336-1-kraxel@redhat.com> References: <20200429140003.7336-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.81; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/29 01:28:11 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Laurent Vivier , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, "Michael S. Tsirkin" , Max Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , Paolo Bonzini , Igor Mammedov , John Snow , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The _STA method dates back to the days where we had a static DSDT. The device is listed in the DSDT table unconditionally and the _STA method checks a bit in the isa bridge pci config space to figure whenever a given is isa device is present or not, then evaluates to 0x0f (present) or 0x00 (absent). These days the DSDT is generated by qemu anyway, so if a device is not present we can simply drop it from the DSDT instead. Signed-off-by: Gerd Hoffmann Reviewed-by: Igor Mammedov --- hw/i386/acpi-build.c | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index fea83352e6ab..e01afbd011d9 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1167,39 +1167,26 @@ static Aml *build_mouse_device_aml(void) return dev; } =20 -static Aml *build_lpt_device_aml(void) +static void build_lpt_device_aml(Aml *scope) { Aml *dev; Aml *crs; - Aml *method; - Aml *if_ctx; - Aml *else_ctx; - Aml *zero =3D aml_int(0); - Aml *is_present =3D aml_local(0); + + if (!memory_region_present(get_system_io(), 0x0378)) { + return; + } =20 dev =3D aml_device("LPT"); aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0400"))); =20 - method =3D aml_method("_STA", 0, AML_NOTSERIALIZED); - aml_append(method, aml_store(aml_name("LPEN"), is_present)); - if_ctx =3D aml_if(aml_equal(is_present, zero)); - { - aml_append(if_ctx, aml_return(aml_int(0x00))); - } - aml_append(method, if_ctx); - else_ctx =3D aml_else(); - { - aml_append(else_ctx, aml_return(aml_int(0x0f))); - } - aml_append(method, else_ctx); - aml_append(dev, method); + aml_append(dev, aml_name_decl("_STA", aml_int(0xf))); =20 crs =3D aml_resource_template(); aml_append(crs, aml_io(AML_DECODE16, 0x0378, 0x0378, 0x08, 0x08)); aml_append(crs, aml_irq_no_flags(7)); aml_append(dev, aml_name_decl("_CRS", crs)); =20 - return dev; + aml_append(scope, dev); } =20 static void build_isa_devices_aml(Aml *table) @@ -1215,7 +1202,7 @@ static void build_isa_devices_aml(Aml *table) if (fdc) { aml_append(scope, build_fdc_device_aml(fdc)); } - aml_append(scope, build_lpt_device_aml()); + build_lpt_device_aml(scope); =20 if (ambiguous) { error_report("Multiple ISA busses, unable to define IPMI ACPI data= "); --=20 2.18.2 From nobody Sat May 18 22:31:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1588169359; cv=none; d=zohomail.com; s=zohoarc; b=O6iHNuW1nhVqkeRNMt+9Sb8ov+FORe41vheO0TsVMOlTVxMV2hiPeMLMLAbOF06u5qWlVRrAO6aowYjCtXsoTjpbMTe51wTKe6vf9lCfdzTC4exdcaHF4cPZm7Z4Lj5d9/spFv/9JghoWWcB2aN+fpaJPZ7hci7+4vqARrNOyfk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588169359; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=5ZDaOnP7JoaHpj6dJQ1fXf7vB0ob55bzO9rc0pYbHF0=; b=IEf74Kp0+ln60EXx4XX4ezebh9akbNCc0CTe7zrzuwamQrCIzrTZVJO+WuQJU0BKq9nkobwm58mmNRUzWGlcHywdu5Pg7d+cLtAfPumMXOCCzYWaC1yld8ImmtvgbTPBY02UXdgOt+XKDTMzHpr8ENJIqypOK6r0lmp3O5gJ2iQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588169359194338.11537384998417; Wed, 29 Apr 2020 07:09:19 -0700 (PDT) Received: from localhost ([::1]:59316 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTnOn-0008LF-NX for importer@patchew.org; Wed, 29 Apr 2020 10:09:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42450) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTnGf-0002GR-By for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:01:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jTnGB-0003sl-KQ for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:00:53 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:25267 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jTnGB-0003rX-75 for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:00:23 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-216-Dg2078jNOQWiCF376AWcyQ-1; Wed, 29 Apr 2020 10:00:19 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5EECC8C1A00; Wed, 29 Apr 2020 14:00:18 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-193.ams2.redhat.com [10.36.113.193]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3B1205D9C9; Wed, 29 Apr 2020 14:00:17 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 8B43B9DA6; Wed, 29 Apr 2020 16:00:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588168822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5ZDaOnP7JoaHpj6dJQ1fXf7vB0ob55bzO9rc0pYbHF0=; b=G6XeiYVBb9R/WW4AuKeeQZUZ7eMFbzG4EAq1RAcWtrHAP7dDZ80r/tEwWKqZ3HQnR2fm03 voWKOkHi7/hfBf6Hc0FxuG0hJM7jtbTbmZaVb+5xx1WzKzqnCQEZn12o6nLGquxC3LIFjV TpQ1COPSBF+C4vYEXgRFvKriaNZ8/XA= X-MC-Unique: Dg2078jNOQWiCF376AWcyQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v3 11/15] acpi: move aml builder code for parallel device Date: Wed, 29 Apr 2020 15:59:59 +0200 Message-Id: <20200429140003.7336-12-kraxel@redhat.com> In-Reply-To: <20200429140003.7336-1-kraxel@redhat.com> References: <20200429140003.7336-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.61; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/29 00:53:13 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Laurent Vivier , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, "Michael S. Tsirkin" , Max Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , Paolo Bonzini , Igor Mammedov , John Snow , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Also adds support for multiple LPT devices. Signed-off-by: Gerd Hoffmann Reviewed-by: Igor Mammedov --- hw/char/parallel.c | 32 ++++++++++++++++++++++++++++++++ hw/i386/acpi-build.c | 23 ----------------------- 2 files changed, 32 insertions(+), 23 deletions(-) diff --git a/hw/char/parallel.c b/hw/char/parallel.c index 8dd67d13759b..bc6b55b3b910 100644 --- a/hw/char/parallel.c +++ b/hw/char/parallel.c @@ -28,6 +28,7 @@ #include "qemu/module.h" #include "chardev/char-parallel.h" #include "chardev/char-fe.h" +#include "hw/acpi/aml-build.h" #include "hw/irq.h" #include "hw/isa/isa.h" #include "hw/qdev-properties.h" @@ -568,6 +569,35 @@ static void parallel_isa_realizefn(DeviceState *dev, E= rror **errp) s, "parallel"); } =20 +static void parallel_isa_build_aml(ISADevice *isadev, Aml *scope) +{ + ISAParallelState *isa =3D ISA_PARALLEL(isadev); + int i, uid =3D 0; + Aml *dev; + Aml *crs; + + for (i =3D 0; i < ARRAY_SIZE(isa_parallel_io); i++) { + if (isa->iobase =3D=3D isa_parallel_io[i]) { + uid =3D i + 1; + } + } + if (!uid) { + return; + } + + crs =3D aml_resource_template(); + aml_append(crs, aml_io(AML_DECODE16, isa->iobase, isa->iobase, 0x08, 0= x08)); + aml_append(crs, aml_irq_no_flags(isa->isairq)); + + dev =3D aml_device("LPT%d", uid); + aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0400"))); + aml_append(dev, aml_name_decl("_UID", aml_int(uid))); + aml_append(dev, aml_name_decl("_STA", aml_int(0xf))); + aml_append(dev, aml_name_decl("_CRS", crs)); + + aml_append(scope, dev); +} + /* Memory mapped interface */ static uint64_t parallel_mm_readfn(void *opaque, hwaddr addr, unsigned siz= e) { @@ -624,9 +654,11 @@ static Property parallel_isa_properties[] =3D { static void parallel_isa_class_initfn(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); + ISADeviceClass *isa =3D ISA_DEVICE_CLASS(klass); =20 dc->realize =3D parallel_isa_realizefn; dc->vmsd =3D &vmstate_parallel_isa; + isa->build_aml =3D parallel_isa_build_aml; device_class_set_props(dc, parallel_isa_properties); set_bit(DEVICE_CATEGORY_INPUT, dc->categories); } diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index e01afbd011d9..12a017e1f45b 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1167,28 +1167,6 @@ static Aml *build_mouse_device_aml(void) return dev; } =20 -static void build_lpt_device_aml(Aml *scope) -{ - Aml *dev; - Aml *crs; - - if (!memory_region_present(get_system_io(), 0x0378)) { - return; - } - - dev =3D aml_device("LPT"); - aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0400"))); - - aml_append(dev, aml_name_decl("_STA", aml_int(0xf))); - - crs =3D aml_resource_template(); - aml_append(crs, aml_io(AML_DECODE16, 0x0378, 0x0378, 0x08, 0x08)); - aml_append(crs, aml_irq_no_flags(7)); - aml_append(dev, aml_name_decl("_CRS", crs)); - - aml_append(scope, dev); -} - static void build_isa_devices_aml(Aml *table) { ISADevice *fdc =3D pc_find_fdc0(); @@ -1202,7 +1180,6 @@ static void build_isa_devices_aml(Aml *table) if (fdc) { aml_append(scope, build_fdc_device_aml(fdc)); } - build_lpt_device_aml(scope); =20 if (ambiguous) { error_report("Multiple ISA busses, unable to define IPMI ACPI data= "); --=20 2.18.2 From nobody Sat May 18 22:31:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1588169114; cv=none; d=zohomail.com; s=zohoarc; b=GorEGBTfmVDYbXyReY/SlySgzK8Io9rPg87mxSMlkgiubGVtmoF1J3FlbgI0SYdm2bzuTfEz1eLmr5qRbEY8fqisNxhcBZr0/1aqFT9g+oXf76GEO9BusE+5Ym1+CO5L9rtIVt3GexDisv7yCUK+DHSMKcfodb2f8QK1PvX/aS4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588169114; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=MlobeuEieogGvyuOKT96SVJVOWe5N8/rrPGUeP7tAYw=; b=n5LlMSoDjjaAQe1LX5EdatwUldy0HyDX6oOw2pdn/DJyGAOTc/mKbr+aGB4xVThrr9i8AKeI6969vfKADAyNrAJyumL2DYT2KrweCTeP2fVQBbcoLg9+TXKlLMszXzqfCvdZP5JxRNoGhXgws/XAqi2+PvnPoO1up1nQJPRN/eg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588169114688324.59791867772833; Wed, 29 Apr 2020 07:05:14 -0700 (PDT) Received: from localhost ([::1]:41334 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTnKr-0007nA-0s for importer@patchew.org; Wed, 29 Apr 2020 10:05:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42430) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTnGd-0002GH-Qh for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:01:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jTnGA-0003rC-HC for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:00:51 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:50820 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jTnG9-0003pe-VO for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:00:22 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-287-gnOWKXEcM5KNQ7d7UAkCTw-1; Wed, 29 Apr 2020 10:00:19 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1CB1F100A633; Wed, 29 Apr 2020 14:00:18 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-193.ams2.redhat.com [10.36.113.193]) by smtp.corp.redhat.com (Postfix) with ESMTP id 342E6396; Wed, 29 Apr 2020 14:00:17 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 98FC29DA7; Wed, 29 Apr 2020 16:00:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588168821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MlobeuEieogGvyuOKT96SVJVOWe5N8/rrPGUeP7tAYw=; b=JHBZhEvQZrG8+8xhbP+AHWUByfUQIM1eVjNYLuKP6BNHYAtOKi43Vz7alsTinfzo0v2qlU y1/vgFisiWI0cnPotHjPsTbDdEei8brrGvBtQddvih1r5j8hXG0mfbpVm2Xpbl88vaa0Sd LbuVGNzZjr4IaXzWxfUJIKCzigOlCpw= X-MC-Unique: gnOWKXEcM5KNQ7d7UAkCTw-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v3 12/15] acpi: move aml builder code for floppy device Date: Wed, 29 Apr 2020 16:00:00 +0200 Message-Id: <20200429140003.7336-13-kraxel@redhat.com> In-Reply-To: <20200429140003.7336-1-kraxel@redhat.com> References: <20200429140003.7336-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.81; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/29 01:28:11 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Laurent Vivier , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, "Michael S. Tsirkin" , Max Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , Paolo Bonzini , Igor Mammedov , John Snow , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann Reviewed-by: Igor Mammedov --- hw/block/fdc.c | 83 ++++++++++++++++++++++++++++++++++++++++++++ hw/i386/acpi-build.c | 83 -------------------------------------------- stubs/cmos.c | 7 ++++ stubs/Makefile.objs | 1 + 4 files changed, 91 insertions(+), 83 deletions(-) create mode 100644 stubs/cmos.c diff --git a/hw/block/fdc.c b/hw/block/fdc.c index 33bc9e2f9249..56ddc26c7065 100644 --- a/hw/block/fdc.c +++ b/hw/block/fdc.c @@ -32,6 +32,8 @@ #include "qapi/error.h" #include "qemu/error-report.h" #include "qemu/timer.h" +#include "hw/i386/pc.h" +#include "hw/acpi/aml-build.h" #include "hw/irq.h" #include "hw/isa/isa.h" #include "hw/qdev-properties.h" @@ -2764,6 +2766,85 @@ void isa_fdc_get_drive_max_chs(FloppyDriveType type, (*maxc)--; } =20 +static Aml *build_fdinfo_aml(int idx, FloppyDriveType type) +{ + Aml *dev, *fdi; + uint8_t maxc, maxh, maxs; + + isa_fdc_get_drive_max_chs(type, &maxc, &maxh, &maxs); + + dev =3D aml_device("FLP%c", 'A' + idx); + + aml_append(dev, aml_name_decl("_ADR", aml_int(idx))); + + fdi =3D aml_package(16); + aml_append(fdi, aml_int(idx)); /* Drive Number */ + aml_append(fdi, + aml_int(cmos_get_fd_drive_type(type))); /* Device Type */ + /* + * the values below are the limits of the drive, and are thus independ= ent + * of the inserted media + */ + aml_append(fdi, aml_int(maxc)); /* Maximum Cylinder Number */ + aml_append(fdi, aml_int(maxs)); /* Maximum Sector Number */ + aml_append(fdi, aml_int(maxh)); /* Maximum Head Number */ + /* + * SeaBIOS returns the below values for int 0x13 func 0x08 regardless = of + * the drive type, so shall we + */ + aml_append(fdi, aml_int(0xAF)); /* disk_specify_1 */ + aml_append(fdi, aml_int(0x02)); /* disk_specify_2 */ + aml_append(fdi, aml_int(0x25)); /* disk_motor_wait */ + aml_append(fdi, aml_int(0x02)); /* disk_sector_siz */ + aml_append(fdi, aml_int(0x12)); /* disk_eot */ + aml_append(fdi, aml_int(0x1B)); /* disk_rw_gap */ + aml_append(fdi, aml_int(0xFF)); /* disk_dtl */ + aml_append(fdi, aml_int(0x6C)); /* disk_formt_gap */ + aml_append(fdi, aml_int(0xF6)); /* disk_fill */ + aml_append(fdi, aml_int(0x0F)); /* disk_head_sttl */ + aml_append(fdi, aml_int(0x08)); /* disk_motor_strt */ + + aml_append(dev, aml_name_decl("_FDI", fdi)); + return dev; +} + +static void fdc_isa_build_aml(ISADevice *isadev, Aml *scope) +{ + Aml *dev; + Aml *crs; + int i; + +#define ACPI_FDE_MAX_FD 4 + uint32_t fde_buf[5] =3D { + 0, 0, 0, 0, /* presence of floppy drives #0 - #3 */ + cpu_to_le32(2) /* tape presence (2 =3D=3D never present) */ + }; + + crs =3D aml_resource_template(); + aml_append(crs, aml_io(AML_DECODE16, 0x03F2, 0x03F2, 0x00, 0x04)); + aml_append(crs, aml_io(AML_DECODE16, 0x03F7, 0x03F7, 0x00, 0x01)); + aml_append(crs, aml_irq_no_flags(6)); + aml_append(crs, + aml_dma(AML_COMPATIBILITY, AML_NOTBUSMASTER, AML_TRANSFER8, 2)); + + dev =3D aml_device("FDC0"); + aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0700"))); + aml_append(dev, aml_name_decl("_CRS", crs)); + + for (i =3D 0; i < MIN(MAX_FD, ACPI_FDE_MAX_FD); i++) { + FloppyDriveType type =3D isa_fdc_get_drive_type(isadev, i); + + if (type < FLOPPY_DRIVE_TYPE_NONE) { + fde_buf[i] =3D cpu_to_le32(1); /* drive present */ + aml_append(dev, build_fdinfo_aml(i, type)); + } + } + aml_append(dev, aml_name_decl("_FDE", + aml_buffer(sizeof(fde_buf), (uint8_t *)fde_buf))); + + aml_append(scope, dev); +} + static const VMStateDescription vmstate_isa_fdc =3D{ .name =3D "fdc", .version_id =3D 2, @@ -2797,11 +2878,13 @@ static Property isa_fdc_properties[] =3D { static void isabus_fdc_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); + ISADeviceClass *isa =3D ISA_DEVICE_CLASS(klass); =20 dc->realize =3D isabus_fdc_realize; dc->fw_name =3D "fdc"; dc->reset =3D fdctrl_external_reset_isa; dc->vmsd =3D &vmstate_isa_fdc; + isa->build_aml =3D fdc_isa_build_aml; device_class_set_props(dc, isa_fdc_properties); set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); } diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 12a017e1f45b..7415bd5fdce0 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1052,85 +1052,6 @@ static void build_hpet_aml(Aml *table) aml_append(table, scope); } =20 -static Aml *build_fdinfo_aml(int idx, FloppyDriveType type) -{ - Aml *dev, *fdi; - uint8_t maxc, maxh, maxs; - - isa_fdc_get_drive_max_chs(type, &maxc, &maxh, &maxs); - - dev =3D aml_device("FLP%c", 'A' + idx); - - aml_append(dev, aml_name_decl("_ADR", aml_int(idx))); - - fdi =3D aml_package(16); - aml_append(fdi, aml_int(idx)); /* Drive Number */ - aml_append(fdi, - aml_int(cmos_get_fd_drive_type(type))); /* Device Type */ - /* - * the values below are the limits of the drive, and are thus independ= ent - * of the inserted media - */ - aml_append(fdi, aml_int(maxc)); /* Maximum Cylinder Number */ - aml_append(fdi, aml_int(maxs)); /* Maximum Sector Number */ - aml_append(fdi, aml_int(maxh)); /* Maximum Head Number */ - /* - * SeaBIOS returns the below values for int 0x13 func 0x08 regardless = of - * the drive type, so shall we - */ - aml_append(fdi, aml_int(0xAF)); /* disk_specify_1 */ - aml_append(fdi, aml_int(0x02)); /* disk_specify_2 */ - aml_append(fdi, aml_int(0x25)); /* disk_motor_wait */ - aml_append(fdi, aml_int(0x02)); /* disk_sector_siz */ - aml_append(fdi, aml_int(0x12)); /* disk_eot */ - aml_append(fdi, aml_int(0x1B)); /* disk_rw_gap */ - aml_append(fdi, aml_int(0xFF)); /* disk_dtl */ - aml_append(fdi, aml_int(0x6C)); /* disk_formt_gap */ - aml_append(fdi, aml_int(0xF6)); /* disk_fill */ - aml_append(fdi, aml_int(0x0F)); /* disk_head_sttl */ - aml_append(fdi, aml_int(0x08)); /* disk_motor_strt */ - - aml_append(dev, aml_name_decl("_FDI", fdi)); - return dev; -} - -static Aml *build_fdc_device_aml(ISADevice *fdc) -{ - int i; - Aml *dev; - Aml *crs; - -#define ACPI_FDE_MAX_FD 4 - uint32_t fde_buf[5] =3D { - 0, 0, 0, 0, /* presence of floppy drives #0 - #3 */ - cpu_to_le32(2) /* tape presence (2 =3D=3D never present) */ - }; - - dev =3D aml_device("FDC0"); - aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0700"))); - - crs =3D aml_resource_template(); - aml_append(crs, aml_io(AML_DECODE16, 0x03F2, 0x03F2, 0x00, 0x04)); - aml_append(crs, aml_io(AML_DECODE16, 0x03F7, 0x03F7, 0x00, 0x01)); - aml_append(crs, aml_irq_no_flags(6)); - aml_append(crs, - aml_dma(AML_COMPATIBILITY, AML_NOTBUSMASTER, AML_TRANSFER8, 2)); - aml_append(dev, aml_name_decl("_CRS", crs)); - - for (i =3D 0; i < MIN(MAX_FD, ACPI_FDE_MAX_FD); i++) { - FloppyDriveType type =3D isa_fdc_get_drive_type(fdc, i); - - if (type < FLOPPY_DRIVE_TYPE_NONE) { - fde_buf[i] =3D cpu_to_le32(1); /* drive present */ - aml_append(dev, build_fdinfo_aml(i, type)); - } - } - aml_append(dev, aml_name_decl("_FDE", - aml_buffer(sizeof(fde_buf), (uint8_t *)fde_buf))); - - return dev; -} - static Aml *build_kbd_device_aml(void) { Aml *dev; @@ -1169,7 +1090,6 @@ static Aml *build_mouse_device_aml(void) =20 static void build_isa_devices_aml(Aml *table) { - ISADevice *fdc =3D pc_find_fdc0(); bool ambiguous; =20 Aml *scope =3D aml_scope("_SB.PCI0.ISA"); @@ -1177,9 +1097,6 @@ static void build_isa_devices_aml(Aml *table) =20 aml_append(scope, build_kbd_device_aml()); aml_append(scope, build_mouse_device_aml()); - if (fdc) { - aml_append(scope, build_fdc_device_aml(fdc)); - } =20 if (ambiguous) { error_report("Multiple ISA busses, unable to define IPMI ACPI data= "); diff --git a/stubs/cmos.c b/stubs/cmos.c new file mode 100644 index 000000000000..416cbe4055ff --- /dev/null +++ b/stubs/cmos.c @@ -0,0 +1,7 @@ +#include "qemu/osdep.h" +#include "hw/i386/pc.h" + +int cmos_get_fd_drive_type(FloppyDriveType fd0) +{ + return 0; +} diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs index 45be5dc0ed78..3cbe472d1c6c 100644 --- a/stubs/Makefile.objs +++ b/stubs/Makefile.objs @@ -3,6 +3,7 @@ stub-obj-y +=3D bdrv-next-monitor-owned.o stub-obj-y +=3D blk-commit-all.o stub-obj-y +=3D blockdev-close-all-bdrv-states.o stub-obj-y +=3D clock-warp.o +stub-obj-y +=3D cmos.o stub-obj-y +=3D cpu-get-clock.o stub-obj-y +=3D cpu-get-icount.o stub-obj-y +=3D dump.o --=20 2.18.2 From nobody Sat May 18 22:31:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1588169492; cv=none; d=zohomail.com; s=zohoarc; b=ShYm2JSmkU1VWdfm1GngCv2kcCmY+w0w7cD4a3H+0IjIzbLFgcOBux6Wknv2L+1Md/J8FEI2z3tJsGAvtMF8VLSJgyDj0Rq7ViWPOZ5RkQNdTQPdP6IcydR93fg+JGyP791LKnpSjK5J64dHWGiIofJFs+3WFddJeXNRw3EKbnQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588169492; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=F16+T9NFP4BBchnJjwW3c4sI3G9GYIfTk4uvXJhp3H4=; b=Kkm+enpQXf0rexU8WUZBik6KfK1iVO63mnenmBDALzTzLGKxs7+oeLCk3r5Ey3lMuWxYlwTMhZSbrwSfc1E+2rUuqZii+a4JG5Lcq1wUvnnfqNuOu8zu1p6MCJHqYI2mM4cSHTQ4UliLcaUBdfNr1YuDCP6FNVpInFDu6xf7CO4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588169492686847.3465687853279; Wed, 29 Apr 2020 07:11:32 -0700 (PDT) Received: from localhost ([::1]:39642 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTnQx-0003Z0-2i for importer@patchew.org; Wed, 29 Apr 2020 10:11:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42518) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTnGn-0002N2-OK for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:01:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jTnGG-0003ys-Ct for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:01:01 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:54603 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jTnGF-0003y3-UK for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:00:27 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-514-b5Q2hmsLP_WjMsXFdOH7fg-1; Wed, 29 Apr 2020 10:00:20 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 27B999116D; Wed, 29 Apr 2020 14:00:19 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-193.ams2.redhat.com [10.36.113.193]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5C2E228544; Wed, 29 Apr 2020 14:00:18 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id A351E9DA8; Wed, 29 Apr 2020 16:00:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588168827; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=F16+T9NFP4BBchnJjwW3c4sI3G9GYIfTk4uvXJhp3H4=; b=Dnf1zmxgb39Iz/wqnV9r3Eo6sB4SCDuGs650vv18ipzc+PY+Uyo34y/6qTaBDTaWXeaUwG zVf+6lhQGejb11G0JA8NbeceLA5yXbzQF3L9IDgHanX/kDInkfVeA+WVyrCh8iPkvllKZ2 ZKcTZBN3ExcmNuslwzKvRSk0PXJYg3Q= X-MC-Unique: b5Q2hmsLP_WjMsXFdOH7fg-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v3 13/15] acpi: move aml builder code for i8042 (kbd+mouse) device Date: Wed, 29 Apr 2020 16:00:01 +0200 Message-Id: <20200429140003.7336-14-kraxel@redhat.com> In-Reply-To: <20200429140003.7336-1-kraxel@redhat.com> References: <20200429140003.7336-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.120; envelope-from=kraxel@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/29 01:42:37 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Laurent Vivier , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, "Michael S. Tsirkin" , Max Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , Paolo Bonzini , Igor Mammedov , John Snow , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann Reviewed-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/i386/acpi-build.c | 39 --------------------------------------- hw/input/pckbd.c | 31 +++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 39 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 7415bd5fdce0..643e875c05a5 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1052,42 +1052,6 @@ static void build_hpet_aml(Aml *table) aml_append(table, scope); } =20 -static Aml *build_kbd_device_aml(void) -{ - Aml *dev; - Aml *crs; - - dev =3D aml_device("KBD"); - aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0303"))); - - aml_append(dev, aml_name_decl("_STA", aml_int(0xf))); - - crs =3D aml_resource_template(); - aml_append(crs, aml_io(AML_DECODE16, 0x0060, 0x0060, 0x01, 0x01)); - aml_append(crs, aml_io(AML_DECODE16, 0x0064, 0x0064, 0x01, 0x01)); - aml_append(crs, aml_irq_no_flags(1)); - aml_append(dev, aml_name_decl("_CRS", crs)); - - return dev; -} - -static Aml *build_mouse_device_aml(void) -{ - Aml *dev; - Aml *crs; - - dev =3D aml_device("MOU"); - aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0F13"))); - - aml_append(dev, aml_name_decl("_STA", aml_int(0xf))); - - crs =3D aml_resource_template(); - aml_append(crs, aml_irq_no_flags(12)); - aml_append(dev, aml_name_decl("_CRS", crs)); - - return dev; -} - static void build_isa_devices_aml(Aml *table) { bool ambiguous; @@ -1095,9 +1059,6 @@ static void build_isa_devices_aml(Aml *table) Aml *scope =3D aml_scope("_SB.PCI0.ISA"); Object *obj =3D object_resolve_path_type("", TYPE_ISA_BUS, &ambiguous); =20 - aml_append(scope, build_kbd_device_aml()); - aml_append(scope, build_mouse_device_aml()); - if (ambiguous) { error_report("Multiple ISA busses, unable to define IPMI ACPI data= "); } else if (!obj) { diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c index 60a41303203a..29d633ca9478 100644 --- a/hw/input/pckbd.c +++ b/hw/input/pckbd.c @@ -26,6 +26,7 @@ #include "qemu/log.h" #include "hw/isa/isa.h" #include "migration/vmstate.h" +#include "hw/acpi/aml-build.h" #include "hw/input/ps2.h" #include "hw/irq.h" #include "hw/input/i8042.h" @@ -561,12 +562,42 @@ static void i8042_realizefn(DeviceState *dev, Error *= *errp) qemu_register_reset(kbd_reset, s); } =20 +static void i8042_build_aml(ISADevice *isadev, Aml *scope) +{ + Aml *kbd; + Aml *mou; + Aml *crs; + + crs =3D aml_resource_template(); + aml_append(crs, aml_io(AML_DECODE16, 0x0060, 0x0060, 0x01, 0x01)); + aml_append(crs, aml_io(AML_DECODE16, 0x0064, 0x0064, 0x01, 0x01)); + aml_append(crs, aml_irq_no_flags(1)); + + kbd =3D aml_device("KBD"); + aml_append(kbd, aml_name_decl("_HID", aml_eisaid("PNP0303"))); + aml_append(kbd, aml_name_decl("_STA", aml_int(0xf))); + aml_append(kbd, aml_name_decl("_CRS", crs)); + + crs =3D aml_resource_template(); + aml_append(crs, aml_irq_no_flags(12)); + + mou =3D aml_device("MOU"); + aml_append(mou, aml_name_decl("_HID", aml_eisaid("PNP0F13"))); + aml_append(mou, aml_name_decl("_STA", aml_int(0xf))); + aml_append(mou, aml_name_decl("_CRS", crs)); + + aml_append(scope, kbd); + aml_append(scope, mou); +} + static void i8042_class_initfn(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); + ISADeviceClass *isa =3D ISA_DEVICE_CLASS(klass); =20 dc->realize =3D i8042_realizefn; dc->vmsd =3D &vmstate_kbd_isa; + isa->build_aml =3D i8042_build_aml; set_bit(DEVICE_CATEGORY_INPUT, dc->categories); } =20 --=20 2.18.2 From nobody Sat May 18 22:31:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1588169128; cv=none; d=zohomail.com; s=zohoarc; b=fXWtp6A9vCPpZR0Fj89WBNjonMDEYZF0kJS2qNE+Rs2LJz/JMmEfcmmtpBolrwxKgUdQWOyI2HnjjEifqBY2aejq3HsEROLTGknw2SqHNkRgom/RN4lSxqUT2yR5QEMe7pl8rfb4Zt7qd37oMlWXCh1xFm4RFgAlOtkVBKfxfEo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588169128; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=f/It/ZA+R3p3hYtBP/kFTBvIq2cDsS7LMF3deJDMLj0=; b=EW1XRy1W6m0UzL+MFYE/0JVYBGfebmlNAbXPfx6NwbeR61aO0KStrByec9pBBCzfrcy/NCLKr+OJm+HaxTk/rxLHxZFFanubDyTE142uPCLZWUBWgFtDZkumcbmmJxrGrmXHMj5pOJhy7jARreZ69me0BF+p9PAay4rgWk8RuTs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588169128014403.11756160783193; Wed, 29 Apr 2020 07:05:28 -0700 (PDT) Received: from localhost ([::1]:42416 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTnL4-0008LE-Fz for importer@patchew.org; Wed, 29 Apr 2020 10:05:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42458) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTnGi-0002HX-6H for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:01:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jTnGD-0003vB-2t for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:00:55 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:36095 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jTnGC-0003tP-L8 for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:00:24 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-404-dLHX3XuOMyGm0CaZwNcO2w-1; Wed, 29 Apr 2020 10:00:21 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E7077107ACF2; Wed, 29 Apr 2020 14:00:19 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-193.ams2.redhat.com [10.36.113.193]) by smtp.corp.redhat.com (Postfix) with ESMTP id 098AD99D1; Wed, 29 Apr 2020 14:00:19 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id AF3009DA9; Wed, 29 Apr 2020 16:00:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588168823; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=f/It/ZA+R3p3hYtBP/kFTBvIq2cDsS7LMF3deJDMLj0=; b=bpWEJcmKQY47xZ6uftJqllBE83tsURvvuy7ZXG3KzXaz4l9uPPbLDBu5zdgdXufZzg7oXY eguHAkT4qS+no0Lxb/1IvqQ2MO4UajbwSSW6Qg4UOFRGReIK+13ym4iwXwWGH1DjppvbVU VmzvHWySIJR9O/5EO8ylelqwd9zENEo= X-MC-Unique: dLHX3XuOMyGm0CaZwNcO2w-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v3 14/15] acpi: factor out fw_cfg_add_acpi_dsdt() Date: Wed, 29 Apr 2020 16:00:02 +0200 Message-Id: <20200429140003.7336-15-kraxel@redhat.com> In-Reply-To: <20200429140003.7336-1-kraxel@redhat.com> References: <20200429140003.7336-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.120; envelope-from=kraxel@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/29 01:42:37 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Laurent Vivier , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, "Michael S. Tsirkin" , Max Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , Paolo Bonzini , Igor Mammedov , John Snow , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Add helper function to add fw_cfg device, also move code to hw/i386/fw_cfg.c. Signed-off-by: Gerd Hoffmann Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Igor Mammedov --- hw/i386/fw_cfg.h | 1 + hw/i386/acpi-build.c | 24 +----------------------- hw/i386/fw_cfg.c | 28 ++++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 23 deletions(-) diff --git a/hw/i386/fw_cfg.h b/hw/i386/fw_cfg.h index 9e742787792b..275f15c1c5e8 100644 --- a/hw/i386/fw_cfg.h +++ b/hw/i386/fw_cfg.h @@ -25,5 +25,6 @@ FWCfgState *fw_cfg_arch_create(MachineState *ms, uint16_t apic_id_limit); void fw_cfg_build_smbios(MachineState *ms, FWCfgState *fw_cfg); void fw_cfg_build_feature_control(MachineState *ms, FWCfgState *fw_cfg); +void fw_cfg_add_acpi_dsdt(Aml *scope, FWCfgState *fw_cfg); =20 #endif diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 643e875c05a5..a8b790021974 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1874,30 +1874,8 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, =20 /* create fw_cfg node, unconditionally */ { - /* when using port i/o, the 8-bit data register *always* overlaps - * with half of the 16-bit control register. Hence, the total size - * of the i/o region used is FW_CFG_CTL_SIZE; when using DMA, the - * DMA control register is located at FW_CFG_DMA_IO_BASE + 4 */ - uint8_t io_size =3D object_property_get_bool(OBJECT(x86ms->fw_cfg), - "dma_enabled", NULL) ? - ROUND_UP(FW_CFG_CTL_SIZE, 4) + sizeof(dma_addr_t= ) : - FW_CFG_CTL_SIZE; - scope =3D aml_scope("\\_SB.PCI0"); - dev =3D aml_device("FWCF"); - - aml_append(dev, aml_name_decl("_HID", aml_string("QEMU0002"))); - - /* device present, functioning, decoding, not shown in UI */ - aml_append(dev, aml_name_decl("_STA", aml_int(0xB))); - - crs =3D aml_resource_template(); - aml_append(crs, - aml_io(AML_DECODE16, FW_CFG_IO_BASE, FW_CFG_IO_BASE, 0x01, io_= size) - ); - aml_append(dev, aml_name_decl("_CRS", crs)); - - aml_append(scope, dev); + fw_cfg_add_acpi_dsdt(scope, x86ms->fw_cfg); aml_append(dsdt, scope); } =20 diff --git a/hw/i386/fw_cfg.c b/hw/i386/fw_cfg.c index da60ada59462..c55abfb01abb 100644 --- a/hw/i386/fw_cfg.c +++ b/hw/i386/fw_cfg.c @@ -15,6 +15,7 @@ #include "qemu/osdep.h" #include "sysemu/numa.h" #include "hw/acpi/acpi.h" +#include "hw/acpi/aml-build.h" #include "hw/firmware/smbios.h" #include "hw/i386/fw_cfg.h" #include "hw/timer/hpet.h" @@ -179,3 +180,30 @@ void fw_cfg_build_feature_control(MachineState *ms, FW= CfgState *fw_cfg) *val =3D cpu_to_le64(feature_control_bits | FEATURE_CONTROL_LOCKED); fw_cfg_add_file(fw_cfg, "etc/msr_feature_control", val, sizeof(*val)); } + +void fw_cfg_add_acpi_dsdt(Aml *scope, FWCfgState *fw_cfg) +{ + /* + * when using port i/o, the 8-bit data register *always* overlaps + * with half of the 16-bit control register. Hence, the total size + * of the i/o region used is FW_CFG_CTL_SIZE; when using DMA, the + * DMA control register is located at FW_CFG_DMA_IO_BASE + 4 + */ + Object *obj =3D OBJECT(fw_cfg); + uint8_t io_size =3D object_property_get_bool(obj, "dma_enabled", NULL)= ? + ROUND_UP(FW_CFG_CTL_SIZE, 4) + sizeof(dma_addr_t) : + FW_CFG_CTL_SIZE; + Aml *dev =3D aml_device("FWCF"); + Aml *crs =3D aml_resource_template(); + + aml_append(dev, aml_name_decl("_HID", aml_string("QEMU0002"))); + + /* device present, functioning, decoding, not shown in UI */ + aml_append(dev, aml_name_decl("_STA", aml_int(0xB))); + + aml_append(crs, + aml_io(AML_DECODE16, FW_CFG_IO_BASE, FW_CFG_IO_BASE, 0x01, io_size= )); + + aml_append(dev, aml_name_decl("_CRS", crs)); + aml_append(scope, dev); +} --=20 2.18.2 From nobody Sat May 18 22:31:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1588169363; cv=none; d=zohomail.com; s=zohoarc; b=LGAgjDZXG8KB2SRPYvi/W6hn5ojb7e+ouGbv9E4SvefJFZybCa8Dkf4z6oXP0XrQsDck5dBT0ofYTiTW5itmCOS0yOH9zR/g7FiXDHtwpg4OUhE3jvBsIUjAaR3eobjyi3Nj9tNz3MMfXdtqCbapwMkKsQ87GOiEz2cyxiFI6u0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588169363; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=n22B91IYToKPDnGhoaRPiX3EBwGdgVDWVvKNerABCAU=; b=TQPGzdVN/M5MmL2z35hWdJ4mSMk8MJjSItc0GxotQrro1gGKC115uu+nI5PoIevjHP94XK6xCjYDRKclHbhLZ/ya1nEaHQsLMiRrj/XvM4ih1ByMKmUo8640algbVGyOw0cfas+yWEdrWYuHcegrJIwzOmiwcAoZN5hjHgW/x+4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588169363222123.66085547162402; Wed, 29 Apr 2020 07:09:23 -0700 (PDT) Received: from localhost ([::1]:59686 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTnOr-0008U1-BB for importer@patchew.org; Wed, 29 Apr 2020 10:09:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42480) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTnGj-0002JB-Tx for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:01:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jTnGE-0003wB-Ax for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:00:57 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:24196) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jTnGD-0003vl-Us for qemu-devel@nongnu.org; Wed, 29 Apr 2020 10:00:25 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-7-WKFz3I-kMLWnDitecz7ARw-1; Wed, 29 Apr 2020 10:00:20 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 22749835B41; Wed, 29 Apr 2020 14:00:19 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-193.ams2.redhat.com [10.36.113.193]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9222F28550; Wed, 29 Apr 2020 14:00:18 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id B81549DAA; Wed, 29 Apr 2020 16:00:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588168825; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=n22B91IYToKPDnGhoaRPiX3EBwGdgVDWVvKNerABCAU=; b=VaC2djYWKxmUIq06Q+cQoL8bBT6sv5uvtchqzLiWwYy6f9Pkt41bn7JA4hfnKEoPdgf3Vz TwdJQrAK/fF6YLPpEiMHZA/ju/nk6LizOR9JH0uPBabzUnZ7VeS4C5oUyDuln7uWBbsmrX xHOgQTH4g3sDUYjncnR0WNL0LXb3ajg= X-MC-Unique: WKFz3I-kMLWnDitecz7ARw-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v3 15/15] acpi: simplify build_isa_devices_aml() Date: Wed, 29 Apr 2020 16:00:03 +0200 Message-Id: <20200429140003.7336-16-kraxel@redhat.com> In-Reply-To: <20200429140003.7336-1-kraxel@redhat.com> References: <20200429140003.7336-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.81; envelope-from=kraxel@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/29 01:28:11 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Laurent Vivier , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, "Michael S. Tsirkin" , Max Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , Paolo Bonzini , Igor Mammedov , John Snow , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" x86 machines can have a single ISA bus only. Signed-off-by: Gerd Hoffmann --- hw/i386/acpi-build.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index a8b790021974..98b3fd1cdb14 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1055,19 +1055,14 @@ static void build_hpet_aml(Aml *table) static void build_isa_devices_aml(Aml *table) { bool ambiguous; - - Aml *scope =3D aml_scope("_SB.PCI0.ISA"); Object *obj =3D object_resolve_path_type("", TYPE_ISA_BUS, &ambiguous); + Aml *scope; =20 - if (ambiguous) { - error_report("Multiple ISA busses, unable to define IPMI ACPI data= "); - } else if (!obj) { - error_report("No ISA bus, unable to define IPMI ACPI data"); - } else { - build_acpi_ipmi_devices(scope, BUS(obj), "\\_SB.PCI0.ISA"); - isa_build_aml(ISA_BUS(obj), scope); - } + assert(obj && !ambiguous); =20 + scope =3D aml_scope("_SB.PCI0.ISA"); + build_acpi_ipmi_devices(scope, BUS(obj), "\\_SB.PCI0.ISA"); + isa_build_aml(ISA_BUS(obj), scope); aml_append(table, scope); } =20 --=20 2.18.2