From patchwork Tue Jan 31 11:53:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13122919 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 D3FB5C636D3 for ; Tue, 31 Jan 2023 11:54:12 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMpD2-00061i-6m; Tue, 31 Jan 2023 06:53:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMpD0-000606-17; Tue, 31 Jan 2023 06:53:54 -0500 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pMpCy-0002Kh-8w; Tue, 31 Jan 2023 06:53:53 -0500 Received: by mail-ed1-x530.google.com with SMTP id q19so4196317edd.2; Tue, 31 Jan 2023 03:53:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+H/hm+NzJf5UK4Gy3W0jifT6di0xnThf7l7iJbMFcRQ=; b=J3/gfD35FFPJlaMStFUC2d5+NrMjog26RghZv65GWxfhwDcrsK9XQ9vgrxuuTc0zXG JyXcZ5bzYspEj6s1Fg99D6X/Q0GndW52E2anpfWhVywJ0Doa2qiPUTU+lqi97EBewdTm lb3DzEy2ezPnrjTTNjwUKmqPQU1en4a6MdCLZzOYPjlSDx4VEsdsqT5jblnIoYXXxXxE Gh2ao8yaNZWcEIhwG7ktsLrmrzrNwL7pUw/oMWCamAkzspOnkWBkIU9XmRKz4LA3jiNO OP2/yGseIPDthSaIPQe5AUAMyQUMOWZOHmQkYr4RHk79iDanxyDGWItrkk7t542hzeQ+ a0Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+H/hm+NzJf5UK4Gy3W0jifT6di0xnThf7l7iJbMFcRQ=; b=3KjgVhzOAkco4yNNmwFAccaudwh/PmoUnC0e9oDJVKsd1HuTTe7QmCXtvSJf5oqAOi Glxzz+IB/l428R4tWUclMU8uoFH/gm/iYxhSeiELU2YRXbwWkOUNswdVUYGdn3Y/Frpw kblY1RcOCzPIL5pxnOuIxNsBjqTjee3HWtm+fS0lZUM/qnJOqih8AL8yntEqQC9GdYuN etywXSSLPGmpzlxCt30B8ZnT1oH26kAzWGrNlwySK0A+tlnJtlpaqYRu8zwf/40GNZGA T1NPENKHfI+1R58CNgVN3pR2rWPlnVJ7jBcK8L7NX+IFcIK/PS1ys/3b+ErjnnZt75Fn ZixA== X-Gm-Message-State: AO0yUKXOmfMgfDzuSw9meH2LDXHQR+4l3Ht8B+7PLqyCr22l+P61aUaF YhCmlyJlsFU6Qx2sgKnTewZK91+2m1w= X-Google-Smtp-Source: AK7set+V3mdoe10qLyNeSQ8OPSKDtF3Fi5eZ5vfwoiNyEmAb/bkM1ihxTPd/XHGB2bzRmBcSM6eWuA== X-Received: by 2002:a05:6402:1010:b0:4a0:b64e:3db9 with SMTP id c16-20020a056402101000b004a0b64e3db9mr21677271edu.16.1675166030082; Tue, 31 Jan 2023 03:53:50 -0800 (PST) Received: from localhost.localdomain (dynamic-077-013-082-236.77.13.pool.telefonica.de. [77.13.82.236]) by smtp.gmail.com with ESMTPSA id c10-20020a056402100a00b00483dd234ac6sm8178318edu.96.2023.01.31.03.53.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 03:53:49 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Igor Mammedov , Richard Henderson , Ani Sinha , "Michael S. Tsirkin" , Paolo Bonzini , BALATON Zoltan , Thomas Huth , Marcel Apfelbaum , Eduardo Habkost , Laurent Vivier , Sunil Muthuswamy , qemu-trivial@nongnu.org, Bernhard Beschow Subject: [PATCH v2 01/20] hw/pci-host/i440fx: Inline sysbus_add_io() Date: Tue, 31 Jan 2023 12:53:07 +0100 Message-Id: <20230131115326.12454-2-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230131115326.12454-1-shentey@gmail.com> References: <20230131115326.12454-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=shentey@gmail.com; helo=mail-ed1-x530.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 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-bounces+qemu-devel=archiver.kernel.org@nongnu.org sysbus_add_io() just wraps memory_region_add_subregion() while also obscuring where the memory is attached. So use memory_region_add_subregion() directly and attach it to the existing memory region s->bus->address_space_io which is set as an alias to get_system_io() by the pc machine. Signed-off-by: Bernhard Beschow Reviewed-by: Thomas Huth --- hw/pci-host/i440fx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c index 262f82c303..9c6882d3fc 100644 --- a/hw/pci-host/i440fx.c +++ b/hw/pci-host/i440fx.c @@ -27,6 +27,7 @@ #include "qemu/range.h" #include "hw/i386/pc.h" #include "hw/pci/pci.h" +#include "hw/pci/pci_bus.h" #include "hw/pci/pci_host.h" #include "hw/pci-host/i440fx.h" #include "hw/qdev-properties.h" @@ -217,10 +218,10 @@ static void i440fx_pcihost_realize(DeviceState *dev, Error **errp) PCIHostState *s = PCI_HOST_BRIDGE(dev); SysBusDevice *sbd = SYS_BUS_DEVICE(dev); - sysbus_add_io(sbd, 0xcf8, &s->conf_mem); + memory_region_add_subregion(s->bus->address_space_io, 0xcf8, &s->conf_mem); sysbus_init_ioports(sbd, 0xcf8, 4); - sysbus_add_io(sbd, 0xcfc, &s->data_mem); + memory_region_add_subregion(s->bus->address_space_io, 0xcfc, &s->data_mem); sysbus_init_ioports(sbd, 0xcfc, 4); /* register i440fx 0xcf8 port as coalesced pio */ From patchwork Tue Jan 31 11:53:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13122920 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 C379EC38142 for ; Tue, 31 Jan 2023 11:54:12 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMpD1-00060y-Ms; Tue, 31 Jan 2023 06:53:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMpD0-00060Y-SL; Tue, 31 Jan 2023 06:53:54 -0500 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pMpCz-0002Kz-CX; Tue, 31 Jan 2023 06:53:54 -0500 Received: by mail-ed1-x534.google.com with SMTP id n6so11500332edo.9; Tue, 31 Jan 2023 03:53:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=61dfWITivyOsWdkZHZZ+3qa///PN8JSZFtxNj4kIeZg=; b=KSZGjo0ogoBSW81ja62iNyQnTKVx/1uFWIHRfJwBHlRbidU0NFTtzbKt7Gu6RevuA5 lnSQTI+CiPmweXXiQMfa8DUHU2mX1bJ2aphF4/TfUBz8CtH0txov3EzwzMXcNTnfGWcG AzyJgVGAOle2Ny7bxJ6BksGHjAgV2lBBUHJVL+J+b46RcKaDFXH28+xE/5YgdfSz4Ir1 uOtv9bNgyhBK5f8dZauWA52oxBZZD7VgBxjSFnXTFJmTtCiFkpaJX36k+zfhWSVjEDuU OTOxkRWkd5kclUUgUjbOIScMzCsXD1W0lBIXg4ZrbhGo6tXrdnrCTAzKUQLTCGzSRpHR vPxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=61dfWITivyOsWdkZHZZ+3qa///PN8JSZFtxNj4kIeZg=; b=p6b8YcBtmEEzPfOYTAkRKQazUskZL0Q0Ww3R+1sgBtHyVea6NNeGUk7QqrDX4BCO/e r4G7G5MfnCYB0ueb1/3XbU4S6o7mVpSl2BfBWmosjcS8Mpp11s//kIrCddYUENQ8vgcq m8P07ScS2msl5EMg1f7Z+zCBwcZPkfZuZn7Soqt4sWovT3Bl6ZVRVEw06N4E2Ynw1oDr OYvWtS22y3W4dEdDkcjR/SaTFNySn4OE52ycaEthvaFJfe7lX1PPdFHMvvUmvU45B9wU VKDJN9oajqF3oWSQJtkcKYEpQghXCYrpYrua+FkmGcQMWDclX/Gi4Sda743i0SsfzBXq w+2g== X-Gm-Message-State: AO0yUKWOpDpBI7MOcPkDapNwnjT3Mlg6ztJri+SJhcyihv4/u0vcWQhq UBhsKW5+75RD2AZ9H1IBGzzji9FkYTs= X-Google-Smtp-Source: AK7set9syy5v0Rd1yeW+Lwmz/PLeidz0LNhVsYV08ziIDnVfh6ZmZ3oPdnBB0U52sAPzuAq3QpT8nw== X-Received: by 2002:a05:6402:43cc:b0:49e:a0f7:9a75 with SMTP id p12-20020a05640243cc00b0049ea0f79a75mr3366934edc.12.1675166031354; Tue, 31 Jan 2023 03:53:51 -0800 (PST) Received: from localhost.localdomain (dynamic-077-013-082-236.77.13.pool.telefonica.de. [77.13.82.236]) by smtp.gmail.com with ESMTPSA id c10-20020a056402100a00b00483dd234ac6sm8178318edu.96.2023.01.31.03.53.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 03:53:51 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Igor Mammedov , Richard Henderson , Ani Sinha , "Michael S. Tsirkin" , Paolo Bonzini , BALATON Zoltan , Thomas Huth , Marcel Apfelbaum , Eduardo Habkost , Laurent Vivier , Sunil Muthuswamy , qemu-trivial@nongnu.org, Bernhard Beschow Subject: [PATCH v2 02/20] hw/pci-host/q35: Inline sysbus_add_io() Date: Tue, 31 Jan 2023 12:53:08 +0100 Message-Id: <20230131115326.12454-3-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230131115326.12454-1-shentey@gmail.com> References: <20230131115326.12454-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::534; envelope-from=shentey@gmail.com; helo=mail-ed1-x534.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 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-bounces+qemu-devel=archiver.kernel.org@nongnu.org sysbus_add_io() just wraps memory_region_add_subregion() while also obscuring where the memory is attached. So use memory_region_add_subregion() directly and attach it to the existing memory region s->mch.address_space_io which is set as an alias to get_system_io() by the q35 machine. Signed-off-by: Bernhard Beschow Reviewed-by: Thomas Huth --- hw/pci-host/q35.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c index 26390863d6..fa05844319 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@ -50,10 +50,12 @@ static void q35_host_realize(DeviceState *dev, Error **errp) Q35PCIHost *s = Q35_HOST_DEVICE(dev); SysBusDevice *sbd = SYS_BUS_DEVICE(dev); - sysbus_add_io(sbd, MCH_HOST_BRIDGE_CONFIG_ADDR, &pci->conf_mem); + memory_region_add_subregion(s->mch.address_space_io, + MCH_HOST_BRIDGE_CONFIG_ADDR, &pci->conf_mem); sysbus_init_ioports(sbd, MCH_HOST_BRIDGE_CONFIG_ADDR, 4); - sysbus_add_io(sbd, MCH_HOST_BRIDGE_CONFIG_DATA, &pci->data_mem); + memory_region_add_subregion(s->mch.address_space_io, + MCH_HOST_BRIDGE_CONFIG_DATA, &pci->data_mem); sysbus_init_ioports(sbd, MCH_HOST_BRIDGE_CONFIG_DATA, 4); /* register q35 0xcf8 port as coalesced pio */ From patchwork Tue Jan 31 11:53:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13122923 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 364C7C38142 for ; Tue, 31 Jan 2023 11:54:19 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMpD3-00065f-48; Tue, 31 Jan 2023 06:53:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMpD1-000616-Mw; Tue, 31 Jan 2023 06:53:55 -0500 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pMpD0-0002LF-8p; Tue, 31 Jan 2023 06:53:55 -0500 Received: by mail-ed1-x52e.google.com with SMTP id cw4so9003683edb.13; Tue, 31 Jan 2023 03:53:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=P7kVESaQNShpQPsRNC9Brnvan+iBx6TlgfEej59IhxY=; b=EvTAn7SlwPfJOKjNQ6MSEg5z8JIP3VQMLJGgxnVHMT9MhtnDDypLCc451j5f9z6wFU Zr44/DKVsi6inZx1rzpkmJP5idOgtkWFojgX4MSyOeckhKV8rqDZH8VeecWy7lPlSf2J e+lrZsS6358lrQd/0QbE0ur+RSW9tX7g/3uOUL/JT3UemshUshqQjkKCK5Ze9ZEk6Dl/ oAAMBBc9EyYHd4v+nkEgMAUsm79zUq6mbAQfInANb2spVDqpbIjKIPO2O3mJwmTMIjPr s4/rLYj7hzmwwa46IJ9DpMsXs77XcoCWhk6YGPlyC8DNLIBx4acTltbSTa+WAYCX4nf6 v7ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=P7kVESaQNShpQPsRNC9Brnvan+iBx6TlgfEej59IhxY=; b=vygCayUlOsLyXcjshvBbXW+EdL+b4jJRDn1u4RF0zVN3UCy6CxnetOnaEGkQbh1sAK iRtD6X72fwCEHbSL1xl9FfesGqM2E8JSpPXR3165pPLzXZuXw9IUCMEQEDdQzjlumywl auOb9MgnDSXa/TIBrNV8SpA5/YTqkxkvmMLtVGTDWFeTX3OuXyEuqYIO9u1QAM6cDtFr wkxBwxespb4vzEoDe0aTPaszfrSfk0ScDrliHv/bfl712k4v91JvlJwyKQeW/sRdCJlX rtmUooN9+8cyUm40tMhTBIBs4mDFrYKaN86eUJqpKiOuH5W7Q3emS9YAky8Gee8Ec3sk kDzg== X-Gm-Message-State: AFqh2kpukFFn2e7Qn2L/PpLhJgJWLH+dx0R0VAejvURc8CxvxShKuMYC qqEAck6bbtKMAdW1aditWEvvN5kxzMU= X-Google-Smtp-Source: AMrXdXt2uZhGrzz2/SvFp3GyQhX8ANN4eAnGmDAF4fvwIQ8JDl92k5yA/MAbBNDSV/6x4OFORmuBXg== X-Received: by 2002:a05:6402:28c6:b0:49b:98be:c38 with SMTP id ef6-20020a05640228c600b0049b98be0c38mr58059296edb.11.1675166032329; Tue, 31 Jan 2023 03:53:52 -0800 (PST) Received: from localhost.localdomain (dynamic-077-013-082-236.77.13.pool.telefonica.de. [77.13.82.236]) by smtp.gmail.com with ESMTPSA id c10-20020a056402100a00b00483dd234ac6sm8178318edu.96.2023.01.31.03.53.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 03:53:52 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Igor Mammedov , Richard Henderson , Ani Sinha , "Michael S. Tsirkin" , Paolo Bonzini , BALATON Zoltan , Thomas Huth , Marcel Apfelbaum , Eduardo Habkost , Laurent Vivier , Sunil Muthuswamy , qemu-trivial@nongnu.org, Bernhard Beschow Subject: [PATCH v2 03/20] hw/i386/pc_q35: Reuse machine parameter Date: Tue, 31 Jan 2023 12:53:09 +0100 Message-Id: <20230131115326.12454-4-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230131115326.12454-1-shentey@gmail.com> References: <20230131115326.12454-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=shentey@gmail.com; helo=mail-ed1-x52e.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 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-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Bernhard Beschow Reviewed-by: Thomas Huth --- hw/i386/pc_q35.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 83c57c6eb1..351ef25f69 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -218,7 +218,7 @@ static void pc_q35_init(MachineState *machine) pc_memory_init(pcms, get_system_memory(), rom_memory, &ram_memory, pci_hole64_size); - object_property_add_child(qdev_get_machine(), "q35", OBJECT(q35_host)); + object_property_add_child(OBJECT(machine), "q35", OBJECT(q35_host)); object_property_set_link(OBJECT(q35_host), MCH_HOST_PROP_RAM_MEM, OBJECT(ram_memory), NULL); object_property_set_link(OBJECT(q35_host), MCH_HOST_PROP_PCI_MEM, From patchwork Tue Jan 31 11:53:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13122921 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 B8BB1C636D4 for ; Tue, 31 Jan 2023 11:54:14 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMpD5-0006CT-4I; Tue, 31 Jan 2023 06:53:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMpD3-00068z-TQ; Tue, 31 Jan 2023 06:53:57 -0500 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pMpD2-0002Ld-AT; Tue, 31 Jan 2023 06:53:57 -0500 Received: by mail-ed1-x533.google.com with SMTP id m8so4910607edd.10; Tue, 31 Jan 2023 03:53:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=t92b27dE+gGhz/kBBZjyJ9tzM1cgqKREqnkeDjI0BJ8=; b=Q7bV2Oq3cHPRrGnb0K7gYUkYr6NTwLma5WjR2j5E7f1tdbnJDVdZDJB+bCQnrpiZnU jnYk0b1URvNjPBRc2btYaH9Nc3V9uKP4acxAPp+5Ylheg5S1iRyCVsZQRHaqoZzp1cK2 4FI/tolt5deOx56N9baFpNUWYZoycZVMLK3rKfKvg69kQ7jyMxBnXSZ4/NHiDzEHSJWK 50zutiCRryFBN+Fyuyz/o7Hvkb8oZp1uQ4rvMhDKBRhQGh2/LpGlZONAgOPHwnBvDj/G ol3HDG3xtsACxXwlPQvQC7AbG36KuyRHNXZdfiobLpLY+fw7ihw86RMRVHRcr1wpwpgX uKzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=t92b27dE+gGhz/kBBZjyJ9tzM1cgqKREqnkeDjI0BJ8=; b=zbXSbnWSsinSKnEa5APONPd8iygiK7BFzzBUBHOlsIJZTEhwgpqKfnXJmMAQnLAinO kY+HoNthzT4Cl3/0anN4x1YnH/3QX8MOSaN0a5dE+w3HcKNLILhwILQ1bMuNuBl1/Erl kJquZ0X04ON0kETYVGbupKHgZmeHxJNF2i8jfQ2vzJMD82nJHRcKZRIy0fb0J21QRjh5 +CI09JPalbnc0FxoaUqZavLTp2iT22OskWW8diBzvqeh/JjZhavg/dCQlawZoXWeO68N X9FcRwD4woIANvdwEeZ0u8sOFl7n5LM5kaR7nqw6oyTU0fQsk59tDeWx5ufiYFQLbqA5 A2KQ== X-Gm-Message-State: AO0yUKVPr2/JdMxS0hiykb4ZZrPddvAn5hvjKU77pFPBch1rdEsXFYC1 71/9hY0MbjFAY5odNG2pbyVUaA7uN6M= X-Google-Smtp-Source: AK7set8cel3Y5fc4wCVQ4A1XXxK555VIVIiQi3ypaZ0X97RrX+NeBut4pv/VtxRintHX/5gfILBpcw== X-Received: by 2002:a05:6402:194d:b0:499:4130:fae with SMTP id f13-20020a056402194d00b0049941300faemr3526215edz.10.1675166033579; Tue, 31 Jan 2023 03:53:53 -0800 (PST) Received: from localhost.localdomain (dynamic-077-013-082-236.77.13.pool.telefonica.de. [77.13.82.236]) by smtp.gmail.com with ESMTPSA id c10-20020a056402100a00b00483dd234ac6sm8178318edu.96.2023.01.31.03.53.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 03:53:53 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Igor Mammedov , Richard Henderson , Ani Sinha , "Michael S. Tsirkin" , Paolo Bonzini , BALATON Zoltan , Thomas Huth , Marcel Apfelbaum , Eduardo Habkost , Laurent Vivier , Sunil Muthuswamy , qemu-trivial@nongnu.org, Bernhard Beschow Subject: [PATCH v2 04/20] hw/i386/pc_q35: Resolve redundant q35_host variable Date: Tue, 31 Jan 2023 12:53:10 +0100 Message-Id: <20230131115326.12454-5-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230131115326.12454-1-shentey@gmail.com> References: <20230131115326.12454-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=shentey@gmail.com; helo=mail-ed1-x533.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 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-bounces+qemu-devel=archiver.kernel.org@nongnu.org The variable is redundant to "phb" and is never used by its real type. Signed-off-by: Bernhard Beschow Reviewed-by: Thomas Huth --- hw/i386/pc_q35.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 351ef25f69..88324af91f 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -118,8 +118,7 @@ static void pc_q35_init(MachineState *machine) PCMachineState *pcms = PC_MACHINE(machine); PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms); X86MachineState *x86ms = X86_MACHINE(machine); - Q35PCIHost *q35_host; - PCIHostState *phb; + Object *phb; PCIBus *host_bus; PCIDevice *lpc; DeviceState *lpc_dev; @@ -206,10 +205,10 @@ static void pc_q35_init(MachineState *machine) } /* create pci host bus */ - q35_host = Q35_HOST_DEVICE(qdev_new(TYPE_Q35_HOST_DEVICE)); + phb = OBJECT(qdev_new(TYPE_Q35_HOST_DEVICE)); if (pcmc->pci_enabled) { - pci_hole64_size = object_property_get_uint(OBJECT(q35_host), + pci_hole64_size = object_property_get_uint(phb, PCI_HOST_PROP_PCI_HOLE64_SIZE, &error_abort); } @@ -218,23 +217,22 @@ static void pc_q35_init(MachineState *machine) pc_memory_init(pcms, get_system_memory(), rom_memory, &ram_memory, pci_hole64_size); - object_property_add_child(OBJECT(machine), "q35", OBJECT(q35_host)); - object_property_set_link(OBJECT(q35_host), MCH_HOST_PROP_RAM_MEM, + object_property_add_child(OBJECT(machine), "q35", phb); + object_property_set_link(phb, MCH_HOST_PROP_RAM_MEM, OBJECT(ram_memory), NULL); - object_property_set_link(OBJECT(q35_host), MCH_HOST_PROP_PCI_MEM, + object_property_set_link(phb, MCH_HOST_PROP_PCI_MEM, OBJECT(pci_memory), NULL); - object_property_set_link(OBJECT(q35_host), MCH_HOST_PROP_SYSTEM_MEM, + object_property_set_link(phb, MCH_HOST_PROP_SYSTEM_MEM, OBJECT(get_system_memory()), NULL); - object_property_set_link(OBJECT(q35_host), MCH_HOST_PROP_IO_MEM, + object_property_set_link(phb, MCH_HOST_PROP_IO_MEM, OBJECT(system_io), NULL); - object_property_set_int(OBJECT(q35_host), PCI_HOST_BELOW_4G_MEM_SIZE, + object_property_set_int(phb, PCI_HOST_BELOW_4G_MEM_SIZE, x86ms->below_4g_mem_size, NULL); - object_property_set_int(OBJECT(q35_host), PCI_HOST_ABOVE_4G_MEM_SIZE, + object_property_set_int(phb, PCI_HOST_ABOVE_4G_MEM_SIZE, x86ms->above_4g_mem_size, NULL); /* pci */ - sysbus_realize_and_unref(SYS_BUS_DEVICE(q35_host), &error_fatal); - phb = PCI_HOST_BRIDGE(q35_host); - host_bus = phb->bus; + sysbus_realize_and_unref(SYS_BUS_DEVICE(phb), &error_fatal); + host_bus = PCI_BUS(qdev_get_child_bus(DEVICE(phb), "pcie.0")); /* create ISA bus */ lpc = pci_create_simple_multifunction(host_bus, PCI_DEVFN(ICH9_LPC_DEV, ICH9_LPC_FUNC), true, From patchwork Tue Jan 31 11:53:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13122924 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 99AC7C38142 for ; Tue, 31 Jan 2023 11:54:36 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMpD5-0006Dc-Sj; Tue, 31 Jan 2023 06:53:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMpD4-00069n-4q; Tue, 31 Jan 2023 06:53:58 -0500 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pMpD2-0002Lu-I1; Tue, 31 Jan 2023 06:53:57 -0500 Received: by mail-ed1-x534.google.com with SMTP id z11so14156594ede.1; Tue, 31 Jan 2023 03:53:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TM72a0z+FhD5ZHMPDrVDIbYVXz3mYKr8EKyN+3lrNng=; b=Pmc5Q7XvzfTV1Cnma1hYjjikyO1Y7OT0fKjDb7+QbAh/g3wj81zUpI2BurNIvB25xE ZltEflif/8AtTPu6FGBsT3bFERIC17ZC0TArtmeGWp2RzVoKUH0BenNfBctY+k0miYfF n5znlv8FX+ZL+aroLEIusUhCZdhz9K8U2l2JNhs+G+Cpv2/A+HWvSyiBQe5j8iNP3lUe VOgoJ/Pr4J2Mh+z5Ig5cuKJ/TG9cHug1ZmLgFJg2gjDe338aTHnGA8lWR9r1lttIHE9i pyjZvoKm/cMmlqCuT6kFqog7XZyhTk+6rZTpvbjXVpgTMo2ibnNCMHVtQP1XgtKGx37A T3Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TM72a0z+FhD5ZHMPDrVDIbYVXz3mYKr8EKyN+3lrNng=; b=Rwurj4VKaGOrrkOQs1ogDa+CH4JNd/yBQbC0XQ9jtJbEbZ8SSCWgcBxE49N55X7Pll nSggQB4ojFydl1N/TLb478Be4NZd4ME4u8LZc901DTQ5Lo7w5eI18YtTRovtMvIt1h1e 0vvo/6xQKq0M7cdWuI+kl3026AyVL/kyVvPudSOc3dgKjbIVCq7gG4bgUNN0zabI9CK5 pIQAWl9m9ZVSP0KuNHSy7LMTRPJW2yo4IALCzmBCS34eVV8lHu+FnTcQ8FJcp3GbJLrB NruHV6zm5XEqtM2X6OP9JSXvLvDtIL917sWAzzI8wwfLpF7Y3aCg6y0oTOoMS5P0hB6G BEgg== X-Gm-Message-State: AFqh2koJe2/ZaH5zHM2W9yExKpmg/S3R9bphV8cS/fthOf05adXRdXSp ZSPuZwH2c7b7k1H9TvUFi8ULZWKglG8= X-Google-Smtp-Source: AMrXdXs69TSXdiAZ5xtBC15dMKgcdG/hCJmT8qZ6J7COIrDS7agTX2SuUL9M8AQawbYKXEK7gl6uGA== X-Received: by 2002:a05:6402:28ca:b0:49c:96f9:417e with SMTP id ef10-20020a05640228ca00b0049c96f9417emr53090466edb.2.1675166034659; Tue, 31 Jan 2023 03:53:54 -0800 (PST) Received: from localhost.localdomain (dynamic-077-013-082-236.77.13.pool.telefonica.de. [77.13.82.236]) by smtp.gmail.com with ESMTPSA id c10-20020a056402100a00b00483dd234ac6sm8178318edu.96.2023.01.31.03.53.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 03:53:54 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Igor Mammedov , Richard Henderson , Ani Sinha , "Michael S. Tsirkin" , Paolo Bonzini , BALATON Zoltan , Thomas Huth , Marcel Apfelbaum , Eduardo Habkost , Laurent Vivier , Sunil Muthuswamy , qemu-trivial@nongnu.org, Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 05/20] hw/i386/pc_{q35, piix}: Reuse MachineClass::desc as SMB product name Date: Tue, 31 Jan 2023 12:53:11 +0100 Message-Id: <20230131115326.12454-6-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230131115326.12454-1-shentey@gmail.com> References: <20230131115326.12454-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::534; envelope-from=shentey@gmail.com; helo=mail-ed1-x534.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 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-bounces+qemu-devel=archiver.kernel.org@nongnu.org No need to repeat the descriptions. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- hw/i386/pc_piix.c | 2 +- hw/i386/pc_q35.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index df64dd8dcc..ee9d9a4175 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -197,7 +197,7 @@ static void pc_init1(MachineState *machine, if (pcmc->smbios_defaults) { MachineClass *mc = MACHINE_GET_CLASS(machine); /* These values are guest ABI, do not change */ - smbios_set_defaults("QEMU", "Standard PC (i440FX + PIIX, 1996)", + smbios_set_defaults("QEMU", mc->desc, mc->name, pcmc->smbios_legacy_mode, pcmc->smbios_uuid_encoded, pcms->smbios_entry_point_type); diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 88324af91f..bc4fd06c1e 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -198,7 +198,7 @@ static void pc_q35_init(MachineState *machine) if (pcmc->smbios_defaults) { /* These values are guest ABI, do not change */ - smbios_set_defaults("QEMU", "Standard PC (Q35 + ICH9, 2009)", + smbios_set_defaults("QEMU", mc->desc, mc->name, pcmc->smbios_legacy_mode, pcmc->smbios_uuid_encoded, pcms->smbios_entry_point_type); From patchwork Tue Jan 31 11:53:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13122937 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 C07E0C636CC for ; Tue, 31 Jan 2023 11:57:08 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMpD6-0006HI-Tb; Tue, 31 Jan 2023 06:54:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMpD5-0006Cg-AV; Tue, 31 Jan 2023 06:53:59 -0500 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pMpD3-0002MA-N6; Tue, 31 Jan 2023 06:53:59 -0500 Received: by mail-ed1-x531.google.com with SMTP id fi26so14124286edb.7; Tue, 31 Jan 2023 03:53:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3yIebqAQdVBnY9ggCXk4emJQdJ27qXicTYyoeqC3khY=; b=XyLMrjl/Q+8QA4nrLKNE5rosrDCTYg8HRwZwgp9r3dQAN2GOpI+G/KUYYdrfI4DFVw ba+rF9IQB6lY56RJrupP5qNGoANofHpEdfvPFfWMAdRWpoNg23S9tV3n8q8J0BMQFzxq rU2wc+o61rnq/yEeEt9WiqQ5G9euJMb6gmcIY24wOmu6OU1PNoMahHvzI25VVCrBoAST iQeqphRB9/UYXH0bSE925rGcUjwRNiY1t/Tgq03hKJKdqm22dJoSMFi+WVf9NNTnD0wv K3T5TGVk/TXhtegYgMQaWJXrRg6b0PMu1MsI62YnskFlE2WqUmdRLIeVnfsg98l955sR 6a6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3yIebqAQdVBnY9ggCXk4emJQdJ27qXicTYyoeqC3khY=; b=BXZ4CDEP6sZc71cp0cNRlbV/sJaDrrRC+oUpwzPHrdviTlJD1u9d2yLJ2DCDhbkwMM 6Rnx9ai5jOs7meegwwgyX/ycEY5VYGbIHORIJZxx0Wl73imKZ7IyFm9pjdmS4yV68Qc2 zNutffKugboOojc1eKBm91A0Mk1jCu91lzJsW8PUoz1riP5LyqN6yxfkqaD+KE1doZXd rk30XrfCP3AgVtKNvDgIixZ4wjvZYa1mj/HJAG2y/wzH56p7vKASjAD30dPjzt/C3yYC Jvry4Z72RNS/x0e2q5V959MzQUph4QcsIF8MGDQSgQx1LI+lsTydHEvhyXW+OCA1nTve jpuw== X-Gm-Message-State: AO0yUKUIx6r1NekL9i3rp7xQo0DLp8h0x6hi5tFiEwED9jnMD+9xTu7s sD2zl1E6VR9vW6pLMgyXuor0s/yjK4w= X-Google-Smtp-Source: AK7set+WqbUVBLCchQZClUcOZOhi+CFOr/KwU0n4LRtVnZ2f1lG3rb8MeOAxRkEBV/cyev3c0Y9eKg== X-Received: by 2002:a05:6402:5508:b0:49e:9751:2f17 with SMTP id fi8-20020a056402550800b0049e97512f17mr13598542edb.17.1675166035786; Tue, 31 Jan 2023 03:53:55 -0800 (PST) Received: from localhost.localdomain (dynamic-077-013-082-236.77.13.pool.telefonica.de. [77.13.82.236]) by smtp.gmail.com with ESMTPSA id c10-20020a056402100a00b00483dd234ac6sm8178318edu.96.2023.01.31.03.53.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 03:53:55 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Igor Mammedov , Richard Henderson , Ani Sinha , "Michael S. Tsirkin" , Paolo Bonzini , BALATON Zoltan , Thomas Huth , Marcel Apfelbaum , Eduardo Habkost , Laurent Vivier , Sunil Muthuswamy , qemu-trivial@nongnu.org, Bernhard Beschow Subject: [PATCH v2 06/20] hw/i386/pc_{q35, piix}: Minimize usage of get_system_memory() Date: Tue, 31 Jan 2023 12:53:12 +0100 Message-Id: <20230131115326.12454-7-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230131115326.12454-1-shentey@gmail.com> References: <20230131115326.12454-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::531; envelope-from=shentey@gmail.com; helo=mail-ed1-x531.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 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-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Bernhard Beschow Reviewed-by: Thomas Huth --- hw/i386/pc_piix.c | 2 +- hw/i386/pc_q35.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index ee9d9a4175..5bde4533cc 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -241,7 +241,7 @@ static void pc_init1(MachineState *machine, isa_bus = ISA_BUS(qdev_get_child_bus(DEVICE(piix3), "isa.0")); } else { pci_bus = NULL; - isa_bus = isa_bus_new(NULL, get_system_memory(), system_io, + isa_bus = isa_bus_new(NULL, system_memory, system_io, &error_abort); i8257_dma_init(isa_bus, 0); pcms->hpet_enabled = false; diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index bc4fd06c1e..3ae2f41cf3 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -124,6 +124,7 @@ static void pc_q35_init(MachineState *machine) DeviceState *lpc_dev; BusState *idebus[MAX_SATA_PORTS]; ISADevice *rtc_state; + MemoryRegion *system_memory = get_system_memory(); MemoryRegion *system_io = get_system_io(); MemoryRegion *pci_memory; MemoryRegion *rom_memory; @@ -191,7 +192,7 @@ static void pc_q35_init(MachineState *machine) rom_memory = pci_memory; } else { pci_memory = NULL; - rom_memory = get_system_memory(); + rom_memory = system_memory; } pc_guest_info_init(pcms); @@ -214,7 +215,7 @@ static void pc_q35_init(MachineState *machine) } /* allocate ram and load rom/bios */ - pc_memory_init(pcms, get_system_memory(), rom_memory, &ram_memory, + pc_memory_init(pcms, system_memory, rom_memory, &ram_memory, pci_hole64_size); object_property_add_child(OBJECT(machine), "q35", phb); @@ -223,7 +224,7 @@ static void pc_q35_init(MachineState *machine) object_property_set_link(phb, MCH_HOST_PROP_PCI_MEM, OBJECT(pci_memory), NULL); object_property_set_link(phb, MCH_HOST_PROP_SYSTEM_MEM, - OBJECT(get_system_memory()), NULL); + OBJECT(system_memory), NULL); object_property_set_link(phb, MCH_HOST_PROP_IO_MEM, OBJECT(system_io), NULL); object_property_set_int(phb, PCI_HOST_BELOW_4G_MEM_SIZE, From patchwork Tue Jan 31 11:53:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13122939 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 D93D8C636CC for ; Tue, 31 Jan 2023 11:57:38 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMpD8-0006O2-1N; Tue, 31 Jan 2023 06:54:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMpD6-0006Dm-1d; Tue, 31 Jan 2023 06:54:00 -0500 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pMpD4-0002Kz-BN; Tue, 31 Jan 2023 06:53:59 -0500 Received: by mail-ed1-x534.google.com with SMTP id n6so11500563edo.9; Tue, 31 Jan 2023 03:53:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=z2bhIYmeYwrzW+hLS8eeCTJRHx/Ps44JepqikhNr1/g=; b=BRY4DH9pEcHi7OZczBRJOblYM6sIQGl0kbwqMpYm3DtCTxQYbdDIqrksDOE5DG68Mh i7/Da8CP8TkvNSt9L2R6pcbMMioLkHUxf17LbjO7j1POnJQvJ0QVarpwCQ0RwsrP/qv9 n9hEDJ2T+EbWF7LbMXtYXcSwkqgulC0aDAoAazzj4zLCNx4DnyETBQ4lwX87QcZLcEF5 VtPQ3zwVNpNzFtYCzJsoFarUQNutS3yp9MPp9CKHw0i1+DR7akZNwVxFK0XBZQeMUQzW aLpnm1Ubx8uatS9yg0t8lj/Q280+C+zTxs8y5IbGjDwHMaL+1TP4g8xThnVm+ErsWMkr ka7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=z2bhIYmeYwrzW+hLS8eeCTJRHx/Ps44JepqikhNr1/g=; b=7amcDdWztpo3gvMCsmX7cgSNRRAGlE52JtxGDAlO37brwCRlTzUogehBysWrARb4/x h4OPxadEY3fHh4GkNeq5dwgDI4Iu6PykLGjvo8shJ0ZlZ1tdeNxR7OhaEG1SkiQ5xoV5 zb0KvbxGw7dbNOmNaXsB8NRLZjOEvW6OKGjHW4Qp6rgHoh1SzpLOToTcn/dazkmFrssn 0NLfw1xTHj4N9BBj/GRaodIuYj1f5id1pzzdIV/kpMHPhMHXEMr0U8D3jYUaZ4sH9cPc Fe1KuA0YS13TBNMflwEEBV1nz2RA4ar30HwIUHd+/y16FfU0GDOYgaLsD3pf+bR1Tz3U WRtA== X-Gm-Message-State: AO0yUKVUaeRFVfFIpujf5eQpLzGgI3gMueWWwRKB3bRPe3Uv+2sxxEPQ RA2n4pU/AKFYmmVtSetN+Tmo/uWLjCU= X-Google-Smtp-Source: AK7set9l6p9lINm68FtLRBLvMdr5nnlnZ3nvBzzI+yP0Aqo8aLu8Ssc1+BXioVIp8MdSrmpGiWccug== X-Received: by 2002:a05:6402:2029:b0:4a2:584d:23c5 with SMTP id ay9-20020a056402202900b004a2584d23c5mr5155808edb.18.1675166037020; Tue, 31 Jan 2023 03:53:57 -0800 (PST) Received: from localhost.localdomain (dynamic-077-013-082-236.77.13.pool.telefonica.de. [77.13.82.236]) by smtp.gmail.com with ESMTPSA id c10-20020a056402100a00b00483dd234ac6sm8178318edu.96.2023.01.31.03.53.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 03:53:56 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Igor Mammedov , Richard Henderson , Ani Sinha , "Michael S. Tsirkin" , Paolo Bonzini , BALATON Zoltan , Thomas Huth , Marcel Apfelbaum , Eduardo Habkost , Laurent Vivier , Sunil Muthuswamy , qemu-trivial@nongnu.org, Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 07/20] hw/i386/pc: Initialize ram_memory variable directly Date: Tue, 31 Jan 2023 12:53:13 +0100 Message-Id: <20230131115326.12454-8-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230131115326.12454-1-shentey@gmail.com> References: <20230131115326.12454-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::534; envelope-from=shentey@gmail.com; helo=mail-ed1-x534.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 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-bounces+qemu-devel=archiver.kernel.org@nongnu.org Going through pc_memory_init() seems quite complicated for a simple assignment. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé --- include/hw/i386/pc.h | 1 - hw/i386/pc.c | 2 -- hw/i386/pc_piix.c | 4 ++-- hw/i386/pc_q35.c | 5 ++--- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 88a120bc23..5331b9a5c5 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -163,7 +163,6 @@ void xen_load_linux(PCMachineState *pcms); void pc_memory_init(PCMachineState *pcms, MemoryRegion *system_memory, MemoryRegion *rom_memory, - MemoryRegion **ram_memory, uint64_t pci_hole64_size); uint64_t pc_pci_hole64_start(void); DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus); diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 6e592bd969..8898cc9961 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -936,7 +936,6 @@ static hwaddr pc_max_used_gpa(PCMachineState *pcms, uint64_t pci_hole64_size) void pc_memory_init(PCMachineState *pcms, MemoryRegion *system_memory, MemoryRegion *rom_memory, - MemoryRegion **ram_memory, uint64_t pci_hole64_size) { int linux_boot, i; @@ -994,7 +993,6 @@ void pc_memory_init(PCMachineState *pcms, * Split single memory region and use aliases to address portions of it, * done for backwards compatibility with older qemus. */ - *ram_memory = machine->ram; ram_below_4g = g_malloc(sizeof(*ram_below_4g)); memory_region_init_alias(ram_below_4g, NULL, "ram-below-4g", machine->ram, 0, x86ms->below_4g_mem_size); diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 5bde4533cc..00ba725656 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -143,6 +143,7 @@ static void pc_init1(MachineState *machine, if (xen_enabled()) { xen_hvm_init_pc(pcms, &ram_memory); } else { + ram_memory = machine->ram; if (!pcms->max_ram_below_4g) { pcms->max_ram_below_4g = 0xe0000000; /* default: 3.5G */ } @@ -205,8 +206,7 @@ static void pc_init1(MachineState *machine, /* allocate ram and load rom/bios */ if (!xen_enabled()) { - pc_memory_init(pcms, system_memory, - rom_memory, &ram_memory, hole64_size); + pc_memory_init(pcms, system_memory, rom_memory, hole64_size); } else { pc_system_flash_cleanup_unused(pcms); if (machine->kernel_filename != NULL) { diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 3ae2f41cf3..50fa5aa9bc 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -128,7 +128,7 @@ static void pc_q35_init(MachineState *machine) MemoryRegion *system_io = get_system_io(); MemoryRegion *pci_memory; MemoryRegion *rom_memory; - MemoryRegion *ram_memory; + MemoryRegion *ram_memory = machine->ram; GSIState *gsi_state; ISABus *isa_bus; int i; @@ -215,8 +215,7 @@ static void pc_q35_init(MachineState *machine) } /* allocate ram and load rom/bios */ - pc_memory_init(pcms, system_memory, rom_memory, &ram_memory, - pci_hole64_size); + pc_memory_init(pcms, system_memory, rom_memory, pci_hole64_size); object_property_add_child(OBJECT(machine), "q35", phb); object_property_set_link(phb, MCH_HOST_PROP_RAM_MEM, From patchwork Tue Jan 31 11:53:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13122938 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 5F1B0C38142 for ; Tue, 31 Jan 2023 11:57:18 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMpDA-0006aK-D7; Tue, 31 Jan 2023 06:54:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMpD6-0006HV-SN; Tue, 31 Jan 2023 06:54:00 -0500 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pMpD5-0002Ld-AR; Tue, 31 Jan 2023 06:54:00 -0500 Received: by mail-ed1-x533.google.com with SMTP id m8so4910819edd.10; Tue, 31 Jan 2023 03:53:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HjssvFKx3IZ7l0mShz5AWOIUaxXusJrli4FZYIRJEUs=; b=EkjItNl5IOzfYAIOPVp8tpE7kjkQ33LSTO/HG1D3aL0q0x701NnMDo0dbISRAbbPCX 5kKM/4pMy3Jte0Tu5zaFq1QAiwnsXjkd0PQOS6BQOFan3VJYXSbMUiwO+QYbGccXtfvZ 3uIfVUw4wVzrUgQMqioRDrdZf66IUjfmnIU34Jjp23Iw0Bjx6J/JlsM3bJYGh3CFULpe pGg0goHBUppva9TcKglePfzeIsid1d01+jdB1zCXa0k0ZC1YMKR76zyrp0yEG/2TnKcs Lf73nJ8c36lvcWbPbRf1GtOLEuqpSs+SiaRzoNjGE1/2RaJ4n4muiU0nIkPOMcOYQEWc DAXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HjssvFKx3IZ7l0mShz5AWOIUaxXusJrli4FZYIRJEUs=; b=KYFjdavw+4G7qGho0lAWBXHmNfHSt7Owpvbuft7exAP0yPDJrnQgcfGJzI78HPOu3/ 58NFVrnrMt6E9iohGJ6JVB29k8VVhRxABru23sfSZHptWu+B0XvWYEbwk+bFO+A/t9lL eAa+1UFObgoNAT06gHKX0dxBfp/WXkK+kw47KtnYe32iff6azGSDkp5kFgOv0CxtM1cm NX1Lhomskl4MzWHMCNPdjvOKRLQjlhzxnp1R+4LlCkj814TgWKRDxGd68dECKbZXHVsT J3rN/e0mNwSHZBXahMB298v4iuR9kOfwx7Jkk+ZVYZmPHXUa9bnWktrIUVZ2jRXwPz1P 8E5A== X-Gm-Message-State: AO0yUKVQZ0yra7+M1QUoxkTSjQl3v7JJRAYPuBywaT4TQEDM1dtS8F8i hFmKik9lEPPewhNBVi0feXoKlS2PVh0= X-Google-Smtp-Source: AK7set+9G9dVpeOnLUU+a6PsXNYG6tcGXRow4RP5Am2bgNN1Hg2bSnAZN2xge0ESrSdC8HY0boLsaA== X-Received: by 2002:aa7:de1a:0:b0:474:a583:2e1a with SMTP id h26-20020aa7de1a000000b00474a5832e1amr3137843edv.12.1675166038038; Tue, 31 Jan 2023 03:53:58 -0800 (PST) Received: from localhost.localdomain (dynamic-077-013-082-236.77.13.pool.telefonica.de. [77.13.82.236]) by smtp.gmail.com with ESMTPSA id c10-20020a056402100a00b00483dd234ac6sm8178318edu.96.2023.01.31.03.53.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 03:53:57 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Igor Mammedov , Richard Henderson , Ani Sinha , "Michael S. Tsirkin" , Paolo Bonzini , BALATON Zoltan , Thomas Huth , Marcel Apfelbaum , Eduardo Habkost , Laurent Vivier , Sunil Muthuswamy , qemu-trivial@nongnu.org, Bernhard Beschow Subject: [PATCH v2 08/20] hw/i386/ich9: Rename Q35_MASK to ICH9_MASK Date: Tue, 31 Jan 2023 12:53:14 +0100 Message-Id: <20230131115326.12454-9-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230131115326.12454-1-shentey@gmail.com> References: <20230131115326.12454-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=shentey@gmail.com; helo=mail-ed1-x533.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 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-bounces+qemu-devel=archiver.kernel.org@nongnu.org The Q35_MASK macro is already defined by TYPE_Q35_HOST_DEVICE, so let TYPE_ICH9_LPC_DEVICE have its own one to prevent potential name clash. Signed-off-by: Bernhard Beschow Reviewed-by: Thomas Huth --- include/hw/i386/ich9.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h index 222781e8b9..36e0ccd16a 100644 --- a/include/hw/i386/ich9.h +++ b/include/hw/i386/ich9.h @@ -75,7 +75,7 @@ struct ICH9LPCState { qemu_irq gsi[GSI_NUM_PINS]; }; -#define Q35_MASK(bit, ms_bit, ls_bit) \ +#define ICH9_MASK(bit, ms_bit, ls_bit) \ ((uint##bit##_t)(((1ULL << ((ms_bit) + 1)) - 1) & ~((1ULL << ls_bit) - 1))) /* ICH9: Chipset Configuration Registers */ @@ -137,13 +137,13 @@ struct ICH9LPCState { #define ICH9_LPC_NB_PIRQS 8 /* PCI A-H */ #define ICH9_LPC_PMBASE 0x40 -#define ICH9_LPC_PMBASE_BASE_ADDRESS_MASK Q35_MASK(32, 15, 7) +#define ICH9_LPC_PMBASE_BASE_ADDRESS_MASK ICH9_MASK(32, 15, 7) #define ICH9_LPC_PMBASE_RTE 0x1 #define ICH9_LPC_PMBASE_DEFAULT 0x1 #define ICH9_LPC_ACPI_CTRL 0x44 #define ICH9_LPC_ACPI_CTRL_ACPI_EN 0x80 -#define ICH9_LPC_ACPI_CTRL_SCI_IRQ_SEL_MASK Q35_MASK(8, 2, 0) +#define ICH9_LPC_ACPI_CTRL_SCI_IRQ_SEL_MASK ICH9_MASK(8, 2, 0) #define ICH9_LPC_ACPI_CTRL_9 0x0 #define ICH9_LPC_ACPI_CTRL_10 0x1 #define ICH9_LPC_ACPI_CTRL_11 0x2 @@ -162,7 +162,7 @@ struct ICH9LPCState { #define ICH9_LPC_PIRQH_ROUT 0x6b #define ICH9_LPC_PIRQ_ROUT_IRQEN 0x80 -#define ICH9_LPC_PIRQ_ROUT_MASK Q35_MASK(8, 3, 0) +#define ICH9_LPC_PIRQ_ROUT_MASK ICH9_MASK(8, 3, 0) #define ICH9_LPC_PIRQ_ROUT_DEFAULT 0x80 #define ICH9_LPC_GEN_PMCON_1 0xa0 @@ -172,7 +172,7 @@ struct ICH9LPCState { #define ICH9_LPC_GEN_PMCON_LOCK 0xa6 #define ICH9_LPC_RCBA 0xf0 -#define ICH9_LPC_RCBA_BA_MASK Q35_MASK(32, 31, 14) +#define ICH9_LPC_RCBA_BA_MASK ICH9_MASK(32, 31, 14) #define ICH9_LPC_RCBA_EN 0x1 #define ICH9_LPC_RCBA_DEFAULT 0x0 From patchwork Tue Jan 31 11:53:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13122927 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 DD4FDC636CC for ; Tue, 31 Jan 2023 11:54:44 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMpDB-0006eL-9c; Tue, 31 Jan 2023 06:54:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMpD8-0006SG-QI; Tue, 31 Jan 2023 06:54:02 -0500 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pMpD7-0002N0-3w; Tue, 31 Jan 2023 06:54:02 -0500 Received: by mail-ed1-x531.google.com with SMTP id x7so10898906edr.0; Tue, 31 Jan 2023 03:54:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bR11ilDZxRVhc8S1OrHlRFd0u3m3X/MLZG9Khl8VZ48=; b=XR9uRYBkQFset9dXTdmlev+sqxSZC25VcdSn9O8m0AQU0vvpm6Fzuv/tBgz/vXDv5n jel7KLFXZxwxCMTbkoc2mpuyQW/MWhJX0KA+PmsywtoirlbC7FgRK8D8qP4ilw24DqVu sRbCYxNMRcPKCtKULSLE7vghn2mpkloCE9ZnG+sPBtqzUscayVoh0HcJa15KXztMXz6s YLdI+SOiEK1d9eMte5ZNzqvvamQB0qQALd9i6uTPcgjay8VvWlDMnlGpSb61suRGbFHP qn0m5MYSQk1ABw4giB/pvmoAP90muzWK1Bul60tAZnUZyG2tDQFV145/5hOn3dElX7Qi 7Esg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bR11ilDZxRVhc8S1OrHlRFd0u3m3X/MLZG9Khl8VZ48=; b=UbIjk+RwRpvqxmEcxW+h3nNscwDGRLCuR+qlFAo55hgw2AlR+Dk27M52CCLmqCRqra t4tjIuUuea5iSBXMRB8xTMRQXH/KHcbj6GA7EJTgCG/RksQiWw8OHe8cuZ/2t+4gHhlf ud+DARU8yee8FE1Nx5gowifVZQHZuaTL5DW51EZLw4/97eKtPwVIXSP6rQJ6DoQEIoCa rgm2jL36R1pvEqYFEnl9CHnTi+5vr7wf2vVqkjAIL6t902+SCKWikrvcER30ZTL/Og32 q8nfDdM98G1xfIN/PzDFC0rILqdyLZwhaZQTpfF28rG41W66ooEdtLHe9F8NI/UqijH5 NmFg== X-Gm-Message-State: AFqh2krf1e79vM98/Z2m6AAbNg757G9xrz775FNb/aKoxjBgcxnrXlzx vgfMvhJSpkt0dr5BcjqzmQQVIomWxdc= X-Google-Smtp-Source: AMrXdXtLs/Z3DRGCYEc9WNPy0POlL61UXsTiTtKPaZvMZDOwV18fe8xnHfHrKrMdFn84d7pXZ2YYFg== X-Received: by 2002:aa7:de95:0:b0:49d:be2b:b9b1 with SMTP id j21-20020aa7de95000000b0049dbe2bb9b1mr54137552edv.36.1675166039266; Tue, 31 Jan 2023 03:53:59 -0800 (PST) Received: from localhost.localdomain (dynamic-077-013-082-236.77.13.pool.telefonica.de. [77.13.82.236]) by smtp.gmail.com with ESMTPSA id c10-20020a056402100a00b00483dd234ac6sm8178318edu.96.2023.01.31.03.53.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 03:53:58 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Igor Mammedov , Richard Henderson , Ani Sinha , "Michael S. Tsirkin" , Paolo Bonzini , BALATON Zoltan , Thomas Huth , Marcel Apfelbaum , Eduardo Habkost , Laurent Vivier , Sunil Muthuswamy , qemu-trivial@nongnu.org, Bernhard Beschow Subject: [PATCH v2 09/20] hw/isa/lpc_ich9: Unexport PIRQ functions Date: Tue, 31 Jan 2023 12:53:15 +0100 Message-Id: <20230131115326.12454-10-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230131115326.12454-1-shentey@gmail.com> References: <20230131115326.12454-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::531; envelope-from=shentey@gmail.com; helo=mail-ed1-x531.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 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-bounces+qemu-devel=archiver.kernel.org@nongnu.org No need to rely on the board to wire up the ICH9 PCI IRQs. All functions access private state of the LPC device which suggests that it should wire up the IRQs. Signed-off-by: Bernhard Beschow --- include/hw/i386/ich9.h | 3 --- hw/i386/pc_q35.c | 3 --- hw/isa/lpc_ich9.c | 11 ++++++++--- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h index 36e0ccd16a..921e4c7ef6 100644 --- a/include/hw/i386/ich9.h +++ b/include/hw/i386/ich9.h @@ -9,9 +9,6 @@ #include "hw/acpi/ich9.h" #include "qom/object.h" -void ich9_lpc_set_irq(void *opaque, int irq_num, int level); -int ich9_lpc_map_irq(PCIDevice *pci_dev, int intx); -PCIINTxRoute ich9_route_intx_pin_to_irq(void *opaque, int pirq_pin); void ich9_lpc_pm_init(PCIDevice *pci_lpc, bool smm_enabled); I2CBus *ich9_smb_init(PCIBus *bus, int devfn, uint32_t smb_io_base); diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 50fa5aa9bc..83e4fb7868 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -267,9 +267,6 @@ static void pc_q35_init(MachineState *machine) for (i = 0; i < GSI_NUM_PINS; i++) { qdev_connect_gpio_out_named(lpc_dev, ICH9_GPIO_GSI, i, x86ms->gsi[i]); } - pci_bus_irqs(host_bus, ich9_lpc_set_irq, ich9_lpc, ICH9_LPC_NB_PIRQS); - pci_bus_map_irqs(host_bus, ich9_lpc_map_irq); - pci_bus_set_route_irq_fn(host_bus, ich9_route_intx_pin_to_irq); isa_bus = ich9_lpc->isa_bus; if (x86ms->pic == ON_OFF_AUTO_ON || x86ms->pic == ON_OFF_AUTO_AUTO) { diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index 8d541e2b54..b444faacd2 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -259,7 +259,7 @@ static void ich9_lpc_update_apic(ICH9LPCState *lpc, int gsi) qemu_set_irq(lpc->gsi[gsi], level); } -void ich9_lpc_set_irq(void *opaque, int pirq, int level) +static void ich9_lpc_set_irq(void *opaque, int pirq, int level) { ICH9LPCState *lpc = opaque; int pic_irq, pic_dis; @@ -275,7 +275,7 @@ void ich9_lpc_set_irq(void *opaque, int pirq, int level) /* return the pirq number (PIRQ[A-H]:0-7) corresponding to * a given device irq pin. */ -int ich9_lpc_map_irq(PCIDevice *pci_dev, int intx) +static int ich9_lpc_map_irq(PCIDevice *pci_dev, int intx) { BusState *bus = qdev_get_parent_bus(&pci_dev->qdev); PCIBus *pci_bus = PCI_BUS(bus); @@ -286,7 +286,7 @@ int ich9_lpc_map_irq(PCIDevice *pci_dev, int intx) return lpc->irr[PCI_SLOT(pci_dev->devfn)][intx]; } -PCIINTxRoute ich9_route_intx_pin_to_irq(void *opaque, int pirq_pin) +static PCIINTxRoute ich9_route_intx_pin_to_irq(void *opaque, int pirq_pin) { ICH9LPCState *lpc = opaque; PCIINTxRoute route; @@ -680,6 +680,7 @@ static void ich9_lpc_realize(PCIDevice *d, Error **errp) { ICH9LPCState *lpc = ICH9_LPC_DEVICE(d); DeviceState *dev = DEVICE(d); + PCIBus *pci_bus = pci_get_bus(d); ISABus *isa_bus; if ((lpc->smi_host_features & BIT_ULL(ICH9_LPC_SMI_F_CPU_HOT_UNPLUG_BIT)) && @@ -728,6 +729,10 @@ static void ich9_lpc_realize(PCIDevice *d, Error **errp) isa_bus_irqs(isa_bus, lpc->gsi); i8257_dma_init(isa_bus, 0); + + pci_bus_irqs(pci_bus, ich9_lpc_set_irq, d, ICH9_LPC_NB_PIRQS); + pci_bus_map_irqs(pci_bus, ich9_lpc_map_irq); + pci_bus_set_route_irq_fn(pci_bus, ich9_route_intx_pin_to_irq); } static bool ich9_rst_cnt_needed(void *opaque) From patchwork Tue Jan 31 11:53:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13122925 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 BEEABC636D3 for ; Tue, 31 Jan 2023 11:54:36 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMpDB-0006h4-Me; Tue, 31 Jan 2023 06:54:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMpDA-0006Zx-9m; Tue, 31 Jan 2023 06:54:04 -0500 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pMpD8-0002Oh-JS; Tue, 31 Jan 2023 06:54:04 -0500 Received: by mail-ej1-x62f.google.com with SMTP id p26so29611410ejx.13; Tue, 31 Jan 2023 03:54:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gvdYUWMM+UZxFmN1oPZ6vShFoUpMnto+10azUGQSHiM=; b=QB00bgW6+YKn6n6lCJMsIZf2UsttOSdBXT5fDGP1fWUj+HZ0li53EMOPA2KzVHJp/u GFEPUb/k7wlNpK1dh8n/XEvraWpcoFFCBV1sIM3bcDOKgD9MzmuvqqN0vZ48AQ0ZVYsq WGgNvRyD/4+O1QjpoaVHta8lo8pfcmjTe5EoVzQOCWtrpi3CA0bBY8WQKFDOF55rEMSd 2FvgE4/Y1mB+aUCeeywKGMhDD9D7MYDkQk+IwiX9DZzqUBdImXhAynLXyxwTqw3Xaq7z bc5g2Yr7YsErtdjgEgOo4nQErYss1l84jl+7u6LxaYhd8Ad7EYk7goTf7BhMRERlN0sJ 3rlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gvdYUWMM+UZxFmN1oPZ6vShFoUpMnto+10azUGQSHiM=; b=LzJmREDtPlFF36V6nnTi6/HiOnwHYv4dizH5r9jx3eQ5DiOBjbeYhviLdVTMUdZNW5 bAKKbfFJLxlIzA8FNa+oKLcYqBtLChhfI5w4ikj4u6AKlQMYswVAh6JVxRNsOTQaxufM sJaKNU5kpH1RnkZ48vDlemLrbTBBH5pH/yiLVOgyFusvvQPW4VRV63Ti9WV+d/2I4rcO KjgIGNv4MJjXQPSXyKNmNPiyhJzQDQgMxgohbziiIokCxdfZPc+qkm46CL3HcL+GyEfN 8PshbW9Y5cRFu45U6Sh8iLiPGdQ1O7cGNF0jbAevWfj+IUICyaBgusNU6pqzfeyDiPR+ AkFg== X-Gm-Message-State: AO0yUKX2/WnWZByDolWWwhHcapSt9tSZGhINDU4UNKyfGfdywWzUssYq ULYC1KOonOzRlTUX5NOQdkMlkvn7jJU= X-Google-Smtp-Source: AK7set+fWEik5Uzle//P3JHOv1ogGXTy+Vf61wCwOsM8CKcm2WuZdiowtplAbjEYecCGC60XZx1Y6w== X-Received: by 2002:a17:906:4dc7:b0:882:7e27:ea6d with SMTP id f7-20020a1709064dc700b008827e27ea6dmr15160420ejw.27.1675166040541; Tue, 31 Jan 2023 03:54:00 -0800 (PST) Received: from localhost.localdomain (dynamic-077-013-082-236.77.13.pool.telefonica.de. [77.13.82.236]) by smtp.gmail.com with ESMTPSA id c10-20020a056402100a00b00483dd234ac6sm8178318edu.96.2023.01.31.03.53.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 03:54:00 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Igor Mammedov , Richard Henderson , Ani Sinha , "Michael S. Tsirkin" , Paolo Bonzini , BALATON Zoltan , Thomas Huth , Marcel Apfelbaum , Eduardo Habkost , Laurent Vivier , Sunil Muthuswamy , qemu-trivial@nongnu.org, Bernhard Beschow Subject: [PATCH v2 10/20] hw/isa/lpc_ich9: Eliminate ICH9LPCState::isa_bus Date: Tue, 31 Jan 2023 12:53:16 +0100 Message-Id: <20230131115326.12454-11-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230131115326.12454-1-shentey@gmail.com> References: <20230131115326.12454-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62f; envelope-from=shentey@gmail.com; helo=mail-ej1-x62f.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 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-bounces+qemu-devel=archiver.kernel.org@nongnu.org By using qdev_get_child_bus() we can eliminate ICH9LPCState::isa_bus and spare the ich9_lpc variable in pc_q35, too. Signed-off-by: Bernhard Beschow Reviewed-by: Thomas Huth --- include/hw/i386/ich9.h | 3 --- hw/i386/pc_q35.c | 4 +--- hw/isa/lpc_ich9.c | 5 +---- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h index 921e4c7ef6..05464f6965 100644 --- a/include/hw/i386/ich9.h +++ b/include/hw/i386/ich9.h @@ -1,7 +1,6 @@ #ifndef HW_ICH9_H #define HW_ICH9_H -#include "hw/isa/isa.h" #include "hw/sysbus.h" #include "hw/i386/pc.h" #include "hw/isa/apm.h" @@ -64,8 +63,6 @@ struct ICH9LPCState { * triggers feature lockdown */ uint64_t smi_negotiated_features; /* guest-invisible, host endian */ - /* isa bus */ - ISABus *isa_bus; MemoryRegion rcrb_mem; /* root complex register block */ Notifier machine_ready; diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 83e4fb7868..a4d5c89409 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -132,7 +132,6 @@ static void pc_q35_init(MachineState *machine) GSIState *gsi_state; ISABus *isa_bus; int i; - ICH9LPCState *ich9_lpc; PCIDevice *ahci; ram_addr_t lowmem; DriveInfo *hd[MAX_SATA_PORTS]; @@ -262,12 +261,11 @@ static void pc_q35_init(MachineState *machine) /* irq lines */ gsi_state = pc_gsi_create(&x86ms->gsi, pcmc->pci_enabled); - ich9_lpc = ICH9_LPC_DEVICE(lpc); lpc_dev = DEVICE(lpc); for (i = 0; i < GSI_NUM_PINS; i++) { qdev_connect_gpio_out_named(lpc_dev, ICH9_GPIO_GSI, i, x86ms->gsi[i]); } - isa_bus = ich9_lpc->isa_bus; + isa_bus = ISA_BUS(qdev_get_child_bus(lpc_dev, "isa.0")); if (x86ms->pic == ON_OFF_AUTO_ON || x86ms->pic == ON_OFF_AUTO_AUTO) { pc_i8259_create(isa_bus, gsi_state->i8259_irq); diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index b444faacd2..9ab966ef88 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -710,8 +710,6 @@ static void ich9_lpc_realize(PCIDevice *d, Error **errp) memory_region_init_io(&lpc->rcrb_mem, OBJECT(d), &rcrb_mmio_ops, lpc, "lpc-rcrb-mmio", ICH9_CC_SIZE); - lpc->isa_bus = isa_bus; - ich9_cc_init(lpc); apm_init(d, &lpc->apm, ich9_apm_ctrl_changed, lpc); @@ -819,8 +817,7 @@ static void build_ich9_isa_aml(AcpiDevAmlIf *adev, Aml *scope) { Aml *field; BusChild *kid; - ICH9LPCState *s = ICH9_LPC_DEVICE(adev); - BusState *bus = BUS(s->isa_bus); + BusState *bus = qdev_get_child_bus(DEVICE(adev), "isa.0"); Aml *sb_scope = aml_scope("\\_SB"); /* ICH9 PCI to ISA irq remapping */ From patchwork Tue Jan 31 11:53:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13122922 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 3DA43C636CC for ; Tue, 31 Jan 2023 11:54:13 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMpDD-0006mU-PQ; Tue, 31 Jan 2023 06:54:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMpDB-0006eY-8i; Tue, 31 Jan 2023 06:54:05 -0500 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pMpD9-0002Kb-0k; Tue, 31 Jan 2023 06:54:04 -0500 Received: by mail-ed1-x533.google.com with SMTP id u21so14135398edv.3; Tue, 31 Jan 2023 03:54:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lKzuVQAa7neEdkz9/LLBUDYgSgZ4PlYBRiFkTU0L45g=; b=FccqFdOm8DOzycoH4VSNakOnua4XfI7D1d05WeDjjlhiba4EUbrEQaCQnyvwAx+6Jr sWf4gT1oGMTk+ql0kOTKitSGtSs8gNE5BMC3m3KUMgvPT44b/V/L2DPRS/6/p1aFOr3W +I8ZD+CkZpkGx0U0bt+PXyKYBvzFwfw4X9ISrJjSGgSMFVX44Nait3Xop/G/CvtTCTLd qcNoV7wb8mXRVLR54eOVFzMw4puhiVpo3VMB7qrAN3fhxrISsTO/xplZ55qHt8uiqzzZ 8vyK/ChwevvGLtOUcjHGVwaLacwfCcm4HcmzepXdzvr1tTFeSOcQ/iQzbTEgNSxr5zTV +jGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lKzuVQAa7neEdkz9/LLBUDYgSgZ4PlYBRiFkTU0L45g=; b=niyht+LBbtixZD79bqbIp3Aylxl6AZ8L0BLaTH5elHLhwVS4MUf5oQ/AcNu2i1JeMs KZEf1CwJdgxWt14/o+ASz4xZQqDZIikesXMx80Kiy9csLcu2S0IYm8da83MWeUeeYBcW 9BAjr9cIzDwKw2Kp9c9R4aoSTqVEJVEtMrybiA63OwOREBcoHHrUH7OQP4cgmYFbrUTH L5+0fKTyHNXL1awEYqgrRkgdu7LJSLG6Bax1RJfJKrnlN85M+UdeIYcpSH5WJG31rK9c 6erpL4ZMEFksoz3WxX1JjosOKoQ+VrpLqNCqxfSnv67/nv7MnzSeOcqxzLcA5c7kRPGl ztgA== X-Gm-Message-State: AO0yUKU/UYG9P14nUqH0inK6s7tXIjBCrQE4FixX77hMGLPxf78wDzJX SVw5ESNej108zMwV//cTK5ExDxd67qQ= X-Google-Smtp-Source: AK7set8QQqdq174NbhI2cyxwBOsShtJXXsvMlh1BjZ+Hoh6lzape4N8/LwB87CtIy4WsP+CZ3ugKbw== X-Received: by 2002:a05:6402:14d4:b0:4a2:1d40:3cb7 with SMTP id f20-20020a05640214d400b004a21d403cb7mr14868057edx.16.1675166041635; Tue, 31 Jan 2023 03:54:01 -0800 (PST) Received: from localhost.localdomain (dynamic-077-013-082-236.77.13.pool.telefonica.de. [77.13.82.236]) by smtp.gmail.com with ESMTPSA id c10-20020a056402100a00b00483dd234ac6sm8178318edu.96.2023.01.31.03.54.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 03:54:01 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Igor Mammedov , Richard Henderson , Ani Sinha , "Michael S. Tsirkin" , Paolo Bonzini , BALATON Zoltan , Thomas Huth , Marcel Apfelbaum , Eduardo Habkost , Laurent Vivier , Sunil Muthuswamy , qemu-trivial@nongnu.org, Bernhard Beschow Subject: [PATCH v2 11/20] hw/isa/lpc_ich9: Reuse memory and io address space of PCI bus Date: Tue, 31 Jan 2023 12:53:17 +0100 Message-Id: <20230131115326.12454-12-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230131115326.12454-1-shentey@gmail.com> References: <20230131115326.12454-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=shentey@gmail.com; helo=mail-ed1-x533.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 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-bounces+qemu-devel=archiver.kernel.org@nongnu.org In pc_q35.c the PCI host bridge's io and memory space is initialized with get_system_memory() and get_system_io() respectively. Therefore, using pci_address_space() and pci_address_space_io() is equivalent. All in all this makes the LPC function respect whatever memory spaces the PCI bus was set up with. Signed-off-by: Bernhard Beschow --- hw/isa/lpc_ich9.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index 9ab966ef88..1b7e5585b3 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -506,10 +506,10 @@ static void ich9_lpc_rcba_update(ICH9LPCState *lpc, uint32_t rcba_old) uint32_t rcba = pci_get_long(lpc->d.config + ICH9_LPC_RCBA); if (rcba_old & ICH9_LPC_RCBA_EN) { - memory_region_del_subregion(get_system_memory(), &lpc->rcrb_mem); + memory_region_del_subregion(pci_address_space(&lpc->d), &lpc->rcrb_mem); } if (rcba & ICH9_LPC_RCBA_EN) { - memory_region_add_subregion_overlap(get_system_memory(), + memory_region_add_subregion_overlap(pci_address_space(&lpc->d), rcba & ICH9_LPC_RCBA_BA_MASK, &lpc->rcrb_mem, 1); } @@ -695,7 +695,7 @@ static void ich9_lpc_realize(PCIDevice *d, Error **errp) return; } - isa_bus = isa_bus_new(DEVICE(d), get_system_memory(), get_system_io(), + isa_bus = isa_bus_new(dev, pci_address_space(d), pci_address_space_io(d), errp); if (!isa_bus) { return; From patchwork Tue Jan 31 11:53:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13122928 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 93D2EC38142 for ; Tue, 31 Jan 2023 11:54:46 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMpDD-0006mZ-T3; Tue, 31 Jan 2023 06:54:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMpDC-0006kb-Hn; Tue, 31 Jan 2023 06:54:06 -0500 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pMpDA-0002P4-Ss; Tue, 31 Jan 2023 06:54:06 -0500 Received: by mail-ej1-x630.google.com with SMTP id dr8so19236932ejc.12; Tue, 31 Jan 2023 03:54:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cjbKNJ2e/Nb+msjDvSg2Rp01VPuMdSK9TW+rDQ4iT2Q=; b=RUcZfjAZTx8VlDv3/Xh//0GaY3AMLo3GbyeKnUCR6wEUnSLK/dgkdkxOJ6ShGjnJc6 mhZpc4/R0s0GuawtBPv+5aJOTNnhzNKKNFHoA0+kzh2smoLBFYXQSOjXne8CnD28pii0 HMaeWeGEWNUSUt+PY9n8Mq4zf5EBtIrEas7le60MD5mvhnMtkOggYwDJNh8x8aJNxzvf i/ZfLr6HjV+mdszQstO47ZDwyO3cnI6a8LtGJWyPgbj5woQl6szDdafApQ/+lVEQ1UJd 19Tx3/s1jmraeH8Io+/QmhTQuTTbRAk3LbUnoFTlavGERKwCi2Ck+LXY6ekuQYKaG9EW 2V5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cjbKNJ2e/Nb+msjDvSg2Rp01VPuMdSK9TW+rDQ4iT2Q=; b=aVm4q4zWfwaZC4Rje/pkhijjSHM3QFvO+jX75BXjyX2uzDE82IwU/2YUxi3/eenCDw iglIJYXunO4F0bLWgQAJ8+CWO1UeHG3olVYfxxmtmvj5l1rZVF0lz3ejRWj0iD+OrjjO BWuwk6IHMFzuwtwC55I8pMqZ3md6etrDzMZP0wRtm35tk66PhVwYvl1yY4ZhVxsrqiG1 X9rpazlU3e+KumVj1ipqLcFxAPA2bq+CCR4Uq62fnbOqkKb7dp43i5cnEqnxC7U8tPAI 08s1An0eOTApw/sfNmbFsfeJiWC8j4I90exvYajJt1XfELjg+beYUBHdw2LvzRgmO3jh rcUw== X-Gm-Message-State: AO0yUKW7O9lZLPU6sWFJnAZjWNoLB3sESeDtVxL4R/rGmt7w9Mf5kJNS Qji+4gO5/PXaG/4a7U6B0w2WEJulRo8= X-Google-Smtp-Source: AK7set84EY8pxQcsyz6ZxFnuPjw2k0WV6qv9yiy9Ipd0iR161RwuKb3hn3kJfaQQpNbZyFWQc2V6qg== X-Received: by 2002:a17:907:c23:b0:870:2cc7:e8e2 with SMTP id ga35-20020a1709070c2300b008702cc7e8e2mr3624927ejc.54.1675166042697; Tue, 31 Jan 2023 03:54:02 -0800 (PST) Received: from localhost.localdomain (dynamic-077-013-082-236.77.13.pool.telefonica.de. [77.13.82.236]) by smtp.gmail.com with ESMTPSA id c10-20020a056402100a00b00483dd234ac6sm8178318edu.96.2023.01.31.03.54.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 03:54:02 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Igor Mammedov , Richard Henderson , Ani Sinha , "Michael S. Tsirkin" , Paolo Bonzini , BALATON Zoltan , Thomas Huth , Marcel Apfelbaum , Eduardo Habkost , Laurent Vivier , Sunil Muthuswamy , qemu-trivial@nongnu.org, Bernhard Beschow Subject: [PATCH v2 12/20] hw/i2c/smbus_ich9: Move ich9_smb_set_irq() in front of ich9_smbus_realize() Date: Tue, 31 Jan 2023 12:53:18 +0100 Message-Id: <20230131115326.12454-13-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230131115326.12454-1-shentey@gmail.com> References: <20230131115326.12454-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=shentey@gmail.com; helo=mail-ej1-x630.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 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-bounces+qemu-devel=archiver.kernel.org@nongnu.org This is a preparation for the next commit to make it cleaner. Signed-off-by: Bernhard Beschow --- hw/i2c/smbus_ich9.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/hw/i2c/smbus_ich9.c b/hw/i2c/smbus_ich9.c index ee50ba1f2c..06d97ac942 100644 --- a/hw/i2c/smbus_ich9.c +++ b/hw/i2c/smbus_ich9.c @@ -80,6 +80,18 @@ static void ich9_smbus_write_config(PCIDevice *d, uint32_t address, } } +static void ich9_smb_set_irq(PMSMBus *pmsmb, bool enabled) +{ + ICH9SMBState *s = pmsmb->opaque; + + if (enabled == s->irq_enabled) { + return; + } + + s->irq_enabled = enabled; + pci_set_irq(&s->dev, enabled); +} + static void ich9_smbus_realize(PCIDevice *d, Error **errp) { ICH9SMBState *s = ICH9_SMB_DEVICE(d); @@ -128,18 +140,6 @@ static void ich9_smb_class_init(ObjectClass *klass, void *data) adevc->build_dev_aml = build_ich9_smb_aml; } -static void ich9_smb_set_irq(PMSMBus *pmsmb, bool enabled) -{ - ICH9SMBState *s = pmsmb->opaque; - - if (enabled == s->irq_enabled) { - return; - } - - s->irq_enabled = enabled; - pci_set_irq(&s->dev, enabled); -} - I2CBus *ich9_smb_init(PCIBus *bus, int devfn, uint32_t smb_io_base) { PCIDevice *d = From patchwork Tue Jan 31 11:53:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13122926 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 9F783C636CC for ; Tue, 31 Jan 2023 11:54:39 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMpDE-0006ni-W5; Tue, 31 Jan 2023 06:54:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMpDC-0006l9-P3; Tue, 31 Jan 2023 06:54:06 -0500 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pMpDB-0002Kh-32; Tue, 31 Jan 2023 06:54:06 -0500 Received: by mail-ed1-x530.google.com with SMTP id q19so4196853edd.2; Tue, 31 Jan 2023 03:54:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yYP8QNgLvA7AK+0xhZ1WbcXqy12AF56ZzSpPZ3vA+gE=; b=p9cIwVbY6n1TYYueXO0wjPpk1DMJrE9JdHyTU7REWvm0qpiG3av3hmkBEh3X4Ose6N 0MxaWJbrYVbwMp9kgP1Chz96LFcGyR2cYXfL5p+nxyI45tiDxI0JrYZ5IBMha7ZdWZqC QAjJUJRbP5laxSg79llx6AG8lGEMlkC/6rffrsZgTVpvOLbK3PAeQ3l+loH5kwXKNup0 yD4fmRdjimGud2bJFm8soLx8ynMXruzY1jb6l3bXfwYKghJjoCUireM9oKnClhk6h56L I01pYIzsSKGEEN1faKwXO1R4qycXeT9WmY4i3ZXBpUWTPHnWo3mV+oxTOJecSXpqfuVZ PRcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yYP8QNgLvA7AK+0xhZ1WbcXqy12AF56ZzSpPZ3vA+gE=; b=Czi/pXBO5NdRYt8Mfo5ngC7+SHh3jo674+X0Xy+YoGubLPxkTpfl7goNGZFH7oASb7 A41RkAm7bdL88/bN+GDw0FZQhadcij7ZI8NblY1E0kFDZ3WHmNSM74IDbbJbu41E24cD UR5+OnvgdOcdXANKeji/ujS3KCO0e076NWnRuipudQ3YRVszc0TStaUt6kIY0CO7QWjn LhiBPf354YPxkODSlBmLRo09PlB71FxYHav/QjHSXLjWZolzB37U/dBWEwzsOMYUM0ii ZhH2icemy0i5YDqH+KC9Ecc8/cEUU8A0g5d/tElYBt4PdTw7lJEz/vvbDbv65rBI+end +63g== X-Gm-Message-State: AFqh2kr2FCmrZ2dCOyLtvNx8nG6HmUOnzw9XO9G9lnCl3y06OB1/OeFb XMdowyhu/tnP6THah8Fkzu2ioEIzGKQ= X-Google-Smtp-Source: AMrXdXsyRKpckzTh0SBR5xiE5MPgkceurtB/HfggJJ7sl308LBypZpKsb+2nKLE06kHDCu6LjWl32w== X-Received: by 2002:a05:6402:1394:b0:49e:a107:268e with SMTP id b20-20020a056402139400b0049ea107268emr46859525edv.3.1675166043795; Tue, 31 Jan 2023 03:54:03 -0800 (PST) Received: from localhost.localdomain (dynamic-077-013-082-236.77.13.pool.telefonica.de. [77.13.82.236]) by smtp.gmail.com with ESMTPSA id c10-20020a056402100a00b00483dd234ac6sm8178318edu.96.2023.01.31.03.54.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 03:54:03 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Igor Mammedov , Richard Henderson , Ani Sinha , "Michael S. Tsirkin" , Paolo Bonzini , BALATON Zoltan , Thomas Huth , Marcel Apfelbaum , Eduardo Habkost , Laurent Vivier , Sunil Muthuswamy , qemu-trivial@nongnu.org, Bernhard Beschow Subject: [PATCH v2 13/20] hw/i2c/smbus_ich9: Inline ich9_smb_init() and remove it Date: Tue, 31 Jan 2023 12:53:19 +0100 Message-Id: <20230131115326.12454-14-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230131115326.12454-1-shentey@gmail.com> References: <20230131115326.12454-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=shentey@gmail.com; helo=mail-ed1-x530.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 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-bounces+qemu-devel=archiver.kernel.org@nongnu.org ich9_smb_init() is a legacy init function, so modernize the code. Note that the smb_io_base parameter was unused. Signed-off-by: Bernhard Beschow --- include/hw/i386/ich9.h | 1 - hw/i2c/smbus_ich9.c | 13 +++---------- hw/i386/pc_q35.c | 11 ++++++++--- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h index 05464f6965..52ea116f44 100644 --- a/include/hw/i386/ich9.h +++ b/include/hw/i386/ich9.h @@ -9,7 +9,6 @@ #include "qom/object.h" void ich9_lpc_pm_init(PCIDevice *pci_lpc, bool smm_enabled); -I2CBus *ich9_smb_init(PCIBus *bus, int devfn, uint32_t smb_io_base); void ich9_generate_smi(void); diff --git a/hw/i2c/smbus_ich9.c b/hw/i2c/smbus_ich9.c index 06d97ac942..c7fdf32db0 100644 --- a/hw/i2c/smbus_ich9.c +++ b/hw/i2c/smbus_ich9.c @@ -105,6 +105,9 @@ static void ich9_smbus_realize(PCIDevice *d, Error **errp) pm_smbus_init(&d->qdev, &s->smb, false); pci_register_bar(d, ICH9_SMB_SMB_BASE_BAR, PCI_BASE_ADDRESS_SPACE_IO, &s->smb.io); + + s->smb.set_irq = ich9_smb_set_irq; + s->smb.opaque = s; } static void build_ich9_smb_aml(AcpiDevAmlIf *adev, Aml *scope) @@ -140,16 +143,6 @@ static void ich9_smb_class_init(ObjectClass *klass, void *data) adevc->build_dev_aml = build_ich9_smb_aml; } -I2CBus *ich9_smb_init(PCIBus *bus, int devfn, uint32_t smb_io_base) -{ - PCIDevice *d = - pci_create_simple_multifunction(bus, devfn, true, TYPE_ICH9_SMB_DEVICE); - ICH9SMBState *s = ICH9_SMB_DEVICE(d); - s->smb.set_irq = ich9_smb_set_irq; - s->smb.opaque = s; - return s->smb.smbus; -} - static const TypeInfo ich9_smb_info = { .name = TYPE_ICH9_SMB_DEVICE, .parent = TYPE_PCI_DEVICE, diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index a4d5c89409..fab8e57913 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -312,10 +312,15 @@ static void pc_q35_init(MachineState *machine) } if (pcms->smbus_enabled) { + PCIDevice *smb; + /* TODO: Populate SPD eeprom data. */ - pcms->smbus = ich9_smb_init(host_bus, - PCI_DEVFN(ICH9_SMB_DEV, ICH9_SMB_FUNC), - 0xb100); + smb = pci_create_simple_multifunction(host_bus, + PCI_DEVFN(ICH9_SMB_DEV, + ICH9_SMB_FUNC), + true, TYPE_ICH9_SMB_DEVICE); + pcms->smbus = I2C_BUS(qdev_get_child_bus(DEVICE(smb), "i2c")); + smbus_eeprom_init(pcms->smbus, 8, NULL, 0); } From patchwork Tue Jan 31 11:53:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13122933 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 D0AB7C636CC for ; Tue, 31 Jan 2023 11:55:56 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMpDG-0006pe-O6; Tue, 31 Jan 2023 06:54:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMpDD-0006mY-Rs; Tue, 31 Jan 2023 06:54:07 -0500 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pMpDC-0002Kz-Bx; Tue, 31 Jan 2023 06:54:07 -0500 Received: by mail-ed1-x534.google.com with SMTP id n6so11500911edo.9; Tue, 31 Jan 2023 03:54:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0YKkwhxcXAzM3VHw9UsOTvoyMrRmWQaCXcSphc2uXOc=; b=JfMc61Ot7pgGVPGxXCwypHN2xdS0YDwL5gYEU7PX0it5yE8dXarmZlLXOB0iGhvGFQ 9MEG15VuzgJZgS+h56CsOpaDXGvHH9qnmBBdmyL+xzSvxJ2WmQoqSslckr4G6MOsXZak R1OdMKHZCnYHl9LxRUpwiLziU239X27Yl82wLdIgl4nlvEXuHCp1GwYcZWDTd1epuUTG nAnlHi9puGidpHBKcxAXerGaMZLDNohss0IHWdffu9cbAtaUEMsLjn3sIcjgxt2GpEKB IU6/scuLKL9Le5CE8keKuxKRLFa5BIvYM5LjZ2mgkyKh+vQIzdLfApEpczyolekY4GnI aS8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0YKkwhxcXAzM3VHw9UsOTvoyMrRmWQaCXcSphc2uXOc=; b=dyQFqvcTCO7oTzf9uyeT9zEG4nqxuZs6XO5odIu1raXMQMufr1i9g5wLAGZZCLeNVE 7sCy5m7Uj8iusJVu4Vdk9KOKX/+guQmOU6k6tc5GM0P4gxf2oPo6+e064nldBNqTI4Fu /1VOYNr9MSCve/TbXAF9XDTTcyJZXvci6wVprRWJXc+MxwrDepAiyvXZIBkuF2EBqmu/ 9JGF0a92yiqutr4PzCP0+UCTleMcj+YFXbgBABcJKq23qVWl43ZUNpGzH/eHPgE74+NY AlEZVn7cfJyZpwz9M7VCEz8nXjULtpJ7xmyCsTcXkD/gkvAmaYnUU/MmD9aQKWLYiiIs Rh3w== X-Gm-Message-State: AO0yUKUGhlMRJpzqTB3csNdCddbywBRCEQm9vxByaqpo5oY4crgmTHYZ iYSm+83dA2nyutNbvTBSw4PQyxBii8U= X-Google-Smtp-Source: AK7set9muMtpTnzBDHuOvCXoLUGdcqrP+R996N5ewrJC3o6IheaGnhme3ddBFRAdgloFw5967m0lHw== X-Received: by 2002:aa7:d295:0:b0:4a2:4074:7d81 with SMTP id w21-20020aa7d295000000b004a240747d81mr8561397edq.16.1675166045124; Tue, 31 Jan 2023 03:54:05 -0800 (PST) Received: from localhost.localdomain (dynamic-077-013-082-236.77.13.pool.telefonica.de. [77.13.82.236]) by smtp.gmail.com with ESMTPSA id c10-20020a056402100a00b00483dd234ac6sm8178318edu.96.2023.01.31.03.54.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 03:54:04 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Igor Mammedov , Richard Henderson , Ani Sinha , "Michael S. Tsirkin" , Paolo Bonzini , BALATON Zoltan , Thomas Huth , Marcel Apfelbaum , Eduardo Habkost , Laurent Vivier , Sunil Muthuswamy , qemu-trivial@nongnu.org, Bernhard Beschow Subject: [PATCH v2 14/20] hw/i386/pc_q35: Allow for setting properties before realizing TYPE_ICH9_LPC_DEVICE Date: Tue, 31 Jan 2023 12:53:20 +0100 Message-Id: <20230131115326.12454-15-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230131115326.12454-1-shentey@gmail.com> References: <20230131115326.12454-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::534; envelope-from=shentey@gmail.com; helo=mail-ed1-x534.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 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-bounces+qemu-devel=archiver.kernel.org@nongnu.org This is a preparation to make the next patch cleaner. Signed-off-by: Bernhard Beschow --- hw/i386/pc_q35.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index fab8e57913..27a1fe351d 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -232,10 +232,11 @@ static void pc_q35_init(MachineState *machine) /* pci */ sysbus_realize_and_unref(SYS_BUS_DEVICE(phb), &error_fatal); host_bus = PCI_BUS(qdev_get_child_bus(DEVICE(phb), "pcie.0")); + /* create ISA bus */ - lpc = pci_create_simple_multifunction(host_bus, PCI_DEVFN(ICH9_LPC_DEV, - ICH9_LPC_FUNC), true, - TYPE_ICH9_LPC_DEVICE); + lpc = pci_new_multifunction(PCI_DEVFN(ICH9_LPC_DEV, ICH9_LPC_FUNC), true, + TYPE_ICH9_LPC_DEVICE); + pci_realize_and_unref(lpc, host_bus, &error_fatal); object_property_add_link(OBJECT(machine), PC_MACHINE_ACPI_DEVICE_PROP, TYPE_HOTPLUG_HANDLER, From patchwork Tue Jan 31 11:53:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13122929 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 97EBBC636CC for ; Tue, 31 Jan 2023 11:55:07 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMpDI-0006vS-LE; Tue, 31 Jan 2023 06:54:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMpDG-0006pU-KY; Tue, 31 Jan 2023 06:54:10 -0500 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pMpDE-0002QC-C3; Tue, 31 Jan 2023 06:54:10 -0500 Received: by mail-ed1-x52d.google.com with SMTP id be12so2874325edb.4; Tue, 31 Jan 2023 03:54:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jK+HqWAF0i2+Iqc7sL+yhGP1FjJWW4+T+puMuZ1qqd4=; b=UIsY2UnGhNtrQxN/UhbVwa8QS7eNS4t+LpQIbBEihswqTMe+WDWLDiPhkKEfYqKBJX TTY9G+TxS1dEjHzQhWC7fifyQ83qs88TkOkqnupWe7Byn1qhOjAa8TKsIWu7jAUw6mdY QRWjDzJNXvFV5vRbh3BhIFsO2Rcm0U797YgDUY97HwLUObf2C2grDBNbIwF+qdJ4QLQf xuVC3VMr1m/lBXjR+paYrxCehjOTObVjIrv3A8I+/6QUTFgxBJn7BlL04CgIohCMatPD 8TH5sBpUpWSAnqO3Tx+qjTXWQprBnVDH685gNXxfCYw0YhMWJDuYj+B2P97nY68Z4phR l2LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jK+HqWAF0i2+Iqc7sL+yhGP1FjJWW4+T+puMuZ1qqd4=; b=6UgbE5fczmKakQEKe8koh4kh2cO95xx5RDU8fOGuflfHYow5JmSYoUMd/bkJHF+bES p7DD4/lTHE9epYP1y4pRD1fYzPMPci3m8TQST7/y40k6OnTHHXXaw/6Ei6I1RS9M0eMd RovSy6WTlbwI7+6OAgM3ECFNQCcuDr2HdTgcScIqPujY9QVuzBA2ROuBJaM/pw4jhs0+ l1pwryRRWELw42KEmhEv7bl38akW7osbF5XmN6a08UxhW0EpnragIxq/r4jdrPHwoM91 4H0v/GWpvxz6ruAbObr8j9r1O680GikeDWXwXoN9I/rOgS5nwZWhE9Anobhe23V7MOZR eXuw== X-Gm-Message-State: AO0yUKVdCTAnXnjYX0W47H6goed++3aJtThusUhYD/TUjB7PCjVIf/Ke pgMGXdGmHe8ithhjnIg1p6z7gIe642k= X-Google-Smtp-Source: AK7set9xeJ9vw/ZG+t6WJpUZcCy/RqYQdr+LhNLqJT6IKzCrl/wuFh1wn4qgOuGTWvljwmSS9+0aKw== X-Received: by 2002:a05:6402:1a5c:b0:4a0:8ea1:cce with SMTP id bf28-20020a0564021a5c00b004a08ea10ccemr27531815edb.25.1675166046150; Tue, 31 Jan 2023 03:54:06 -0800 (PST) Received: from localhost.localdomain (dynamic-077-013-082-236.77.13.pool.telefonica.de. [77.13.82.236]) by smtp.gmail.com with ESMTPSA id c10-20020a056402100a00b00483dd234ac6sm8178318edu.96.2023.01.31.03.54.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 03:54:05 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Igor Mammedov , Richard Henderson , Ani Sinha , "Michael S. Tsirkin" , Paolo Bonzini , BALATON Zoltan , Thomas Huth , Marcel Apfelbaum , Eduardo Habkost , Laurent Vivier , Sunil Muthuswamy , qemu-trivial@nongnu.org, Bernhard Beschow Subject: [PATCH v2 15/20] hw/isa/lpc_ich9: Connect pm stuff to lpc internally Date: Tue, 31 Jan 2023 12:53:21 +0100 Message-Id: <20230131115326.12454-16-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230131115326.12454-1-shentey@gmail.com> References: <20230131115326.12454-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52d; envelope-from=shentey@gmail.com; helo=mail-ed1-x52d.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 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-bounces+qemu-devel=archiver.kernel.org@nongnu.org Make TYPE_ICH9_LPC_DEVICE more self-contained by moving the call to ich9_lpc_pm_init() from board code to its realize function. In order to propagate x86_machine_is_smm_enabled(), introduce an "smm-enabled" property like we have in piix4. Signed-off-by: Bernhard Beschow --- include/hw/acpi/ich9.h | 6 ++---- include/hw/i386/ich9.h | 2 -- hw/acpi/ich9.c | 8 ++------ hw/i386/pc_q35.c | 5 ++--- hw/isa/lpc_ich9.c | 8 +++++--- 5 files changed, 11 insertions(+), 18 deletions(-) diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h index d41866a229..57a542c4b8 100644 --- a/include/hw/acpi/ich9.h +++ b/include/hw/acpi/ich9.h @@ -64,7 +64,7 @@ typedef struct ICH9LPCPMRegs { uint8_t disable_s3; uint8_t disable_s4; uint8_t s4_val; - uint8_t smm_enabled; + bool smm_enabled; bool smm_compat; bool enable_tco; TCOIORegs tco_regs; @@ -72,9 +72,7 @@ typedef struct ICH9LPCPMRegs { #define ACPI_PM_PROP_TCO_ENABLED "enable_tco" -void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm, - bool smm_enabled, - qemu_irq sci_irq); +void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm, qemu_irq sci_irq); void ich9_pm_iospace_update(ICH9LPCPMRegs *pm, uint32_t pm_io_base); extern const VMStateDescription vmstate_ich9_pm; diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h index 52ea116f44..433c8942c9 100644 --- a/include/hw/i386/ich9.h +++ b/include/hw/i386/ich9.h @@ -8,8 +8,6 @@ #include "hw/acpi/ich9.h" #include "qom/object.h" -void ich9_lpc_pm_init(PCIDevice *pci_lpc, bool smm_enabled); - void ich9_generate_smi(void); #define ICH9_CC_SIZE (16 * 1024) /* 16KB. Chipset configuration registers */ diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index a93c470e9d..54bb3d83b3 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -291,9 +291,7 @@ static void pm_powerdown_req(Notifier *n, void *opaque) acpi_pm1_evt_power_down(&pm->acpi_regs); } -void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm, - bool smm_enabled, - qemu_irq sci_irq) +void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm, qemu_irq sci_irq) { memory_region_init(&pm->io, OBJECT(lpc_pci), "ich9-pm", ICH9_PMIO_SIZE); memory_region_set_enabled(&pm->io, false); @@ -303,7 +301,7 @@ void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm, acpi_pm_tmr_init(&pm->acpi_regs, ich9_pm_update_sci_fn, &pm->io); acpi_pm1_evt_init(&pm->acpi_regs, ich9_pm_update_sci_fn, &pm->io); acpi_pm1_cnt_init(&pm->acpi_regs, &pm->io, pm->disable_s3, pm->disable_s4, - pm->s4_val, !pm->smm_compat && !smm_enabled); + pm->s4_val, !pm->smm_compat && !pm->smm_enabled); acpi_gpe_init(&pm->acpi_regs, ICH9_PMIO_GPE0_LEN); memory_region_init_io(&pm->io_gpe, OBJECT(lpc_pci), &ich9_gpe_ops, pm, @@ -314,8 +312,6 @@ void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm, "acpi-smi", 8); memory_region_add_subregion(&pm->io, ICH9_PMIO_SMI_EN, &pm->io_smi); - pm->smm_enabled = smm_enabled; - if (pm->enable_tco) { acpi_pm_tco_init(&pm->tco_regs, &pm->io); } diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 27a1fe351d..2b34b88dc2 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -236,6 +236,8 @@ static void pc_q35_init(MachineState *machine) /* create ISA bus */ lpc = pci_new_multifunction(PCI_DEVFN(ICH9_LPC_DEV, ICH9_LPC_FUNC), true, TYPE_ICH9_LPC_DEVICE); + qdev_prop_set_bit(DEVICE(lpc), "smm-enabled", + x86_machine_is_smm_enabled(x86ms)); pci_realize_and_unref(lpc, host_bus, &error_fatal); object_property_add_link(OBJECT(machine), PC_MACHINE_ACPI_DEVICE_PROP, @@ -289,9 +291,6 @@ static void pc_q35_init(MachineState *machine) pc_basic_device_init(pcms, isa_bus, x86ms->gsi, &rtc_state, !mc->no_floppy, 0xff0104); - /* connect pm stuff to lpc */ - ich9_lpc_pm_init(lpc, x86_machine_is_smm_enabled(x86ms)); - if (pcms->sata_enabled) { /* ahci and SATA device, for q35 1 ahci controller is built-in */ ahci = pci_create_simple_multifunction(host_bus, diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index 1b7e5585b3..7d21857d53 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -407,14 +407,13 @@ static void smi_features_ok_callback(void *opaque) lpc->smi_features_ok = 1; } -void ich9_lpc_pm_init(PCIDevice *lpc_pci, bool smm_enabled) +static void ich9_lpc_pm_init(ICH9LPCState *lpc) { - ICH9LPCState *lpc = ICH9_LPC_DEVICE(lpc_pci); qemu_irq sci_irq; FWCfgState *fw_cfg = fw_cfg_find(); sci_irq = qemu_allocate_irq(ich9_set_sci, lpc, 0); - ich9_pm_init(lpc_pci, &lpc->pm, smm_enabled, sci_irq); + ich9_pm_init(PCI_DEVICE(lpc), &lpc->pm, sci_irq); if (lpc->smi_host_features && fw_cfg) { uint64_t host_features_le; @@ -731,6 +730,8 @@ static void ich9_lpc_realize(PCIDevice *d, Error **errp) pci_bus_irqs(pci_bus, ich9_lpc_set_irq, d, ICH9_LPC_NB_PIRQS); pci_bus_map_irqs(pci_bus, ich9_lpc_map_irq); pci_bus_set_route_irq_fn(pci_bus, ich9_route_intx_pin_to_irq); + + ich9_lpc_pm_init(lpc); } static bool ich9_rst_cnt_needed(void *opaque) @@ -797,6 +798,7 @@ static const VMStateDescription vmstate_ich9_lpc = { static Property ich9_lpc_properties[] = { DEFINE_PROP_BOOL("noreboot", ICH9LPCState, pin_strap.spkr_hi, false), DEFINE_PROP_BOOL("smm-compat", ICH9LPCState, pm.smm_compat, false), + DEFINE_PROP_BOOL("smm-enabled", ICH9LPCState, pm.smm_enabled, false), DEFINE_PROP_BIT64("x-smi-broadcast", ICH9LPCState, smi_host_features, ICH9_LPC_SMI_F_BROADCAST_BIT, true), DEFINE_PROP_BIT64("x-smi-cpu-hotplug", ICH9LPCState, smi_host_features, From patchwork Tue Jan 31 11:53:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13122935 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 A05C7C38142 for ; Tue, 31 Jan 2023 11:56:51 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMpDJ-0006xY-2p; Tue, 31 Jan 2023 06:54:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMpDH-0006q1-FR; Tue, 31 Jan 2023 06:54:11 -0500 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pMpDG-0002QT-1s; Tue, 31 Jan 2023 06:54:11 -0500 Received: by mail-ed1-x530.google.com with SMTP id be12so2874389edb.4; Tue, 31 Jan 2023 03:54:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lnvu4fyAcGdKKQ5z10VgUCBohnACidYbKqIze/VgDBY=; b=Pf1PV0Yd/U3xaYDvFOlytVW3dMzllsmsuRhj07aYnEL2BK5pusN9LDPQQewqTaMIWC loIbQW4BcEGOBHYX5NXodUJY7C5DjZjCePKXQmTlKzFOQIt3OwG483mP23M6wUq0UcVL 58pKSCs8Ux36jUOg79vh9qPyTH6nUu7mpiVpRfI8L1yNpOLqn5TCVXKOsPY+RY1ZG35Z 9vC5BHAVHMX4RzX/fJS7gcNXfSlxqh6I9WHjYpsZtHbutEsW5EhqTQu+/UEGQJqgy0eb xLtGkIUk9xLOBwEXbe/2v3hTkoCKIx9k2ulgr41Aoj171nHrT5Q0gbcqqGII7YIRsm1v yvpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lnvu4fyAcGdKKQ5z10VgUCBohnACidYbKqIze/VgDBY=; b=mCcBpbnwRTRb6jVqMECOnnx6sgZwx8GACICD49Noneee+o9rbZrR7gkckYSPh6Gq3S HkdhGIiTA2yFPJr9zjyYZT4Y9znGdwQo4DBrTBIxbkgWKBJUXAMM9Tm5YH3ezbv1PuTr vdnRIyvJ7gRAY16frim4s5RS6jkPQPiiB8bwncyOzD/V/JOksjuY8G9Fulj9gA3QNMpg SixXrrALloq/6Giiws3MM9CpomzYnz3FqL+jvV7jk0T2W03jGaa1vwwPuC/3cJMO32ne em1OI7+rmZTV67AyxbyH34rQBB+T0OScaSeYKECJl8qNpBgtqKyRTGmapbN1WZ/K7DjH BltA== X-Gm-Message-State: AO0yUKXphpcgJiHw39DdImFTuiqZYxbNUnR7/zDFJRy0sKh80/x5fPz9 GJUnXUzel4tgQjYyOWQ0ob17lqf0+VM= X-Google-Smtp-Source: AK7set+yXMa8t7tRMZ45QcNmBAHODOr77ylxzIKNBqew0CpRQXP/ZHsuwBmYFsDMvElLN9XUS8TCUQ== X-Received: by 2002:aa7:cd48:0:b0:4a2:2e33:35fd with SMTP id v8-20020aa7cd48000000b004a22e3335fdmr14224473edw.15.1675166047461; Tue, 31 Jan 2023 03:54:07 -0800 (PST) Received: from localhost.localdomain (dynamic-077-013-082-236.77.13.pool.telefonica.de. [77.13.82.236]) by smtp.gmail.com with ESMTPSA id c10-20020a056402100a00b00483dd234ac6sm8178318edu.96.2023.01.31.03.54.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 03:54:06 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Igor Mammedov , Richard Henderson , Ani Sinha , "Michael S. Tsirkin" , Paolo Bonzini , BALATON Zoltan , Thomas Huth , Marcel Apfelbaum , Eduardo Habkost , Laurent Vivier , Sunil Muthuswamy , qemu-trivial@nongnu.org, Bernhard Beschow Subject: [PATCH v2 16/20] hw/isa/lpc_ich9: Remove redundant ich9_lpc_reset() invocation Date: Tue, 31 Jan 2023 12:53:22 +0100 Message-Id: <20230131115326.12454-17-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230131115326.12454-1-shentey@gmail.com> References: <20230131115326.12454-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=shentey@gmail.com; helo=mail-ed1-x530.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 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-bounces+qemu-devel=archiver.kernel.org@nongnu.org ich9_lpc_reset() is the dc->reset callback which is called automatically. No need to call it explicitly during k->realize. Signed-off-by: Bernhard Beschow --- hw/isa/lpc_ich9.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index 7d21857d53..b2842f2743 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -57,8 +57,6 @@ /*****************************************************************************/ /* ICH9 LPC PCI to ISA bridge */ -static void ich9_lpc_reset(DeviceState *qdev); - /* chipset configuration register * to access chipset configuration registers, pci_[sg]et_{byte, word, long} * are used. @@ -439,8 +437,6 @@ static void ich9_lpc_pm_init(ICH9LPCState *lpc) sizeof lpc->smi_features_ok, true); } - - ich9_lpc_reset(DEVICE(lpc)); } /* APM */ From patchwork Tue Jan 31 11:53:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13122932 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 525CDC38142 for ; Tue, 31 Jan 2023 11:55:25 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMpDK-00071F-0B; Tue, 31 Jan 2023 06:54:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMpDH-0006qS-Va; Tue, 31 Jan 2023 06:54:12 -0500 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pMpDG-0002N0-4J; Tue, 31 Jan 2023 06:54:11 -0500 Received: by mail-ed1-x531.google.com with SMTP id x7so10899384edr.0; Tue, 31 Jan 2023 03:54:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VrUMT8KXOlwyP+wNgiIX+Cf413CiRY1aEg+ePqpscxE=; b=TvB8Y25Ce/3Ie20AFkSnSditc4a+Yx0wW2YKy+ahdjomO0H6DQ0XtLYbnyQ0J6Dq27 t4Xib9hsaDZa8be45zIxy5aSvqQ2wLx/0d5aIN8Xk+/oS8qoY89THm6+1z+RmlnJZhjO OqrbPvvpPO16D9MSUJ97FiCQ42hm1gVTC0JnDayA4ijmKCxWUpfX8idVI6zhqIsXlMBz wy13573IHbQwHIRMtx7KdKl/X++kvoX5Jt2E/eD1fOcNcBI301BIlY+/SFYo1mSNXNWu RjkREXql8hcjHDEdV+nvmxG3DabdHmZlHYAPLd+Z8LCjd08O2ng5qVDPS8mKXx6dzHPB xwaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VrUMT8KXOlwyP+wNgiIX+Cf413CiRY1aEg+ePqpscxE=; b=0BMHgN3IXy7LNlHr/13OgIG+WDP2xOmnkwOrmfz+WgMgUaLJtn+JEtJ640vRBd5CD9 iyQ6KDW/5MMoHhXS1nXJs9ksUdF+xfxtQAkwoEJNlS9sP3W7oUC+iPGksa+FiNNNyiHP 9GI3z84LONK+DKCTDW4O8H/viNJO4hqvvJtf0buyhN3svCUr2LnlooKVmE+o2cCXkMfF YPRDO2Vgsbm4bXfUbI1GnHZ0tW9jNocSTce73wqmolv9jFJwkyeGT3L/5oHZMd67Kl7z bglFYPoppXPyOLabljVgslbRrR4eJHhFL0Fl9nQ2BjRQH1yyoQGxYFhuBsHWXYHU5DXj aUHw== X-Gm-Message-State: AO0yUKXMmzW3c9Ef/WWa9ZAEoG70qZ8+Wdd4Q6mOrhHHvHDcVzsuNAJo 0Q5iaEXM34/M3dgkFF6KidV82F1RNJM= X-Google-Smtp-Source: AK7set+OrWVv/Rc5aaTzF5R/Wv+rPWsHB8Enu8pOnLss/YUMuq5xAxMQo8ygOMlRE3H4fYzZz4wi1Q== X-Received: by 2002:a05:6402:f0c:b0:4a2:4ed3:c14b with SMTP id i12-20020a0564020f0c00b004a24ed3c14bmr3587685eda.36.1675166048541; Tue, 31 Jan 2023 03:54:08 -0800 (PST) Received: from localhost.localdomain (dynamic-077-013-082-236.77.13.pool.telefonica.de. [77.13.82.236]) by smtp.gmail.com with ESMTPSA id c10-20020a056402100a00b00483dd234ac6sm8178318edu.96.2023.01.31.03.54.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 03:54:08 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Igor Mammedov , Richard Henderson , Ani Sinha , "Michael S. Tsirkin" , Paolo Bonzini , BALATON Zoltan , Thomas Huth , Marcel Apfelbaum , Eduardo Habkost , Laurent Vivier , Sunil Muthuswamy , qemu-trivial@nongnu.org, Bernhard Beschow Subject: [PATCH v2 17/20] hw/i386/ich9: Remove redundant GSI_NUM_PINS Date: Tue, 31 Jan 2023 12:53:23 +0100 Message-Id: <20230131115326.12454-18-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230131115326.12454-1-shentey@gmail.com> References: <20230131115326.12454-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::531; envelope-from=shentey@gmail.com; helo=mail-ed1-x531.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 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-bounces+qemu-devel=archiver.kernel.org@nongnu.org Most code uses IOAPIC_NUM_PINS. The only place where GSI_NUM_PINS defines the size of an array is ICH9LPCState::gsi which needs to match IOAPIC_NUM_PINS. Remove GSI_NUM_PINS for consistency. Signed-off-by: Bernhard Beschow --- include/hw/i386/ich9.h | 2 +- include/hw/i386/x86.h | 1 - hw/i386/pc.c | 6 +++--- hw/i386/pc_q35.c | 3 ++- hw/isa/lpc_ich9.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h index 433c8942c9..d29090a9b7 100644 --- a/include/hw/i386/ich9.h +++ b/include/hw/i386/ich9.h @@ -63,7 +63,7 @@ struct ICH9LPCState { MemoryRegion rcrb_mem; /* root complex register block */ Notifier machine_ready; - qemu_irq gsi[GSI_NUM_PINS]; + qemu_irq gsi[IOAPIC_NUM_PINS]; }; #define ICH9_MASK(bit, ms_bit, ls_bit) \ diff --git a/include/hw/i386/x86.h b/include/hw/i386/x86.h index 62fa5774f8..0becd1460e 100644 --- a/include/hw/i386/x86.h +++ b/include/hw/i386/x86.h @@ -134,7 +134,6 @@ bool x86_machine_is_acpi_enabled(const X86MachineState *x86ms); /* Global System Interrupts */ -#define GSI_NUM_PINS IOAPIC_NUM_PINS #define ACPI_BUILD_PCI_IRQS ((1<<5) | (1<<9) | (1<<10) | (1<<11)) typedef struct GSIState { diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 8898cc9961..cbca3f5db5 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -28,7 +28,7 @@ #include "hw/i386/pc.h" #include "hw/char/serial.h" #include "hw/char/parallel.h" -#include "hw/i386/apic.h" +#include "hw/i386/ioapic.h" #include "hw/i386/topology.h" #include "hw/i386/fw_cfg.h" #include "hw/i386/vmport.h" @@ -406,7 +406,7 @@ GSIState *pc_gsi_create(qemu_irq **irqs, bool pci_enabled) if (kvm_ioapic_in_kernel()) { kvm_pc_setup_irq_routing(pci_enabled); } - *irqs = qemu_allocate_irqs(gsi_handler, s, GSI_NUM_PINS); + *irqs = qemu_allocate_irqs(gsi_handler, s, IOAPIC_NUM_PINS); return s; } @@ -1295,7 +1295,7 @@ void pc_basic_device_init(struct PCMachineState *pcms, sysbus_realize_and_unref(SYS_BUS_DEVICE(hpet), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(hpet), 0, HPET_BASE); - for (i = 0; i < GSI_NUM_PINS; i++) { + for (i = 0; i < IOAPIC_NUM_PINS; i++) { sysbus_connect_irq(SYS_BUS_DEVICE(hpet), i, gsi[i]); } pit_isa_irq = -1; diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 2b34b88dc2..87f1ff94be 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -43,6 +43,7 @@ #include "hw/i386/ich9.h" #include "hw/i386/amd_iommu.h" #include "hw/i386/intel_iommu.h" +#include "hw/i386/ioapic.h" #include "hw/display/ramfb.h" #include "hw/firmware/smbios.h" #include "hw/ide/pci.h" @@ -265,7 +266,7 @@ static void pc_q35_init(MachineState *machine) gsi_state = pc_gsi_create(&x86ms->gsi, pcmc->pci_enabled); lpc_dev = DEVICE(lpc); - for (i = 0; i < GSI_NUM_PINS; i++) { + for (i = 0; i < IOAPIC_NUM_PINS; i++) { qdev_connect_gpio_out_named(lpc_dev, ICH9_GPIO_GSI, i, x86ms->gsi[i]); } isa_bus = ISA_BUS(qdev_get_child_bus(lpc_dev, "isa.0")); diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index b2842f2743..808c572ae4 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -717,7 +717,7 @@ static void ich9_lpc_realize(PCIDevice *d, Error **errp) ICH9_RST_CNT_IOPORT, &lpc->rst_cnt_mem, 1); - qdev_init_gpio_out_named(dev, lpc->gsi, ICH9_GPIO_GSI, GSI_NUM_PINS); + qdev_init_gpio_out_named(dev, lpc->gsi, ICH9_GPIO_GSI, IOAPIC_NUM_PINS); isa_bus_irqs(isa_bus, lpc->gsi); From patchwork Tue Jan 31 11:53:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13122930 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 032EFC38142 for ; Tue, 31 Jan 2023 11:55:08 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMpDK-00077m-Vi; Tue, 31 Jan 2023 06:54:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMpDJ-0006yK-5t; Tue, 31 Jan 2023 06:54:13 -0500 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pMpDH-0002Ld-0h; Tue, 31 Jan 2023 06:54:12 -0500 Received: by mail-ed1-x533.google.com with SMTP id m8so4911424edd.10; Tue, 31 Jan 2023 03:54:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BPyNoKLwqrBVFKG2N3ckMQKAySrANIY0G3waLTCmOus=; b=mfRiWDOpyXywEd2MQvhMpzpw1wkYkpbL1GdcHplAaL3VrrWgLgYWi/xRDusUU0WgE2 QQSpcZbr5qVQbn0XAZZm6pWiZRP/7eV2wbCMGe4aFvsoK5t31ML3iN1sYDQRjVMAt9Sg j5IuG1dVteybbTTI6fSefoW/IR/l352/dB57V0kIRKVUI+xtwPBIVNDf+/WrOvpiPrHd uat8FrKk/vxJVqv9+e7b6AuIwNBYkFFNV3QYJ7FMruDxu6vuDse5jE6qX+8+QkdRxJsz nPk62Ki3adZcyz7dcLahPPAWVkQ41p6fdp2vEG54CydxLVHZPsR21/XHqueL74Og0ijZ cdew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BPyNoKLwqrBVFKG2N3ckMQKAySrANIY0G3waLTCmOus=; b=Jq7juod7UYj3YRdYYrUeiDapbflO2w/IVXhyMkO1xjTnJCHC0ck79ekq61/gI3T3Wo hjt+AjF9663Yd1W/UhbWdkqOmIku0aF3iduVSN9dJNQB08qp/W0zLKHubSTjn7TD8RMD Ddws885HY5DN1tLdkZlrdLuu/iP1nGXoOz++DGiPme8O6kLdsB7amsDCA9rUuxV3EXLu gCcmfy54b4rQFfIyQP5FyFYiVZLsDx6I47X23v05C8E7R5BAhCzIuhHIyr1Nqhx37tcF YWT3C2E1vSYBrHN159GusuR4bwUEbd3ZKRwhIjwUOqb5XswEMFaSo3xtjQFNFRAJsj5F OMCg== X-Gm-Message-State: AO0yUKXf1bhEkoHJK/IYN+abg79rc+Mhz2DnkgBX/euX1xf9xGDBWe4k LT1xNDimg5v1QsRJT1cBmoy78KrUf1I= X-Google-Smtp-Source: AK7set/GyFALkyBWWPTkOtG98Ye9TJIwXNMBinFgcpzz/LkCEpWZIOev/xr99EjXs9LL2oSwnCstcQ== X-Received: by 2002:a05:6402:2696:b0:49e:1c17:904 with SMTP id w22-20020a056402269600b0049e1c170904mr3832816edd.15.1675166049589; Tue, 31 Jan 2023 03:54:09 -0800 (PST) Received: from localhost.localdomain (dynamic-077-013-082-236.77.13.pool.telefonica.de. [77.13.82.236]) by smtp.gmail.com with ESMTPSA id c10-20020a056402100a00b00483dd234ac6sm8178318edu.96.2023.01.31.03.54.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 03:54:09 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Igor Mammedov , Richard Henderson , Ani Sinha , "Michael S. Tsirkin" , Paolo Bonzini , BALATON Zoltan , Thomas Huth , Marcel Apfelbaum , Eduardo Habkost , Laurent Vivier , Sunil Muthuswamy , qemu-trivial@nongnu.org, Bernhard Beschow Subject: [PATCH v2 18/20] hw: Move ioapic*.h to intc/ Date: Tue, 31 Jan 2023 12:53:24 +0100 Message-Id: <20230131115326.12454-19-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230131115326.12454-1-shentey@gmail.com> References: <20230131115326.12454-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=shentey@gmail.com; helo=mail-ed1-x533.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 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-bounces+qemu-devel=archiver.kernel.org@nongnu.org The ioapic sources reside in hw/intc already. Move the headers there as well. Signed-off-by: Bernhard Beschow --- MAINTAINERS | 1 + include/hw/i386/x86.h | 2 +- include/hw/{i386 => intc}/ioapic.h | 6 +++--- include/hw/{i386 => intc}/ioapic_internal.h | 8 ++++---- hw/i386/kvm/ioapic.c | 3 +-- hw/i386/pc.c | 2 +- hw/i386/pc_q35.c | 2 +- hw/intc/apic.c | 2 +- hw/intc/ioapic.c | 4 ++-- hw/intc/ioapic_common.c | 4 ++-- target/i386/whpx/whpx-all.c | 2 +- 11 files changed, 18 insertions(+), 18 deletions(-) rename include/hw/{i386 => intc}/ioapic.h (93%) rename include/hw/{i386 => intc}/ioapic_internal.h (96%) diff --git a/MAINTAINERS b/MAINTAINERS index c581c11a64..f96e86c57b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1703,6 +1703,7 @@ F: include/hw/char/parallel.h F: include/hw/dma/i8257.h F: include/hw/i2c/pm_smbus.h F: include/hw/input/i8042.h +F: include/hw/intc/ioapic* F: include/hw/isa/i8259_internal.h F: include/hw/isa/superio.h F: include/hw/timer/hpet.h diff --git a/include/hw/i386/x86.h b/include/hw/i386/x86.h index 0becd1460e..7eeac10e74 100644 --- a/include/hw/i386/x86.h +++ b/include/hw/i386/x86.h @@ -23,8 +23,8 @@ #include "hw/i386/topology.h" #include "hw/boards.h" #include "hw/nmi.h" +#include "hw/intc/ioapic.h" #include "hw/isa/isa.h" -#include "hw/i386/ioapic.h" #include "qom/object.h" struct X86MachineClass { diff --git a/include/hw/i386/ioapic.h b/include/hw/intc/ioapic.h similarity index 93% rename from include/hw/i386/ioapic.h rename to include/hw/intc/ioapic.h index ef37b8a9fd..aa122e25e3 100644 --- a/include/hw/i386/ioapic.h +++ b/include/hw/intc/ioapic.h @@ -17,8 +17,8 @@ * License along with this library; if not, see . */ -#ifndef HW_IOAPIC_H -#define HW_IOAPIC_H +#ifndef HW_INTC_IOAPIC_H +#define HW_INTC_IOAPIC_H #define IOAPIC_NUM_PINS 24 #define IO_APIC_DEFAULT_ADDRESS 0xfec00000 @@ -30,4 +30,4 @@ void ioapic_eoi_broadcast(int vector); -#endif /* HW_IOAPIC_H */ +#endif /* HW_INTC_IOAPIC_H */ diff --git a/include/hw/i386/ioapic_internal.h b/include/hw/intc/ioapic_internal.h similarity index 96% rename from include/hw/i386/ioapic_internal.h rename to include/hw/intc/ioapic_internal.h index e8ff338d7f..37b8565539 100644 --- a/include/hw/i386/ioapic_internal.h +++ b/include/hw/intc/ioapic_internal.h @@ -19,11 +19,11 @@ * License along with this library; if not, see . */ -#ifndef QEMU_IOAPIC_INTERNAL_H -#define QEMU_IOAPIC_INTERNAL_H +#ifndef HW_INTC_IOAPIC_INTERNAL_H +#define HW_INTC_IOAPIC_INTERNAL_H #include "exec/memory.h" -#include "hw/i386/ioapic.h" +#include "hw/intc/ioapic.h" #include "hw/sysbus.h" #include "qemu/notify.h" #include "qom/object.h" @@ -115,4 +115,4 @@ void ioapic_reset_common(DeviceState *dev); void ioapic_stat_update_irq(IOAPICCommonState *s, int irq, int level); -#endif /* QEMU_IOAPIC_INTERNAL_H */ +#endif /* HW_INTC_IOAPIC_INTERNAL_H */ diff --git a/hw/i386/kvm/ioapic.c b/hw/i386/kvm/ioapic.c index 272e26b4a2..cd5ea5d60b 100644 --- a/hw/i386/kvm/ioapic.c +++ b/hw/i386/kvm/ioapic.c @@ -12,9 +12,8 @@ #include "qemu/osdep.h" #include "monitor/monitor.h" -#include "hw/i386/x86.h" #include "hw/qdev-properties.h" -#include "hw/i386/ioapic_internal.h" +#include "hw/intc/ioapic_internal.h" #include "hw/intc/kvm_irqcount.h" #include "sysemu/kvm.h" diff --git a/hw/i386/pc.c b/hw/i386/pc.c index cbca3f5db5..b6c353346c 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -28,7 +28,6 @@ #include "hw/i386/pc.h" #include "hw/char/serial.h" #include "hw/char/parallel.h" -#include "hw/i386/ioapic.h" #include "hw/i386/topology.h" #include "hw/i386/fw_cfg.h" #include "hw/i386/vmport.h" @@ -47,6 +46,7 @@ #include "multiboot.h" #include "hw/rtc/mc146818rtc.h" #include "hw/intc/i8259.h" +#include "hw/intc/ioapic.h" #include "hw/timer/i8254.h" #include "hw/input/i8042.h" #include "hw/irq.h" diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 87f1ff94be..cd61d801c7 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -43,11 +43,11 @@ #include "hw/i386/ich9.h" #include "hw/i386/amd_iommu.h" #include "hw/i386/intel_iommu.h" -#include "hw/i386/ioapic.h" #include "hw/display/ramfb.h" #include "hw/firmware/smbios.h" #include "hw/ide/pci.h" #include "hw/ide/ahci.h" +#include "hw/intc/ioapic.h" #include "hw/usb.h" #include "hw/usb/hcd-uhci.h" #include "qapi/error.h" diff --git a/hw/intc/apic.c b/hw/intc/apic.c index 2d3e55f4e2..0ff060f721 100644 --- a/hw/intc/apic.c +++ b/hw/intc/apic.c @@ -20,7 +20,7 @@ #include "qemu/thread.h" #include "hw/i386/apic_internal.h" #include "hw/i386/apic.h" -#include "hw/i386/ioapic.h" +#include "hw/intc/ioapic.h" #include "hw/intc/i8259.h" #include "hw/intc/kvm_irqcount.h" #include "hw/pci/msi.h" diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c index 264262959d..6364ecab1b 100644 --- a/hw/intc/ioapic.c +++ b/hw/intc/ioapic.c @@ -24,10 +24,10 @@ #include "qapi/error.h" #include "monitor/monitor.h" #include "hw/i386/apic.h" -#include "hw/i386/ioapic.h" -#include "hw/i386/ioapic_internal.h" #include "hw/i386/x86.h" #include "hw/intc/i8259.h" +#include "hw/intc/ioapic.h" +#include "hw/intc/ioapic_internal.h" #include "hw/pci/msi.h" #include "hw/qdev-properties.h" #include "sysemu/kvm.h" diff --git a/hw/intc/ioapic_common.c b/hw/intc/ioapic_common.c index aa5f760871..b05f436dac 100644 --- a/hw/intc/ioapic_common.c +++ b/hw/intc/ioapic_common.c @@ -24,9 +24,9 @@ #include "qemu/module.h" #include "migration/vmstate.h" #include "monitor/monitor.h" -#include "hw/i386/ioapic.h" -#include "hw/i386/ioapic_internal.h" #include "hw/intc/intc.h" +#include "hw/intc/ioapic.h" +#include "hw/intc/ioapic_internal.h" #include "hw/sysbus.h" /* ioapic_no count start from 0 to MAX_IOAPICS, diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index e738d83e81..3d0c0b375f 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -19,7 +19,7 @@ #include "sysemu/runstate.h" #include "qemu/main-loop.h" #include "hw/boards.h" -#include "hw/i386/ioapic.h" +#include "hw/intc/ioapic.h" #include "hw/i386/apic_internal.h" #include "qemu/error-report.h" #include "qapi/error.h" From patchwork Tue Jan 31 11:53:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13122934 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 4F412C636CC for ; Tue, 31 Jan 2023 11:56:14 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMpDN-0007ID-Mo; Tue, 31 Jan 2023 06:54:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMpDJ-000711-OO; Tue, 31 Jan 2023 06:54:13 -0500 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pMpDI-0002Lu-1n; Tue, 31 Jan 2023 06:54:13 -0500 Received: by mail-ed1-x534.google.com with SMTP id z11so14157367ede.1; Tue, 31 Jan 2023 03:54:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=K5q6pEDmjbLQHJco4WLG6HNWuGgK1XtcwTBdRpFvGtI=; b=BBup4VtaxJBinKfpx6oe/NejpbXWqtl6M0IBcjcPjSDM87sVNaDyXmL5eAmKYDE++c e14Rj5A9gxYYeslYjPEFO71Bns4mz5yVUy9RQAHVITlP61fl/p0aLtRHxOk/zhBV+Uyb rwAzpL48qiGoaeQHHqrP18NkqcLvs8xmbzmN1B7Ivem5ZBskxiq0Lc/aKdgVu3UMKFIx qmea2mF2fv+sE6DhWcEI01h0J4j0kw9vakSPFHPd7Ie5VOH7NTpu5tiBFrD/EMqG6GG0 gN8G8jWgzhkhaNHQXZnUM1tervko560j2kThm7ZPsX2tcH6j1hoaW5YZxGAsIfNJS+bC hzKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=K5q6pEDmjbLQHJco4WLG6HNWuGgK1XtcwTBdRpFvGtI=; b=A/bcBrtvRTxd3P0OvrUu5NuwX1EcOj+hvO0K6dL9WDHDeEltfqIwgxOAxki6rNr5Lx Bhbzni9+6WIntKv3twcO6Lvu8RRnGLhaEoibRdOaQnhfk9Z1lXMjpP7Ah2ohhRNyNNov yH0o1bpUXc5vNqTizNvzXgP8ACyx2QBbZeD9CWRdfd/e8SfIQUsR0UfITtrjK6UDo9Fc oDr33/lmjnjkgQfbyIVLUC3p1+9Nhhf4M24mZ8CbPNK0If4kwXS8TSrgsHAT4S2fN+IK kvM2EWS2jtFzWyuvNF310tdL0C455BG8/5WpAwQZwLdVWZpYBxPddJADBRfttivRUz49 bnGg== X-Gm-Message-State: AO0yUKXmn5aau5+0FEGMx28lt/cAsU3PbZzhAKhy3QUAQ3e1dWlHMK3R KUXHVCAQeCq5bd9nzAqqPEhr1UN446k= X-Google-Smtp-Source: AK7set9ZgJ2HtzZZGCVzWksZmbaXuhJ11VBNJEViJy4/FcVa50YXx1bt5mbY3w01GOUtsKp4KUWvpA== X-Received: by 2002:aa7:d593:0:b0:4a2:34dd:2bb9 with SMTP id r19-20020aa7d593000000b004a234dd2bb9mr10826988edq.41.1675166050851; Tue, 31 Jan 2023 03:54:10 -0800 (PST) Received: from localhost.localdomain (dynamic-077-013-082-236.77.13.pool.telefonica.de. [77.13.82.236]) by smtp.gmail.com with ESMTPSA id c10-20020a056402100a00b00483dd234ac6sm8178318edu.96.2023.01.31.03.54.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 03:54:10 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Igor Mammedov , Richard Henderson , Ani Sinha , "Michael S. Tsirkin" , Paolo Bonzini , BALATON Zoltan , Thomas Huth , Marcel Apfelbaum , Eduardo Habkost , Laurent Vivier , Sunil Muthuswamy , qemu-trivial@nongnu.org, Bernhard Beschow Subject: [PATCH v2 19/20] hw/i386/ich9: Clean up includes Date: Tue, 31 Jan 2023 12:53:25 +0100 Message-Id: <20230131115326.12454-20-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230131115326.12454-1-shentey@gmail.com> References: <20230131115326.12454-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::534; envelope-from=shentey@gmail.com; helo=mail-ed1-x534.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 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-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Bernhard Beschow --- include/hw/i386/ich9.h | 8 +++++--- hw/i386/acpi-build.c | 1 + hw/isa/lpc_ich9.c | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h index d29090a9b7..3125863049 100644 --- a/include/hw/i386/ich9.h +++ b/include/hw/i386/ich9.h @@ -1,11 +1,13 @@ #ifndef HW_ICH9_H #define HW_ICH9_H -#include "hw/sysbus.h" -#include "hw/i386/pc.h" #include "hw/isa/apm.h" -#include "hw/acpi/acpi.h" #include "hw/acpi/ich9.h" +#include "hw/intc/ioapic.h" +#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" +#include "exec/memory.h" +#include "qemu/notify.h" #include "qom/object.h" void ich9_generate_smi(void); diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 127c4e2d50..266df7a153 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -59,6 +59,7 @@ #include "hw/acpi/pcihp.h" #include "hw/i386/fw_cfg.h" #include "hw/i386/ich9.h" +#include "hw/i386/pc.h" #include "hw/pci/pci_bus.h" #include "hw/pci-host/i440fx.h" #include "hw/pci-host/q35.h" diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index 808c572ae4..f508f6071e 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -40,8 +40,8 @@ #include "hw/irq.h" #include "hw/isa/apm.h" #include "hw/pci/pci.h" -#include "hw/pci/pci_bridge.h" #include "hw/i386/ich9.h" +#include "hw/i386/pc.h" #include "hw/acpi/acpi.h" #include "hw/acpi/ich9.h" #include "hw/pci/pci_bus.h" From patchwork Tue Jan 31 11:53:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13122931 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 002F8C636CC for ; Tue, 31 Jan 2023 11:55:22 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMpDk-00080m-3i; Tue, 31 Jan 2023 06:54:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMpDX-0007ao-BN; Tue, 31 Jan 2023 06:54:34 -0500 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pMpDV-0002UD-Em; Tue, 31 Jan 2023 06:54:27 -0500 Received: by mail-lf1-x133.google.com with SMTP id u12so13276773lfq.0; Tue, 31 Jan 2023 03:54:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JpV0VXPFV+veIfQCqfhElqv7o/IlC5FYc5Xa7nt93Zs=; b=V2AWkvLELj5yqeXmX4sAv6Iyrmu7uRvYZ1nTwYFZ00ifFpdgkUsAza+NA+t569OKlj VXTuHaL0Bqoudee1Sqj0iI1LQePQu8vqyhHw5zPBid9kL9E7q3Zrs3X4H5fQdyQqS40S tSOZzH2oIAG4ygqvDF9kfBnz7qqV2evk8Xwu7YNYf90sDbXRrXWZGhB5Y0gsspL6U1zV FPAAZrSAXPT4OVt25l5ZoWo/8V4THUPk3POkxo121siLMAh7G4f26eHy63mxaa2+rbZP z3RzpgZW8PSUN5wwJKBUVSMu9NlDTe0TEA2tX1oWCWhCsiS6OXYJzomqxkD8JaXCTrnL xWew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JpV0VXPFV+veIfQCqfhElqv7o/IlC5FYc5Xa7nt93Zs=; b=DeHcfSjUFPyI9nGWmFP7GbrEub/YbFUKctp0BEciK3o7XQoBTaEV67z0ooiCz2z6Uy Mf3IC1llgxMgf4t8rvijnAilV9d7KUdYNCM/d6KLkZIcInl/qd5U5730BN6EVvU+3dYQ BtN8O94Es5nkf1PB4kjoECy4RLfaGr7jBaAQ4fOxQzYFxOSoSpT4slj6Wx/oBeba3y5d RkNTUxTPqYLl2kUMnz4OzBTEj+u3MM9ji9VIl+2O+Du5hoXsd1CFdykUX9KVsxgHIAIS os+m7sGA9G4Rf3JVZifAy4XxDWPy9jwGNwRUcNYvD2y0S2lCqsevpY4GT5o3uHM0fIep yqxA== X-Gm-Message-State: AO0yUKVnOEsI1ACLmVBKtJWfILqSeUNPt//k53S851Hlk7gZmAJswHHf 1YQ2KBUpH7z6pERP7OaB9NXPW6t5z48= X-Google-Smtp-Source: AMrXdXt+CAachw/qlayHkhZNQuju3cxnVqcd3SJaX5o6xKiwVoGI0Hm7PnTBgRgR6NsVJpGz2HnEbw== X-Received: by 2002:a05:6402:4447:b0:497:c96b:4dea with SMTP id o7-20020a056402444700b00497c96b4deamr122358538edb.5.1675166051869; Tue, 31 Jan 2023 03:54:11 -0800 (PST) Received: from localhost.localdomain (dynamic-077-013-082-236.77.13.pool.telefonica.de. [77.13.82.236]) by smtp.gmail.com with ESMTPSA id c10-20020a056402100a00b00483dd234ac6sm8178318edu.96.2023.01.31.03.54.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 03:54:11 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Igor Mammedov , Richard Henderson , Ani Sinha , "Michael S. Tsirkin" , Paolo Bonzini , BALATON Zoltan , Thomas Huth , Marcel Apfelbaum , Eduardo Habkost , Laurent Vivier , Sunil Muthuswamy , qemu-trivial@nongnu.org, Bernhard Beschow Subject: [PATCH v2 20/20] hw: Move ich9.h to southbridge/ Date: Tue, 31 Jan 2023 12:53:26 +0100 Message-Id: <20230131115326.12454-21-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230131115326.12454-1-shentey@gmail.com> References: <20230131115326.12454-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::133; envelope-from=shentey@gmail.com; helo=mail-lf1-x133.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 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-bounces+qemu-devel=archiver.kernel.org@nongnu.org ICH9 is a south bridge which doesn't necessarily depend on x86, so move it into the southbridge folder, analoguous to PIIX. Signed-off-by: Bernhard Beschow --- MAINTAINERS | 1 + include/hw/{i386 => southbridge}/ich9.h | 6 +++--- hw/acpi/ich9.c | 2 +- hw/acpi/ich9_tco.c | 2 +- hw/i2c/smbus_ich9.c | 2 +- hw/i386/acpi-build.c | 2 +- hw/i386/pc_q35.c | 2 +- hw/isa/lpc_ich9.c | 2 +- hw/pci-bridge/i82801b11.c | 2 +- tests/qtest/tco-test.c | 2 +- 10 files changed, 12 insertions(+), 11 deletions(-) rename include/hw/{i386 => southbridge}/ich9.h (99%) diff --git a/MAINTAINERS b/MAINTAINERS index f96e86c57b..8753fc066c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1670,6 +1670,7 @@ F: hw/i2c/smbus_ich9.c F: hw/acpi/piix4.c F: hw/acpi/ich9*.c F: include/hw/acpi/ich9*.h +F: include/hw/southbridge/ich9.h F: include/hw/southbridge/piix.h F: hw/misc/sga.c F: hw/isa/apm.c diff --git a/include/hw/i386/ich9.h b/include/hw/southbridge/ich9.h similarity index 99% rename from include/hw/i386/ich9.h rename to include/hw/southbridge/ich9.h index 3125863049..7004eecbf9 100644 --- a/include/hw/i386/ich9.h +++ b/include/hw/southbridge/ich9.h @@ -1,5 +1,5 @@ -#ifndef HW_ICH9_H -#define HW_ICH9_H +#ifndef HW_SOUTHBRIDGE_ICH9_H +#define HW_SOUTHBRIDGE_ICH9_H #include "hw/isa/apm.h" #include "hw/acpi/ich9.h" @@ -242,4 +242,4 @@ struct ICH9LPCState { #define ICH9_LPC_SMI_F_CPU_HOTPLUG_BIT 1 #define ICH9_LPC_SMI_F_CPU_HOT_UNPLUG_BIT 2 -#endif /* HW_ICH9_H */ +#endif /* HW_SOUTHBRIDGE_ICH9_H */ diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index 54bb3d83b3..d23bfcaa6b 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -36,7 +36,7 @@ #include "hw/acpi/acpi.h" #include "hw/acpi/ich9_tco.h" -#include "hw/i386/ich9.h" +#include "hw/southbridge/ich9.h" #include "hw/mem/pc-dimm.h" #include "hw/mem/nvdimm.h" diff --git a/hw/acpi/ich9_tco.c b/hw/acpi/ich9_tco.c index fbf97f81f4..1540f4fd46 100644 --- a/hw/acpi/ich9_tco.c +++ b/hw/acpi/ich9_tco.c @@ -9,7 +9,7 @@ #include "qemu/osdep.h" #include "sysemu/watchdog.h" -#include "hw/i386/ich9.h" +#include "hw/southbridge/ich9.h" #include "migration/vmstate.h" #include "hw/acpi/ich9_tco.h" diff --git a/hw/i2c/smbus_ich9.c b/hw/i2c/smbus_ich9.c index c7fdf32db0..b3eb82bc2e 100644 --- a/hw/i2c/smbus_ich9.c +++ b/hw/i2c/smbus_ich9.c @@ -27,7 +27,7 @@ #include "migration/vmstate.h" #include "qemu/module.h" -#include "hw/i386/ich9.h" +#include "hw/southbridge/ich9.h" #include "qom/object.h" #include "hw/acpi/acpi_aml_interface.h" diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 266df7a153..44ed879c8a 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -55,10 +55,10 @@ #include "hw/hyperv/vmbus-bridge.h" /* Supported chipsets: */ +#include "hw/southbridge/ich9.h" #include "hw/southbridge/piix.h" #include "hw/acpi/pcihp.h" #include "hw/i386/fw_cfg.h" -#include "hw/i386/ich9.h" #include "hw/i386/pc.h" #include "hw/pci/pci_bus.h" #include "hw/pci-host/i440fx.h" diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index cd61d801c7..2c8c43834c 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -40,7 +40,6 @@ #include "hw/qdev-properties.h" #include "hw/i386/x86.h" #include "hw/i386/pc.h" -#include "hw/i386/ich9.h" #include "hw/i386/amd_iommu.h" #include "hw/i386/intel_iommu.h" #include "hw/display/ramfb.h" @@ -48,6 +47,7 @@ #include "hw/ide/pci.h" #include "hw/ide/ahci.h" #include "hw/intc/ioapic.h" +#include "hw/southbridge/ich9.h" #include "hw/usb.h" #include "hw/usb/hcd-uhci.h" #include "qapi/error.h" diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index f508f6071e..2699dc574a 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -40,7 +40,7 @@ #include "hw/irq.h" #include "hw/isa/apm.h" #include "hw/pci/pci.h" -#include "hw/i386/ich9.h" +#include "hw/southbridge/ich9.h" #include "hw/i386/pc.h" #include "hw/acpi/acpi.h" #include "hw/acpi/ich9.h" diff --git a/hw/pci-bridge/i82801b11.c b/hw/pci-bridge/i82801b11.c index f3b4a14611..0e83cd11b2 100644 --- a/hw/pci-bridge/i82801b11.c +++ b/hw/pci-bridge/i82801b11.c @@ -45,7 +45,7 @@ #include "hw/pci/pci_bridge.h" #include "migration/vmstate.h" #include "qemu/module.h" -#include "hw/i386/ich9.h" +#include "hw/southbridge/ich9.h" /*****************************************************************************/ /* ICH9 DMI-to-PCI bridge */ diff --git a/tests/qtest/tco-test.c b/tests/qtest/tco-test.c index d865e95dfc..0547d41173 100644 --- a/tests/qtest/tco-test.c +++ b/tests/qtest/tco-test.c @@ -14,7 +14,7 @@ #include "libqos/pci-pc.h" #include "qapi/qmp/qdict.h" #include "hw/pci/pci_regs.h" -#include "hw/i386/ich9.h" +#include "hw/southbridge/ich9.h" #include "hw/acpi/ich9.h" #include "hw/acpi/ich9_tco.h"