From patchwork Wed Jul 13 08:17:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 12916255 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 655C4C433EF for ; Wed, 13 Jul 2022 08:26:05 +0000 (UTC) Received: from localhost ([::1]:35020 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBXh6-0004f6-Do for qemu-devel@archiver.kernel.org; Wed, 13 Jul 2022 04:26:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38146) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBXZW-0005cH-Pq for qemu-devel@nongnu.org; Wed, 13 Jul 2022 04:18:14 -0400 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]:38910) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oBXZU-0004mw-1d for qemu-devel@nongnu.org; Wed, 13 Jul 2022 04:18:14 -0400 Received: by mail-ed1-x52c.google.com with SMTP id fd6so13100708edb.5 for ; Wed, 13 Jul 2022 01:18:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TsQkvWvy9rR281aclrHcJiJxmz0ne6wj08lCmwkqTXA=; b=CtsK37mNTFD9IwyfANbx+Xuj6hImAM1V5fFzprWgo5QtYPb9HsOFH7vc7GZJoksAGF /AlaVQScJW5tBR0l60czicr9SR3sNfOKaNDF0nNISSBD8tAuum7SQT07k9qcspC5XJ+F vrxotQrA4X9VRw7XEKXNZ6r1KbDuc0v15nQ4Aox141dPeR7N0mXP6kGa784I0qoURGUx VH0BpcA7YDlJIWhYsWJOdbiHgs/1OY0JmeZujV2q+YwhPW5PkwQ4X3o76tf2H9CeEw9e VnM4ZaMK7fIii1ylUoOO9L/o3qAXdsB1DvHH34HZqPhI4QWqbWYvMxedQdWl0FEXQflZ 3glw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TsQkvWvy9rR281aclrHcJiJxmz0ne6wj08lCmwkqTXA=; b=deYtpdHy9sVL0jCzHgeZLfsSNnO+63+2gRDom9Muj8K5lDn355frLBlChRldy27u9M 4kdq/aaX4VZAR2KiibgpuU/O3AmVr1/ZqKZBTEMkNyD3Rznx57PK473obnuKKHwk9QW/ 9C/v/0Kr72xDSiciNhQORlyAFlZgSUJS5jOeB8QPV0XL1jBAjjO2vKFblZzTp5lbMUrL iyOiXvzwLQSiHv5y27bNglmkgHI2U4tt2qFKXnyz+XoJW0i+36kNT4tmR4A7u41j8rLi egpV9MNuz5zk+rg0Y4pL5jTrMeVCJnD55QilOOuN6o0H04AVOHlLqz0+5eCitDON9u9K vDuA== X-Gm-Message-State: AJIora84zyv8+Rzi2j+cXmOuwLZY5t63LNd/9mX2auodpeUfJrejqwRQ +maywoU0IXB96PrjYVr+vvsQwfqQpkA= X-Google-Smtp-Source: AGRyM1v73Ed8ZHj1D0zvkg77g5PO2wyYRpCHGZ656tDYf65ATZlFENLd+TmG+ZNWTTLeO6xPElZ0NA== X-Received: by 2002:a05:6402:40d6:b0:43a:cc69:1db9 with SMTP id z22-20020a05640240d600b0043acc691db9mr3193915edb.380.1657700289959; Wed, 13 Jul 2022 01:18:09 -0700 (PDT) Received: from localhost.localdomain (dynamic-077-183-210-047.77.183.pool.telefonica.de. [77.183.210.47]) by smtp.gmail.com with ESMTPSA id w13-20020aa7dccd000000b00435a62d35b5sm7483431edu.45.2022.07.13.01.18.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jul 2022 01:18:09 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , Eduardo Habkost , Paolo Bonzini , Marcel Apfelbaum , Richard Henderson , =?utf-8?q?Herv=C3=A9_Pous?= =?utf-8?q?sineau?= , Aurelien Jarno , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Bernhard Beschow Subject: [PATCH 00/11] QOM'ify PIIX3 southbridge Date: Wed, 13 Jul 2022 10:17:24 +0200 Message-Id: <20220713081735.112016-1-shentey@gmail.com> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52c; envelope-from=shentey@gmail.com; helo=mail-ed1-x52c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Similar to PIIX4 this series QOM'ifies internal device creation for PIIX3. This reduces the delta between the implementations of PIIX3 and PIIX4 and therefore might allow to merge both implementations in the future. There were two challenges in this series: First, QEMU considers the ACPI and USB functions to be optional in PIIX3. When instantiating those with object_initialize_child(), they need to be unparented in the realize function to prevent an assertion (see respective commit messages). Second, the PIC used to be instantiated outside of the southbridge while some sub functions require a PIC with populated qemu_irqs. This has been solved by introducing a proxy PIC which furthermore allows PIIX3 to be agnostic towards the virtualization technology used (KVM, TCG, Xen). Testing done: * make check * make check-avocado * Boot live CD: * qemu-system-x86_64 -M pc -m 2G -accel kvm -cpu host -cdrom manjaro-kde-21.3.2-220704-linux515.iso * qemu-system-x86_64 -M q35 -m 2G -accel kvm -cpu host -cdrom manjaro-kde-21.3.2-220704-linux515.iso Bernhard Beschow (11): hw/i386/pc: QOM'ify DMA creation hw/i386/pc_piix: Allow for setting properties before realizing PIIX3 southbridge hw/isa/piix3: QOM'ify USB controller creation hw/isa/piix3: QOM'ify ACPI controller creation hw/i386/pc: QOM'ify RTC creation hw/i386/pc: No need for rtc_state to be an out-parameter hw/intc/i8259: Introduce i8259 proxy "isa-pic" hw/isa/piix3: QOM'ify ISA PIC creation hw/isa/piix3: QOM'ify IDE controller creation hw/isa/piix3: Wire up ACPI interrupt internally hw/isa/piix3: Remove extra ';' outside of functions hw/i386/Kconfig | 1 - hw/i386/pc.c | 17 ++++--- hw/i386/pc_piix.c | 70 ++++++++++++++++------------- hw/i386/pc_q35.c | 3 +- hw/intc/i8259.c | 27 +++++++++++ hw/isa/Kconfig | 1 + hw/isa/lpc_ich9.c | 11 +++++ hw/isa/piix3.c | 84 ++++++++++++++++++++++++++++++++--- include/hw/i386/ich9.h | 2 + include/hw/i386/pc.h | 2 +- include/hw/intc/i8259.h | 14 ++++++ include/hw/southbridge/piix.h | 16 ++++++- 12 files changed, 201 insertions(+), 47 deletions(-)