From patchwork Wed Feb 8 00:07:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 651527 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp3190212pva; Tue, 7 Feb 2023 16:08:58 -0800 (PST) X-Google-Smtp-Source: AK7set8Vc/Oe1xG5rsX3gOuW4dGKJLLZqoiPsFYN5NuDxkpYz3TOyTn1eqcYJZMnVR0jUhfRJol2 X-Received: by 2002:ad4:596c:0:b0:56b:eda1:de3d with SMTP id eq12-20020ad4596c000000b0056beda1de3dmr7615954qvb.42.1675814938238; Tue, 07 Feb 2023 16:08:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675814938; cv=none; d=google.com; s=arc-20160816; b=N9Q2VfH5SGr9I1mdRhs7RWGja+VvTvbqmRlDMqEPcJTQLacmBHMmUmPxLkwgCjkjHi WMhGzfUgF+eUmUGj/8Wqb6uKPpSpYWtf8K1d9H6R+X8G7sr+attZIuKfrpiF56iSKvEx MkWZ6s4A+0qENglUPUOzDUBao5OnPbz7rNyqdVjvXTEMZiQn2Ift0DhezphCA03X3rn+ tYfkcQRtagNKHQLasdqMihLEIEiDTseiVdeR/GpXXXqfULIhDEXk0QK5Zce57wpVlJtr FG/qF3+DSlx56FrSNl5+Z85exRBnF9SVMGBioO0iaw9zW4CZoXOfH9i+a6bu54IQjrvG 0Mzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=23vodWxpK/bd5tZKFyrhR5Mgkn9GGF8RhXeyzoQkzds=; b=KZhTL/e0YQXA16M1ueVBUB/e0x6QrWX5b9RHen7wRpKbVptMcUZdjTuD8DK5HOW+ce OXYAB6Ywl7KbQ9F+6eLPH/bHMLiA/aPG9hIku9+Li9Ekqy8zRZCBX4/zUvwloFq6Ug+N pZrG9BR9NFck0xImPwm/9+Ip1IwfCEgi9JfBrvAvNZbo9Xshr63oYmegeTS9alYX4v2q bVXx7/3q509zm1sW4VHvX28eaXjrvdB8orokWeOME/B7/a42NKPSoBfBJaLMcitlil5U mDsfAcqkmgrIwSJ7GgYwEiO4YMDOCzoKomL/YLKPuR6gFZjtt03YiSzjqvUcanHjU9s1 hI6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uGbotc5R; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d7-20020ac85d87000000b003b8483db22dsi12232704qtx.139.2023.02.07.16.08.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Feb 2023 16:08:58 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uGbotc5R; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPY0C-0005RP-Pp; Tue, 07 Feb 2023 19:07: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 1pPY0B-0005R1-RV for qemu-devel@nongnu.org; Tue, 07 Feb 2023 19:07:55 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pPY09-0008Rr-Ss for qemu-devel@nongnu.org; Tue, 07 Feb 2023 19:07:55 -0500 Received: by mail-wm1-x32e.google.com with SMTP id u10so9145174wmj.3 for ; Tue, 07 Feb 2023 16:07:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=23vodWxpK/bd5tZKFyrhR5Mgkn9GGF8RhXeyzoQkzds=; b=uGbotc5R0AwV6G3Tuo91yBye5uHQHsD6ZQQcLJtHpCge8AvqPd2o9Z+dI2i1PGFVyy sLKGLzqnliN1YRuKsgWwRTxG70jWozsXA4RiCJrVQixhW376sGLKaw4o80rsKZ7fhzU4 6NGfwMXkXex0KWc/IDQ9e95kzzzoHM/WwVm8HgcH0hXMY+wNW9qodh6nSepT96ZfntdY rS/CN+fgZT0b0cBDKemEFbb6IUO1HwOQrmmYzZgxa55XwodBBoQ6nidtmgH/64wprFy1 hCMmI1j5WEXeBbu/5RysYUUFgay5A7WyNhHrPbL3i1U+PeIxjrkGa6w5xM7Q06+bRyYt UlYw== 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=23vodWxpK/bd5tZKFyrhR5Mgkn9GGF8RhXeyzoQkzds=; b=pNsV6yuxnWEJAgeK0rEEsQs51GsHV9A8xGbBBjjUeotZ9hsTYhCqM8DYlRwHLKIzzp u/oNwY3plCWg+eAyFeN7NpkI2we6y6czYU5WakCTAZaH8aW7jUmQ4n3MwKTez5Fx7AGB 2mbt8KPryf8fTxJNxlWGypFJX6FK4xy7uX07QZElG4314tRivtBlKY50Us3m/1kvyTt6 eXlM0tEc4VMtCexfk2oJYauxB3+pv+gxMliEyjnVPLNXo0pbAM+shQWBiW4YI8Uxn0zI d8JWkSn0LysNyLWKkBUu0TkWHtBaRnxbKuuRAIuADgVgPSOLrCsNsGghe4OLZIteG7KU cjmQ== X-Gm-Message-State: AO0yUKV3F0zBksu9Z9OlnuMubD17H+s+2FPHg1oLc7OsS2NoPsTt1LTk y1UbcV3jsK5dcw9HcjIWAHALJmuBU3AJrpc+ X-Received: by 2002:a05:600c:3416:b0:3df:50eb:7ca6 with SMTP id y22-20020a05600c341600b003df50eb7ca6mr4840800wmp.15.1675814871595; Tue, 07 Feb 2023 16:07:51 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id h2-20020a05600c350200b003dc434b39c7sm4063772wmq.0.2023.02.07.16.07.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 07 Feb 2023 16:07:51 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: BALATON Zoltan , Paolo Bonzini , qemu-block@nongnu.org, Bernhard Beschow , Mark Cave-Ayland , John Snow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 1/7] hw/isa: Un-inline isa_bus_from_device() Date: Wed, 8 Feb 2023 01:07:37 +0100 Message-Id: <20230208000743.79415-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230208000743.79415-1-philmd@linaro.org> References: <20230208000743.79415-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org No point in inlining isa_bus_from_device() which is only used at device realization time. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/isa/isa-bus.c | 5 +++++ include/hw/isa/isa.h | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index 4fe61d6dfe..5bd99379e9 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -162,6 +162,11 @@ bool isa_realize_and_unref(ISADevice *dev, ISABus *bus, Error **errp) return qdev_realize_and_unref(&dev->parent_obj, &bus->parent_obj, errp); } +ISABus *isa_bus_from_device(ISADevice *dev) +{ + return ISA_BUS(qdev_get_parent_bus(DEVICE(dev))); +} + ISADevice *isa_vga_init(ISABus *bus) { vga_interface_created = true; diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index 25acd5c34c..ad8bdd941f 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -123,9 +123,6 @@ int isa_register_portio_list(ISADevice *dev, const MemoryRegionPortio *portio, void *opaque, const char *name); -static inline ISABus *isa_bus_from_device(ISADevice *d) -{ - return ISA_BUS(qdev_get_parent_bus(DEVICE(d))); -} +ISABus *isa_bus_from_device(ISADevice *dev); #endif From patchwork Wed Feb 8 00:07:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 651528 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp3190237pva; Tue, 7 Feb 2023 16:09:02 -0800 (PST) X-Google-Smtp-Source: AK7set8648hjNiQUrYRlrFFzWW/N2ojVPGX/X54GHI5gyTqwqNAMFthab0WRcV+yaWae1nNbbIHx X-Received: by 2002:a05:6214:d43:b0:53d:a0d9:979d with SMTP id 3-20020a0562140d4300b0053da0d9979dmr8986005qvr.23.1675814941897; Tue, 07 Feb 2023 16:09:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675814941; cv=none; d=google.com; s=arc-20160816; b=OFCwW5O/PZJa+5W83jeWWpnJZ06J8WKrHvYEOO5i6yrnzigGIc+HuTGjmtVDvRu66x KznHKDPHAWiGFD7oigW5T48eCGFmWpiJKRDJb2C9kW/8BDXuLIKbjqH24ma6OtXirLqU JyRfC89n+8g97ZLtykQOgS8FtxNKTUlryRn2dcgwlQaTe5kDZixaGUjC4Jaip3m6Zx7e AzNSb66nPpJWW3I8WytuibOd/vyjyfblE+18u26j07BPVj9CfrT/wfXpE4UapE15pgv4 epzbXloURCQf53KiPEup9vcxPf77vvnSzkMRyj0NjtBnbR6KLVnxdG3J8Ckl8+whX8NW 62IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uG/V5STTly/AiDD51pW5nIRJQwYRV7tuuua0OnmiC/A=; b=qgdAWY5gVHvOfHraysGtfXT120zvZJgheQuWRgv+gtGpYa6yiM4XGwa2NQp2ZkQiHu AG7kJZE87hn7X++qQ9IgXNMAh9DlU7Lgzz6/XVTNVXyvXV6AA29qiexCdYBTlaYuJDHp rWXHwMai9mrN3DyfbzzTiG7iiUXKz2D+vvAbzk2KetqxWBzZFc0XcLpF4iuj7N4CTcjh EfUN20sTGpVa6iCP2+odBjZw56gt9KOXtV7bmFLUcDl75UDyF5AuHzkEkcVugCY4uZ0d Y0J/STUbsXMpAiu1gcZwxwHVkfyDnOqZa23N+pe+96RRKZq5myq/WeZiZlHvTaxrHD45 syWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KISIPCHM; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a4-20020a0ca984000000b00498925e2db2si2912277qvb.524.2023.02.07.16.09.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Feb 2023 16:09:01 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KISIPCHM; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPY0H-0005SK-Kc; Tue, 07 Feb 2023 19:08:01 -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 1pPY0F-0005Ry-US for qemu-devel@nongnu.org; Tue, 07 Feb 2023 19:08:00 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pPY0E-0008Rr-55 for qemu-devel@nongnu.org; Tue, 07 Feb 2023 19:07:59 -0500 Received: by mail-wm1-x32e.google.com with SMTP id u10so9145291wmj.3 for ; Tue, 07 Feb 2023 16:07:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=uG/V5STTly/AiDD51pW5nIRJQwYRV7tuuua0OnmiC/A=; b=KISIPCHMW8jjyuruF5tKYxLoSQIBoNoTotZpaR8UnCTk+RnckiU8Q9jP1idhMpPREI RR3cf0Ee2JdU+A8RxBXK26Nxda18Hq1AWpcGORkJBhIBr5v6797HDbzsOStBtojYoJjo jjp0gZTIRI1GI0DEXnQ5wOd6f8VlqXy0Q5Sbfcze88qmdN9Nr5cKaiJ7309wnjN6PWbZ +xnA/nAoNhg8UH60TnfCvhtBBoLizBovAnIMSY2Cum17vJI+UWIKv2vIc92br7D1KxZ6 zL+aHJiII/ZS7Ei5k62fwFj0uMiarAX4zql71FCQCxstbnKBxE7K9DXmBAGOCmaOM5Q1 dzLA== 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=uG/V5STTly/AiDD51pW5nIRJQwYRV7tuuua0OnmiC/A=; b=K/sw8UJ30uCFSYWoVqD/mBJBFXlU1jUZFt+4GGvkExWg2kUpBaNgLzlf7HsoEJerVm Lxt124HC6RUYkJulrLyrXSB6EFPaGL9Om59o4gOOHVWSd9IQ8m1BcmHniBGug965AD/5 JoOeL3b9Ew9Z82UIFl3eqvMsPb2ouqQA4T+blUhaXzCI25IsneC+9GKnF2n6CYRXQQw3 0kG1JSVltkHRzh5TYN4ji30XexCvpkxELt+UTzE9koeiIYQRz3ABjLPsir/hylBbPht4 T30hP8GL9J8qMClbIaSWqMQuPYWOFGr/cZvGA6/s2kJE9eQEqmBmXKsBKKLXzSQPnY7q nKPg== X-Gm-Message-State: AO0yUKWrEFAYaXUUEk9oqM5CSqG3lEeBthVXgh7PrCNoxzI5IbbQA1cp fcx+yeSwxb/9JtfATKWZlkZGpqSBLScdaldT X-Received: by 2002:a05:600c:4d8a:b0:3de:d52:2cd2 with SMTP id v10-20020a05600c4d8a00b003de0d522cd2mr4633589wmp.4.1675814876873; Tue, 07 Feb 2023 16:07:56 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id h7-20020a05600c314700b003dc59d6f2f8sm283729wmo.17.2023.02.07.16.07.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 07 Feb 2023 16:07:56 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: BALATON Zoltan , Paolo Bonzini , qemu-block@nongnu.org, Bernhard Beschow , Mark Cave-Ayland , John Snow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 2/7] hw/isa: Use isa_address_space_io() to reduce access on global 'isabus' Date: Wed, 8 Feb 2023 01:07:38 +0100 Message-Id: <20230208000743.79415-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230208000743.79415-1-philmd@linaro.org> References: <20230208000743.79415-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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, 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/isa/isa-bus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index 5bd99379e9..95fc1ba5f7 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -114,7 +114,7 @@ static inline void isa_init_ioport(ISADevice *dev, uint16_t ioport) void isa_register_ioport(ISADevice *dev, MemoryRegion *io, uint16_t start) { - memory_region_add_subregion(isabus->address_space_io, start, io); + memory_region_add_subregion(isa_address_space_io(dev), start, io); isa_init_ioport(dev, start); } @@ -133,7 +133,7 @@ int isa_register_portio_list(ISADevice *dev, isa_init_ioport(dev, start); portio_list_register(piolist, OBJECT(dev), pio_start, opaque, name, - isabus->address_space_io, start); + isa_address_space_io(dev), start); return 0; } From patchwork Wed Feb 8 00:07:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 651529 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp3190316pva; Tue, 7 Feb 2023 16:09:11 -0800 (PST) X-Google-Smtp-Source: AK7set+L/MzCHutdZ6DtdfzlBbZoPP70OYePkiM1UR4Ub4FqPbwX8OINXaHYnmjGK6EDq/HJynF0 X-Received: by 2002:ad4:5762:0:b0:568:b43:572 with SMTP id r2-20020ad45762000000b005680b430572mr9352907qvx.47.1675814951479; Tue, 07 Feb 2023 16:09:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675814951; cv=none; d=google.com; s=arc-20160816; b=vWpzYZBuer46wxMFPddIWySqpYZeQY/nLWm43bFfBVUhugLMcmd8uMHCBd+Z/SID7h LEVYJpT3LrR55bupeDYYAAHG5IoP2VohjOD59rzOua/0GhFhfuqP7LDPp/NRm+ZjKXUo laOGHlET4qbCr8ukE6ZoSksjnIXixaYRRpCYZplL/qeCom1pIncCIJ0yibxIs+qM4F9r 6w50ih2Wa1xSiSiYrl75F5TXHdHzo72nQAJSO0qtnKUljyweBh5O8/oZ8XkNjTG3XHGy zslIBGlzrkqF21iNMDNmJTzqxR1CscngK5XAv+02PZXiXkE8FIqfQIDQjORcMTxtYBnN UwiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4tTUjj/6z5YIik+WT6J4Jq4VcPmVbs4Ch1nMrvTlVBs=; b=jBNc68M+sfMX6OtQ/6H9mSW/OtGwxI5jU2h1I85dziVvyieMbGldaCE5WQCjVMAjlK ZHPDoW+ml14i9PTBYc8BCOnqLdVwO1Lfq8/IegQZMwLtAYPa/UNqnZ5P+tkk84yTzXS3 f0tHoEF6elzr+9uKRnn4DwQDz4Y4dYR8pynV2Z5mBprhQUpCCm+3YSX2JF09ukq3D0pf JNS2B1Z3UvEoHwe0zeDxRv2Unjq/0cICwqPDm3U1Qo9nyj2G680J6HdAFgOCz/xjWcCT 3jR0bRUsvDdded00/lAWiexM65zs5NiPKEbu98EV4jjOuPcVtECNpThmpB3VeOPUcBmO uKWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J89jpmx0; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j20-20020a0ce014000000b00569480deb50si10809904qvk.205.2023.02.07.16.09.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Feb 2023 16:09:11 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J89jpmx0; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPY0s-0005gx-KY; Tue, 07 Feb 2023 19:08:38 -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 1pPY0L-0005TE-PW for qemu-devel@nongnu.org; Tue, 07 Feb 2023 19:08:36 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pPY0K-0008T8-5e for qemu-devel@nongnu.org; Tue, 07 Feb 2023 19:08:05 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ba1so11124570wrb.5 for ; Tue, 07 Feb 2023 16:08:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=4tTUjj/6z5YIik+WT6J4Jq4VcPmVbs4Ch1nMrvTlVBs=; b=J89jpmx03GmYskJDiFaQletafQEWZIlvVTAlfawMaw2+n8iEI4EeRv+ymlv+DGhZya /py8QV2GO4sO1cVjfYIVsyBiABi3M94XL+zz9lp7CX8FIbZ2uUEPoP2RRbQZkLzf/wgL ZohZPKVT9R5pzTMm73KaptquFnH63UhvMhvV+WcT6dWiKtkW1lLyN2i673twA2SpvAMn tL5EglDzcDsamBYBZkb3eIJnC2mBJEI+kTCsl8Lf8sRXeea8X1H7AXtWeBCytaoh29qS IWnZlkYPb/0UpEh5OYDzK+VIh2lq4ueaaOy2EmqxqgTcJ7uvrST6mdcTc/LzCC+QAVtg sLZA== 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=4tTUjj/6z5YIik+WT6J4Jq4VcPmVbs4Ch1nMrvTlVBs=; b=itCGlBHMi1wrrfuFISf7L4rtbLMBbflEz15We1gVyrAGx+PDT2EM8SVzx0E4aES6Jq p5/lcvj1Fcc98fBob9tefjLrn2zVZXlz2NJj77evMXSOum7ZULOJupejAsPk4FXbYGdw aQsWBRV9XglMvlL9oOYUn4yELq7+Fn2b8x1qv9+D2AsDhTxWdSDBQsBgodpeBnuDAHB0 cT78n0OtEqdsOpHL8syM5HvVM11xB7ymfwEW9L+pMcvR3w1audTKWt1uSOgAlisK5Ggy QMxUfWNp/G6rV5mbnvguY3pHD+cXGqopnTD+3WWwfkmGQ+DirvxP/0pGpbl95PZ/aCC+ 6Wsw== X-Gm-Message-State: AO0yUKU8U9rqhKd8on5D8z923GVjUniQ4tCeAEFKxV/aRt1ze7WKKGiJ 05BClqA335HR+sri3TZpmlkcOHMnZyxMJ1Gk X-Received: by 2002:a5d:6b88:0:b0:2c3:ea88:5e4d with SMTP id n8-20020a5d6b88000000b002c3ea885e4dmr4552313wrx.27.1675814882366; Tue, 07 Feb 2023 16:08:02 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id n10-20020a05600c304a00b003db1ca20170sm230525wmh.37.2023.02.07.16.08.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 07 Feb 2023 16:08:01 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: BALATON Zoltan , Paolo Bonzini , qemu-block@nongnu.org, Bernhard Beschow , Mark Cave-Ayland , John Snow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 3/7] hw/ide: Rename ISA specific ide_init_ioport() as ide_init_ioport_isa() Date: Wed, 8 Feb 2023 01:07:39 +0100 Message-Id: <20230208000743.79415-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230208000743.79415-1-philmd@linaro.org> References: <20230208000743.79415-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Rename ide_init_ioport() as ide_init_ioport_isa() to make explicit it expects an ISA device. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/ide/ioport.c | 2 +- hw/ide/isa.c | 2 +- hw/ide/piix.c | 4 ++-- include/hw/ide/internal.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/ide/ioport.c b/hw/ide/ioport.c index e6caa537fa..ac804a89e8 100644 --- a/hw/ide/ioport.c +++ b/hw/ide/ioport.c @@ -50,7 +50,7 @@ static const MemoryRegionPortio ide_portio2_list[] = { PORTIO_END_OF_LIST(), }; -int ide_init_ioport(IDEBus *bus, ISADevice *dev, int iobase, int iobase2) +int ide_init_ioport_isa(IDEBus *bus, ISADevice *dev, int iobase, int iobase2) { int ret; diff --git a/hw/ide/isa.c b/hw/ide/isa.c index 8bedbd13f1..4dbd1e48b8 100644 --- a/hw/ide/isa.c +++ b/hw/ide/isa.c @@ -74,7 +74,7 @@ static void isa_ide_realizefn(DeviceState *dev, Error **errp) ISAIDEState *s = ISA_IDE(dev); ide_bus_init(&s->bus, sizeof(s->bus), dev, 0, 2); - ide_init_ioport(&s->bus, isadev, s->iobase, s->iobase2); + ide_init_ioport_isa(&s->bus, isadev, s->iobase, s->iobase2); s->irq = isa_get_irq(isadev, s->isairq); ide_init2(&s->bus, s->irq); vmstate_register(VMSTATE_IF(dev), 0, &vmstate_ide_isa, s); diff --git a/hw/ide/piix.c b/hw/ide/piix.c index 267dbf37db..a587541bb2 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -140,8 +140,8 @@ static int pci_piix_init_ports(PCIIDEState *d) for (i = 0; i < 2; i++) { ide_bus_init(&d->bus[i], sizeof(d->bus[i]), DEVICE(d), i, 2); - ret = ide_init_ioport(&d->bus[i], NULL, port_info[i].iobase, - port_info[i].iobase2); + ret = ide_init_ioport_isa(&d->bus[i], NULL, + port_info[i].iobase, port_info[i].iobase2); if (ret) { return ret; } diff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h index fc0aa81a88..88a096f9df 100644 --- a/include/hw/ide/internal.h +++ b/include/hw/ide/internal.h @@ -628,7 +628,7 @@ int ide_init_drive(IDEState *s, BlockBackend *blk, IDEDriveKind kind, int chs_trans, Error **errp); void ide_init2(IDEBus *bus, qemu_irq irq); void ide_exit(IDEState *s); -int ide_init_ioport(IDEBus *bus, ISADevice *isa, int iobase, int iobase2); +int ide_init_ioport_isa(IDEBus *bus, ISADevice *isa, int iobase, int iobase2); void ide_register_restart_cb(IDEBus *bus); void ide_exec_cmd(IDEBus *bus, uint32_t val); From patchwork Wed Feb 8 00:07:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 651534 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp3190500pva; Tue, 7 Feb 2023 16:09:36 -0800 (PST) X-Google-Smtp-Source: AK7set9Aq9Z1VdUZgTys8HR7E8c5SwPhVEc2D/JNtjaCoiFFJTsxJ1IS/Jj7m1cNWfxQvwKsJuyp X-Received: by 2002:a05:622a:54c:b0:3b8:68fa:afc6 with SMTP id m12-20020a05622a054c00b003b868faafc6mr9965707qtx.29.1675814976612; Tue, 07 Feb 2023 16:09:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675814976; cv=none; d=google.com; s=arc-20160816; b=qyL29VFpMAfqsbeiWNpFey/a83eSuOQXmVk9mLIzhqVouuHbx8+UizER72w8ZGmLGJ MVnWxoXaoXLq/ALxmOIF7H7UAlG59Hv8rK6HXz4jlyiQnv6D3jGXwYHlDK/vnDAc6r+Z 7u8j0oU6ZwZZ0IYxHiquC5SsbSH+WxrDeTyKjCPV2ttniLkrPTKe6KG70629pqbKo0T2 hRpuRqktBzyFO0pUqAQjvaCyr7cWvNz8P+N8grsmACMIKi93+YHqv2XqpInrV3M30cee wQv/PObaPKA9mNlMwuW9bcfq/NbbeGRupIyQVRLdQH2ZHcm1n1I5fR5cyADxmcxNNQ2t EH8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=diC00nVev9fo2jzQ51pUVYSS0FWICYuGAlQ1rUUG02E=; b=aWxEIM5/LK8zctuFkI1PQddb63VtJTuW2IvQ0F8ZREAbVCYwJ+7E+PmS+RBQ5SrLDk hmTa3b+A5OE4Vsdm0yVBgiRbgi3lzdKGdxzgbljO/tyr9KArq2OaOEXiIxRhqCGxo+Cu xZTMp+AH3seg5kosXPRvcpDVZ6iAXnwe727Me4Wc8W1apmq1gP0SiUUpuzXXIlBrYGYP CQtnfS1wOrowxXDXmnie+Jae6KJY2wn7yniV4yXZs8I2RrtVddxdcQA+RkKazNKbDPs9 Rd2/Y5K1dbtOHbNLuo/7cnO88Sa3+XBQg6+X5jYnQ/JZFekEfacSwMKPBBBZO+LiTUJh TL5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Gi6ehZ2r; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b187-20020a3799c4000000b0072ae79559c3si12091222qke.388.2023.02.07.16.09.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Feb 2023 16:09:36 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Gi6ehZ2r; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPY0w-0005mH-IZ; Tue, 07 Feb 2023 19:08:42 -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 1pPY0u-0005kM-H3 for qemu-devel@nongnu.org; Tue, 07 Feb 2023 19:08:40 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pPY0q-0008TU-B9 for qemu-devel@nongnu.org; Tue, 07 Feb 2023 19:08:40 -0500 Received: by mail-wr1-x42a.google.com with SMTP id a2so14914714wrd.6 for ; Tue, 07 Feb 2023 16:08:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=diC00nVev9fo2jzQ51pUVYSS0FWICYuGAlQ1rUUG02E=; b=Gi6ehZ2rFEWCzqXwYxBtZp0erXbt0/0kb/eBPAcrI/gBXJbqkoVAsXPeHSYQ9j/LPx 4LZyVxREXx+xeTSPFr8bgjGdDYPAhWsqoE2xVof+UMJYFDIFX5NxjwWiqMaMh24hWlme LuiXJsi6jki4z4qMBScOk30Hrpcz70xV/c+BS53p4rVkARU7AgmH9QZT3l8oKgekdO/p w0ePHbjyUSs+G1huhBNtW5/Xukjad5vOBgbfMzMyWg+Uo+9yQ2cGVQ1uMkRHY1yXVb1a 2qcIezxOKWwKYIsCY+R+PBqMREw5A+EExoHxZs2zTsUsLrH7xIIbmvBdNuqX3KzZYdS+ l23g== 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=diC00nVev9fo2jzQ51pUVYSS0FWICYuGAlQ1rUUG02E=; b=k9uvBhgI0uAvFDlXtw7rK1McHho/v54Gewr0C7/SNBxWIrXmbAdNHYucah10pHz1XQ kei0T2+HWP/ZCb93zsbotkVM3U2h6OOo8Hn/eImfJRC/ZMLA+VUxezDo5AHUiPdd3BZe 1S2CjHXk4zPr4MpBg9uv66HM73VHD3wCWufkY/Tp50DdiALlu2zeAE/naBkKz/P8qdwo jmKyZSQoS8ORDHm7rmW8jraQwbBQegQpree5RyKJZjLGtAsPoYXQAAVpIKjlih6TkXP/ fiqm3Lqb05Y5KR+xaC7IxqEN7XOuoXtaTgVdpdE9J5xnB1MgxHzGxewxMV902+QqeQkK 6//Q== X-Gm-Message-State: AO0yUKXxZ2/LkQpHvDyxpMT+LZzKMPKPkuOeJYv+v7c3Q1y8Q18Z0M4k 8h9mnXR9v11qM0CMf25WqS8U5Wb7PTnJ9a2X X-Received: by 2002:a5d:60cb:0:b0:2c3:d65e:d131 with SMTP id x11-20020a5d60cb000000b002c3d65ed131mr4163809wrt.63.1675814887832; Tue, 07 Feb 2023 16:08:07 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id e2-20020a5d5002000000b002c3be6ae0b1sm12252120wrt.65.2023.02.07.16.08.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 07 Feb 2023 16:08:07 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: BALATON Zoltan , Paolo Bonzini , qemu-block@nongnu.org, Bernhard Beschow , Mark Cave-Ayland , John Snow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 4/7] hw/ide: Introduce generic ide_init_ioport() Date: Wed, 8 Feb 2023 01:07:40 +0100 Message-Id: <20230208000743.79415-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230208000743.79415-1-philmd@linaro.org> References: <20230208000743.79415-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Add ide_init_ioport() which is not restricted to the ISA bus. (Next commit will use it for a PCI device). Inspired-by: Mark Cave-Ayland Signed-off-by: Philippe Mathieu-Daudé --- hw/ide/ioport.c | 11 +++++++++-- include/hw/ide/internal.h | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/hw/ide/ioport.c b/hw/ide/ioport.c index ac804a89e8..494fa88368 100644 --- a/hw/ide/ioport.c +++ b/hw/ide/ioport.c @@ -54,8 +54,6 @@ int ide_init_ioport_isa(IDEBus *bus, ISADevice *dev, int iobase, int iobase2) { int ret; - /* ??? Assume only ISA and PCI configurations, and that the PCI-ISA - bridge has been setup properly to always register with ISA. */ ret = isa_register_portio_list(dev, &bus->portio_list, iobase, ide_portio_list, bus, "ide"); @@ -66,3 +64,12 @@ int ide_init_ioport_isa(IDEBus *bus, ISADevice *dev, int iobase, int iobase2) return ret; } + +void ide_init_ioport(IDEBus *bus, Object *owner, MemoryRegion *io, + int iobase, int iobase2) +{ + portio_list_register(&bus->portio_list, owner, ide_portio_list, + bus, "ide", io, iobase); + portio_list_register(&bus->portio2_list, owner, ide_portio2_list, + bus, "ide", io, iobase2); +} diff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h index 88a096f9df..79db902505 100644 --- a/include/hw/ide/internal.h +++ b/include/hw/ide/internal.h @@ -629,6 +629,8 @@ int ide_init_drive(IDEState *s, BlockBackend *blk, IDEDriveKind kind, void ide_init2(IDEBus *bus, qemu_irq irq); void ide_exit(IDEState *s); int ide_init_ioport_isa(IDEBus *bus, ISADevice *isa, int iobase, int iobase2); +void ide_init_ioport(IDEBus *bus, Object *owner, MemoryRegion *io, + int iobase, int iobase2); void ide_register_restart_cb(IDEBus *bus); void ide_exec_cmd(IDEBus *bus, uint32_t val); From patchwork Wed Feb 8 00:07:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 651531 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp3190493pva; Tue, 7 Feb 2023 16:09:34 -0800 (PST) X-Google-Smtp-Source: AK7set9Tiw/3lgSitYPxjq1PsiDRX/Fl/ygsOw2Eanv0XhwlYnwFGcCYBJqEUeTsMRADPwKHnak7 X-Received: by 2002:a05:622a:1884:b0:3b8:1f30:f49d with SMTP id v4-20020a05622a188400b003b81f30f49dmr9149703qtc.66.1675814974184; Tue, 07 Feb 2023 16:09:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675814974; cv=none; d=google.com; s=arc-20160816; b=q5FoOBoFJCJubSBsGD3XITTEQ0PlT7h/v+QOimw+09lvRpJEEbku0wCu1BBiPLscIU Haln+KECLgVGfb1c1euaAewpsgCeHKPq8dPpysumK3l2CHRL5dTqXstB8qRigTYO6VFX r2wgeLuuVa9WaSYfR0db/4JB31vzlOf+7FX+mOsB6eX7UAMQAj2x1ZzFKL5UEokX+mRJ m+8qJIzVzlknE3rU4CM9pS/PDmlTkEpfNtCSpG2plGDuIwWPut1tEqBf+Jp+UuEz5HzN S3aWvmcvFt75dGGEWkuZUQH5ivwlqU0YRWL0HvCEpx1JX78txwh4Rvd3Yom7m0zRa8Wy SZgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fopVAIyIRlKFxEEYJZbUN+t4EvUshH8xvbQAPi6kQOU=; b=o2e2lFjEwN7u48JmwWNhWaGUy10N40nub9J1+OB9cwR2Zpd6/cYH0jIr9bvPQueOJh C/iknRC0rI4ytFAEtoXwnhDvaIhX96Sr3omtk2BA5DBOVg67df0mNZsaBHSpEUj7zjR1 LH8zFf/sRSbYkQ1mef5McAASL9cwCacvp5EMzLGAcjHn7ysPiNL/MEdhMQDucXer6Oy5 cuqWpMbywpx6awwbUMpg7+HJiopbUdcgEf4ZkQZ5OscwfwQsviu7oCcwpC1B46wDuV2M ooFOc5jQyzYpOk6XpuhBmtRFugPcW1/rpCjcXXPwMREVq6+qTG5mZVHsOKuveQOed7Vv Yr3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yXL4BqCf; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o4-20020a375a04000000b0070736988c17si10311033qkb.496.2023.02.07.16.09.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Feb 2023 16:09:34 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yXL4BqCf; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPY0u-0005kI-Gx; Tue, 07 Feb 2023 19:08: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 1pPY0t-0005iO-6A for qemu-devel@nongnu.org; Tue, 07 Feb 2023 19:08:39 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pPY0q-0008Tt-AY for qemu-devel@nongnu.org; Tue, 07 Feb 2023 19:08:38 -0500 Received: by mail-wr1-x434.google.com with SMTP id h16so15165199wrz.12 for ; Tue, 07 Feb 2023 16:08:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=fopVAIyIRlKFxEEYJZbUN+t4EvUshH8xvbQAPi6kQOU=; b=yXL4BqCfFe9IFC+dxPqn3+KW66QtcTHRWOM77VSC9Rub9DevrR852DDbmTbEiBUYrr L/x1MIzUlub5vPHWLmtJo7pooTOtlJD4oq4k/iepx2zvr560HJJgvTBm5UmaIACsntzl 6beAE0huNHyFCBb1xpeTKyqMiF5yYYgeqY7Y+nGJMdBISPHdCvQu7q6aBSRWHv7QWW4/ yRUpymJd+kNgCayYLKL5W/f4D6VCj5iPCgx8Nq5Uck7AIJCno4+niidtrP6mGQb3IiCj /D7aCXBUp8JhvAdD5yxZMaTttF9VgVu3VnomJyMZxI8tTKpXVoEC4UuaVRxdOYrxxbBn cZIw== 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=fopVAIyIRlKFxEEYJZbUN+t4EvUshH8xvbQAPi6kQOU=; b=zQh4xObaIYSJzPRediSuRfBlk6bp+3HsAaiauOhk7W2IR4Br0OVsVMwXvra+lFn7TT IYfuRW5iBFKwc6OF1puVD/Vvl8O+Fad1w+itDqmO6f1c7cm3jKE7Sy64FC7UySl3PdaG PUWr6yI2GyZEAkpnWW59kT5Dk6IVzlg+Kl2iLWtOywWX/ifM4kOs9uOSsU8/eAi79Ghx x4s11MNrT/KFyjYgK7wyQR1cm/P7NQ/tXsz8Jgk/BR5Gn7Ll6gBSQhzKsEEHdkLGSaO3 VhJi9VlNoFlrK8McuzCLxWphD3bC8fgCyTNsQgGE5pbwjPuSof60S1FUn07iE7FwSRTf uyHg== X-Gm-Message-State: AO0yUKVCFtTPBb/0mdElioIJHyssgvDDH1IA1QODI44JOwkkkfjf7wtT YN5npemJv0MHs53o7KsOnFlhOAlr9H1PUj5s X-Received: by 2002:adf:fb82:0:b0:2bf:dab7:8f9f with SMTP id a2-20020adffb82000000b002bfdab78f9fmr3617454wrr.65.1675814893048; Tue, 07 Feb 2023 16:08:13 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id l4-20020adff484000000b002c3ed120cf8sm4975045wro.61.2023.02.07.16.08.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 07 Feb 2023 16:08:12 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: BALATON Zoltan , Paolo Bonzini , qemu-block@nongnu.org, Bernhard Beschow , Mark Cave-Ayland , John Snow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 5/7] hw/ide/piix: Use generic ide_init_ioport() Date: Wed, 8 Feb 2023 01:07:41 +0100 Message-Id: <20230208000743.79415-6-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230208000743.79415-1-philmd@linaro.org> References: <20230208000743.79415-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org TYPE_PIIX3_IDE is a PCI function inheriting from QOM TYPE_PCI_DEVICE. To be able to call the ISA specific ide_init_ioport_isa(), we call this function passing a NULL ISADevice argument. Remove this hack by calling the recently added generic ide_init_ioport(), which doesn't expect any ISADevice. Inspired-by: Bernhard Beschow Signed-off-by: Philippe Mathieu-Daudé --- hw/ide/piix.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/hw/ide/piix.c b/hw/ide/piix.c index a587541bb2..1cd4389611 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -136,15 +136,13 @@ static int pci_piix_init_ports(PCIIDEState *d) {0x1f0, 0x3f6, 14}, {0x170, 0x376, 15}, }; - int i, ret; + int i; for (i = 0; i < 2; i++) { ide_bus_init(&d->bus[i], sizeof(d->bus[i]), DEVICE(d), i, 2); - ret = ide_init_ioport_isa(&d->bus[i], NULL, - port_info[i].iobase, port_info[i].iobase2); - if (ret) { - return ret; - } + ide_init_ioport(&d->bus[i], OBJECT(d), + pci_address_space_io(PCI_DEVICE(d)), + port_info[i].iobase, port_info[i].iobase2); ide_init2(&d->bus[i], isa_get_irq(NULL, port_info[i].isairq)); bmdma_init(&d->bus[i], &d->bmdma[i], d); From patchwork Wed Feb 8 00:07:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 651536 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp3190654pva; Tue, 7 Feb 2023 16:09:55 -0800 (PST) X-Google-Smtp-Source: AK7set/2+3mLkFSlhnHi85tMdplic9lkk66YvPpsrckJ/+j5wQaSgDJMLBz8HEU5SsVaNvGxjdT2 X-Received: by 2002:a05:622a:1a26:b0:3b9:cd2a:f13d with SMTP id f38-20020a05622a1a2600b003b9cd2af13dmr8454718qtb.59.1675814995766; Tue, 07 Feb 2023 16:09:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675814995; cv=none; d=google.com; s=arc-20160816; b=ekWF1n5OAgXqDzuDEEHfBfBBGboG3bjM34YtgV1D0727mol2cS1BsM6r4kLZNsMj6a iPhUUr8f3gW3IVq0BYzezPqhKT4NnUJQ6A6KFLqFcp0dD9afCU6WTPDpeAIzB5DKq2n4 MX53pM7e44glD4atXUs31TxNJqApdaJukV+R4qrF2edst9pXK/d9t3h1EKn1N4WyBS+s RTuCCt7+spdE/e0l2EozHHjPd2IQN/INZLHS5JdiiWgcDKcmtWaUvB6Zw26+dRHllikp Gdk6MDIY5+cuYeSIwXOISf3+vhuKQ5Tyn2LjNhoObJKpbYNU1EifHteJM7a0aQEKncdy ZMrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=sg0r6PGoxk1gksSrk3lmpIJquA29NN0p4VPmWvLuBck=; b=IqfSclaNk2mBTmSqalXG3e/jUSGI4H1QApZbcLrV+wXNGkEaHZBpn+iZ//LsonEJMe ebJ2mszkVOypW4XcwIc8yMsgahcWWj3rqpHgjNG/8qni5GrzcAJ+Jo2WQ4q8sZJBFjqH YSxVnFtbPU4Tu1mN7afNEuHi+41+7mUAaNtiKk24Sbj8AaQ8mtCV2/tcCYDAwsbgSMJP 17HiTTvN7722HNmbWOYvTqmO5U2WKJ2ndlJ064ZYspg8lJKh6+tfYH4DQoIumbycB4wO 8gpa7Bcik1Op4h/Oq6ZNSxFC3V6WWFPYuYtm8X8ar6/XxJv9XEZHhKyN17ZP22miskCK QVrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=stgA1Rjc; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id bq14-20020a05620a468e00b00719706643f2si12753476qkb.111.2023.02.07.16.09.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Feb 2023 16:09:55 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=stgA1Rjc; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPY0t-0005j6-If; Tue, 07 Feb 2023 19:08:39 -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 1pPY0r-0005dx-OV for qemu-devel@nongnu.org; Tue, 07 Feb 2023 19:08:37 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pPY0q-0008UA-4m for qemu-devel@nongnu.org; Tue, 07 Feb 2023 19:08:37 -0500 Received: by mail-wr1-x435.google.com with SMTP id bk16so15169322wrb.11 for ; Tue, 07 Feb 2023 16:08:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=sg0r6PGoxk1gksSrk3lmpIJquA29NN0p4VPmWvLuBck=; b=stgA1RjcwivJZ3RRONhjsEOyqE4DR0Prn/WEq0ksnxdRtrf6/xKiXte6WZ3JPdSkWA u4vWxEx5o95hhjRHKFE1IXxkSDW/saYEsR34hQ/TtNoak/CmtW4ARiHpvTbKkV6N9kcf sDDUcqz1IAvM6ZhVDRKgvfI8HK2Dtx1jX8CGbY+m8vP4HIGICHG/RCn0zcC7SUXktS+T ZDVn7gfIUAB/EXrn/JTqr7BQ5pEGxw0IQlrEpS4Y3+TS9cah80VvUyZ0p+1XtxZQ7xcr dEjkLMp/cMb5kF5LEJp9GpOvuuwcqcAx+fJA9/6xKSHcUI8Uz0R4l9pCmyMyVhrxXhKS vL4g== 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=sg0r6PGoxk1gksSrk3lmpIJquA29NN0p4VPmWvLuBck=; b=G+eTu19CO+HTc/uJfiq1+qSbfiEEWE+mLez0wM2jlH2FBrbdknUypsumbmh+kfFp+Z dOPklEsMDbP0mFYaogepwZGLePcu0RXm0TyP0HRvqpYNvCMGNJRevH7JWmYF6MUP4x45 ZVUzbYxsTyM3xLwVy4tMEs4G0vjiCky3oeym4iiPiQTTHEDymaxztTCNK861C2bT8DhF tDapDPf8vzu0H5Jbt11XOLlbnZO3FcwU79TGr31Rdd/RVHMuQRlgdj/lHqNd0tUUlegL xzSWEsszssOiHz12X9vu3ZnQ7lPb6jRdmL0KFFZQ6VfJ396upQRwNHY0NmczRVIVjFrA ENqg== X-Gm-Message-State: AO0yUKUR2Te3nlQcNUbuF910qCPUlO2T5+zz5gmdi2NMJyCiWkRb9lAM cikDjp9nKSIdmpkE2MMF2gSG51RunG70To4v X-Received: by 2002:a05:6000:10a:b0:2bf:9656:d1a8 with SMTP id o10-20020a056000010a00b002bf9656d1a8mr440178wrx.32.1675814898407; Tue, 07 Feb 2023 16:08:18 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id r6-20020a5d4986000000b002bfc24e1c55sm12145081wrq.78.2023.02.07.16.08.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 07 Feb 2023 16:08:17 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: BALATON Zoltan , Paolo Bonzini , qemu-block@nongnu.org, Bernhard Beschow , Mark Cave-Ayland , John Snow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 6/7] hw/isa: Assert isa_register_portio_list() gets non-NULL ISA device Date: Wed, 8 Feb 2023 01:07:42 +0100 Message-Id: <20230208000743.79415-7-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230208000743.79415-1-philmd@linaro.org> References: <20230208000743.79415-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=philmd@linaro.org; helo=mail-wr1-x435.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, 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The previous commit removed the single call to isa_register_portio_list() with dev=NULL. To be sure we won't reintroduce such weird (ab)use, add an assertion. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/isa/isa-bus.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index 95fc1ba5f7..3d1996c115 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -107,7 +107,7 @@ IsaDma *isa_get_dma(ISABus *bus, int nchan) static inline void isa_init_ioport(ISADevice *dev, uint16_t ioport) { - if (dev && (dev->ioport_id == 0 || ioport < dev->ioport_id)) { + if (dev->ioport_id == 0 || ioport < dev->ioport_id) { dev->ioport_id = ioport; } } @@ -123,6 +123,8 @@ int isa_register_portio_list(ISADevice *dev, const MemoryRegionPortio *pio_start, void *opaque, const char *name) { + assert(dev); + if (!isabus) { return -ENODEV; } From patchwork Wed Feb 8 00:07:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 651535 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp3190620pva; Tue, 7 Feb 2023 16:09:52 -0800 (PST) X-Google-Smtp-Source: AK7set8gT8qT4ThxJXFnsCbhQuKc1g+ablCBm6RQronksf7jLE/1Pu0LXOMSTi3EGDrN7LRsJDXw X-Received: by 2002:a05:622a:cc:b0:3b8:2c34:b9f2 with SMTP id p12-20020a05622a00cc00b003b82c34b9f2mr8735601qtw.63.1675814992482; Tue, 07 Feb 2023 16:09:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675814992; cv=none; d=google.com; s=arc-20160816; b=EkhhvRC2Mq6E/d2Oj2L8xgCMJCaN07XlA5bIzLgjaGmrje2Cxzx+02m7X8od8rIFBO 5KJZgQ7citwZiPiEpnBY1lI6nazNKqQN4xydqbKM4EdSxyoCWWVZlvpscqJ8pyT9c1Aj WDYWTUJqIp39pZP016pbbniYcWq3ONSGn3S5b0BrkaMLcspJqAqCoG3eho6jtyQG/YQU uPDVC29Oicaw5vMdqp0WTCr6p7Iz9vQVnsdYoWBHJf0ZXO9Cbj6B8piQ5Zv+QhlxoOq3 0bgqPCTqpZ2OS9GvjGuBqtHSOIXuv3MrOaO79sgoc4uEkG8SDpgxGCOhIL61yOi8GK5Y PyQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uNIF4djSxUYnm/AbMKC463cXHq46lEXK87Wn0R/Xyf0=; b=E+Xqu4jC1LbphbwwDI5vow8luhDVvI1f/o5AWRQEMPR/yb/q5uRWpfedZVVFKheElR S5QPLv+CCDr9PdhhuuvFUHwDPOnrHH4yO+LyQl92HZqIp7kRcHq1HF9fCBCgx8B0wYcN w1tRKD26bq7J7UgNhPyIz2OOQVsbkKhQWuOEfuWoGAjg9j6j9ytplFlfOADtjm77R2/N vSkDdc0bCZZBagc2W7KD+yIRkTV9fa2BovTgmYE7xDZSpjwedtMu96v7db6akAGdbQvz uEFc7t2ok0eYgeVqj+dQ7gjVzdzKsyzNGwZnatsoSPLWkL6pnBW+h9ambbWi34enYCB3 vmFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Oe1MMWaK; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m126-20020a37bc84000000b007140bf2008dsi10731042qkf.628.2023.02.07.16.09.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Feb 2023 16:09:52 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Oe1MMWaK; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPY0x-0005mQ-QO; Tue, 07 Feb 2023 19:08:43 -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 1pPY0u-0005kQ-J7 for qemu-devel@nongnu.org; Tue, 07 Feb 2023 19:08:40 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pPY0q-0008UZ-Cb for qemu-devel@nongnu.org; Tue, 07 Feb 2023 19:08:40 -0500 Received: by mail-wr1-x436.google.com with SMTP id i5so8016321wrc.0 for ; Tue, 07 Feb 2023 16:08:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=uNIF4djSxUYnm/AbMKC463cXHq46lEXK87Wn0R/Xyf0=; b=Oe1MMWaKLYwu+0LOyXn1IC0dNlTgroAGOtIk+aVSbrguok+HXHBBqAKr9x9vPdMLc1 O6CF04HcWt33HYLATMWuV7pmz8bxvVlbQXjiXTUXo8peVntoSMkCJmpl5fXx3At34SSc MywMR7FY1Ed4YornA+emY96LfrCmySCgsuy7VbfcCdTCvtolQAu9OqrUrq8aPcZaFyZR igs3GPzRlgOcYNNPUQll2nC/NyJ+fEB2pVdjsAzDA5ydbbC1BCcr9ANbxRF3gz4Q/s9r nAkcmJZVdhN3KWjnRrBJO4dVYaYueu+fXn+mY6vFNRW3OyoIhbZ0iQjjKU0qj1j8ZpqK R0QQ== 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=uNIF4djSxUYnm/AbMKC463cXHq46lEXK87Wn0R/Xyf0=; b=DFt7K1+SyNYaWjkBjalmnjwLzYAwbpBvdgEnPjjo7iz/fr39H8TpspHssxq1xidQyX Kkx7BDzUnmNW9rxRRNIl16BWAx/QNu9wPQbdU63IZThChs9bHXwODTKEjO/Y73UZBKGD Xhxw67gcp+9qdKbbfCv5W4XxNl1tL2ZFNC5ciRs0kgrA9Ei8bsM5/MBfq034zdEcQzkj CN+0lXM25pF6Q2PQxKNDpiiRwUKo2sQPEfqCU1xQ38O0+Qj5dGlZPl7fpayGtnCeOUMH EOC2yMqjCPa++nhX90skfgj5CpziAqDGOKmSXo1vZFiC027l6Hn7eM/79fh1M/hg9cFe ueEA== X-Gm-Message-State: AO0yUKVtFpGE30m6F9HiHgFV9uuSNV5JcqsDAR505h8By21rOI2SCmio tG/OmS7PCYyg8pt4y4l0NyPZOQxHb16y2dqh X-Received: by 2002:a05:6000:1141:b0:2c3:db5b:727d with SMTP id d1-20020a056000114100b002c3db5b727dmr5176917wrx.53.1675814903639; Tue, 07 Feb 2023 16:08:23 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id i3-20020a5d5223000000b002bfae1398bbsm12318666wra.42.2023.02.07.16.08.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 07 Feb 2023 16:08:23 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: BALATON Zoltan , Paolo Bonzini , qemu-block@nongnu.org, Bernhard Beschow , Mark Cave-Ayland , John Snow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 7/7] hw/ide/piix: Remove dead code in pci_piix_init_ports() Date: Wed, 8 Feb 2023 01:07:43 +0100 Message-Id: <20230208000743.79415-8-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230208000743.79415-1-philmd@linaro.org> References: <20230208000743.79415-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.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, 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org pci_piix_init_ports() always return '0' so can't fail. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/ide/piix.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/hw/ide/piix.c b/hw/ide/piix.c index 1cd4389611..54d545ce3a 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -126,7 +126,7 @@ static void piix_ide_reset(DeviceState *dev) pci_set_byte(pci_conf + 0x20, 0x01); /* BMIBA: 20-23h */ } -static int pci_piix_init_ports(PCIIDEState *d) +static void pci_piix_init_ports(PCIIDEState *d) { static const struct { int iobase; @@ -149,15 +149,12 @@ static int pci_piix_init_ports(PCIIDEState *d) d->bmdma[i].bus = &d->bus[i]; ide_register_restart_cb(&d->bus[i]); } - - return 0; } static void pci_piix_ide_realize(PCIDevice *dev, Error **errp) { PCIIDEState *d = PCI_IDE(dev); uint8_t *pci_conf = dev->config; - int rc; pci_conf[PCI_CLASS_PROG] = 0x80; // legacy ATA mode @@ -166,11 +163,7 @@ static void pci_piix_ide_realize(PCIDevice *dev, Error **errp) vmstate_register(VMSTATE_IF(dev), 0, &vmstate_ide_pci, d); - rc = pci_piix_init_ports(d); - if (rc) { - error_setg_errno(errp, -rc, "Failed to realize %s", - object_get_typename(OBJECT(dev))); - } + pci_piix_init_ports(d); } static void pci_piix_ide_exitfn(PCIDevice *dev)