From patchwork Sun Jan 12 22:16:37 2025 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: 856767 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1178205wrc; Sun, 12 Jan 2025 14:18:16 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVM3EaxZa1j0OYSMGTZqO5Cp32PyFiCDSXX/hGELc0hPRQQFPbmZzUcu8wfDDlinmZ8HCsHKw==@linaro.org X-Google-Smtp-Source: AGHT+IHHUJmQXxVffGJAGsvyKMUVD4+otwZNhu4oDFWieOiJT0oF1iFibOtUU48A5H6wwmOCOTt7 X-Received: by 2002:a05:620a:1914:b0:7b6:d76d:3bf8 with SMTP id af79cd13be357-7bcd972908cmr2601033085a.11.1736720296199; Sun, 12 Jan 2025 14:18:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720296; cv=none; d=google.com; s=arc-20240605; b=UO5Kthzdm7toevPbgPzyFiPkUkgfBKDQzBLYQ8leZJgAUZIGhA3nfIIZmvtRcXS7M2 ZwEFkNpla98+joivqPrgzEktdLB4ucsDp5rZj8EnS9g0Yd0Yyv7nhfZtM5jrfUSfvx1R HAhXJEdd1Tz4bjqi2o+98gUKgLjDaftCq9sJn1pw2/glGdcrcXM3U8gRG9IeTpCCT4Qp x3knV8de7ufbuHfchjT0noA7Sd4o9zGGcyoI4yU0AEAaNTnBtNpWQ/xeDa30b2Sf/BOy 7GaIeNGx8s9bEum0/JET9m/uBvuXea7k4+z6ewsfpqCqkGyDAW4vWAjPfHdj+wS08QGQ tEjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=Ywj2BAcQgFygxoktSFGKPUmNs77JhmrlY9uWsg78bmQ=; fh=FNQoTbNR8b5AlVN2MDS61FgNhh56vBI6p9zyU31Z1lU=; b=VmlInfwXJ5igsIeIRxb55DFR6y5ZN87m1yISqJzJjBPNSDFNBOwUbVvzbo1kIxAgDw bJt4JJw30VPyBgZqEkvOI5YsDp9iALqzv9xdliccyt9eZrQzTqLf9OIHWmFUfkMbGrg7 r8r98qLJm4LErjYOjpcNICJcAUJvMtPdUb5RRYNJKwWVjQxcSh1Ki2DndGyYcl5Kq5vn Bqx3txRKEuaGPiEd+OJbnUr6I+EyjtBHRwFfUeLRtplvJ4xm6QtC7+BRwYk7Ep/18ZzA P7FDWBzh40GbAaZM44PcQ+OBsrtgpXkXNmuW+Lnlex8NHyNkVSa3I4aK8TqAopRCj6OH HftA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rxY+gcQE; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7bce32370b0si1028604685a.171.2025.01.12.14.18.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:18:16 -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=rxY+gcQE; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6H4-0007SA-E1; Sun, 12 Jan 2025 17:17: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 1tX6H3-0007Rw-7P for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:17:37 -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 1tX6H1-0006Nd-3l for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:17:36 -0500 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-385deda28b3so2105896f8f.0 for ; Sun, 12 Jan 2025 14:17:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720253; x=1737325053; darn=nongnu.org; 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=Ywj2BAcQgFygxoktSFGKPUmNs77JhmrlY9uWsg78bmQ=; b=rxY+gcQE5smfc8QyToVvNI9WbOIXyZ+XQgGhMt8hMHVg/VCYsU5LXT5WF46AgtPYFM Cam1sOvmmDWSYMa3cHDkNC/nPhShTmFh+HBxcKz4yxd/aCEwnqC9J0AcOvehDGZ+SZYE 9y9TCF9aSRuEY7eusVbW7s3gxMoZ1IkoeI6eTlGlzChfonGrVrlDCXHY3/S80l31b8YF hgH/WzG5OCSqwdW/XAgkItw7wRt138yML4Uxbd1hd3oHoyM42ib2nwyBOomnuw8ypZ9N earO9uiztUjmJKZjTu3zSPhxctBgx3OGDvrT91Xthrgwl5JAPo7BboyGZPMvkJ1aeMT6 olwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720253; x=1737325053; 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=Ywj2BAcQgFygxoktSFGKPUmNs77JhmrlY9uWsg78bmQ=; b=mO4X3o2rF6sZoTZZAbIy4kKpgb4q/BSmPy7w20HosoiIqXdyuafsIhCti8YOTuf9t7 1KciNv6FZdW8cixB75tdxN860ls1R2oKnKiiQmOlzMBOC/BEuGZsd465G82vDv8StyEN vxKet5frTP/b/QnjlPOgu7kPhVbomvTWkP2uB9J29AZRIkEOqPMHxiefkyYQOAUDBVK+ hMw8eDqjXgNHG7A8MHMZ0qz0qyyj5fIZYVaginRNNkIGmqbTyKABqmd9foOcvpdbOdvz uV6owyxN6H6xbcQJvw9XmcHPBWRVv+UNJeXY1VV5hjHxbVsrG79fUgwuxOf+kvcxkaaq kg5w== X-Gm-Message-State: AOJu0YyezVJ4QMhz99ttgocf03xfrZiCLQeiHp04Pwf//E3nwu1h++HC uOh1B3YoMIkG7fbS9k2KHODPsi7wCp6BYa6MN1/sJ9t0wgK6mlkrzY3PuGfo9ZmnTuhLYQQVyNT 5hZM= X-Gm-Gg: ASbGnctHcHnwJYYG++J7TH4I2ExElW3puCJ88+km12NYNHJbIMJ8Y9CF2ldP9SAoAa2 ew6uHHmU8P9r7HuDJ+9pSWzLN9iqNjXKX+1RH2z7DVBdDYV9qxaczhBJ9dxAtXFsYi77WwCldcs CgFwa8HRExAmI4SD6H+BGIT1ef/TA+YVNr9A2pDbVUeim7ACL+7Abg8Ogeg4Ax6GTS/xjD/MS6Q OhqQGGm45y4CDKbCjgLTVFuK2g7aVWccJQFUL41zkf50jZEQyMVkBq5/9cTkYpWMOf9bQhXe3Dm cT4gg0UGzJo+fJ5oASRnaCI+s5kiqdU= X-Received: by 2002:a05:6000:1ac6:b0:38b:da34:5915 with SMTP id ffacd0b85a97d-38bda34591bmr2232597f8f.23.1736720252865; Sun, 12 Jan 2025 14:17:32 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e3838a3sm10654601f8f.33.2025.01.12.14.17.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:17:32 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell , BALATON Zoltan Subject: [PULL 01/49] pc-bios/meson.build: Silent unuseful DTC warnings Date: Sun, 12 Jan 2025 23:16:37 +0100 Message-ID: <20250112221726.30206-2-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-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=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 QEMU consumes some device tree blobs, so these have been committed to the tree in as firmware, along with the device tree source used to generate them. We know the blobs are "good enough" to have QEMU boot a system, so we don't really maintain and rebuild the sources. These blobs were generated with older 'dtc' binaries. We use the v1.6.1 version since 2021 (commit 962fde57b7 "dtc: Update to version 1.6.1"). Since commit 6e0dc9d2a8 ("meson: compile bundled device trees"), if dtc binary is available, it is directly used to compile the device tree sources. New versions of 'dtc' add checks which display warnings or errors. Our sources are a bit old, so dtc v1.6.1 now emit the following warnings on a fresh build: [163/3414] Generating pc-bios/canyonlands.dts with a custom command pc-bios/canyonlands.dts:47.9-50.4: Warning (unit_address_vs_reg): /memory: node has a reg or ranges property, but no unit name pc-bios/canyonlands.dts:210.13-429.5: Warning (unit_address_vs_reg): /plb/opb: node has a reg or ranges property, but no unit name pc-bios/canyonlands.dts:464.26-504.5: Warning (pci_bridge): /plb/pciex@d00000000: node name is not "pci" or "pcie" pc-bios/canyonlands.dts:506.26-546.5: Warning (pci_bridge): /plb/pciex@d20000000: node name is not "pci" or "pcie" pc-bios/canyonlands.dtb: Warning (unit_address_format): Failed prerequisite 'pci_bridge' pc-bios/canyonlands.dtb: Warning (pci_device_reg): Failed prerequisite 'pci_bridge' pc-bios/canyonlands.dtb: Warning (pci_device_bus_num): Failed prerequisite 'pci_bridge' pc-bios/canyonlands.dts:268.14-289.7: Warning (avoid_unnecessary_addr_size): /plb/opb/ebc/ndfc@3,0: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property [164/3414] Generating pc-bios/petalogix-s3adsp1800.dts with a custom command pc-bios/petalogix-s3adsp1800.dts:258.33-266.5: Warning (interrupt_provider): /plb/interrupt-controller@81800000: Missing #address-cells in interrupt provider [165/3414] Generating pc-bios/petalogix-ml605.dts with a custom command pc-bios/petalogix-ml605.dts:234.39-241.5: Warning (interrupt_provider): /axi/interrupt-controller@81800000: Missing #address-cells in interrupt provider [177/3414] Generating pc-bios/bamboo.dts with a custom command pc-bios/bamboo.dts:45.9-48.4: Warning (unit_address_vs_reg): /memory: node has a reg or ranges property, but no unit name pc-bios/bamboo.dts:87.13-154.5: Warning (unit_address_vs_reg): /plb/opb: node has a reg or ranges property, but no unit name pc-bios/bamboo.dts:198.3-50: Warning (chosen_node_stdout_path): /chosen:linux,stdout-path: Use 'stdout-path' instead pc-bios/bamboo.dts:87.13-154.5: Warning (interrupts_property): /plb/opb: Missing interrupt-parent pc-bios/bamboo.dts:100.14-108.6: Warning (interrupts_property): /plb/opb/ebc: Missing interrupt-parent >From QEMU perspective, these warnings are not really useful. It is the responsibility of developers adding DT source/blob to QEMU repository to check the source doesn't produce warnings, but as long as the blob is useful enough, QEMU can consume it. So these warnings don't add any value, instead they are noisy and might distract us to focus on important warnings. Better disable them. 'dtc' provides the '--quiet' option for that [*]: $ dtc --help Usage: dtc [options] Options: -[qI:O:o:V:d:R:S:p:a:fb:i:H:sW:E:@AThv] -q, --quiet Quiet: -q suppress warnings, -qq errors, -qqq all Update meson to disable these unuseful DTC warnings. [*] https://lore.kernel.org/qemu-devel/CAFEAcA-WJ9J1YQunJ+bSG=wnpxh1By+Bf18j2CyV7G0vZ=8b7g@mail.gmail.com/ Suggested-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daudé Acked-by: BALATON Zoltan Message-Id: <20231006064750.33852-1-philmd@linaro.org> --- pc-bios/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pc-bios/meson.build b/pc-bios/meson.build index 4823dff189a..b68b29cc7d1 100644 --- a/pc-bios/meson.build +++ b/pc-bios/meson.build @@ -99,7 +99,8 @@ foreach f : [ output: out, install: get_option('install_blobs'), install_dir: qemu_datadir, - command: [ dtc, '-I', 'dts', '-O', 'dtb', '-o', '@OUTPUT@', '@INPUT0@' ]) + command: [ dtc, '-q', '-I', 'dts', '-O', 'dtb', + '-o', '@OUTPUT@', '@INPUT0@' ]) else blobs += out endif From patchwork Sun Jan 12 22:16:38 2025 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: 856769 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1178236wrc; Sun, 12 Jan 2025 14:18:21 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVclTXIa/2JLkWQ7myCHK6ZSZHfwmUAeokEb2dPZd11t/vQbWCrsBXaG3dyamXVA4Tl5r9I0Q==@linaro.org X-Google-Smtp-Source: AGHT+IEl3JVXjsJAIr+YRye3vSGJsAUMzkt2xZy/eAYIQHCff2Wt+qPWY0dEav2h11cINaFTZQRe X-Received: by 2002:ad4:5d64:0:b0:6d8:9838:d3a9 with SMTP id 6a1803df08f44-6df9b22d71cmr212950076d6.26.1736720301209; Sun, 12 Jan 2025 14:18:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720301; cv=none; d=google.com; s=arc-20240605; b=Qc2sfAdm2FgePY+0ycBygjXCAtbPoA+h70ECbBjDFfx8yGNrecJJGkVFDBub43mpWV S/r6mKwbgj1xqQ+ldQAgQz3xFyvdgShLXnZrrL2xvjGYSkndzRCytJKDYXqlXAyL/7rh QAi8Xqko4De+qgd99HaYCzj2wxIM6OmEn4Yn1uiL1UZnW3caE3eQIKCVNNfDUg13f29U fauBJzFxr7wuvkfHw1y/LCYbKxD27L7M3LCIQwqelbQrjrcg8kymrkaoRsvePguMTPRU wyjpuSowFEO8s97l4+mYmysphfnenC/Ee+UHEfIg9kHoqnjln+OxvqrcMgSuVNz0pY1p wwdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=o/QB0eCOWglzRhv0POd1a0450MrEr7ITHH+s9iR/zMg=; fh=50e5w3+W6SHHNE+06M/ShWWkYgFcpUwndl6hLiFb1X0=; b=PfiVzp/+Npf2RSPxKamO1AtXGtkgzv+wnL5gZSpNGeIvstH2YphvfYtXNThSOFtv+K 3BXFSOh7BgaB1/u0Vl3TCxhRfOBW0JW5pFX8IT24MG+6nmzK9VonoGq0avVNSpJLZszm Z0S+Z1JbbfSFipcDeyQx9y/ekunaSYCPTh65qxMuf9XaSxeYebOU38vxOM+QoeVD9QGn NcUtt0w4c5rK967fzolqwaetsk5R0FeJI4hCol/uSKGWp+BLs9Cr7X8uzO6nJoqIfZNl Y9CtIGEI2+j48mmWSq962PVI4jXRMUgeHsv3SepuKGNL5Bke4S71NMwrVvYOEZ1WITPe PxMw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WzcRFFuk; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6dfade982b5si76788596d6.231.2025.01.12.14.18.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:18:21 -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=WzcRFFuk; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6HX-0007Ty-77; Sun, 12 Jan 2025 17:18: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 1tX6H8-0007SX-7Q for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:17:42 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6H5-0006O5-Pg for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:17:41 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4363dc916ceso28855785e9.0 for ; Sun, 12 Jan 2025 14:17:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720257; x=1737325057; darn=nongnu.org; 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=o/QB0eCOWglzRhv0POd1a0450MrEr7ITHH+s9iR/zMg=; b=WzcRFFukQ/Yek1m5hnh0Gzid8WquR2GLR97HU4biR3b934lhc0v74JJYjqeB9LA9Hg sKwQRkpbS3+oSPR09KU0nnCS81qGoIZmp1g2/yVJ2JYWLDpd5uZMNQHCzegevIqkglhZ KC4WbHIABgKaXWYRHw4GFNQYgjYX5bEyPBxU2GjbMAHYJp4PEm/Rg7qp+Fc09bUAAUzV u2yt2qgm+CN0ddUc3pW7CHKcP187ZWo4NpWm3uFSL5+FubbwT7ptkbGCe4cLWPSHtjX0 G3Q4uj5zKP80S6VaGAOgb7lZD6Z8Sg/u4hHys7diHoADXwj2PyWHEeHhdAFNW4ErynoF RBHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720257; x=1737325057; 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=o/QB0eCOWglzRhv0POd1a0450MrEr7ITHH+s9iR/zMg=; b=buEZHg+XHbJhmnSIn2eymRZsaiL+ICe7X0ghLx67yxi6kh4T+TpdS44FM1IG7IBzUd /Se/Q1dkst8vEqIu7XMbQdIxnVTbApYQf9YQjZNo+DlJND3cdWgQz1K6DPHVcg8hRCgV vRvlMhoTKr7FM9SN1gZcHHPJaW/NCV8dleFMdXRvETtkmJCeScc5nZqjmPsp1uVQzcZR sqreX/Fo0c99RePnog2a0Cf89MbUWjbTcqCs2zrnFXZo2mX1H5g5EyDVFyUaxCLv+bKg +UDFX8P4wajrdToNQevFNcExsyJm0JsdRlu48GyY8o1P/N+fmtti3G9E0rWqpdUERyOT QFKw== X-Gm-Message-State: AOJu0YwfaaGFnLN3M22NyYUXn2piRrkOSMGdgmN7RagPLbB5zgYWNsqQ aKA/auvQbP7k8szZliXW0qWMubCDc2Ix1M3551h+2DeQz1dUzKB36s3WpuxkL1ywCqh6qcD325c wHp8= X-Gm-Gg: ASbGncv6GawSDM66PYnKZyrV3yrbk6EstN3WRRWENnA/+z6Xtc1i3i2YDPmeHM+DBP4 yc+vH3ONdAzheuW0lAyqYu6HJ/4a7nRevAh7Ur2vpKM5LjPoncDoHqjg8N9EnzHYCP7+UIzDC07 tumRaDB2zf7ZN6PMZy87+thGWe0NpEvrPnLZlcv/8NrzcqdfdeUb+yjf+Xj/JS20KtzaSmRhqGY 2xXP7XK9LJpEH1Q8t8J4TgcGqtQJNXehqIEg2SWWrEGOb9ee1cM76sNrSnF0rXuxkFTfpfpG94g dKQp6WiYyGEjTm7D22VKxbug+q5pGoE= X-Received: by 2002:a05:6000:1f89:b0:38a:9ffb:ff02 with SMTP id ffacd0b85a97d-38a9ffc0264mr5293576f8f.12.1736720257354; Sun, 12 Jan 2025 14:17:37 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e38c6dbsm10787823f8f.55.2025.01.12.14.17.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:17:36 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu Subject: [PULL 02/49] target: Replace DEVICE(object_new) -> qdev_new() Date: Sun, 12 Jan 2025 23:16:38 +0100 Message-ID: <20250112221726.30206-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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 Prefer QDev API for QDev objects, avoid the underlying QOM layer. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Zhao Liu Message-Id: <20240216110313.17039-8-philmd@linaro.org> --- target/mips/cpu.c | 2 +- target/xtensa/cpu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target/mips/cpu.c b/target/mips/cpu.c index e3af02a4e6d..47cd7cfdcef 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -644,7 +644,7 @@ MIPSCPU *mips_cpu_create_with_clock(const char *cpu_type, Clock *cpu_refclk, { DeviceState *cpu; - cpu = DEVICE(object_new(cpu_type)); + cpu = qdev_new(cpu_type); qdev_connect_clock_in(cpu, "clk-in", cpu_refclk); object_property_set_bool(OBJECT(cpu), "big-endian", is_big_endian, &error_abort); diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index 0910a3d2904..4eb699d1f45 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -208,7 +208,7 @@ XtensaCPU *xtensa_cpu_create_with_clock(const char *cpu_type, Clock *cpu_refclk) { DeviceState *cpu; - cpu = DEVICE(object_new(cpu_type)); + cpu = qdev_new(cpu_type); qdev_connect_clock_in(cpu, "clk-in", cpu_refclk); qdev_realize(cpu, NULL, &error_abort); From patchwork Sun Jan 12 22:16:39 2025 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: 856772 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1178286wrc; Sun, 12 Jan 2025 14:18:39 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW/7wjKdLZfEDpJzSBAHuHYeBx/lBd9g8+V2O93t7+VDkJWV77jqfDItGKayjZnw7AZIhU7LA==@linaro.org X-Google-Smtp-Source: AGHT+IEKwsW2poKXyX45oD9sKN3zfsVZ/YbjDAYJEq3Dgf7lGizhjTbHMrOfkt47Fn2qnOXufO0y X-Received: by 2002:ac8:5acf:0:b0:467:5384:50ed with SMTP id d75a77b69052e-46c70fd31famr283384181cf.10.1736720318967; Sun, 12 Jan 2025 14:18:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720318; cv=none; d=google.com; s=arc-20240605; b=g/qwa8el6J4GnXuPXjk1rzGIT7HzY3WqVVrHP8a0PEWqF8BVkJxk5qrh7coHlvWiiK 2sJjMUWd5++KoDqfwyAlFtMIl6tUvuiI/iif9X4nzzzapULXprbtubCWRrL6a+Bs9m4J H2o2sz5eWfa6kCAJW+9xW+SehyEbgIZUVj1ItSYTKtyYS0v+ocoVZqQlWBGW8Qoaeu2g Rfkd8WUICTy+EbCYtwN3FTJyMitwe6THeL2ji2G8PnTSBtCzSRNYeWx3I/JHDZGvg9v7 VpASRCQOglPuHgIzkqd+6qtOWvc3cvpcBEUnoqKg+RzLL1/r9ju+tf46XcCqZoPsWRf9 5XFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=RRilqG0RRzc/tLS+/K4TJ6YsxHq+JDiiCxUzzS2N1LY=; fh=50e5w3+W6SHHNE+06M/ShWWkYgFcpUwndl6hLiFb1X0=; b=RYVUTU04WQfTm67V1wSlfwQwgEqzJS8PVAJvGgHbk8Ku8eT1vizTH5PvKAcreIC8eL wKJfIu525o6M5I0wIxsbGGS0s5cMQyv/LgnBacCkKvECJuPrdzrHwaYshyUyCskvyB/6 1esaAlA0N9MiEMaNE0blPv5uS4IPNwRuQ3O1EGoEFMEl82Rnk4/txdSKuL3goRHRcKuR /U/iXgZPe0Gexoyc+A9jWmQ0PQR4nK8u8rU6zcHKChZ6aVCxpkKj8MqdrLzW1zY2eeLH PEP2C6w9C4saxdLTBDMCacXgt1zC8bdIMAYLI097h65bsAVD544n6pqhvrfIiiDwVTv5 mGIA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EnrmkeWV; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46c87330ff4si80023181cf.53.2025.01.12.14.18.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:18:38 -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=EnrmkeWV; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6Ha-0007WF-3n; Sun, 12 Jan 2025 17:18: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 1tX6HO-0007Tb-7x for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:18:03 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6HI-0006Og-Sj for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:17:57 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4363ae65100so38315945e9.0 for ; Sun, 12 Jan 2025 14:17:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720262; x=1737325062; darn=nongnu.org; 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=RRilqG0RRzc/tLS+/K4TJ6YsxHq+JDiiCxUzzS2N1LY=; b=EnrmkeWV5hicqQ7cryUySmTtzA3tNMH5s2rA4H0k7O/qtWG8/b6S/zGDQqy5yXr9AX IFFJ5VzV4JceEYbWLVOCMMp1zWhvGj0sLWaPP2bHY9Cdm5y4v4RSNzZg8Gw/kDFERAyM NhinP/QmQp4PMbDyaSUw9jZJ4PUWUFRa+ItWUv9fAw04kqU3OO0v+iTScHrS+Mnxd2gz MwaH0bo07jhBBRswj2LCDcb62S8MIHUPpzFkpxy33rht5Gzb08BnMYul8gK2p47PQ22q 5a4ZH6AFTOxX2fRosxgAmqp3wl4T4cyLxnmxlcnymrVZ+U1OAWhF6qLLbxaBNnGsBxuI 2uRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720262; x=1737325062; 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=RRilqG0RRzc/tLS+/K4TJ6YsxHq+JDiiCxUzzS2N1LY=; b=sW6pP4SUbqAO0v//6UTO3U3jKlysuOueP/QvF8hXG9rb6ZJMuCgPmqRbtRbXJqg1L4 AeCU8j79d2zKNwRjr/+sdgVPH0CmHTsB7VpQVVW5cETtk+zFi3vLE47RFGD+5ShuBiC9 /XzU7XbEmTatM1GTLAiu0gVGE8BQBtVNg6NxeKYI/UTBoKgFsNTCR8CDJzKadrsOwaoB FYlioYxEoXmV1HffzRjhtgc+wnsTa/QOmP86sqtl/YSPl84doj+5pH0Zr1/nqbRa3YF8 hU44aW/dVU5t7Fl45OP/1JR3mQtTTFXtYut53ds20k6emSY4Ane1geXmYuIuMnQeLu2K 4zsQ== X-Gm-Message-State: AOJu0YwL8b5JGZVdsfDXvJv1rYpycaykHm2LYCLg4TXBUcINRfjgNAc4 Pk4/f5wCJ+iB0uk6CfvieNYnmgFjv08oKBp+eiMV3e4D24isj2qIZ9AfC10DCbkaKrB7iykBOdn MNwc= X-Gm-Gg: ASbGncuINjcj7zcuOblwhpUWEykZ3XhVujcgLWjNunTHmnTQ54sL959xmDSgTauX5I7 WOYakCzhrXmXJWta6EtjVnXsNza0jDkmYBgXyNMxN31goHVa+SuK2FF9W7IRT7KmdchZ6XkOk5K N89fGf1xf+XHaU0w2C3mP11K/8nrF7pptQLFeUJ7GbKOcFF4Fd41B3jGEjpulTITHiIDhieL7Ph tlhCVbSQlm0bsFKxEP1H9NVHySiVhhVB5t01n3Wn4JW5funDPVp2Lok7JAyc67u70AyP4bEDwyd ey0n8hwBKia6A7YvJCBsq57gmuQUgTY= X-Received: by 2002:a05:600c:3ca4:b0:434:a26c:8291 with SMTP id 5b1f17b1804b1-436e26e203emr147457395e9.24.1736720262574; Sun, 12 Jan 2025 14:17:42 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e9dc895esm122279135e9.13.2025.01.12.14.17.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:17:41 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu Subject: [PULL 03/49] hw: Replace DEVICE(object_new) -> qdev_new() Date: Sun, 12 Jan 2025 23:16:39 +0100 Message-ID: <20250112221726.30206-4-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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 Prefer QDev API for QDev objects, avoid the underlying QOM layer. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Zhao Liu Message-Id: <20240216110313.17039-7-philmd@linaro.org> --- hw/arm/musicpal.c | 2 +- hw/sparc/sun4m.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c index a712ff954bd..48a32c24079 100644 --- a/hw/arm/musicpal.c +++ b/hw/arm/musicpal.c @@ -1238,7 +1238,7 @@ static void musicpal_init(MachineState *machine) qdev_get_gpio_in(pic, MP_TIMER4_IRQ), NULL); /* Logically OR both UART IRQs together */ - uart_orgate = DEVICE(object_new(TYPE_OR_IRQ)); + uart_orgate = qdev_new(TYPE_OR_IRQ); object_property_set_int(OBJECT(uart_orgate), "num-lines", 2, &error_fatal); qdev_realize_and_unref(uart_orgate, NULL, &error_fatal); qdev_connect_gpio_out(uart_orgate, 0, diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index 217a69e4d5d..e070360a2c7 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -974,7 +974,7 @@ static void sun4m_hw_init(MachineState *machine) sysbus_mmio_map(s, 0, hwdef->ms_kb_base); /* Logically OR both its IRQs together */ - ms_kb_orgate = DEVICE(object_new(TYPE_OR_IRQ)); + ms_kb_orgate = qdev_new(TYPE_OR_IRQ); object_property_set_int(OBJECT(ms_kb_orgate), "num-lines", 2, &error_fatal); qdev_realize_and_unref(ms_kb_orgate, NULL, &error_fatal); sysbus_connect_irq(s, 0, qdev_get_gpio_in(ms_kb_orgate, 0)); @@ -995,7 +995,7 @@ static void sun4m_hw_init(MachineState *machine) sysbus_mmio_map(s, 0, hwdef->serial_base); /* Logically OR both its IRQs together */ - serial_orgate = DEVICE(object_new(TYPE_OR_IRQ)); + serial_orgate = qdev_new(TYPE_OR_IRQ); object_property_set_int(OBJECT(serial_orgate), "num-lines", 2, &error_fatal); qdev_realize_and_unref(serial_orgate, NULL, &error_fatal); From patchwork Sun Jan 12 22:16:40 2025 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: 856773 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1178294wrc; Sun, 12 Jan 2025 14:18:41 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWNwYpznhcYkkb0rHt2gwsrg1hclM0mtDNtbcc8X3Tk1AhL2XHm84fBIH2GULOSlASGXgcb+g==@linaro.org X-Google-Smtp-Source: AGHT+IGo3XBkZWuK/VV4i6w7LJEPAX1DeEA062qwQykGpwkkof9uTUQK8xCxWMImt5Ar5/wwoJYL X-Received: by 2002:ac8:5813:0:b0:466:aee5:a5b with SMTP id d75a77b69052e-46c70fd1faemr285007331cf.10.1736720321455; Sun, 12 Jan 2025 14:18:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720321; cv=none; d=google.com; s=arc-20240605; b=YsLHrikXRSQJ2G2PPmUgLqorpptYZ6FnvIFsehh3yWoD17uA/SbotcjOaRap25bzBp kPwjMnF4OcRxTtYOYLe+Yx7gStTfIasO4qg0F0jsfY/+KBgO+dp0JaxGA06SyUJhowVH Alfwrem/UdTiSRYyn0GZaVT91RKxnAWYOPBYYZkP/JkjjnK7BGBLvghcDAUCp+slmkGJ xIyB27nI0zKgCTukG3ApX1lmZfg2XWpK5lWTdXgGOXsb54364KGC0oOYPQrZImLWi2tl a3HgZ5AJtzfuxbNn1ka6vJprSU72/jSq9B3GW2Said7qnme0Ny+OQkXZrAkp+8VLgOL4 nH7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=DlEj3ANe4I1Uz5rznp2DVq0ieFeAR6XbYMp+YuA15wg=; fh=50e5w3+W6SHHNE+06M/ShWWkYgFcpUwndl6hLiFb1X0=; b=Iq6UQod38B/kZIBBsQj+W83VBYXCPc7GLM1krm3OMY3KPkKxvjpvOyPmz7ryQkbS0H iu4QjS3zjWCNZqI8jrJQNBFIJABWF5AdAIwPDE15rfBpsJkzYByGagb59rFH5zVrnHpq 3pRHu2/q9ZYpYP6YdEVd+Nj2mtlnl32VJvMDsWcZOtw5BIHoyZ8jnUIw2R4eLEUGakG+ F3v23ePFYINFAxpB6ahoA25hCLkYSrXDbrZ8qZYJtODY1jo7afvFPVktS3UnLOrMaYX0 r2ADdb6WE/xdKtfi5F6zBHCBEC9wuqx+eBFRrcBk2yQAcjmohxE+buMqyjRki1b2am+N eEGA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fhNYUhrT; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46c8733146fsi73937411cf.65.2025.01.12.14.18.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:18:41 -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=fhNYUhrT; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6HY-0007VN-26; Sun, 12 Jan 2025 17:18:08 -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 1tX6HO-0007Tc-OZ for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:18:03 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6HM-0006PA-7H for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:17:58 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4361b0ec57aso36061905e9.0 for ; Sun, 12 Jan 2025 14:17:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720268; x=1737325068; darn=nongnu.org; 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=DlEj3ANe4I1Uz5rznp2DVq0ieFeAR6XbYMp+YuA15wg=; b=fhNYUhrTxdd78hmUpf674+PkTJmigH+B/sOjcG5Va1VrInfuqzit3RXFe1HEat/H2/ eiLcwlo1Uj1NJ8aoVc7NpfX/k4NsUpuDkKRDlaicy8gy8V9NKaBbeXqlnQ4TJo/YnQth 3KFP17USMs/YBT437nohUU6pwn40y1kztyHlR/3opZD7nPFw2Fr/HY0SOSeSZ5uB8ppk gk0Q4JpBoCrzfgJ/T+SiULyC2dN375BFPAkfCfc58QJRGRFnZrS9Ny0N0WRUJriNiWn/ T1mQe/pg6D3cZO0V0iEd/jMvE2fHh63l2LF4/Sd1dTDWmrnRdFRZuD2Rfd7dO0wsTtUG N4Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720268; x=1737325068; 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=DlEj3ANe4I1Uz5rznp2DVq0ieFeAR6XbYMp+YuA15wg=; b=f1PIoilkJda8MkqpwV7WjVr+5RVA6Kv4Shpf6+bSuw0t+CH9ele3rn1gRrBwy5KRld Kogjn4fcVwIst8K5N5P5oIK0Kqsp4hSlK4+lSOTB7OF6qT6kqX56dqJiZULxluFuQyex E8uhJ3eKWbmR+ebX4WiBzknm/Hx5Y6+7ktLj3gtG031SRKHWh1860qlyL6LXr05z3U8p SaVIrb3iIrXWuad5ULqVubxYhAlNZEBpro47QVcwZUFtlGw4u8US2dwrTYTjza1EqqM9 cqTTOii4fiA40RrnqT4cka7otUofJMvOtfN/UhGGBVZtDvIpLvIxKDB4J/2/pMqNtcPp 5P3g== X-Gm-Message-State: AOJu0YyxpSfjwyhXeYp76+W6ohmY0Du3vkmfrxnY0tnRau40bJMMr4P0 FPJSen2FGm4PUdfjDzLNvPbs1pjH0HGMs+OhNI0h7QDZiuhocWS34wNoEeTNhIcOcfneCM9T7UY 1qgI= X-Gm-Gg: ASbGncvewIFvc0cpdFEXF2k5f47G2rIHkN+E+zXn7UEntIHJvKUxP6bdZXqtDqgMUOP ncRH+ch47VGEpT5ovYWQD/GGuYYH2mhl6HM10E7O9mepwdBQiyYnG1eviI9/44/QChLyfni7KyN XGKomJHW7oa5RzvlwAo9ffJfSrMgre6mBxYWMVKRw1CLp7eVX3XpP3tR/kMDBH1cchBm+lCNhVv I33OkfoaHe9F7F2qYGlqg36KxN6o/erC0PZeEKzqZPFSkjtpQwxU+NH675UBK5pJjmi5H/Dv/+x pmXEdSdA7WzvbFMsnkyyx7ejq/HR3qQ= X-Received: by 2002:a05:600c:4745:b0:434:9c60:95a3 with SMTP id 5b1f17b1804b1-436e26c4218mr180621855e9.11.1736720267876; Sun, 12 Jan 2025 14:17:47 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e2dc0f69sm156716585e9.13.2025.01.12.14.17.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:17:47 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu Subject: [PULL 04/49] hw: Add QOM parentship relation with CPUs Date: Sun, 12 Jan 2025 23:16:40 +0100 Message-ID: <20250112221726.30206-5-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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 QDev objects created with object_new() need to manually add their parent relationship with object_property_add_child(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Zhao Liu Message-Id: <20240216110313.17039-22-philmd@linaro.org> --- hw/i386/x86-common.c | 1 + hw/microblaze/petalogix_ml605_mmu.c | 1 + hw/microblaze/petalogix_s3adsp1800_mmu.c | 1 + hw/mips/cps.c | 1 + hw/ppc/e500.c | 1 + hw/ppc/spapr.c | 1 + 6 files changed, 6 insertions(+) diff --git a/hw/i386/x86-common.c b/hw/i386/x86-common.c index 97b4f7d4a0d..9c9ffb3484a 100644 --- a/hw/i386/x86-common.c +++ b/hw/i386/x86-common.c @@ -60,6 +60,7 @@ static void x86_cpu_new(X86MachineState *x86ms, int64_t apic_id, Error **errp) if (!object_property_set_uint(cpu, "apic-id", apic_id, errp)) { goto out; } + object_property_add_child(OBJECT(x86ms), "cpu[*]", OBJECT(cpu)); qdev_realize(DEVICE(cpu), NULL, errp); out: diff --git a/hw/microblaze/petalogix_ml605_mmu.c b/hw/microblaze/petalogix_ml605_mmu.c index 8b44be75a22..b6be40915ac 100644 --- a/hw/microblaze/petalogix_ml605_mmu.c +++ b/hw/microblaze/petalogix_ml605_mmu.c @@ -83,6 +83,7 @@ petalogix_ml605_init(MachineState *machine) /* init CPUs */ cpu = MICROBLAZE_CPU(object_new(TYPE_MICROBLAZE_CPU)); + object_property_add_child(OBJECT(machine), "cpu", OBJECT(cpu)); object_property_set_str(OBJECT(cpu), "version", "8.10.a", &error_abort); /* Use FPU but don't use floating point conversion and square * root instructions diff --git a/hw/microblaze/petalogix_s3adsp1800_mmu.c b/hw/microblaze/petalogix_s3adsp1800_mmu.c index 2c0d8c34cd2..29629310ba2 100644 --- a/hw/microblaze/petalogix_s3adsp1800_mmu.c +++ b/hw/microblaze/petalogix_s3adsp1800_mmu.c @@ -73,6 +73,7 @@ petalogix_s3adsp1800_init(MachineState *machine) MemoryRegion *sysmem = get_system_memory(); cpu = MICROBLAZE_CPU(object_new(TYPE_MICROBLAZE_CPU)); + object_property_add_child(OBJECT(machine), "cpu", OBJECT(cpu)); object_property_set_str(OBJECT(cpu), "version", "7.10.d", &error_abort); object_property_set_bool(OBJECT(cpu), "little-endian", !TARGET_BIG_ENDIAN, &error_abort); diff --git a/hw/mips/cps.c b/hw/mips/cps.c index 0d8cbdc8924..293b405b965 100644 --- a/hw/mips/cps.c +++ b/hw/mips/cps.c @@ -87,6 +87,7 @@ static void mips_cps_realize(DeviceState *dev, Error **errp) /* All cores use the same clock tree */ qdev_connect_clock_in(DEVICE(cpu), "clk-in", s->clock); + object_property_add_child(OBJECT(dev), "cpu[*]", OBJECT(cpu)); if (!qdev_realize_and_unref(DEVICE(cpu), NULL, errp)) { return; } diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index 4551157c011..17d63ced907 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -955,6 +955,7 @@ void ppce500_init(MachineState *machine) */ object_property_set_bool(OBJECT(cs), "start-powered-off", i != 0, &error_abort); + object_property_add_child(OBJECT(machine), "cpu[*]", OBJECT(cpu)); qdev_realize_and_unref(DEVICE(cs), NULL, &error_fatal); if (!firstenv) { diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 623842f8064..125be6d29fd 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2705,6 +2705,7 @@ static void spapr_init_cpus(SpaprMachineState *spapr) &error_fatal); object_property_set_int(core, CPU_CORE_PROP_CORE_ID, core_id, &error_fatal); + object_property_add_child(OBJECT(spapr), "cpu[*]", OBJECT(core)); qdev_realize(DEVICE(core), NULL, &error_fatal); object_unref(core); From patchwork Sun Jan 12 22:16:41 2025 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: 856771 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1178266wrc; Sun, 12 Jan 2025 14:18:28 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVoU6sxQCl7x+FhZE4DqAPvU35UOPBu8Rpb+rVaqxOagKwk9bAoVuWEHdU08h1OLh0xrLGhOg==@linaro.org X-Google-Smtp-Source: AGHT+IGZpn1C6WwvQy0RpilGkCCrn510FU6zGcg+vXR8dYO5Qfyzxj7dsYd2n4ZWLbXym7ZIdabF X-Received: by 2002:ac8:5912:0:b0:466:9bc4:578 with SMTP id d75a77b69052e-46c70ff7a78mr265901741cf.22.1736720308354; Sun, 12 Jan 2025 14:18:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720308; cv=none; d=google.com; s=arc-20240605; b=lQX7FPPQrCQ4BClhZqeB8FYu8QIajYTRY5+w0NP01C8kdW13EtbDC9e1xlkvlHoBWP 14eJbTCYlhxrbuQ3X8DU3yBHKF7T/Ahb3Pr8WdtDQLT8Kxxomcon/y9ni7PZ+9sUCvO0 ct5KapHzwGqbdbXMwW4UMFzjXlTRDDS4qiAyI4M1hhviC7kWl4usmZlwVcIMLu1DA1db 2svqbJMQG+DKcTzQ7hh/ppfOduiHXHQmQb65hWW6rLZKuPShQmnyiMMMaBze51LJREa0 dbRppdHGPw/8IyORV7DZ7n+/mO+WF69bJXW5DjAhKC4U54nEmCfLZQdDlWDr9CzNo/6c Cg1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=+GoeTs3OwFxXFIF/0sszVZvTSkwjTETcrGfwBocwM+s=; fh=50e5w3+W6SHHNE+06M/ShWWkYgFcpUwndl6hLiFb1X0=; b=S5SYi6SWhPzTa9uYvTOmH8welyNyqmIVcMA+X8DG6FODTPlr21H/0s53ZTyMtpy/n8 xg15kBR/Y7W9LwWKM9Ux3NhIuEx0Pbc+cpwPOA+u2CqSGcgKCG0AqOap+v2wXfh5cEb0 /XEZvX6gujejyL2Dv3saZQk/+tsRWOrcQpfu/0G3FJWEQOwk5T2XptUHuGPAyfPexyMi pjf9uYx+VY40PlVTDUA9shEmlH8I293vliJb8B4FXiGecgL4d20tbVUui3mzyqSMuqYZ 6Sc794+MX2a3DGmuAWhstsTgS2LWr8iMIZElFrqZNfdyji8ZSpenvQMj03K0gf/Pci6a eSoQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="T1vdYGt/"; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46c873fb036si82824151cf.368.2025.01.12.14.18.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:18:28 -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="T1vdYGt/"; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6HY-0007Vu-S0; Sun, 12 Jan 2025 17:18:08 -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 1tX6HP-0007Td-ET for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:18:06 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6HN-0006PG-DE for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:17:59 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-436637e8c8dso39392225e9.1 for ; Sun, 12 Jan 2025 14:17:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720273; x=1737325073; darn=nongnu.org; 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=+GoeTs3OwFxXFIF/0sszVZvTSkwjTETcrGfwBocwM+s=; b=T1vdYGt/BNcDErDAjxNxFcs3bhFrOU3Pq7dPtb6PUoPB0unMiprQeZGkBBkBroSdNv m/HjdqP9K34XApdqCvBFc/x/0SZEmMzzwnzeRPsTdErNCoc0lETK6lcRS59U4qJKEBVg E4zjHRsboLuSqhRSKsWoMjiFjc/+zsYuco/7on2Lp5GDiBAK2Fu/+VFbwQiAtfelc1R8 XD1HcT27d/ZwlzgEf/9hVNpiTVZiUIKsBQNsCL4J2LbCoL5AIunpCaUOoH7V1ZnkqSQz 91J5iAkOcYIbf4i3ywK8jlUzYOortqk7xzyuEkcvGFLua8EjyqmwnYs2HIFZ59PVXhMo cSxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720273; x=1737325073; 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=+GoeTs3OwFxXFIF/0sszVZvTSkwjTETcrGfwBocwM+s=; b=CmsHDcPMPanYRUwp34pJ2EFuLIhB4XGW0HsbpKkQa1Xs4Dk62nLJvrLa+yM8HqNW1s B0Kehp1FLVKvQ5+n7LFgZa9VOzPF32+m/WcZq1JY8mCe9+6cOl+lqIPNLq8fq+RYMnxi qmJZhokPSJ59cSGsOpJqJTozkeqdS+F21IRTD5tUqZM4nS1MysiFUqHCAka7vfyL0elh IbwlyoXT+iCwqweTgTcvuyKG86DF9SERtc/1fs3TrdzUO1h0XCzuu6uovNt4tivywUZf mAiIocbirkJiiZQAZ52uND74gj+J2hQ7C0zwhjzb920vvki1/8pV2AGBnXL6WBoMBSF0 TWUA== X-Gm-Message-State: AOJu0YzlNF5Ieb+SkLc5HWUz/Pfl+iNpDV5eFqrtsBEaahJuRZfZca4O iLJNXIYHW1yDIghPWWqGRkR4wOmCclVLYCTe5a5+gyJxkP4bQjE53TQ2q7wQeVM5brNdDHl3Hbn W2Mk= X-Gm-Gg: ASbGnctEqQSUDWYswVXtuzeFo0Zbtl6OIrDPSxos6q06VziI+sIILYeSgNB4IzgZZEh mjmwiHiZ0YRA9O4C+dS4uoCjVAmXpAFqo6HE24mPMDvm69FPJze6q0Yynscmusi7zH/IY1msfA2 ql75l+b6n3Gn0lUJZmx4/j2eqoR+8LiJ1X6TylvOqdUVuexg5U3hpg+pjKtqEXdAFiSxqDmH3XQ V5nlpLfRV6oFlDm7GSWfeVrCU1QH9VW3yJXimCocdZYh/9QtBgwjrefUodmJa0LaZrqXT9Q64qP 1xPSzDpDS2mu/Gtln9k7DppX7ehyCk8= X-Received: by 2002:a05:600c:4704:b0:436:469f:2210 with SMTP id 5b1f17b1804b1-436e267f796mr136934085e9.1.1736720273147; Sun, 12 Jan 2025 14:17:53 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436dd15766fsm98095965e9.2.2025.01.12.14.17.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:17:51 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu Subject: [PULL 05/49] hw/usb: Inline usb_try_new() Date: Sun, 12 Jan 2025 23:16:41 +0100 Message-ID: <20250112221726.30206-6-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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 Inline the single use of usb_try_new(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Zhao Liu Message-Id: <20240216110313.17039-10-philmd@linaro.org> --- include/hw/usb.h | 5 ----- hw/usb/bus.c | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/include/hw/usb.h b/include/hw/usb.h index d46d96779ad..bb778cb844b 100644 --- a/include/hw/usb.h +++ b/include/hw/usb.h @@ -584,11 +584,6 @@ static inline USBDevice *usb_new(const char *name) return USB_DEVICE(qdev_new(name)); } -static inline USBDevice *usb_try_new(const char *name) -{ - return USB_DEVICE(qdev_try_new(name)); -} - static inline bool usb_realize_and_unref(USBDevice *dev, USBBus *bus, Error **errp) { return qdev_realize_and_unref(&dev->qdev, &bus->qbus, errp); diff --git a/hw/usb/bus.c b/hw/usb/bus.c index b19b0b13ebd..7e7deaadcaf 100644 --- a/hw/usb/bus.c +++ b/hw/usb/bus.c @@ -411,7 +411,7 @@ void usb_claim_port(USBDevice *dev, Error **errp) } else { if (bus->nfree == 1 && strcmp(object_get_typename(OBJECT(dev)), "usb-hub") != 0) { /* Create a new hub and chain it on */ - hub = usb_try_new("usb-hub"); + hub = USB_DEVICE(qdev_try_new("usb-hub")); if (hub) { usb_realize_and_unref(hub, bus, NULL); } From patchwork Sun Jan 12 22:16:42 2025 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: 856770 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1178246wrc; Sun, 12 Jan 2025 14:18:25 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXH+3+D6bAS+DBUUKqHyAJFGvQyVANdaOAxLTED8gmIXN5Uo+KE016pOs1R8bk+TeSQsG0IBA==@linaro.org X-Google-Smtp-Source: AGHT+IHc+fPt3ukgh0MOQSzbLnaDRLZJpN8ZNy8NW165ZuqK3EFJX3RH+m5TYiisA0hV7eDXeDH6 X-Received: by 2002:a05:620a:43a2:b0:7b6:d6cb:8b99 with SMTP id af79cd13be357-7bcd961a66dmr2783645785a.0.1736720305174; Sun, 12 Jan 2025 14:18:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720305; cv=none; d=google.com; s=arc-20240605; b=GVIEjHsaIG4RoD5LEKNEW3VFb0vZxxIjo48uqYDp9nYtmC8QFB3TtjN4X2QVYNOc53 KYbmTef+7ANoSO0yfVpGmZF7zxn4ypqXQzq15LvGusX2BUWpU2gzWm2vXazOYFeQ5XTF sNmmAIBXwcroTqvpWzFr4onntJk0sfjKUhCMgpCaYO2h1CbIuYhgBeK7pHT14CVwTVI7 S6adYp8cTsJ+96LhjfSY8yx0jebjjbtEeVb4TlpjKYGsjWxv9JE+RZtGrJ9f1BUXKw4o UMNwa6zvjB9oqQvRmTWRodJTRvcdP9eyDcv7Ys9z+biYbYzfbGlyrwjphus29iRQlskd 7QiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=mFVPbF7stzQL/SqDLEkr/HWvwoJrRGJFOJxTEnGaiiQ=; fh=50e5w3+W6SHHNE+06M/ShWWkYgFcpUwndl6hLiFb1X0=; b=gN0RU/49WfCPf8ui8AbwaPFX/0sohaPaSogcvzjV9cmhIdBCV+gIf6E1pv7tMnrOtP OWLgOp2BwoirSxHKDWzT1C+1+zR0Z4OQwZhGKHmN4q7ldpz0yIdBXzgd/p4aqz60b7Gl OpiIBJbpGJcpN/f67EBiuXuDbUWnAlJzN8o6L9wY8BXTxtezEpmYAwgFSMRVWphIinB1 4asiCod5QACtEBjxL3TPO+U60YZTssTrYRSY2klX6Wwl52t+JI5pdFNdTjs3/2jsgLFK RBkv1afycTsybMqe3JdAa0WQtroRZWrvxL1ePoOjdTD0+e2bbRVIm+az6lhLUp4Q70xh Ec8Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Dw27Pdc1; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7bce322a383si920994685a.8.2025.01.12.14.18.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:18:25 -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=Dw27Pdc1; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6Ha-0007Wa-Kz; Sun, 12 Jan 2025 17:18: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 1tX6HX-0007Ut-BB for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:18:07 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6HU-0006Pp-A9 for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:18:06 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4361f65ca01so35916795e9.1 for ; Sun, 12 Jan 2025 14:18:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720279; x=1737325079; darn=nongnu.org; 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=mFVPbF7stzQL/SqDLEkr/HWvwoJrRGJFOJxTEnGaiiQ=; b=Dw27Pdc1FVbZJcdQb2BULqpE+4etAfeMYvNaUz0dX2mCmYD7/3GGRRhDXHfAEotx4H yY59bi5ALHS63H1cPncAPCJ6GORXVSkv1hTj5YsevWVYG0ynXlcSvCdNQ0Gax/OYFnph bNHNivPiKaVFDYeFg+FBzO+1Y+H4BlSjeRIyrncPMkTkPiT5N2BLmU+Al0N5LPixaZo8 4b7c+Ty3YVo/XMmjc13jC7sP3lBtDXMaFsDiFsIRkXBVZUGVPjguMBDlgyNa1zLAI4aT k9fUeULqhl4BmD3e7RSZ7K85SGoJHe9WVClVz7Zfe/pTpusD15yzJJ5C8PKKUzM91NO9 1DQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720279; x=1737325079; 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=mFVPbF7stzQL/SqDLEkr/HWvwoJrRGJFOJxTEnGaiiQ=; b=YVwwW29Lf8FXyR/eJnxsfua+hHXE+1iCGO640nm5YMAr3SOgtPfyzrx2dfrFt4ym07 TeAiJUCjLSOoPpuAHxykpc1YQXGogtAdZ89xa4WOfkUUOms0G7/kf9IeYU1Ib6EhV7qo eKXAqUliIB5KlzzszKHFfmYpjPvKklv6QfUBisR4eoxqMctmKGfWZE8JgpS1KG6qdIzY u970P8oz9Ix9FpS/Z14MyHxjoWz+ktikYhFXjZ9uW828r5TKZqKS0ImNF29Rqb84YvSs GjR7YY1slFUvUlnh5COrbnuyMoZFebWVy1GKvRw9VKuZ9QW6x3gPaBS4twoaaTEuEIO2 gx3g== X-Gm-Message-State: AOJu0YxKVIytNyqg2MK+N1uPpx+b8Dl0ViBImCMD4A7yIq5Hu9Mx1Owb EM8cGVY3ylz6f5Z1ztUleLYJBkiXe09NL8YuEkzKS+NT7k4m9TXfVwhPPZSGT7xujUqBrhGaipr 73SI= X-Gm-Gg: ASbGncsqF0hriVZAuF+rVsruEfTIpbrM6dbRQVmY9PxU/mdypnka4BrWUN5TLSAyq/W 97hdQ2d/9hcsSPo4P+5SyJ/kk1ofHhMZsakSsEMgreUP7jOhWLxnBtCUObUGtagOiK+B017E+Nn Bnov8Byakzg0J1F+kb+0Fu0EiXhq1yuqStKcUrN/VtvgirPKTXP9reooL1gQLrETb/uh25aUwl7 uh2jfCdBKoVqoAINsD9E39gXxaoadmm3JLpouA5OLupg35rzjuuecOSToJS4J5FN5PF4K+o3Pa3 IyNJonBG4Xv+7Y13ySJ84QEutaPu3ls= X-Received: by 2002:a05:600c:138d:b0:431:44f6:566f with SMTP id 5b1f17b1804b1-436e26c4a1amr161949855e9.13.1736720279176; Sun, 12 Jan 2025 14:17:59 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e37d154sm10823837f8f.10.2025.01.12.14.17.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:17:58 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu Subject: [PULL 06/49] hw/usb: Inline usb_new() Date: Sun, 12 Jan 2025 23:16:42 +0100 Message-ID: <20250112221726.30206-7-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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 Inline the 3 uses of usb_new(). Reviewed-by: Zhao Liu Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20240216110313.17039-11-philmd@linaro.org> --- include/hw/usb.h | 7 +------ hw/usb/bus.c | 3 ++- hw/usb/dev-serial.c | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/include/hw/usb.h b/include/hw/usb.h index bb778cb844b..e410693d0c6 100644 --- a/include/hw/usb.h +++ b/include/hw/usb.h @@ -579,11 +579,6 @@ void usb_pcap_init(FILE *fp); void usb_pcap_ctrl(USBPacket *p, bool setup); void usb_pcap_data(USBPacket *p, bool setup); -static inline USBDevice *usb_new(const char *name) -{ - return USB_DEVICE(qdev_new(name)); -} - static inline bool usb_realize_and_unref(USBDevice *dev, USBBus *bus, Error **errp) { return qdev_realize_and_unref(&dev->qdev, &bus->qbus, errp); @@ -591,7 +586,7 @@ static inline bool usb_realize_and_unref(USBDevice *dev, USBBus *bus, Error **er static inline USBDevice *usb_create_simple(USBBus *bus, const char *name) { - USBDevice *dev = usb_new(name); + USBDevice *dev = USB_DEVICE(qdev_new(name)); usb_realize_and_unref(dev, bus, &error_abort); return dev; diff --git a/hw/usb/bus.c b/hw/usb/bus.c index 7e7deaadcaf..f45b82c776d 100644 --- a/hw/usb/bus.c +++ b/hw/usb/bus.c @@ -662,7 +662,8 @@ USBDevice *usbdevice_create(const char *driver) return NULL; } - dev = f->usbdevice_init ? f->usbdevice_init() : usb_new(f->name); + dev = f->usbdevice_init ? f->usbdevice_init() + : USB_DEVICE(qdev_new(f->name)); if (!dev) { error_report("Failed to create USB device '%s'", f->name); return NULL; diff --git a/hw/usb/dev-serial.c b/hw/usb/dev-serial.c index a0821db902f..aa50a92e26f 100644 --- a/hw/usb/dev-serial.c +++ b/hw/usb/dev-serial.c @@ -624,7 +624,7 @@ static USBDevice *usb_braille_init(void) return NULL; } - dev = usb_new("usb-braille"); + dev = USB_DEVICE(qdev_new("usb-braille")); qdev_prop_set_chr(&dev->qdev, "chardev", cdrv); return dev; } From patchwork Sun Jan 12 22:16:43 2025 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: 856778 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1178926wrc; Sun, 12 Jan 2025 14:21:44 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU6oSNBfefE78LEMOn0nXzTu2hYpSDZjhyHBa4A7Tv8fLmdZ+6AP2pqX+RhSceOCZOXy5i4pg==@linaro.org X-Google-Smtp-Source: AGHT+IErRCz9I/6n+oPMwa0xoou35VBBFgkEeuVeHYLqKIpjUMCjWDYw6mKNHHzWgp8kfvvj8Hg1 X-Received: by 2002:a05:622a:130a:b0:467:5f95:679 with SMTP id d75a77b69052e-46c710e59bcmr272618021cf.42.1736720503936; Sun, 12 Jan 2025 14:21:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720503; cv=none; d=google.com; s=arc-20240605; b=gOnPDpjcwkYwmV+NBFfmP70FphqMXS2TYSlJ9hZ4sAxSwBKYqypxrnXQvf4aqJDmls 8/s4YJqmKRj5vLuhR3fvvZN/q+hdtuLVT333lQgfS1luvApQ+a6ls/0JEazHyJ471riq kx8UsbV7dEoM5cl5AEpHnXauWKIFfsj5GZ2wn6QB47x3gT1OZCzp29IrYyvtDCOtP9HK J66dIaL8i6+uqvXHZezd9zPfcE1eSbX5hJHliapiK2pNLJsdl73P0p16T22ZB/Ctb71l 8/CoXzevzR0KafRn8t62R6G3p1fZjncfTjdbZ1iDcBYRTmiZP3w9If5WAGIHM/N2hUbn fDNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=C/k//ojvQ0ecXxbrd+D/WoEqwCLOQehsHZqlLpHp/lg=; fh=HGG5jZNhe8Q+zQJ9+mddel2c/xsqW3vEoqbd78QYiOw=; b=d5ViRAeJ6G+8SkHSHTzNAEBPXOYGeVpNau3k29C6J1kVy/itCFYKq23SmrgPl7TaBQ P6eQ1pfCihA/R+gDSaf3ctN+HcWubS8dUzUZC3W4Tb2atlgg16bJdiGPisFKK4loaOl1 CjzfTrH7zR52XWMOQDFFqd0hcxcnBzpR2Wt+hhqXlSVdRa+I7qXxd0foqWNautRhlxuN 2mcm96Ke3nfSrdDwF1L400W+kAF7xi8SLEHdEgcwtsq/ZdtmZHUE61p33L/dYsyxM2Ql zKjDWnyv3eXdXc41XqXboRE7H+G8p5yyePMSg/aMU3S0CIfqyo2awNjWYf3j58O9VdGz UZ5Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Zdz+wGVw; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46c8734e13esi73770331cf.143.2025.01.12.14.21.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:21:43 -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=Zdz+wGVw; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6Hc-0007XB-Lk; Sun, 12 Jan 2025 17:18: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 1tX6HZ-0007W3-Ue for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:18:09 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6HW-0006Q2-QM for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:18:08 -0500 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-3863494591bso1955405f8f.1 for ; Sun, 12 Jan 2025 14:18:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720284; x=1737325084; darn=nongnu.org; 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=C/k//ojvQ0ecXxbrd+D/WoEqwCLOQehsHZqlLpHp/lg=; b=Zdz+wGVwxISvBTJQNzEwORjSRl2ftl5rqBmwZq9tbdVaPGeRv5FGyB8Ybhzf4cBtWK CzVXvpuc9EdYt3hR2CDhG7OIacEkilvvyObCR0ujG5jlvFmImqoDV19W44EKtVS0KEyn 1auMB7/xAXjnYlxC7pDm01gNoG49k5GLI//pPGxael6gbemK15Ym/fFz7JIQsOBLuFxj gL4MI27FzVpk+fVK39OIAoEzo7F2+BZrojPyyEFGnKpw0Hnk+uoPm2AlI6l34msbGAb9 k59JJEx5orWHfmCYQ/iq3o7W9d8OyU9qRo/D25KJJHY14r/7ssL+q8GGrgQNIDJzDUtd 1FWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720284; x=1737325084; 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=C/k//ojvQ0ecXxbrd+D/WoEqwCLOQehsHZqlLpHp/lg=; b=FidFEcTUi+QRPxsJkeGxbLrNdxa0LsZfl4pRzSVKpGvDebQXoicl2cK/3p9rHHVEpw jzhIBOhDYt5OBJQOFruzVBZX6CZ7qYsV9jjPNRo8EdoOtCJRae86ENPjRA8PmbFR4MhH KEfcQ77XDH4ipQmU7m+C4f1oDbgRP02FN064pSaz57uCus5pYWji8KafihtLFelj9ih7 dOruweNwAfcYMexyKLZR9VxuzR2qo3JVFdCZnpA6c7+cQwx0G1RGY/oMk7Udj9yJxJ4z 3EaaUBjsHCnA5IEVSA6+bopmqkRpaD7Zyb6LeGj6dPsm+K2yq7BynNZc9+h5SQM52y61 ae7w== X-Gm-Message-State: AOJu0YwPjxMQCxUiS1ldAYSLD6s7lV3p4VaNbr7nJvgn3Wym165eNTu/ UXPCvUq++rOvRF6/ZBr+CMmQfdmXhFs1czHhmsW9ZYEdiJOKMTCD+afnhg/9PiZf/FXHkPOYHfB zJ/4= X-Gm-Gg: ASbGncsLXykSBGtuqLUGP6rZYhCvhivvqS1q+ryHq/k/Q3fY4Odafe3FbSZxoNTWw0A NLai8oBphmdYYwkKi3PVgvdGfiu3D6FryKMIFHCihg7kMqpu9DK207XdDD5D/m6+PBHJVYTOZXH gsMDAv35Q+bkXrhyjqfQgwxX4Wh5cw4/ueSj9fEZQXlXhCgguKa8V9oN2kek391QYunLocHXjDC ESozXiQ5cnXLgJ1vpAYVL77i6Z+yVbvtDIPFKjsyi3Nd1+HQaDEGklb5iBGlIc4CSE2Zik/gOov eGTMNOzvRGT4PysSJKjxDRspWev6gN4= X-Received: by 2002:adf:a411:0:b0:38a:87cc:fbee with SMTP id ffacd0b85a97d-38a87ccfd10mr12095295f8f.14.1736720284392; Sun, 12 Jan 2025 14:18:04 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e4b7f86sm10605149f8f.67.2025.01.12.14.18.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:18:03 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Anton Johansson Subject: [PULL 07/49] hw/microblaze: Restrict MemoryRegionOps are implemented as 32-bit Date: Sun, 12 Jan 2025 23:16:43 +0100 Message-ID: <20250112221726.30206-8-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=philmd@linaro.org; helo=mail-wr1-x432.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 All these MemoryRegionOps read() and write() handlers are implemented expecting 32-bit accesses. Clarify that setting .impl.min/max_access_size fields. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Anton Johansson Message-Id: <20241105130431.22564-8-philmd@linaro.org> --- hw/intc/xilinx_intc.c | 4 ++++ hw/net/xilinx_ethlite.c | 4 ++++ hw/timer/xilinx_timer.c | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/hw/intc/xilinx_intc.c b/hw/intc/xilinx_intc.c index d99cf567aeb..6930f83907a 100644 --- a/hw/intc/xilinx_intc.c +++ b/hw/intc/xilinx_intc.c @@ -144,6 +144,10 @@ static const MemoryRegionOps pic_ops = { .read = pic_read, .write = pic_write, .endianness = DEVICE_NATIVE_ENDIAN, + .impl = { + .min_access_size = 4, + .max_access_size = 4, + }, .valid = { .min_access_size = 4, .max_access_size = 4 diff --git a/hw/net/xilinx_ethlite.c b/hw/net/xilinx_ethlite.c index 4c0c7fcae3e..88ab331acce 100644 --- a/hw/net/xilinx_ethlite.c +++ b/hw/net/xilinx_ethlite.c @@ -166,6 +166,10 @@ static const MemoryRegionOps eth_ops = { .read = eth_read, .write = eth_write, .endianness = DEVICE_NATIVE_ENDIAN, + .impl = { + .min_access_size = 4, + .max_access_size = 4, + }, .valid = { .min_access_size = 4, .max_access_size = 4 diff --git a/hw/timer/xilinx_timer.c b/hw/timer/xilinx_timer.c index 4955fe1b01b..6595cf5f517 100644 --- a/hw/timer/xilinx_timer.c +++ b/hw/timer/xilinx_timer.c @@ -193,6 +193,10 @@ static const MemoryRegionOps timer_ops = { .read = timer_read, .write = timer_write, .endianness = DEVICE_NATIVE_ENDIAN, + .impl = { + .min_access_size = 4, + .max_access_size = 4, + }, .valid = { .min_access_size = 4, .max_access_size = 4 From patchwork Sun Jan 12 22:16:44 2025 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: 856782 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1179112wrc; Sun, 12 Jan 2025 14:22:25 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV8KFK9nWubpD2PFEghkMMiPsrz1goZO5hd3Jpmkl05lO4oc9Ohu3QfsKpi6oHBTG8YvULFJA==@linaro.org X-Google-Smtp-Source: AGHT+IHOuGW8knF1IOvp5x0Kc10+C4fzKA18BcALr7aDWGtAf0JNKTWWj+i+tAEA41X0BRO4iPjd X-Received: by 2002:a05:6214:dcb:b0:6d4:243f:6c9c with SMTP id 6a1803df08f44-6df9b1cf2bbmr337837816d6.9.1736720545530; Sun, 12 Jan 2025 14:22:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720545; cv=none; d=google.com; s=arc-20240605; b=EjoqGF0HB81UptXiO6LWgn5Y+4rx+rxgMfsgMMWMWnS9VWMnliiRlC0wtfzYwcUpru 3WfwggG85DP047cdTZp9+Ao63Tl+aoIOnbXoTdrA7I2kTW+gk3ogd9jZ31wanl9i3IiY mChc1XCP8UeQCHVktQ+VoU1bFG2AkluJzg60a1WQeIlIMyws5FfY7KafnMRIv4p8tcmW es3tUVQZ+ULsDIQERJXgj+NbPY5q3yzACeK1fmBdjOLObY+Xsmudsx/M5lWhVQIMNZ0O 8o0swQjNKdGsQtcz0/eGUE+xhsZckDCDFBk6ygSR8kkKTgjw2vd6tRU5eHU0nMMFJRPE m0SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=tJHT3s1ONSG5jZqV20HBUz7r39y/ubJFRV+s022Q61U=; fh=lA8KdGRRCLcXxei5dR52XWsTSutqQE1F1yBegzCCPPE=; b=RlgyuZa9HZLuoyQiEicv3I+YeEaAgfmFir/7bgipodtGIpgotnWG7KOIlX7QY2EBl2 KheX9nfNjnw0aW3RqlRBbzGPIiOmuqMoZZzYQqwPAQg6AS/nh8Njq1C8sAPphPycucD4 WWQyDnfJCgj4RJllUfxC8mDUAWmwp1y6u2vlbzeb9vNj/cXAES/Ircmzdl16ACbYtwWT 1TluRgH//00ULrDqjYENuhN1iCH4w2rEC3NOVGpbgna2CnY9Jy736tuhYQLqEa1KlBtU VIoTXQ6s/96WxG/7JZuQIFF2L6BMy0GRxaWbExli9rQdS4DnnIdDafQAICYTXN4/S7F1 bJcQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GqsvR3Hw; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6e086a6e73csi34330266d6.389.2025.01.12.14.22.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:22:25 -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=GqsvR3Hw; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6He-0007Xu-Gx; Sun, 12 Jan 2025 17:18: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 1tX6Hc-0007XD-OP for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:18:12 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6Ha-0006Qe-JR for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:18:12 -0500 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-435f8f29f8aso26169995e9.2 for ; Sun, 12 Jan 2025 14:18:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720289; x=1737325089; darn=nongnu.org; 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=tJHT3s1ONSG5jZqV20HBUz7r39y/ubJFRV+s022Q61U=; b=GqsvR3HwWXDC7h9h1NKSOBlBWIxm+tVCIWqb3/Ysp58EBYIbR+tHj6SYo4iruOvIAR IsaDMaeFofLSvDJ6Rc6A/IJiEtIBijxNY1sXGjd5D8tQFHJ6zuqoFrk+SXQsllghITjZ Ad98IWN07geL4ayJlFDd31eVnSIApvh2rRAys9uee3NaljYKAmDOTpmM/0u0oPxiWup3 rIkBrDyqq4ACqzMUjt0PwPVhI+i6OyIB36+5BT/9VIC3+6mTEPJhAut0HzGBXv7I3J7m RX7GLDU9lFJaNiGDFs2Ue4ymadXGbFbQngYl/ZoSlocb1wYDwLf/ajefC6lJr62D0GZS hmfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720289; x=1737325089; 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=tJHT3s1ONSG5jZqV20HBUz7r39y/ubJFRV+s022Q61U=; b=XOXH983vV2LqJSz2zLKzj6jXb/z+hGw2x5md83WGngDWZD3MXjjT3oLSZeF8cxfhDs JfIyTxstYxvZGBNZCLNHv5xruqUn2tfP4BJduuPdVz4XcVlMunogOiRvlZJc+0UQqZgi l3TBn0jFaRUEK61PvWtMUlaZdkJ4IouzJ0INGxAT9VL5AxHtVPT54fKAirMa8T8To6nP YReIEhAEiUkSQupc1cZzvbMRBiNofQxvjojdVo/PLG6JoLUbRhEvWbJXP9gzIFPYW8Fe 7+GlwzkYXB5cWJAZzplRmKrzQ0lrNdvDtozgg1UF1dTeBGUw1JHGFIC7XTrY35N7NWMs o35A== X-Gm-Message-State: AOJu0Yz2QAMDd+5jjDWwLT6FaXAiKD+YEO0PQU3KacmSR2icqZu9WHL0 bAA+2T9Nzc3ubJq1qeWH6HTr9ZtwMIjT3Ifykf3MuJxicODUDAQwG1+AcXo/f61SGA6n6xqVU1u qIm4= X-Gm-Gg: ASbGncuJEyg/7SDW+VIDUg6ydzmmIYfr5i0IDPPhp+0SHllw1Z6l49/TP40BAgHfgn5 I0oU1Hwkd/GQu1BNZF7xPOzrOhu/q3lFe2j9qmvpUwQzVM5h+itQxOqulI3bdLsFRUy0MyHlgZu 7okHMb7V6LzWyS3d/vIm+gvTGghyqGaMtSu++Tp4Cei/uC2U4IVm+gpgdsSm76xH8epCjCYXLHP 67ooqsTN8IfCPPkfNGnC4OLws20/ddmsScOexJm6NAveYHIHjndB4dz1eV1Eu1j5FdOPWDgoq+x AMdJFGR63BwHyZNYem8bkc+gLEmKrds= X-Received: by 2002:a05:600c:1ca9:b0:435:136:75f6 with SMTP id 5b1f17b1804b1-436e2551d7bmr178901185e9.0.1736720288857; Sun, 12 Jan 2025 14:18:08 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e9e6251asm127625035e9.40.2025.01.12.14.18.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:18:08 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Edgar E. Iglesias" Subject: [PULL 08/49] hw/net/xilinx_ethlite: Map MDIO registers (as unimplemented) Date: Sun, 12 Jan 2025 23:16:44 +0100 Message-ID: <20250112221726.30206-9-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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 Rather than handling the MDIO registers as RAM, map them as unimplemented I/O within the device MR. The memory flat view becomes: (qemu) info mtree -f FlatView #0 Root memory region: system 0000000081000000-00000000810007e3 (prio 0, i/o): xlnx.xps-ethernetlite 00000000810007e4-00000000810007f3 (prio 0, i/o): ethlite.mdio 00000000810007f4-0000000081001fff (prio 0, i/o): xlnx.xps-ethernetlite @00000000000007f4 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Edgar E. Iglesias Message-Id: <20241112181044.92193-7-philmd@linaro.org> --- hw/net/xilinx_ethlite.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hw/net/xilinx_ethlite.c b/hw/net/xilinx_ethlite.c index 88ab331acce..442467abeb8 100644 --- a/hw/net/xilinx_ethlite.c +++ b/hw/net/xilinx_ethlite.c @@ -28,15 +28,18 @@ #include "qemu/osdep.h" #include "qemu/module.h" #include "qom/object.h" +#include "qapi/error.h" #include "exec/tswap.h" #include "hw/sysbus.h" #include "hw/irq.h" #include "hw/qdev-properties.h" +#include "hw/misc/unimp.h" #include "net/net.h" #include "trace.h" #define R_TX_BUF0 0 #define BUFSZ_MAX 0x07e4 +#define A_MDIO_BASE 0x07e4 #define R_TX_LEN0 (0x07f4 / 4) #define R_TX_GIE0 (0x07f8 / 4) #define R_TX_CTRL0 (0x07fc / 4) @@ -72,6 +75,7 @@ struct XlnxXpsEthLite uint32_t c_rx_pingpong; unsigned int port_index; /* dual port RAM index */ + UnimplementedDeviceState mdio; uint32_t regs[R_MAX]; }; @@ -232,6 +236,14 @@ static void xilinx_ethlite_realize(DeviceState *dev, Error **errp) { XlnxXpsEthLite *s = XILINX_ETHLITE(dev); + object_initialize_child(OBJECT(dev), "ethlite.mdio", &s->mdio, + TYPE_UNIMPLEMENTED_DEVICE); + qdev_prop_set_string(DEVICE(&s->mdio), "name", "ethlite.mdio"); + qdev_prop_set_uint64(DEVICE(&s->mdio), "size", 4 * 4); + sysbus_realize(SYS_BUS_DEVICE(&s->mdio), &error_fatal); + memory_region_add_subregion(&s->mmio, A_MDIO_BASE, + sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->mdio), 0)); + qemu_macaddr_default_if_unset(&s->conf.macaddr); s->nic = qemu_new_nic(&net_xilinx_ethlite_info, &s->conf, object_get_typename(OBJECT(dev)), dev->id, From patchwork Sun Jan 12 22:16:45 2025 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: 856801 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1179584wrc; Sun, 12 Jan 2025 14:24:41 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXwzsjRUENQQoKMM1HZJy6c8q7sATQDxYJj/qrCvtpreOf00LUsChX5bEOrr7++R4mbr4dLIw==@linaro.org X-Google-Smtp-Source: AGHT+IHSpRqcdVsd1JKZPWf09nE/ofedKckohRZyfIs2XVn3Xl8FZAbZT//bYFFI/ODeLseXO0FU X-Received: by 2002:a05:620a:1a0b:b0:7b6:f110:43d5 with SMTP id af79cd13be357-7bcd973a036mr2959309385a.18.1736720681249; Sun, 12 Jan 2025 14:24:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720681; cv=none; d=google.com; s=arc-20240605; b=Kd1SqgMjTX/gsLMC+JQMBA3n2RzWVFEHz7VX6HjTbXoVdnA5W2gBIbtiDsZ6AyrkdL Rw0iDQEp69Rl/bZ1sfL++5RDoxSpabyzO0532IG8L0Gfv+OtNOH/Ac5PDXPDcATAhztg 6j/ThhqBWf5OCnu/1fjg43rLJkDeivVRca1wyjeRUvp6BGFHz1i5oHubhWg1uQ/X5ys3 ly6Chh8iLHsqpsJ2mBCs6/u/2CE0yO+V1hDdTDPdAAZ/i3imX6H9DRbQGQ0mVrGscWmJ IRpKOXkEiOswZ8zMFdLnql1pp6q+9NwOwyz+4Dx3x6KLJ5mXkYtM74njfdcQWleyBN/u 4qOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=5FcvQxHKjjfdSZc8glJoiGuaRFxkcd8Ym5IYtsN/6Jw=; fh=lA8KdGRRCLcXxei5dR52XWsTSutqQE1F1yBegzCCPPE=; b=WI8+zMvgtZrY1QELe9L9HNDI/MnGA3zcrnuqX4n3a9wJt9PmEOwhznP2HKVfhQjh7B ij3HMlaRybRLEAtCjOx2usoSZjoRTKl6Elu/5HnjEswcFHm4mY8t8jmoQrCjYtf7VzMf JsnCvQnnND/P6YHhmSdZTOAceMrcLSv/W7THBznnRgpYWw4k3y6BMtNU26Y9HF1UChvF Z14Im7VBm19wqSkSaew5OIocWKhjv510fmtp3w4Y/ojNrSkqVxdIeOds3xQ0J3sXIffl mUIazOkZeHG92EfmBzevKoeXA6Y5meapD2pjr+ZuUwKekAETY43rNl5I3Q4/uNx2upnf eFEA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FgosoUDY; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7bce35048d3si958138985a.494.2025.01.12.14.24.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:24:41 -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=FgosoUDY; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6Hm-0007gw-1f; Sun, 12 Jan 2025 17:18:22 -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 1tX6Hk-0007du-39 for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:18:20 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6Hf-0006Qv-9u for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:18:19 -0500 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-385de59c1a0so1809026f8f.2 for ; Sun, 12 Jan 2025 14:18:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720293; x=1737325093; darn=nongnu.org; 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=5FcvQxHKjjfdSZc8glJoiGuaRFxkcd8Ym5IYtsN/6Jw=; b=FgosoUDYBZS2aq8EEArShRNojN2x4C+eAhk08xRTICbxfyJeYp3c8afii0poe5L4Jp QCXgEJMyrQFZrnmY8WZwVSo0Bi8utW5CIVSbypU+PlhbLsLr0ChVT/y2clScCAijGC2v 19jWGBZYFp4+lC+4gxQhPk/9pxyAsT7rXqIaUeqwu+M2F+5MVLxYeboJ8FZDfpxUgLeV C/FO8/zF6FqwcK2JdyDIYuuxSFmPRV3i32Ib7GrDORuf+bk72IVafNKZ7dRFzx0LrM38 581BgpRQT4gOsi9ekYQKicZrGFN03vLNvR65wSdWxBXbPg0FjNpdvmcLR4Rms+zamkYg InrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720293; x=1737325093; 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=5FcvQxHKjjfdSZc8glJoiGuaRFxkcd8Ym5IYtsN/6Jw=; b=jfYi8idkMMhl9UjOOM+fn7O41yqingqOk0b28YUDGBnExwsUaDS5LGSut3jjQQRCzl p7NP0qQQB5KCh3aoLFPNbz4c+1i0NjRBO8zc27S9Um1zIBHCcZzA39YxrdfgLan8z66s d6tic3MIeesU7daDxFuxfe+alDTw3LeH9XgAsfL+daU9dQCvsxV54LWcvRg2qnHzHkze wWsyLBJMy3vsYoVfNHtd5MWjh40hkWmJbAAmFNoQPoQ0EHcZHOrbBBrpq70bT0XG/+w+ IoMNmygFfqzrTxJckzqqmXJr/bS97LmcKOZeDExr4txqdFg1OA5pzTXPzOPxbmxbvaHB +VQA== X-Gm-Message-State: AOJu0YzEg6/F0npX1iveEhhxN6JLPqN/9O5dapxs3GelN6EmRZN4deCe EY6uHALPSxSfiDgUy69rbXaDY45GPzRPLaon7VcQ9MuB7ad5oVPgQpgR+Zbro7KRzKETWa7Qp4I IMp4= X-Gm-Gg: ASbGncvKXNnvQ8PAESlscuQRvETeW3veXDfaY/bM/EQNNrlvzbXvGf0m1ZLNrda3Q4R kZzFr7UFgCSkewgqPBBSPfkwOZs5xcLJbQLXZ08IIPm4FaCu9rejOvD5cNJvqf4qinvNoZrBGXl L6XGADgK2XTlyy4fzlJKW4xvSCYtpXu9GyPG90I1jZjXrldtvt0miDld9k3QdOmthb8ZYI4dXuZ qf2ocIaS0h3xfzGxiCzmeC4HRpsSzUBF/jQJlAUIDP3RzJ/gbf8CC2WbBZIx5eW7wgWT75NQLx6 X+4bBgF874gzMev4eXYK3H1GhSEmqRg= X-Received: by 2002:a5d:5f82:0:b0:385:e1a8:e28e with SMTP id ffacd0b85a97d-38a872faed5mr17067468f8f.10.1736720293328; Sun, 12 Jan 2025 14:18:13 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e4c1dc6sm10634910f8f.96.2025.01.12.14.18.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:18:12 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Edgar E. Iglesias" Subject: [PULL 09/49] hw/net/xilinx_ethlite: Introduce txbuf_ptr() helper Date: Sun, 12 Jan 2025 23:16:45 +0100 Message-ID: <20250112221726.30206-10-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=philmd@linaro.org; helo=mail-wr1-x432.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 For a particular physical address within the EthLite MMIO range, addr_to_port_index() returns which port is accessed. txbuf_ptr() points to the beginning of a (RAM) TX buffer within the device state. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Edgar E. Iglesias Message-Id: <20241112181044.92193-10-philmd@linaro.org> --- hw/net/xilinx_ethlite.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/hw/net/xilinx_ethlite.c b/hw/net/xilinx_ethlite.c index 442467abeb8..8df621904a1 100644 --- a/hw/net/xilinx_ethlite.c +++ b/hw/net/xilinx_ethlite.c @@ -27,6 +27,7 @@ #include "qemu/osdep.h" #include "qemu/module.h" +#include "qemu/bitops.h" #include "qom/object.h" #include "qapi/error.h" #include "exec/tswap.h" @@ -87,6 +88,18 @@ static inline void eth_pulse_irq(XlnxXpsEthLite *s) } } +static unsigned addr_to_port_index(hwaddr addr) +{ + return extract64(addr, 11, 1); +} + +static void *txbuf_ptr(XlnxXpsEthLite *s, unsigned port_index) +{ + unsigned int rxbase = port_index * (0x800 / 4); + + return &s->regs[rxbase + R_TX_BUF0]; +} + static uint64_t eth_read(void *opaque, hwaddr addr, unsigned int size) { @@ -119,6 +132,7 @@ eth_write(void *opaque, hwaddr addr, uint64_t val64, unsigned int size) { XlnxXpsEthLite *s = opaque; + unsigned int port_index = addr_to_port_index(addr); unsigned int base = 0; uint32_t value = val64; @@ -132,12 +146,12 @@ eth_write(void *opaque, hwaddr addr, if ((value & (CTRL_P | CTRL_S)) == CTRL_S) { qemu_send_packet(qemu_get_queue(s->nic), - (void *) &s->regs[base], + txbuf_ptr(s, port_index), s->regs[base + R_TX_LEN0]); if (s->regs[base + R_TX_CTRL0] & CTRL_I) eth_pulse_irq(s); } else if ((value & (CTRL_P | CTRL_S)) == (CTRL_P | CTRL_S)) { - memcpy(&s->conf.macaddr.a[0], &s->regs[base], 6); + memcpy(&s->conf.macaddr.a[0], txbuf_ptr(s, port_index), 6); if (s->regs[base + R_TX_CTRL0] & CTRL_I) eth_pulse_irq(s); } From patchwork Sun Jan 12 22:16:46 2025 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: 856815 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1179714wrc; Sun, 12 Jan 2025 14:25:22 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUz3YWzzB0YfvXQbR/PeOFrftJ+/CwigPd1nSaoJbnrx1etQ8OxzQY+PDPtWCJiTapq5omtgQ==@linaro.org X-Google-Smtp-Source: AGHT+IFWmhHyZ6KL3FqmUAPUzuGZVIMTDwCpIJeTOTZMAxcJjtxpU5UvP4LYECip+7AMMauUkHrl X-Received: by 2002:ac8:5910:0:b0:467:5da6:8096 with SMTP id d75a77b69052e-46c710e5731mr311084611cf.44.1736720722571; Sun, 12 Jan 2025 14:25:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720722; cv=none; d=google.com; s=arc-20240605; b=IRKZdeWYLMkr24aYQpvUJa5vMKgc+nW8/dFVDjjYMbcICnAKCNygxoCUbv5sgqI+jq FxZGOZDcq0JRNstzTh5CT7BEEvrcauOgmqAZsFlqj9rSCnD8F8r+iYqM6KxhGuFEDCOo QCZJnq8Ur/J0NAP7wRTa8NEAOsWwfBseqv4twDgopRYitP6YklCjiYLbtR0OWeYWFFJw j1sDZz/HLRJc/JccGIn47Vjsn2aXUiDL5Ry1p3Jnx60Fg3rHTe7r8HWPRi4IExTB/b7+ Dhy5UmFIp69yTZ+vF/cF7kW6i2BBoS6n6r9fVK1CwIiAk4bZhKPM8ZepAnrVMMHGZq5+ SpBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=Ns13WgDbPYyZM/L1QpNS/fo2t3Mk0eblekogE1hWgpE=; fh=lA8KdGRRCLcXxei5dR52XWsTSutqQE1F1yBegzCCPPE=; b=SOFEMMvt3vON6iurdAM+jyyiqeaDfTgbhtQrGDKBwWzskurmX1XQux/+TfgwyrA7dQ Si35Miu84/bvHtm09SEaW2YhwH/cgfMPH+vC3FTh5z+IZYyMMxceTOUrZGjy0IMBmFwg jgeqvKzu8mlRbcCRpkeQZdVsIwhi3d+hHpuWgYkOJyQOOejLSQOriB/hjJMBig3EFije vYuvqn4+f0U71XDp+BaXXyGvOWPEoUTPfw7mbU7I5mAEZjhNRd1CCX00AcAw+7zOiHXJ Xy6CbjNdXR17J6d3jX+rn3INz2p3DKfYKDI0z4GFB9JtjJvZloijMUkfQ9DZ9CJQm1tP p0rw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IIwMgKp0; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46c873fe83csi77454021cf.457.2025.01.12.14.25.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:25:22 -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=IIwMgKp0; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6Hn-0007hl-SJ; Sun, 12 Jan 2025 17:18:23 -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 1tX6Hm-0007hB-Gh for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:18:22 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6Hk-0006R5-Or for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:18:22 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-43635796b48so22728685e9.0 for ; Sun, 12 Jan 2025 14:18:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720299; x=1737325099; darn=nongnu.org; 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=Ns13WgDbPYyZM/L1QpNS/fo2t3Mk0eblekogE1hWgpE=; b=IIwMgKp0Km7fFdvbVx08dCYVLUgr0IjdLs4+Pvd+bxqs37WGzzoKOOMu2jxms5NRs8 96Wlvn6/iJfMpdhci6bgFVt7ZmOlEsuHahsmg2yuDKtZB2fcFwCL96Ni2DdNcnfqMMFx joLbnVVP9/pK2Sy2coqtzg9t2eEGJsXvRk4eP/f7/nH2GBPDuEjbNOBe726kItT+YTPy CgwbU+wVd4eKoIyAkpxh6bhQixmX5HzAwt2wZg2b4rw90EGniULOUVWw/TLwzvrsmrde 8zZ52uMcTopa/ek2VrnVkC2hfE/qmmRkgrh+IE+1vUUzYfApd+PQMjBSm+cjZwgptNfO /QKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720299; x=1737325099; 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=Ns13WgDbPYyZM/L1QpNS/fo2t3Mk0eblekogE1hWgpE=; b=Xl/PINbRVgTzeKFxOvDfNCVHqyMUrCNxoeHoZ8UBBH6aOYVSJt95EuESiZjositoOH 2mCQsBRHuV5LjVQcni+iFqWAxa8rhxM3iWTXZObTW2Rq196SULSngm4ajSLS0a7OYxot ZRYPBwrhQ22je66CFOR2toKQ6TjoAERRE0vBpUO6qJJN0zHgOnhmxJFcLMo0N+dYHUsI oMvdgoTE1zwbUDHO5estKFICKmiWwEaQ5QsRJno1w9Dajs5sRbz8o0w7iRghLh70I9OL 4CbzT4t/Enh/E4csOeyqBgIGObv/guy2pSgNLu72FU7KHDF8g3dHE8VKQ3qtn35CN47W uIOQ== X-Gm-Message-State: AOJu0YyeHAZN6s/s5CXQOga5EK77Cn2kNLwlloSfidAtH2UW36DxUGcR wGM/TKcEmz9ctevoLb1E9VZlFAiIoeLL/yeaf9yle0VW80Uw0M6A/B4bficLpUpkiK9JbnfbXTj Vj58= X-Gm-Gg: ASbGncvHcNTnW1LUzfwsZHbvHe82njqfGs+DoPQgOBCogFukmgYWOFpITsBtTXyUulw Hx2Ms52HudmTb48MVP13i0FvYZz027QKxNbY/LMPu+rn3T2jR40nGukBQRsczA3Hiy58dSPOBOA jbOVCbOHMiX8rAKv0ze8smFJ7Uw4gcCvbtPNcG4lvEpuVCfPNZGhjbUCLmdW5e55hoDu357bvN+ /OOMzpVmDGPEOp1D4bMdNKZuZqXX5Fyokx++HIUgAWehGdCA7PtJWqZOAxPxrmv+XHpb60NFu1Y tFSVlprHYz5aC8qi5xUShcR8UJlO03I= X-Received: by 2002:a05:600c:1d02:b0:434:e69c:d338 with SMTP id 5b1f17b1804b1-436e9d6ff89mr105271845e9.5.1736720298922; Sun, 12 Jan 2025 14:18:18 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e9d8fc81sm124720305e9.5.2025.01.12.14.18.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:18:18 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Edgar E. Iglesias" Subject: [PULL 10/49] hw/net/xilinx_ethlite: Introduce rxbuf_ptr() helper Date: Sun, 12 Jan 2025 23:16:46 +0100 Message-ID: <20250112221726.30206-11-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.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 rxbuf_ptr() points to the beginning of a (RAM) RX buffer within the device state. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Edgar E. Iglesias Message-Id: <20241112181044.92193-11-philmd@linaro.org> --- hw/net/xilinx_ethlite.c | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/hw/net/xilinx_ethlite.c b/hw/net/xilinx_ethlite.c index 8df621904a1..67adecc0883 100644 --- a/hw/net/xilinx_ethlite.c +++ b/hw/net/xilinx_ethlite.c @@ -60,6 +60,12 @@ #define CTRL_P 0x2 #define CTRL_S 0x1 +typedef struct XlnxXpsEthLitePort { + struct { + uint32_t rx_ctrl; + } reg; +} XlnxXpsEthLitePort; + #define TYPE_XILINX_ETHLITE "xlnx.xps-ethernetlite" OBJECT_DECLARE_SIMPLE_TYPE(XlnxXpsEthLite, XILINX_ETHLITE) @@ -77,6 +83,7 @@ struct XlnxXpsEthLite unsigned int port_index; /* dual port RAM index */ UnimplementedDeviceState mdio; + XlnxXpsEthLitePort port[2]; uint32_t regs[R_MAX]; }; @@ -100,10 +107,18 @@ static void *txbuf_ptr(XlnxXpsEthLite *s, unsigned port_index) return &s->regs[rxbase + R_TX_BUF0]; } +static void *rxbuf_ptr(XlnxXpsEthLite *s, unsigned port_index) +{ + unsigned int rxbase = port_index * (0x800 / 4); + + return &s->regs[rxbase + R_RX_BUF0]; +} + static uint64_t eth_read(void *opaque, hwaddr addr, unsigned int size) { XlnxXpsEthLite *s = opaque; + unsigned port_index = addr_to_port_index(addr); uint32_t r = 0; addr >>= 2; @@ -115,9 +130,12 @@ eth_read(void *opaque, hwaddr addr, unsigned int size) case R_TX_LEN1: case R_TX_CTRL1: case R_TX_CTRL0: + r = s->regs[addr]; + break; + case R_RX_CTRL1: case R_RX_CTRL0: - r = s->regs[addr]; + r = s->port[port_index].reg.rx_ctrl; break; default: @@ -167,7 +185,9 @@ eth_write(void *opaque, hwaddr addr, if (!(value & CTRL_S)) { qemu_flush_queued_packets(qemu_get_queue(s->nic)); } - /* fall through */ + s->port[port_index].reg.rx_ctrl = value; + break; + case R_TX_LEN0: case R_TX_LEN1: case R_TX_GIE0: @@ -197,22 +217,21 @@ static const MemoryRegionOps eth_ops = { static bool eth_can_rx(NetClientState *nc) { XlnxXpsEthLite *s = qemu_get_nic_opaque(nc); - unsigned int rxbase = s->port_index * (0x800 / 4); - return !(s->regs[rxbase + R_RX_CTRL0] & CTRL_S); + return !(s->port[s->port_index].reg.rx_ctrl & CTRL_S); } static ssize_t eth_rx(NetClientState *nc, const uint8_t *buf, size_t size) { XlnxXpsEthLite *s = qemu_get_nic_opaque(nc); - unsigned int rxbase = s->port_index * (0x800 / 4); + unsigned int port_index = s->port_index; /* DA filter. */ if (!(buf[0] & 0x80) && memcmp(&s->conf.macaddr.a[0], buf, 6)) return size; - if (s->regs[rxbase + R_RX_CTRL0] & CTRL_S) { - trace_ethlite_pkt_lost(s->regs[R_RX_CTRL0]); + if (s->port[port_index].reg.rx_ctrl & CTRL_S) { + trace_ethlite_pkt_lost(s->port[port_index].reg.rx_ctrl); return -1; } @@ -220,10 +239,10 @@ static ssize_t eth_rx(NetClientState *nc, const uint8_t *buf, size_t size) trace_ethlite_pkt_size_too_big(size); return -1; } - memcpy(&s->regs[rxbase + R_RX_BUF0], buf, size); + memcpy(rxbuf_ptr(s, port_index), buf, size); - s->regs[rxbase + R_RX_CTRL0] |= CTRL_S; - if (s->regs[R_RX_CTRL0] & CTRL_I) { + s->port[port_index].reg.rx_ctrl |= CTRL_S; + if (s->port[port_index].reg.rx_ctrl & CTRL_I) { eth_pulse_irq(s); } From patchwork Sun Jan 12 22:16:47 2025 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: 856777 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1178509wrc; Sun, 12 Jan 2025 14:19:45 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWYL0NvupJqxCRA509LYYF57tTn3GAo1nEavs0mElwcjAXaxwFHyIW18dKo5IQls+lEN67VHQ==@linaro.org X-Google-Smtp-Source: AGHT+IFyDhrQfWbOIe2j8JjDNnrvtsEmYoRHRanBI6HL1sp3kgrqHBt8jgdJZ03S2L1l/mUR5ZiD X-Received: by 2002:ac8:661a:0:b0:46c:729a:a5b with SMTP id d75a77b69052e-46c729a0aaemr225198671cf.28.1736720385210; Sun, 12 Jan 2025 14:19:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720385; cv=none; d=google.com; s=arc-20240605; b=CQzBAp7Vu1sJE9ZSOkyVE4KQ73ZLcnzvJzbtAP9wFuOl01MGVpvti/nwye/69YhG5S 3yyFlpG8Bg+LT4NqfQQpzUr6fhufZfL11PX9ZO4CV8Ox6GyH+bnx+cOJrIeBxzroCev6 NlK+bN+9jk3EGfzGAsAfQQX/3lGHfmKeqZhLoeV7eonk6ICPiQPGNQr2HIpL/L/5clfT LLniJ8RWBmL6OPE0GVyqOBhQXV9IBu/GiIijULxwK2Hlkf6ioJXOBnqDGgNgrgc6VPQZ VARCgmPsB27QA92LuRqibotgyliuaOil7mi48f94pWNjWGONneN47STPyV/1RZUI2hIG oqXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=bKRlKfb7zopcYrD4FgGjVB3vpdu4ZxJ/hnGTdUI9hkE=; fh=lA8KdGRRCLcXxei5dR52XWsTSutqQE1F1yBegzCCPPE=; b=BXbmAixEzL9u6wQ/UZBxfZSuM8t2QqLH59DETxtTLjLXXdoPslKmbzNu/dcooQfOFG b/Z1vqyklX3VXqk4MK2dq39TAf0O57R3rCm7xBmuj3e1XSTjts0ILpQESh0vFEqwXvC5 sYr5xzL+QK0u+ze3zC5E3V/gAqMjw9uBTG14ubl/SDF7vwhNfOw2krQHHXn7oo76VttF JkFrHcK7LziCd3pByPfW3e66L+JrjXzi/2VNnbNNc6vFVkNCE9Gx534AhignrwJgjoep p7GyaBQq1K62XXDGoPQ31DDjR4KX1x0rv5EIWwHjJtsXK7mOKBMRJj3vkqlfvdORNB6g FSfw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vXwUyyS8; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46c87417992si73023061cf.593.2025.01.12.14.19.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:19:45 -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=vXwUyyS8; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6Hu-0007ot-2L; Sun, 12 Jan 2025 17:18:30 -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 1tX6Hs-0007mv-Et for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:18:28 -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 1tX6Hq-0006RV-Nd for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:18:27 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-385e0e224cbso1929149f8f.2 for ; Sun, 12 Jan 2025 14:18:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720305; x=1737325105; darn=nongnu.org; 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=bKRlKfb7zopcYrD4FgGjVB3vpdu4ZxJ/hnGTdUI9hkE=; b=vXwUyyS8y728nz+0DTj1RhxAZimXUaPy1KM8CB7yzzjmf+0JNrdSJI7+X+f186Et+n 0k1MJeLEKwbD+3iFxVjRoW5gb9XxwvhorLCtEDorjZoqCvQFetXXzMLtecBj/zE7bEle O2eDgmm6jXCtHDK6azTnkBwQKzVq7UNgw0fYM1bP3hjLn1s/kWvRLq6XCVRU8B1hFR28 mReRYBF1ClHtN+V9dydTo5/kY9JexYiUynqvRi/tsTFSC/uZsbBXpZVOZfiHnEwWBiT0 bU/BefdpnfKcHnooSfRwsV2sVIgScM8b855SUjQY+uEcRAmuxO+JjM5raV30kvGoRvxj W6+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720305; x=1737325105; 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=bKRlKfb7zopcYrD4FgGjVB3vpdu4ZxJ/hnGTdUI9hkE=; b=kaGi+RK0aJKrsrPE+lHSMOUTTuj5yKAPu96Fg6PN3M5U2wSqxQhNicWVTovV5caL8Q WTYWV63eER9OAi2GuBxomT41XfrrTuV1VAIUIre3YmqjCjxAo/z2R1koscZ+fqAt7MmC hotXbwsm88EjmSRRdoUSiY9o1HnTlYB7AsM90pBy7MIJfHKYbF0eD94600sDZExm9yrV Vs2MJrMe3KdItSP/m1/YHk4jdu/UcBD4XlyRMvMQAcLJcFbj9AS4QlId+qXuAYB85wq9 HZljJkBexMMlHjYbKA6JKdkf0I2U079p2zTyv/mzlMSjgW/YIBHvSjZ54lUsxEkDQBsM IIpA== X-Gm-Message-State: AOJu0YydX8ENdJF+qEsFGZ2OXGi0y72nXOPzn9ItY/33JeKzN6FHxR7i TcKfHM5FK6EZqZFDgStGDnDRiW8FITwL0EWfGAwJ4/oKtnBJvHYDXKKAd8waKc5KW5b2Y2ifmLq kKi4= X-Gm-Gg: ASbGncsWzLGUBibct9763I+8Thvpmr9vBvqLfEGFIazPm/jw/x1lfWG2whTLW8LBrF+ HbUJGQIaBRhqC60iN75n8evfNKac70J1vg9d6FxOx5GLFZPf9QTWo6TA4/BdyUib6El29R6g3XP W/pFd4trR23eUVaU72fQM67H/j0jbRski78oFTsAC1c1rtKr3gy+aH1lYwQc8NYLSBG4RHu+Pip MnWEfAEdFngwKQ7T4iLSvKLgJ68TnEo2eddT5ccPcEDYUY8LkHzvJd8ALmKNbjwx8u8D7xIJ4HZ aEjBKy/Ub5M3uQjfkbpF4vSpyzThdZo= X-Received: by 2002:a5d:64a1:0:b0:38a:4b8a:ffec with SMTP id ffacd0b85a97d-38a872ef24cmr16298372f8f.33.1736720304863; Sun, 12 Jan 2025 14:18:24 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e38d013sm10779861f8f.58.2025.01.12.14.18.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:18:23 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Edgar E. Iglesias" Subject: [PULL 11/49] hw/net/xilinx_ethlite: Access TX_GIE register for each port Date: Sun, 12 Jan 2025 23:16:47 +0100 Message-ID: <20250112221726.30206-12-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-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=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 Rather than accessing the registers within the mixed RAM/MMIO region as indexed register, declare a per-port TX_GIE. This will help to map the RAM as RAM (keeping MMIO as MMIO) in few commits. Previous s->regs[R_TX_GIE0] and s->regs[R_TX_GIE1] are now unused. Not a concern, this array will soon disappear. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Edgar E. Iglesias Message-Id: <20241112181044.92193-13-philmd@linaro.org> --- hw/net/xilinx_ethlite.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/hw/net/xilinx_ethlite.c b/hw/net/xilinx_ethlite.c index 67adecc0883..3252c9d508a 100644 --- a/hw/net/xilinx_ethlite.c +++ b/hw/net/xilinx_ethlite.c @@ -62,6 +62,8 @@ typedef struct XlnxXpsEthLitePort { struct { + uint32_t tx_gie; + uint32_t rx_ctrl; } reg; } XlnxXpsEthLitePort; @@ -90,7 +92,7 @@ struct XlnxXpsEthLite static inline void eth_pulse_irq(XlnxXpsEthLite *s) { /* Only the first gie reg is active. */ - if (s->regs[R_TX_GIE0] & GIE_GIE) { + if (s->port[0].reg.tx_gie & GIE_GIE) { qemu_irq_pulse(s->irq); } } @@ -126,6 +128,9 @@ eth_read(void *opaque, hwaddr addr, unsigned int size) switch (addr) { case R_TX_GIE0: + r = s->port[port_index].reg.tx_gie; + break; + case R_TX_LEN0: case R_TX_LEN1: case R_TX_CTRL1: @@ -190,10 +195,13 @@ eth_write(void *opaque, hwaddr addr, case R_TX_LEN0: case R_TX_LEN1: - case R_TX_GIE0: s->regs[addr] = value; break; + case R_TX_GIE0: + s->port[port_index].reg.tx_gie = value; + break; + default: s->regs[addr] = tswap32(value); break; From patchwork Sun Jan 12 22:16:48 2025 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: 856779 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1178929wrc; Sun, 12 Jan 2025 14:21:44 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUy5lKs26QMXizJ7WaNj6Q4qFph6vtY3KBEuS6bNGnNcYtwwJN8TFWWQ73Zzrk+kbSmtSu8EQ==@linaro.org X-Google-Smtp-Source: AGHT+IHdBsufmtBnHBRWr/wixjZjZy54kzk7q5RoZOfLCnR2Kig0mes7qf2IJ7Czrh/zFR8EDuUZ X-Received: by 2002:a05:620a:a10f:b0:7b8:5520:1888 with SMTP id af79cd13be357-7bcd97b87c9mr2465450685a.57.1736720504362; Sun, 12 Jan 2025 14:21:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720504; cv=none; d=google.com; s=arc-20240605; b=dsuPdaihVW5f/nvbw8KMNeEIbnltAq0dHX0DSYw8spHyHlK6LYOkue4AYxQXfXQduR WSRgGhTysYkQoII5mD65sIPY6P8xEbiF2PPtqAfzNvsCYzgGjI/e697pu4XOy6jDBG5I THZKeelgDGpljMxN1QjKPSMiHKgTGxiew17tzJlPSfBFMXEuzGv/wzvjdO6vGAe1yWul i81/wdEoRqNsQIkBLwCPR9e2V9BnU/CKRDMnBscfacSWDdm7JqvqUhfzuMUtvkNALSR5 x5LNP9TcZsC3Ns+DEgvgytlCpnTKgoZ2LNFWfDKJSnPRd+Vp2utakLRLml57MK4JCcd3 hgFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=2Bp5G8urywZcUZ8mpuup1anSVqL83TQbEqLWjAWe4bw=; fh=lA8KdGRRCLcXxei5dR52XWsTSutqQE1F1yBegzCCPPE=; b=irquoKERlBgXh9CkARMnbQmZevLHLsNdZR+S1nBqfeb+6Bg5gKbz+E11QelZh+Rrgn iPC7fbqRLvuVxDepSFpm2zMJhlX3NyRq/FTUWA3grfxzJsX93dxNO5LbMbs0DtM/eWSz ZN469uBrKCywSk8lBAZKWHoq6cuGosbxU+g1WSOsTl7/CI4xVswul3JXW8aohF9X46dQ BZHF6EEmC63ubtvgrgpJqYVTtTLaVaALchKrIKcC5yL9y825TT3wpLHWw7W3MBzZdu4B ikAf692AcxhXvCFEU0Q/jcaiUHS85Fm26N6ryAFY/k01wsKR5pSObwlL2jFwq1l9EHmF 8WQA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qw7ghaXu; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7bce3307575si1031025385a.251.2025.01.12.14.21.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:21:44 -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=qw7ghaXu; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6I1-00081Q-Lw; Sun, 12 Jan 2025 17:18:37 -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 1tX6Hx-0007w7-JH for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:18:33 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6Hw-0006Rh-3v for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:18:33 -0500 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-385f06d0c8eso1948846f8f.0 for ; Sun, 12 Jan 2025 14:18:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720310; x=1737325110; darn=nongnu.org; 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=2Bp5G8urywZcUZ8mpuup1anSVqL83TQbEqLWjAWe4bw=; b=qw7ghaXu9+NLWQnDA1s1+6oVv2S7ofC80BYaT6pMvxjcUKSffJFjTV7JGM7OMz1ZyO LXOsRoJzgsxqfYtwqk+QLkpP993bLHp2S/1vV293GNXaMQY5TkVCcRXjzldDPW7h1Y6x Xh/XydVPJ0PCLqmAMor+SHDkBx69T1UoDpIVppM6HRmmVfcH1ZU7GsSFUUdK0KmLER1k Ga93hUF4VAXHb87ekHjvOc1iXP1sEPeQtXEpXpLVBN1vAXL2U/JRX4pwba3BaA4Kr5/D 9qnlcUns6jg9430G6ORQQWkj2mz8p5BTAiuklG9lR/j+niHfOl1wRmxg3284Qgpic517 L+/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720310; x=1737325110; 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=2Bp5G8urywZcUZ8mpuup1anSVqL83TQbEqLWjAWe4bw=; b=ad8owRIlu/O4wlZG8Kz+OqaSF7na8zEUmzlgbV+2VuZxQWmZnIhZust7frSp0MwUPz 3eKP+DMKwBrcFLQRdqavj70+o7Nnflf6dY1y0uE0mtQL0pPuCnq5Uyicxn/AEgvutx2D fhia04LiN55XHj2Y6lCeWGO0c5m7xJiWYOqEVIzQTn2qEwAoH/b3kd57ZJH6EbNyyKR8 s9JnJ8daP675BlUO2vTlolFxxGF/aZbtDzJABSumqJTuhkyaz3HFqxfKAoW+T9aRh7rq 76EPU8DY9Khm2h50CytbtxsfIkCkS9/TxuIhvliWowfPGj2HOxMkeXNLa++mxelAxF7u +0gQ== X-Gm-Message-State: AOJu0YyF81YDl8mmysbK3aKwV8s8GXUQfuh5zXFn3CICcTbNRal8OW1H OVhWxT/j42QyahmJj0Rrv5bUJpwAvTxhXwaRVsYwMyowPwpteaOwBL9Eo2Mti69+dsnmqZWPQNg nJE8= X-Gm-Gg: ASbGnctNw7ZKUBuIHX+SMmzTmHRGVtZIaHdgwT1xYQ78TdanmIBWy6LT9GIlYduNkEI 7ccvqwRdTvXf7wLOeyl+SdBoaQW63dUlY4ednT8nsERcIea0583qia2XtvH5qKPLjGKdZ19kRP7 0w43RM8mBKBzeQg98ZerTl2SQvvt1qxnJsWwjsPk0giQS8fTdZTulo/U+JPcVz7Rfqi4zE1iynD lLKuXYMwH8pl/2afjp/FkhCvZ5O/hmxTiOvKu/uGhagEt1gP3M1s+xRhZPu6V54ojgfQvi+Yt6p TntMibiF4R65u8CwQy8KBv1zwapM5QQ= X-Received: by 2002:a5d:584d:0:b0:386:4a16:dad7 with SMTP id ffacd0b85a97d-38a872d2a33mr17436794f8f.10.1736720309997; Sun, 12 Jan 2025 14:18:29 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e383654sm10762987f8f.30.2025.01.12.14.18.28 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:18:28 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Edgar E. Iglesias" Subject: [PULL 12/49] hw/net/xilinx_ethlite: Access TX_LEN register for each port Date: Sun, 12 Jan 2025 23:16:48 +0100 Message-ID: <20250112221726.30206-13-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.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 Rather than accessing the registers within the mixed RAM/MMIO region as indexed register, declare a per-port TX_LEN. This will help to map the RAM as RAM (keeping MMIO as MMIO) in few commits. Previous s->regs[R_TX_LEN0] and s->regs[R_TX_LEN1] are now unused. Not a concern, this array will soon disappear. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Edgar E. Iglesias Message-Id: <20241112181044.92193-14-philmd@linaro.org> --- hw/net/xilinx_ethlite.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/net/xilinx_ethlite.c b/hw/net/xilinx_ethlite.c index 3252c9d508a..ce9555bd1e2 100644 --- a/hw/net/xilinx_ethlite.c +++ b/hw/net/xilinx_ethlite.c @@ -62,6 +62,7 @@ typedef struct XlnxXpsEthLitePort { struct { + uint32_t tx_len; uint32_t tx_gie; uint32_t rx_ctrl; @@ -133,6 +134,9 @@ eth_read(void *opaque, hwaddr addr, unsigned int size) case R_TX_LEN0: case R_TX_LEN1: + r = s->port[port_index].reg.tx_len; + break; + case R_TX_CTRL1: case R_TX_CTRL0: r = s->regs[addr]; @@ -170,7 +174,7 @@ eth_write(void *opaque, hwaddr addr, if ((value & (CTRL_P | CTRL_S)) == CTRL_S) { qemu_send_packet(qemu_get_queue(s->nic), txbuf_ptr(s, port_index), - s->regs[base + R_TX_LEN0]); + s->port[port_index].reg.tx_len); if (s->regs[base + R_TX_CTRL0] & CTRL_I) eth_pulse_irq(s); } else if ((value & (CTRL_P | CTRL_S)) == (CTRL_P | CTRL_S)) { @@ -195,7 +199,7 @@ eth_write(void *opaque, hwaddr addr, case R_TX_LEN0: case R_TX_LEN1: - s->regs[addr] = value; + s->port[port_index].reg.tx_len = value; break; case R_TX_GIE0: From patchwork Sun Jan 12 22:16:49 2025 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: 856774 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1178331wrc; Sun, 12 Jan 2025 14:18:56 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU/JQy6tT5NdW3utyFVXfgp6yXqs8tFRQ5D3c7pt4ng+jZNUW/LqGW7BQ9asG7N8D4qKdpJ4w==@linaro.org X-Google-Smtp-Source: AGHT+IEETXS52dp14Pvr/sRNXFoVgFhNQSpPS7011HH/VttuAEbAeNOa1RuYmRJkA/JcduTBtCe/ X-Received: by 2002:a05:620a:618c:b0:7b6:d959:59e with SMTP id af79cd13be357-7bcd9727b17mr2758492585a.3.1736720335953; Sun, 12 Jan 2025 14:18:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720335; cv=none; d=google.com; s=arc-20240605; b=IZkBUra3KNcjRTZnxrKcO9SLiTT3lgzejyZ2qULfRx+fT2tstQtm5hoLrd/dLiMWxJ QUZdKyWZivj0cEHb08jyYONXR6D+QawyMgsTVV5AFcQYJgb5tttI1rJt6a3+772fRBIg cVzab9OULBnK9+B5e1KiwjHFbdFgatZZA/Ada0utr52Hr6H9vXnTY7Ot49Bm0wvBYzws UgSBtFfxxdjVtJDWGNcofO//HJauoeXQL7znc6PMkY0kp9FjYwbQvTyUw2LKoiAfEuXn 7XJ6woqCP2hj1S4Hzxe/537hg9tCZJeX6cwuhGHfYdQpCrpc5rYViG31lWlIsHSCANBC UYsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=mVeyTCl5h3W5QLqThsMAAyK0yBMC4OoyGuT39cU7uug=; fh=lA8KdGRRCLcXxei5dR52XWsTSutqQE1F1yBegzCCPPE=; b=IfwcNZgm5mk06QJYO3ZIzUbi/+f0Rtn8Bjh15nZvj6MjIVA+UPQPVjAuTnrGQNvqiK vdMu8XzEOqzgTDD3J+MlL9jz3peZqrs/jfJCfuJqgJbEGmqsWwh5pVXdw52d5QiR/tVH WVTcpq/cRHsHkrjJOIsrtlM9jikRTHIWbt4fa7IQU34MCO4YCe9sG9uA4lAmzu1BuI0k VFEtlniWjUANmBbc4cvF1zIUP97bK9vIQLdlpag97CbfWEBWZv/2dQfXaadXFCWXkmU2 i+qKeURBKsxwJsqIRnL8ZCHfGVueURVJO5OSPlkYCihqgtsOyPNtyukWVvZUMGHRorSJ uYcQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ixAPpkFU; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6dfade98240si73664916d6.191.2025.01.12.14.18.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:18: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=ixAPpkFU; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6IF-0008UN-Ro; Sun, 12 Jan 2025 17:18:52 -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 1tX6I3-0008BH-7o for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:18:39 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6I0-0006Rx-IO for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:18:38 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-385e0e224cbso1929169f8f.2 for ; Sun, 12 Jan 2025 14:18:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720314; x=1737325114; darn=nongnu.org; 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=mVeyTCl5h3W5QLqThsMAAyK0yBMC4OoyGuT39cU7uug=; b=ixAPpkFURUEnseLhNEAXrI7X4vSsLNO+3g7d+SIB1RS2g5tj5l8jRoUICjzIsmdFoA Sot2cQlaje4o0fode5tC6CHhPATHZezdJvf6hXb9lhzORNt0CmZ0oIS/wspLY6EKRpju aS0goXPVWgr4ns8WyklJeTf5hZC6mJtFdE3FF01UmXp5Pdc5jcHyInVIdvr3AN6N9Cwj qvdlhdSDBtSFGvltGBwDjA/RmCsOy2hcQsuACJpCDfwzsQ0dd78J0GscSxfxfXGCtEcb 5YszwGqAsTOUOccYkOksnraeWBGoC3Gtk3dC+kfBYSdRKBA950ItAoj8Mw5ntqsH8Htt bxsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720314; x=1737325114; 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=mVeyTCl5h3W5QLqThsMAAyK0yBMC4OoyGuT39cU7uug=; b=ZczMJWOiEKWhIrgpve7PDWiMjietF6SO7D4lHqt0mYcTivFHNpMVAZ45j+vY+/ZnkK UpGHwFhyywdHRjbuOr2O17h3hLSeRzEs7DTNcCiRyzDiVK1Pq/DsPvgsKQOjbP8DuaWE WudryAowmNNCw4nqAYPx+LspBwyHo6pMvnt6VF+fxqeXsaELqiyS52/2g57zRCH5GPFB gyDmTXuGy6LQLFsvHwWHp3FNSEp4gdgtHRbiK8nhokX80dEoJr/K8O6LsXS02QQ0qmrq yQQljczXrwKkPjUsAIcrbGBXmOpQiQiTBjpQUjndG6UclNAEonDzfyjPP9ocmOaNqQRs HQBg== X-Gm-Message-State: AOJu0YzHSfIDiAudcGG0weekQx0CcJxemR7Ftmq4FQ9x10j8jhNzgCdp fb4u94kZfW79pAZ8LdqrTU0FC7DTSX4di7dw5vTEeIUAoNoTkZCcvLNXHE2xcT2CzywbqlA808f vDNc= X-Gm-Gg: ASbGncvfGwwGcjtH4LvFS5PRtRPjboS6aEayMurDVridZRle5LRNhTzFsBrtNaiB9sM IG0WAMl0D/TVvnjdXz968A7+Uc4ldwvqxplBH3IkcIRIXAFcTZiP1HK/JNr1DdCyB+BRlEzJMKx Nxgi4PZPvM0S1TOX7k9GhJF/zM7FRzFQ1atXvsF8A17ECjr8yIfjj9pcB4a0SOEkvBwh3D+SM0T KyWMZXX8DQxyv3OSUUXJkq2AJzuZX6fECv30BnyXqm402SjQzytCEm2FNc9RMe8YGW7wX0LP8zX tMz+boZ5SHxlyZiExRKG5sPqMszXPN8= X-Received: by 2002:a5d:6c63:0:b0:385:e22e:288f with SMTP id ffacd0b85a97d-38a872ea33fmr16499846f8f.31.1736720314465; Sun, 12 Jan 2025 14:18:34 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e2ddca2dsm158256285e9.21.2025.01.12.14.18.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:18:34 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Edgar E. Iglesias" Subject: [PULL 13/49] hw/net/xilinx_ethlite: Access TX_CTRL register for each port Date: Sun, 12 Jan 2025 23:16:49 +0100 Message-ID: <20250112221726.30206-14-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.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 Rather than accessing the registers within the mixed RAM/MMIO region as indexed register, declare a per-port TX_CTRL. This will help to map the RAM as RAM (keeping MMIO as MMIO) in few commits. Previous s->regs[R_TX_CTRL0] and s->regs[R_TX_CTRL1] are now unused. Not a concern, this array will soon disappear. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Edgar E. Iglesias Message-Id: <20241112181044.92193-15-philmd@linaro.org> --- hw/net/xilinx_ethlite.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/hw/net/xilinx_ethlite.c b/hw/net/xilinx_ethlite.c index ce9555bd1e2..f8b01fe9a62 100644 --- a/hw/net/xilinx_ethlite.c +++ b/hw/net/xilinx_ethlite.c @@ -64,6 +64,7 @@ typedef struct XlnxXpsEthLitePort { struct { uint32_t tx_len; uint32_t tx_gie; + uint32_t tx_ctrl; uint32_t rx_ctrl; } reg; @@ -139,7 +140,7 @@ eth_read(void *opaque, hwaddr addr, unsigned int size) case R_TX_CTRL1: case R_TX_CTRL0: - r = s->regs[addr]; + r = s->port[port_index].reg.tx_ctrl; break; case R_RX_CTRL1: @@ -160,7 +161,6 @@ eth_write(void *opaque, hwaddr addr, { XlnxXpsEthLite *s = opaque; unsigned int port_index = addr_to_port_index(addr); - unsigned int base = 0; uint32_t value = val64; addr >>= 2; @@ -168,24 +168,23 @@ eth_write(void *opaque, hwaddr addr, { case R_TX_CTRL0: case R_TX_CTRL1: - if (addr == R_TX_CTRL1) - base = 0x800 / 4; - if ((value & (CTRL_P | CTRL_S)) == CTRL_S) { qemu_send_packet(qemu_get_queue(s->nic), txbuf_ptr(s, port_index), s->port[port_index].reg.tx_len); - if (s->regs[base + R_TX_CTRL0] & CTRL_I) + if (s->port[port_index].reg.tx_ctrl & CTRL_I) { eth_pulse_irq(s); + } } else if ((value & (CTRL_P | CTRL_S)) == (CTRL_P | CTRL_S)) { memcpy(&s->conf.macaddr.a[0], txbuf_ptr(s, port_index), 6); - if (s->regs[base + R_TX_CTRL0] & CTRL_I) + if (s->port[port_index].reg.tx_ctrl & CTRL_I) { eth_pulse_irq(s); + } } /* We are fast and get ready pretty much immediately so we actually never flip the S nor P bits to one. */ - s->regs[addr] = value & ~(CTRL_P | CTRL_S); + s->port[port_index].reg.tx_ctrl = value & ~(CTRL_P | CTRL_S); break; /* Keep these native. */ From patchwork Sun Jan 12 22:16:50 2025 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: 856776 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1178423wrc; Sun, 12 Jan 2025 14:19:14 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVoa6TNnmT6grUIKicUws7hV/uLMw10iCFZSJTQF9ZWu1f1iUdZZ10yDKkv5Y/W2EmwwmrDtQ==@linaro.org X-Google-Smtp-Source: AGHT+IFk7dFuVnP7aYkRo0zVDRU5B1pRlAqPKrSaG3nYWg14iYOHZn2XV/Sf5OSx7u0U59HJdC98 X-Received: by 2002:a05:6214:2428:b0:6d8:960e:5785 with SMTP id 6a1803df08f44-6df9b234c28mr286068706d6.13.1736720354691; Sun, 12 Jan 2025 14:19:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720354; cv=none; d=google.com; s=arc-20240605; b=G+EGZms5DpeQHdSpYToIkzMGpKJMwWvZbu2+xSFNbPIfP1Dj7+MrJ/b1dU9HvJsinZ 1nUUm7nFpMgPlxbS39oiTgNBfwIM+AMkk8uNH92NqYUCv8hnK7OWFv44yaWhhw+kitvh v5jup6KQRGyLGApXjhjIjnwvHgv7rc8DhmKjRIp6WbCeC4ycX81livtK3eQ+NvXdtBaK YXT7OZ/WPa2TDef2XGdfTi9kCEAiuRunVObT23/7Hr5nT3v56pHrfwTLpk4bSc+Xmq0n x/YSmfVFDyLmHqE/ti0tnF/HYKZXWNOjZzJm64ObSo3GXlIaENtn9GCUd0HPSwhNOrkm 0QLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=N7W7S4fRmwH0o3LlR3Rkb17HVQ8y9jsuH8Ex5UdLq6I=; fh=lA8KdGRRCLcXxei5dR52XWsTSutqQE1F1yBegzCCPPE=; b=Lb6O4Emb+sb8vyMAr9pxK6B3amMUJ50mL6HjqYU5abfw/xbl0CMrTytVr9XVk/SATc EzmsaSLaQ9k5Fz5ZSjJE1QzPLHqmb2FFxChlMDIlkHTtpHVhMXgE9phfFccqu8mNpch9 RsQiFK14d2SfY5j22bcRknybqR61gAsW0g0+4JZ8NnBXk9NfwMWT3UTZghDRDEtk0wcl iDwl4Ae7Rr8EC44nv6UR+BWZzZoWqrkc1N17ydVVevg/4I6A0Drs0DcFFSFkWWtDmVUW AwfOfbrEyRHFsGN3PvDyP5rsgI1ab+PRJpBat0lMxo8X1Xsa+MH9m8I6mpdJngqjJQvG iQLQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wJ2NapqN; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46c8734e31csi82067051cf.139.2025.01.12.14.19.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:19:14 -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=wJ2NapqN; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6II-0000Kf-Ga; Sun, 12 Jan 2025 17:18:54 -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 1tX6I6-0008Ty-Vv for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:18:43 -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 1tX6I5-0006SB-60 for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:18:42 -0500 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-385dece873cso1777885f8f.0 for ; Sun, 12 Jan 2025 14:18:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720319; x=1737325119; darn=nongnu.org; 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=N7W7S4fRmwH0o3LlR3Rkb17HVQ8y9jsuH8Ex5UdLq6I=; b=wJ2NapqNXwMLxkYCfIYuLIJKlla8aGxvDDVCVO9nLQHJuuntk3YGHMhjxAp2XxVAUb o5IwYz614KZAEOY4ukRH5kTSJ8kbmu/XL9iVk9epvNMI6cEs5Z5RzA+/BnNmRmy2Aa4Y VUPDdBcQw+H5wylP8NPpTgwUlwB890GDWK/HZFkUdiNlqpiKC309eD9yLo26aWJTp6Xq Uj/2QE/4iplwSmfHC9CCLWqojbFlcBuWx5+w6hon/MqC1MoW5bg5VesQ8XooZlqQQ6VJ DJ/JX53xcVHIrbsDz2EZE5U+Jye0Qp8qTuGItR3xbs6rtrhZxCrz7RriRbW2/97/QOf2 WqoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720319; x=1737325119; 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=N7W7S4fRmwH0o3LlR3Rkb17HVQ8y9jsuH8Ex5UdLq6I=; b=Jzmo/2B6NlSkNFEH3hjr1/45PYt7pXzO03qgJmt0D+IQsQWhBUGLcfCJufYOlf/p8S tA1I8Xsf4/gX2/78IShkMJi0KdYAAV3I2H9kl8hu7AptdWOeoTCTzp/405t4nDWvb7lW X4jJZhuN6FEZ4pCGmwSepD6wJnbLFOlisshpdC359rf3fhxpsis+zJ1PwplPl2BR3qkL IdDr+xkA+Gk2RxGAfNjA0zKA3kC4B0pYdYADqxX6LJ7MT8O0L2KPY2sSVtT9RM7Ka9Oy OfiJEn8GrW8+rmF1BVrDaD0CqKG23z3Ui2wYjUB1X6jqENgmw4IanTgBPoi45jjuz97K nxng== X-Gm-Message-State: AOJu0YxqFp4n8OKziK91RM2f4vFgojCFqGFPhA5ePA8X+Plg9l8mASom 8JerAxReKrXmPN+5U1gBGz94oEy5zes3/beCEYR9ewyHMrwmkisfGZffT7KCBQnH5UECdo4oDpK UyuE= X-Gm-Gg: ASbGncuTRrQpIS3ezuKbCCjf45z6/t8QnLb3YR3WXhVJ594KNw27SkLu5fwkz5w1kOm pxvb+do9tx58oMzdwGzHh9ozPhvq+k8xRDINmpOfzVL0SnkZQVsZU7yUe3he1106cQtdg88eU2Y 1fO7FewaQeMmuD16ZLsd6foINmU+NpD0tMt98RccK9pYFAt4eBnaGxCPaV099yqUDNwjWU2PVyv WvZxlTAjMFS03FYN+EhpSoMAemMC7ytEzmmPy60BzJA3Xe0XvOxCPmRtuo9oMaBJ1ckMjkLCzwk TJVv1EitclGZxECjTIo3Y48NB5EhISU= X-Received: by 2002:a05:6000:1a85:b0:385:e0d6:fb48 with SMTP id ffacd0b85a97d-38a872f6f22mr14729476f8f.7.1736720319021; Sun, 12 Jan 2025 14:18:39 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436dd1682e4sm97919235e9.1.2025.01.12.14.18.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:18:38 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Edgar E. Iglesias" Subject: [PULL 14/49] hw/net/xilinx_ethlite: Map RX_CTRL as MMIO Date: Sun, 12 Jan 2025 23:16:50 +0100 Message-ID: <20250112221726.30206-15-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-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 Declare RX registers as MMIO region, split it out of the current mixed RAM/MMIO region. The memory flat view becomes: (qemu) info mtree -f FlatView #0 Root memory region: system 0000000081000000-00000000810007e3 (prio 0, i/o): xlnx.xps-ethernetlite 00000000810007e4-00000000810007f3 (prio 0, i/o): ethlite.mdio 00000000810007f4-00000000810017fb (prio 0, i/o): xlnx.xps-ethernetlite @00000000000007f4 00000000810017fc-00000000810017ff (prio 0, i/o): ethlite.rx[0]io 0000000081001800-0000000081001ffb (prio 0, i/o): xlnx.xps-ethernetlite @0000000000001800 0000000081001ffc-0000000081001fff (prio 0, i/o): ethlite.rx[1]io Reviewed-by: Edgar E. Iglesias Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20241112181044.92193-16-philmd@linaro.org> --- hw/net/xilinx_ethlite.c | 82 +++++++++++++++++++++++++++++++++-------- 1 file changed, 67 insertions(+), 15 deletions(-) diff --git a/hw/net/xilinx_ethlite.c b/hw/net/xilinx_ethlite.c index f8b01fe9a62..9ac81ca1e06 100644 --- a/hw/net/xilinx_ethlite.c +++ b/hw/net/xilinx_ethlite.c @@ -49,11 +49,16 @@ #define R_TX_CTRL1 (0x0ffc / 4) #define R_RX_BUF0 (0x1000 / 4) -#define R_RX_CTRL0 (0x17fc / 4) +#define A_RX_BASE0 0x17fc #define R_RX_BUF1 (0x1800 / 4) -#define R_RX_CTRL1 (0x1ffc / 4) +#define A_RX_BASE1 0x1ffc #define R_MAX (0x2000 / 4) +enum { + RX_CTRL = 0, + RX_MAX +}; + #define GIE_GIE 0x80000000 #define CTRL_I 0x8 @@ -61,6 +66,8 @@ #define CTRL_S 0x1 typedef struct XlnxXpsEthLitePort { + MemoryRegion rxio; + struct { uint32_t tx_len; uint32_t tx_gie; @@ -118,6 +125,55 @@ static void *rxbuf_ptr(XlnxXpsEthLite *s, unsigned port_index) return &s->regs[rxbase + R_RX_BUF0]; } +static uint64_t port_rx_read(void *opaque, hwaddr addr, unsigned int size) +{ + XlnxXpsEthLite *s = opaque; + unsigned port_index = addr_to_port_index(addr); + uint32_t r = 0; + + switch (addr >> 2) { + case RX_CTRL: + r = s->port[port_index].reg.rx_ctrl; + break; + default: + g_assert_not_reached(); + } + + return r; +} + +static void port_rx_write(void *opaque, hwaddr addr, uint64_t value, + unsigned int size) +{ + XlnxXpsEthLite *s = opaque; + unsigned port_index = addr_to_port_index(addr); + + switch (addr >> 2) { + case RX_CTRL: + if (!(value & CTRL_S)) { + qemu_flush_queued_packets(qemu_get_queue(s->nic)); + } + s->port[port_index].reg.rx_ctrl = value; + break; + default: + g_assert_not_reached(); + } +} + +static const MemoryRegionOps eth_portrx_ops = { + .read = port_rx_read, + .write = port_rx_write, + .endianness = DEVICE_NATIVE_ENDIAN, + .impl = { + .min_access_size = 4, + .max_access_size = 4, + }, + .valid = { + .min_access_size = 4, + .max_access_size = 4, + }, +}; + static uint64_t eth_read(void *opaque, hwaddr addr, unsigned int size) { @@ -143,11 +199,6 @@ eth_read(void *opaque, hwaddr addr, unsigned int size) r = s->port[port_index].reg.tx_ctrl; break; - case R_RX_CTRL1: - case R_RX_CTRL0: - r = s->port[port_index].reg.rx_ctrl; - break; - default: r = tswap32(s->regs[addr]); break; @@ -188,14 +239,6 @@ eth_write(void *opaque, hwaddr addr, break; /* Keep these native. */ - case R_RX_CTRL0: - case R_RX_CTRL1: - if (!(value & CTRL_S)) { - qemu_flush_queued_packets(qemu_get_queue(s->nic)); - } - s->port[port_index].reg.rx_ctrl = value; - break; - case R_TX_LEN0: case R_TX_LEN1: s->port[port_index].reg.tx_len = value; @@ -288,6 +331,15 @@ static void xilinx_ethlite_realize(DeviceState *dev, Error **errp) memory_region_add_subregion(&s->mmio, A_MDIO_BASE, sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->mdio), 0)); + for (unsigned i = 0; i < 2; i++) { + memory_region_init_io(&s->port[i].rxio, OBJECT(dev), + ð_portrx_ops, s, + i ? "ethlite.rx[1]io" : "ethlite.rx[0]io", + 4 * RX_MAX); + memory_region_add_subregion(&s->mmio, i ? A_RX_BASE1 : A_RX_BASE0, + &s->port[i].rxio); + } + qemu_macaddr_default_if_unset(&s->conf.macaddr); s->nic = qemu_new_nic(&net_xilinx_ethlite_info, &s->conf, object_get_typename(OBJECT(dev)), dev->id, From patchwork Sun Jan 12 22:16:51 2025 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: 856775 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1178348wrc; Sun, 12 Jan 2025 14:18:59 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVrYIuWMyEljPSgF+D9AvPKTI+ZO6KhU/tO807uH3Shh7LcVGO2uaKVtIDhDFU7kJLvsZqQIA==@linaro.org X-Google-Smtp-Source: AGHT+IFytzz56bpVC/y04JDVHaWaeFnHvSUjd3/SJw49P6/KvIXJiC7N0fw8boF88VJv0a86VxME X-Received: by 2002:a05:620a:4044:b0:7b6:c695:fb7c with SMTP id af79cd13be357-7bcd97165b6mr2810728385a.33.1736720338985; Sun, 12 Jan 2025 14:18:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720338; cv=none; d=google.com; s=arc-20240605; b=a8N90MyAQgokSSVH49CjaoYOwcLNePrrHJhuDxl1v6z45TaTB1wFxJFU8Zn7o18md/ lEgFiE4i75mX2NotXNs0KDqSYzvCd0Ck/NXRodsOsfULJMFKggeKMXx8oX1dg+06yG2M +pdy02NX9SQEHBHDQuLaht8cY+wOLkvjzMybFMYQcNi7jK88EjVIMp31JNPfA9UB/B9N uArBN2IKZeoAyvAZoA4dxbJhm2l3jqWsPe5bXFanIZdI/44WZGmEZWqkOgQSZb9kJ3C5 u8N4C5HvxGlyU+pkQ/PIW1j/oSxat4pWyRJVzbAFbdv+MSECHzVqrqerP7JRmjnpfYfU tClA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=A5/QTsgFaeb0rXegtfTvFnFX4bMeOUBeCuDa9RC3KRI=; fh=lA8KdGRRCLcXxei5dR52XWsTSutqQE1F1yBegzCCPPE=; b=eHVT62OZmxV7MIq1yCt/gh7S/D7sKIYhGhPGn6sQU69nBwDF0U2p6Zn8qW4UKST24H csFDxc8PU8yDrtVhFY+zpuVyZboncqMdt94U1e665ieeOBHc5BxGUq6tdKYKGuQ1Wc3x iU39AQdRRxl5ou2Q5TQ63KoISG1rqTIHz5zJWZCFDmVn3PZQXwfUqNNELK9dp7FA2OYg pr+9IMHHP36atgNhUOf/3MY77mIXKUybjavgjq5dcnghCIMVvXk/Ec+s13RvDqxH7umI enYvKO7JCBbWRLIg4QzILVEGcP84V92giY0bS6xZwF7qCpfdIY4/gskmZDsWKJGAgQ2f OLXA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wcaXHS11; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7bce350a837si926254185a.629.2025.01.12.14.18.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:18: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=wcaXHS11; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6IK-0000TU-05; Sun, 12 Jan 2025 17:18: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 1tX6IC-0008Uc-4v for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:18:51 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6IA-0006SY-Cv for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:18:47 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-436202dd7f6so42821545e9.0 for ; Sun, 12 Jan 2025 14:18:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720324; x=1737325124; darn=nongnu.org; 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=A5/QTsgFaeb0rXegtfTvFnFX4bMeOUBeCuDa9RC3KRI=; b=wcaXHS11r02PTU4Vf/83fCYAEe4BhNa6bHGrhLzovv9y6Dg+bMmlJfEKIIUVGdtMFU dH8N7PBLG+Z3is3MAyGOvRGuY7t8lREYnwVBcv45zvS33l4jBcUS3DRh1wsR+lAdUEg2 YHUu+Acm3yieTjn4b/oP/yS9SU6v6/jKT1PX0Kkf1ssDYmo0tYMKH6TwgaX3sKKu+kUI 7KXVfDsI0axA5wGG7Hc6WP0riTkg+DSyjgONa8lbb9nOFVNY89sFbG7CkAiPfdVMBrFc Uv8DyjKazytsnNl77qWFIZB8Jw6hCbJb0rvGNh7KDhLXnOu6jXycv1EcHiadudUfVr+C f/EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720324; x=1737325124; 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=A5/QTsgFaeb0rXegtfTvFnFX4bMeOUBeCuDa9RC3KRI=; b=ITQaHATnHjBbwA+eaTYuUlyUwk2ZwyhplgQp3xeQ2erqYsX5CfIC16Ama/3yfRvpVU /lq3h19pYE4Wgqs2NH6KRqKTD/OUi79j967P2te1GqgKIoRTNQ317yiDP8h08jvjwQDn +f46xE5pzgMNltSHdUFVLMdv4dlnexN8k6NVt/u/iJXqaOSpkIMMFttFRLq2vRCIcXBy ksjpFuVkGJ0u57MKrZt4Bo50idiqrbqC7dfpXFUOAfLIsHi36NcVxi15Q8oaRPL5TPYM A3PKIJt5asncc3SFY4IdKJyA7meswHganHOpmIS/GKgAFNaoCJDwqk2BnMriu8DGmBsF kZAQ== X-Gm-Message-State: AOJu0YzbJBTGLL4qgGO4lYzD8vPw/mzlTfulcnkzMUuvku+jJr1fovdO j5lgDNUeZOHyJKE9/QKKe0OYMD3TXvU/nGAxESZEN7MM/DlUsuNy8z+0Y2rjmVkPxYFB5ouHl2+ 9OSU= X-Gm-Gg: ASbGncueYyYJEWp2bpPidp4jNxMv/AsqqY0wh+i5gi2m1e2wBYE3Q569siOVd8JgZDN ebj+NzxYdSEshg+kqwPiZH91WxY3KgvvQLAai29by2bkoOq/nYvrmpaCUmcxx3RT32O6N5AL9xD GMwy1gURYwbXVZOeejVgWrv2EshqtyIhG+V2zUmu+b9XK4L5ilVugQitYeSGQWLZ8gfh4e0ImWR Tt7+Eg/AKBN97EdGUqmGDoIehAXlr7kjVuaZCvPzXTSux3B56xCIB3cLc9etyADUScR5HnxKrBB yGu1xpIAU81dyvyhp6PSNG721szFWFY= X-Received: by 2002:a05:600c:511f:b0:436:1b96:7072 with SMTP id 5b1f17b1804b1-436e26867f6mr185333775e9.5.1736720324251; Sun, 12 Jan 2025 14:18:44 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e9e03f8bsm122319065e9.23.2025.01.12.14.18.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:18:43 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Edgar E. Iglesias" Subject: [PULL 15/49] hw/net/xilinx_ethlite: Map TX_LEN as MMIO Date: Sun, 12 Jan 2025 23:16:51 +0100 Message-ID: <20250112221726.30206-16-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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 Declare TX registers as MMIO region, split it out of the current mixed RAM/MMIO region. The memory flat view becomes: (qemu) info mtree -f FlatView #0 Root memory region: system 0000000081000000-00000000810007e3 (prio 0, i/o): xlnx.xps-ethernetlite 00000000810007e4-00000000810007f3 (prio 0, i/o): ethlite.mdio 00000000810007f4-00000000810007f7 (prio 0, i/o): ethlite.tx[0]io 00000000810007f8-0000000081000ff3 (prio 0, i/o): xlnx.xps-ethernetlite @00000000000007f8 0000000081000ff4-0000000081000ff7 (prio 0, i/o): ethlite.tx[1]io 0000000081000ff8-00000000810017fb (prio 0, i/o): xlnx.xps-ethernetlite @0000000000000ff8 00000000810017fc-00000000810017ff (prio 0, i/o): ethlite.rx[0]io 0000000081001800-0000000081001ffb (prio 0, i/o): xlnx.xps-ethernetlite @0000000000001800 0000000081001ffc-0000000081001fff (prio 0, i/o): ethlite.rx[1]io Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Edgar E. Iglesias Message-Id: <20241112181044.92193-17-philmd@linaro.org> --- hw/net/xilinx_ethlite.c | 73 ++++++++++++++++++++++++++++++++++------- 1 file changed, 61 insertions(+), 12 deletions(-) diff --git a/hw/net/xilinx_ethlite.c b/hw/net/xilinx_ethlite.c index 9ac81ca1e06..5dac44fa688 100644 --- a/hw/net/xilinx_ethlite.c +++ b/hw/net/xilinx_ethlite.c @@ -41,11 +41,11 @@ #define R_TX_BUF0 0 #define BUFSZ_MAX 0x07e4 #define A_MDIO_BASE 0x07e4 -#define R_TX_LEN0 (0x07f4 / 4) +#define A_TX_BASE0 0x07f4 #define R_TX_GIE0 (0x07f8 / 4) #define R_TX_CTRL0 (0x07fc / 4) #define R_TX_BUF1 (0x0800 / 4) -#define R_TX_LEN1 (0x0ff4 / 4) +#define A_TX_BASE1 0x0ff4 #define R_TX_CTRL1 (0x0ffc / 4) #define R_RX_BUF0 (0x1000 / 4) @@ -54,6 +54,11 @@ #define A_RX_BASE1 0x1ffc #define R_MAX (0x2000 / 4) +enum { + TX_LEN = 0, + TX_MAX +}; + enum { RX_CTRL = 0, RX_MAX @@ -66,6 +71,7 @@ enum { #define CTRL_S 0x1 typedef struct XlnxXpsEthLitePort { + MemoryRegion txio; MemoryRegion rxio; struct { @@ -125,6 +131,52 @@ static void *rxbuf_ptr(XlnxXpsEthLite *s, unsigned port_index) return &s->regs[rxbase + R_RX_BUF0]; } +static uint64_t port_tx_read(void *opaque, hwaddr addr, unsigned int size) +{ + XlnxXpsEthLite *s = opaque; + unsigned port_index = addr_to_port_index(addr); + uint32_t r = 0; + + switch (addr >> 2) { + case TX_LEN: + r = s->port[port_index].reg.tx_len; + break; + default: + g_assert_not_reached(); + } + + return r; +} + +static void port_tx_write(void *opaque, hwaddr addr, uint64_t value, + unsigned int size) +{ + XlnxXpsEthLite *s = opaque; + unsigned port_index = addr_to_port_index(addr); + + switch (addr >> 2) { + case TX_LEN: + s->port[port_index].reg.tx_len = value; + break; + default: + g_assert_not_reached(); + } +} + +static const MemoryRegionOps eth_porttx_ops = { + .read = port_tx_read, + .write = port_tx_write, + .endianness = DEVICE_NATIVE_ENDIAN, + .impl = { + .min_access_size = 4, + .max_access_size = 4, + }, + .valid = { + .min_access_size = 4, + .max_access_size = 4, + }, +}; + static uint64_t port_rx_read(void *opaque, hwaddr addr, unsigned int size) { XlnxXpsEthLite *s = opaque; @@ -189,11 +241,6 @@ eth_read(void *opaque, hwaddr addr, unsigned int size) r = s->port[port_index].reg.tx_gie; break; - case R_TX_LEN0: - case R_TX_LEN1: - r = s->port[port_index].reg.tx_len; - break; - case R_TX_CTRL1: case R_TX_CTRL0: r = s->port[port_index].reg.tx_ctrl; @@ -239,11 +286,6 @@ eth_write(void *opaque, hwaddr addr, break; /* Keep these native. */ - case R_TX_LEN0: - case R_TX_LEN1: - s->port[port_index].reg.tx_len = value; - break; - case R_TX_GIE0: s->port[port_index].reg.tx_gie = value; break; @@ -332,6 +374,13 @@ static void xilinx_ethlite_realize(DeviceState *dev, Error **errp) sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->mdio), 0)); for (unsigned i = 0; i < 2; i++) { + memory_region_init_io(&s->port[i].txio, OBJECT(dev), + ð_porttx_ops, s, + i ? "ethlite.tx[1]io" : "ethlite.tx[0]io", + 4 * TX_MAX); + memory_region_add_subregion(&s->mmio, i ? A_TX_BASE1 : A_TX_BASE0, + &s->port[i].txio); + memory_region_init_io(&s->port[i].rxio, OBJECT(dev), ð_portrx_ops, s, i ? "ethlite.rx[1]io" : "ethlite.rx[0]io", From patchwork Sun Jan 12 22:16:52 2025 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: 856816 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1179724wrc; Sun, 12 Jan 2025 14:25:24 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWIXI9vaJ0JOvYld09pEpgcno6u/RagvwCYs9Nnv43ZmSWPuqtjwBtEpBfKygkkA+En64SMGA==@linaro.org X-Google-Smtp-Source: AGHT+IGpmUf+S4FvGI29a+XaEHziathEkfgGf3I6HHBX3TXKgZWxLTGyVPns2Zar57nUwhv/692+ X-Received: by 2002:a05:622a:558a:b0:467:7eb6:a007 with SMTP id d75a77b69052e-46c710e1747mr336309061cf.37.1736720724561; Sun, 12 Jan 2025 14:25:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720724; cv=none; d=google.com; s=arc-20240605; b=ZKh/lEyInLlxKgpyvimlKn1cvKOYOTppDdQUA8koNmbveGqq9H0se2FPlVgZnP2A/P MfS1Z5zTUSUN4Paj1pDEZKa8cq5xFocDLZOhZNKK130gjKgVREVb7SPMr/NkUCancwje +f2ps0tysvILHo2jrALKrUqVXfU2vKwuKqhC4Ya7AuT4ZeaKxb/P0aF8Q/rUIElXypvd c2sBg+NIpxwXYK/tV7rSx8HkixoKvRom6l+tCcFjYnP3iNU4I71WyvNwiIRw+2ZaO0NZ G4fMU/lhPrPTuANfzQb0YxYhf1GIvkIyZlPcMQxNCVhlUc4U3n7x+Rd5/AEar7htSF5K FIEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=JQ/yRHFRw+pRRef+zyQSK+jFDarKIc/XCW+pBv+XSCs=; fh=lA8KdGRRCLcXxei5dR52XWsTSutqQE1F1yBegzCCPPE=; b=lQR1QPDQFa8PoC7NvEzRHWtquv+R63rNr/BeaXN93hmQGQxaUO8EIwvV9xT4+FE2jX 4kXsZWMzW/DildOUjioi5BBttJP/O+Rumi6sXy5I8Cou5MEPGUuKyUyQlAIZk/mnQL5d lKqxHa5B2Tvn0dBDDQUAVhvUxGsrrpCu37AuMIMKi1/URLtNc9w9Lb4/rGFCdQkrBzms SM8zev/mEptSZGunHeGL+8j+aeOmjBhGGDbsJ1WiaVhGxC1z0yXzKsTHOOGW16HLWuN0 AZHvg4rLoM+dgGJ6Er+KyBdtsM5jkubHxDbE16teO/yCsToHmCvLAvD2voc+yeO2/yqZ 2Vjw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aUVBvZva; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46c873e5226si73471501cf.274.2025.01.12.14.25.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:25:24 -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=aUVBvZva; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6IM-0000X6-Bo; Sun, 12 Jan 2025 17:18: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 1tX6II-0000LW-DF for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:18:54 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6IF-0006Sy-1J for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:18:54 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-43690d4605dso25675245e9.0 for ; Sun, 12 Jan 2025 14:18:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720329; x=1737325129; darn=nongnu.org; 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=JQ/yRHFRw+pRRef+zyQSK+jFDarKIc/XCW+pBv+XSCs=; b=aUVBvZvaZy/pU7shbKIaZuZ/6Rg2NH+pd2ufL8sYJ7V0a7ov5hfcHUji1dXWvc3+dB cWOgU1MiL0Dx2aYznUpQeSGADsA5h9R4Vmvqbe2Q5fvgN8OdVLWiCbE+q3FzDjXU/2y9 EJcdDBY4UZgHuWkAm1QnFRG/N43SR8QqR4qNijcP4tBJI8reZQU8BYnnqND8Dska9KWT OUqPOkKs+BN8mrtMc/U8XotBxvjEHYt8v9bq6vdTnllsuBpqD6STrrI16nSNvlOsexPv QYdeN8Unl5eAYcc0jxq7/lkFuhUksPuaQhsz3meC1Vop9xLdO7vIQVW9JdPUfWP9bzHF nzNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720329; x=1737325129; 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=JQ/yRHFRw+pRRef+zyQSK+jFDarKIc/XCW+pBv+XSCs=; b=esiLCnI2atiNxMe2oguqXR6tlQ6+1KcgKeKSfcunDqZLGA4FX4B8Boa0ghZOuiT4oK N6rPyYc1QynePfyh2qWZC6WymfQU329TTfLvFLwOzT8s/5Y8FsPVFE0Y2FOXZC1KsB7I fJmGRpIpYs9In8WmUlS1QUsSnhNGBT3S0lmMhPLdtkJZLVH530Yc4MjIMBuLzRVi+/NX Sbpk0qD6AkwPRIWn4wgo74s97aFlxhq7uB2QdYqUIRk2lWdBBihkWvdeIkk9DNA1AU9b 2DuetdSLm7fa49KkDsgAZpVy/rNBW+2v103tNgLvQbULQL2ylIKyrUJnkkPKmanCYkS1 Aq4w== X-Gm-Message-State: AOJu0YzB8l0bAJsHFFPqI5hc6msFtNx0ZOIinxG24uMC1NuduG8eDBvo tuRJ6HF863bk1ji9Hcr8MEQpDxfKZfdlRhhiZBgPqKQRbWgX/zt8NhnPyHOik7uAcx9qTULd3Nx WHF4= X-Gm-Gg: ASbGncvJxU3u55vm8tDeApSsk15QyJw/BW3G+bqskb3IIPMpezku2gioTt6xGijNRq+ 8NmXWvg9Itw+hQrYXlaZi/XhPLcL+dd2IQ3+xn5EDI8FUu+g9wIlOSGD7MzyhqpR1zYjSZasjez gKeJZab1n40O7SpUw84r+KNnC4V7TCjjQECxazHgkHAtTt20uYiXQvhz0lbtLoetDiCTWBncees ZYpfQDpkxa6w/EZiA+ah6vYO908sEVV3Vmd13dLTPq3AoFGZbTCZj6SD51Y6iXhoAcPFJ5JftON kcgYxO9YJoT0Fz8qiwERNx/auPsua+Q= X-Received: by 2002:a05:600c:1c28:b0:434:a734:d268 with SMTP id 5b1f17b1804b1-436e2699dfbmr185976455e9.14.1736720329124; Sun, 12 Jan 2025 14:18:49 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e2da66fcsm158823095e9.6.2025.01.12.14.18.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:18:48 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Edgar E. Iglesias" Subject: [PULL 16/49] hw/net/xilinx_ethlite: Map TX_GIE as MMIO Date: Sun, 12 Jan 2025 23:16:52 +0100 Message-ID: <20250112221726.30206-17-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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 Add TX_GIE to the TX registers MMIO region. Before TX_GIE1 was accessed as RAM, with no effect. Now it is accessed as MMIO, also without any effect. The memory flat view becomes: (qemu) info mtree -f FlatView #0 Root memory region: system 0000000081000000-00000000810007e3 (prio 0, i/o): xlnx.xps-ethernetlite 00000000810007e4-00000000810007f3 (prio 0, i/o): ethlite.mdio 00000000810007f4-00000000810007fb (prio 0, i/o): ethlite.tx[0]io 00000000810007fc-0000000081000ff3 (prio 0, i/o): xlnx.xps-ethernetlite @00000000000007fc 0000000081000ff4-0000000081000ffb (prio 0, i/o): ethlite.tx[1]io 0000000081000ffc-00000000810017fb (prio 0, i/o): xlnx.xps-ethernetlite @0000000000000ffc 00000000810017fc-00000000810017ff (prio 0, i/o): ethlite.rx[0]io 0000000081001800-0000000081001ffb (prio 0, i/o): xlnx.xps-ethernetlite @0000000000001800 0000000081001ffc-0000000081001fff (prio 0, i/o): ethlite.rx[1]io Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Edgar E. Iglesias Message-Id: <20241112181044.92193-18-philmd@linaro.org> --- hw/net/xilinx_ethlite.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/hw/net/xilinx_ethlite.c b/hw/net/xilinx_ethlite.c index 5dac44fa688..898c09b3981 100644 --- a/hw/net/xilinx_ethlite.c +++ b/hw/net/xilinx_ethlite.c @@ -42,7 +42,6 @@ #define BUFSZ_MAX 0x07e4 #define A_MDIO_BASE 0x07e4 #define A_TX_BASE0 0x07f4 -#define R_TX_GIE0 (0x07f8 / 4) #define R_TX_CTRL0 (0x07fc / 4) #define R_TX_BUF1 (0x0800 / 4) #define A_TX_BASE1 0x0ff4 @@ -56,6 +55,7 @@ enum { TX_LEN = 0, + TX_GIE = 1, TX_MAX }; @@ -141,6 +141,9 @@ static uint64_t port_tx_read(void *opaque, hwaddr addr, unsigned int size) case TX_LEN: r = s->port[port_index].reg.tx_len; break; + case TX_GIE: + r = s->port[port_index].reg.tx_gie; + break; default: g_assert_not_reached(); } @@ -158,6 +161,9 @@ static void port_tx_write(void *opaque, hwaddr addr, uint64_t value, case TX_LEN: s->port[port_index].reg.tx_len = value; break; + case TX_GIE: + s->port[port_index].reg.tx_gie = value; + break; default: g_assert_not_reached(); } @@ -237,10 +243,6 @@ eth_read(void *opaque, hwaddr addr, unsigned int size) switch (addr) { - case R_TX_GIE0: - r = s->port[port_index].reg.tx_gie; - break; - case R_TX_CTRL1: case R_TX_CTRL0: r = s->port[port_index].reg.tx_ctrl; @@ -285,11 +287,6 @@ eth_write(void *opaque, hwaddr addr, s->port[port_index].reg.tx_ctrl = value & ~(CTRL_P | CTRL_S); break; - /* Keep these native. */ - case R_TX_GIE0: - s->port[port_index].reg.tx_gie = value; - break; - default: s->regs[addr] = tswap32(value); break; From patchwork Sun Jan 12 22:16:53 2025 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: 856798 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1179441wrc; Sun, 12 Jan 2025 14:24:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWPm26fNDN67GUJHMrb0KKI1E6VZunBhaVvFaU6ZiFGu8ReLiIZ1wUPhzLbdweMYHFBvHHKTA==@linaro.org X-Google-Smtp-Source: AGHT+IFr+kyS/w1O5m6Q6dTWaHqmcdQWKPPWnwwlNsBNwZv4s+lbsmHt+RbLBLl8bPOhvOQL0QhO X-Received: by 2002:a05:620a:4456:b0:7b1:4f5c:6e86 with SMTP id af79cd13be357-7bcd973cff2mr2779988885a.17.1736720640166; Sun, 12 Jan 2025 14:24:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720640; cv=none; d=google.com; s=arc-20240605; b=fRyHg8F4d4wArO/q0rQDDiqwYoTKt50WXvo72F7I/8E4jMHvr0aMvwF5OZrG0XWrD5 MMzhsTXVtgjzXAeZhx/HMXHfjNF25HDZKtlF/IlttXG5BhW8Arhd3mGhd0tlbmtiLFSm 1Zkvw+MnOOEwf4bS59ZJ3Hb1AxFEesYrZY1ywTlt3yIrme0KOU2lI5Ij8Eg7Tf8tsDVZ tpecnuhzCkLBE9lgM5EjJGD3ZbKL8EzrAbKqe0V/f1WJykhnraT8d4sLzCyA0X5mW1o7 U/7JLB3gxAKjzxLQINbRuKNo0XLGcxetuAXCMW44nBmnyElO72iU3M1KKty1Irmktd20 zYEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=SFoahiPSgH64KUxCBuOvqcnFDOzpDhwSVqu05ihWUQw=; fh=lA8KdGRRCLcXxei5dR52XWsTSutqQE1F1yBegzCCPPE=; b=T4gufUFaTebE42XoN7MJ+o9z8AppHzNdbSn2lP5QyWe6H8dNz06NaPRNijs5Z1DRDW WbU90iR3+VgFv8nE38QduugrkRqELoK4DdZS38CemPqn7LiwL6PS9mrgQkYZptZvZfxs 2R/ixf32r/BuCMphAruqTmEqFhL1tmoF05vSws0CSKEUwAnYmUCTHQkrtcggYwiWkgc/ 2U3TgHk/RjVHXor8pWiD6BJXsImVt3Ruj4ATggw/OMOWK3VGA3OExSc81eib5lCYt07N Q2z5d1FSn2xq1Vno5CsyCkmBYU7fNsGf8F4suMRXfDJ9PwPJHu6+TLxiiVC6evgLYjcz VtGA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="cm1+Z/RD"; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7bce34fceffsi1027890985a.417.2025.01.12.14.23.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:24:00 -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="cm1+Z/RD"; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6IY-0000qL-PI; Sun, 12 Jan 2025 17:19: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 1tX6IO-0000fX-NH for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:19:01 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6IK-0006Ty-7R for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:18:59 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-4361b0ec57aso36065515e9.0 for ; Sun, 12 Jan 2025 14:18:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720334; x=1737325134; darn=nongnu.org; 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=SFoahiPSgH64KUxCBuOvqcnFDOzpDhwSVqu05ihWUQw=; b=cm1+Z/RDJdSQdCAxa8iZDvgsuMkA8PSC9bs+O78ftPn3c4NlYFF0Wzpu2A7Yzsp2bZ Lt6LXzT+bj28dJWO/gydvCViFkKYdybwZynFIxo8Gc0njKz+JvDmKrMPxoLaVVpnlK/5 xa9mHVUwTlvBvRST+w7sSUfdH5Q/mZsjFkP68VN3pYwZhP+uZMQczpmjMvewcLjHtwC1 UD9mhpFFjy/Qa0bqCsTkuxWGZR+JqB01DeiXINDok47ycTaXzEcqlwnsTrdb+TQxH1rC pwOMlwLlwQEn6JXh/xkiikkjrdGIa4jOlvVqYjbOLaGZmPMUJsBy+8QjTZbPJV1ErN8U f3pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720334; x=1737325134; 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=SFoahiPSgH64KUxCBuOvqcnFDOzpDhwSVqu05ihWUQw=; b=s1oDwhwXaVyD7zPAAImkkyCTHOr/7/Zb6qSzf0D71MEaafsAuZMsmpA6CH9dTYOrYF ZAvlzJDwNcwLwulFBfkPSQ4JawnI0CmRd9y38mSJsSVV2QepdKyqHTthc/x/nF9m21/b O6I5gan66Wk0WUy0PiX1JRpZ2Iy6cW2zGmueS5vmkSMjPk4BJwHzHQYDkJb2my8gSKY6 e3GQQFDHxg8dxg7HOhwwP3v1R1mqPRvvoQsQJI48vIk1OB6jxiYz/jnjMaajbFcbz7Av 5FzdSn21m8Ufi+iCdFMJJfNiNkxvOOQXPM6p06PtlXUMnbGaEq2fqu2pTE2rDwrHOSCy I6BQ== X-Gm-Message-State: AOJu0Yw0Ohjp9ya2E2GgEPmyKsWkXHQFCtUNZXImJvy9S+opU/AaH0Ux wDzFAbJ1rSdHbyveJaJ1Np5enYxUouVI172VVmHQvJ89KhzvWa5mKWQu/5CuHstBgMXXrAAVhV6 oPcg= X-Gm-Gg: ASbGncuuY/U8ZFvKtB1BUbwwuCRUNy6+2GKb5NcWmC+xz8gjCyL0ZUoi8uiWaD3/LrL Os71vyqP2Qq+y2/rQNvXAPyvIvKxABHEdkC4PyfESrpLqcB9PXr38fyS5ImRiMPw2AZCW7s8n5n 7+jBFnf8SpZuj6tYO1MRQCSPKfQeJQR5mEMHzdQrnLYkGYvi4QrQccIGY9zFVf1hi/G2mJAhPfQ zbS00qiQ00O2QFGbsBJI0cPSlBibodlmNT/Jt6un2/4qldle1IGzgMM60lrg+tjIkXNE/G5IlpH aDKqSWF+c3AlFP5byMbFI96g/tE2qbM= X-Received: by 2002:a05:600c:4745:b0:434:9c60:95a3 with SMTP id 5b1f17b1804b1-436e26c4218mr180634545e9.11.1736720334426; Sun, 12 Jan 2025 14:18:54 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e2dc08bbsm156785245e9.12.2025.01.12.14.18.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:18:53 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Edgar E. Iglesias" Subject: [PULL 17/49] hw/net/xilinx_ethlite: Map TX_CTRL as MMIO Date: Sun, 12 Jan 2025 23:16:53 +0100 Message-ID: <20250112221726.30206-18-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.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 Add TX_CTRL to the TX registers MMIO region. The memory flat view becomes: (qemu) info mtree -f FlatView #0 Root memory region: system 0000000081000000-00000000810007e3 (prio 0, i/o): xlnx.xps-ethernetlite 00000000810007e4-00000000810007f3 (prio 0, i/o): ethlite.mdio 00000000810007f4-00000000810007ff (prio 0, i/o): ethlite.tx[0]io 0000000081000800-0000000081000ff3 (prio 0, i/o): xlnx.xps-ethernetlite @0000000000000800 0000000081000ff4-0000000081000fff (prio 0, i/o): ethlite.tx[1]io 0000000081001000-00000000810017fb (prio 0, i/o): xlnx.xps-ethernetlite @0000000000001000 00000000810017fc-00000000810017ff (prio 0, i/o): ethlite.rx[0]io 0000000081001800-0000000081001ffb (prio 0, i/o): xlnx.xps-ethernetlite @0000000000001800 0000000081001ffc-0000000081001fff (prio 0, i/o): ethlite.rx[1]io Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Edgar E. Iglesias Message-Id: <20241112181044.92193-19-philmd@linaro.org> --- hw/net/xilinx_ethlite.c | 54 ++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 30 deletions(-) diff --git a/hw/net/xilinx_ethlite.c b/hw/net/xilinx_ethlite.c index 898c09b3981..5ab8ae43b2b 100644 --- a/hw/net/xilinx_ethlite.c +++ b/hw/net/xilinx_ethlite.c @@ -42,10 +42,8 @@ #define BUFSZ_MAX 0x07e4 #define A_MDIO_BASE 0x07e4 #define A_TX_BASE0 0x07f4 -#define R_TX_CTRL0 (0x07fc / 4) #define R_TX_BUF1 (0x0800 / 4) #define A_TX_BASE1 0x0ff4 -#define R_TX_CTRL1 (0x0ffc / 4) #define R_RX_BUF0 (0x1000 / 4) #define A_RX_BASE0 0x17fc @@ -56,6 +54,7 @@ enum { TX_LEN = 0, TX_GIE = 1, + TX_CTRL = 2, TX_MAX }; @@ -144,6 +143,9 @@ static uint64_t port_tx_read(void *opaque, hwaddr addr, unsigned int size) case TX_GIE: r = s->port[port_index].reg.tx_gie; break; + case TX_CTRL: + r = s->port[port_index].reg.tx_ctrl; + break; default: g_assert_not_reached(); } @@ -164,6 +166,26 @@ static void port_tx_write(void *opaque, hwaddr addr, uint64_t value, case TX_GIE: s->port[port_index].reg.tx_gie = value; break; + case TX_CTRL: + if ((value & (CTRL_P | CTRL_S)) == CTRL_S) { + qemu_send_packet(qemu_get_queue(s->nic), + txbuf_ptr(s, port_index), + s->port[port_index].reg.tx_len); + if (s->port[port_index].reg.tx_ctrl & CTRL_I) { + eth_pulse_irq(s); + } + } else if ((value & (CTRL_P | CTRL_S)) == (CTRL_P | CTRL_S)) { + memcpy(&s->conf.macaddr.a[0], txbuf_ptr(s, port_index), 6); + if (s->port[port_index].reg.tx_ctrl & CTRL_I) { + eth_pulse_irq(s); + } + } + /* + * We are fast and get ready pretty much immediately + * so we actually never flip the S nor P bits to one. + */ + s->port[port_index].reg.tx_ctrl = value & ~(CTRL_P | CTRL_S); + break; default: g_assert_not_reached(); } @@ -236,18 +258,12 @@ static uint64_t eth_read(void *opaque, hwaddr addr, unsigned int size) { XlnxXpsEthLite *s = opaque; - unsigned port_index = addr_to_port_index(addr); uint32_t r = 0; addr >>= 2; switch (addr) { - case R_TX_CTRL1: - case R_TX_CTRL0: - r = s->port[port_index].reg.tx_ctrl; - break; - default: r = tswap32(s->regs[addr]); break; @@ -260,33 +276,11 @@ eth_write(void *opaque, hwaddr addr, uint64_t val64, unsigned int size) { XlnxXpsEthLite *s = opaque; - unsigned int port_index = addr_to_port_index(addr); uint32_t value = val64; addr >>= 2; switch (addr) { - case R_TX_CTRL0: - case R_TX_CTRL1: - if ((value & (CTRL_P | CTRL_S)) == CTRL_S) { - qemu_send_packet(qemu_get_queue(s->nic), - txbuf_ptr(s, port_index), - s->port[port_index].reg.tx_len); - if (s->port[port_index].reg.tx_ctrl & CTRL_I) { - eth_pulse_irq(s); - } - } else if ((value & (CTRL_P | CTRL_S)) == (CTRL_P | CTRL_S)) { - memcpy(&s->conf.macaddr.a[0], txbuf_ptr(s, port_index), 6); - if (s->port[port_index].reg.tx_ctrl & CTRL_I) { - eth_pulse_irq(s); - } - } - - /* We are fast and get ready pretty much immediately so - we actually never flip the S nor P bits to one. */ - s->port[port_index].reg.tx_ctrl = value & ~(CTRL_P | CTRL_S); - break; - default: s->regs[addr] = tswap32(value); break; From patchwork Sun Jan 12 22:16:54 2025 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: 856780 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1178928wrc; Sun, 12 Jan 2025 14:21:44 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXTLTQYS5zQVRvM77/B7FrTbwCCAeyqU7l563KPVac+w18DNa4SRzmTHtSKu/v++b24FVCgTA==@linaro.org X-Google-Smtp-Source: AGHT+IFCpyaVHj3ELgKBq9B0y4SE4DlrzrliPky39eXWhg+zH+6cS+ZJZjimtM1uY3caNqkf+0zW X-Received: by 2002:a05:622a:6082:b0:46c:726a:2b39 with SMTP id d75a77b69052e-46c726a2e4fmr300992461cf.3.1736720504252; Sun, 12 Jan 2025 14:21:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720504; cv=none; d=google.com; s=arc-20240605; b=YaeCgWCOJiEiR1wfNnjYdNmdRTkRBpaPgfUEBUS7S9cHvx8bZqli7naT8WnwhPUVDE 7g8F/rYGKAeiEr6/jqYkd35BuTYR0PTDC7Nah7YeE6LyJhaoGykKFCdn3RYzqDjP9FsP DOZUEA5NXhu0lhow8Ga0MuHHcHyQ1JWHc78JaBIHNQmVnpdF1YyD4HF9wn15NZw+fziu nJao4eWiL8IV3GdK2/VsnMqKA0hJDolVHqvE536XFLVKCSnTVegqFsgIzlSYDL4gYimt BGXymPiIM6oLxhB7U4yZh9WPFmuX3RzUpYYyHEyupChFbZxgzvMGwd++3XWzCp2zJHYg yVPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=YjOXcw3e6sngFlw7RAw10nmapkVZsHVwbnyM2hBKQkY=; fh=5j8/36AP6hgEy7723NyYDaJLSX8hwm7xFA++6qykRLk=; b=VTW6TLDQ9VIU/S+3oTQIihVkbeFpAOWJQ0J76iaemHHIUsJppMuGERgBBh986PG4wZ ha93oj6V360plyKbm0knoXOuHYmPGFeDfbwm5Nul0QH+iMGHZHFPzjURwjqnsN/qXwJY QUdWKPgaeY46qG9zK/6CE+lzk8FR3CMy7clhqQnguP/s9xVK4fVCmBjxu7C70CJ+ChQx Xo7Ug47zNU+tybpL/D9FXmV3eUa7WyY6zyPJgJ/ecY5fof1MLO0pRv2O1USWqLXB/CTA wa6UU+0uZomvpl9pskzGfSUHoksXp83/t1De/QFR8u8eZA4+PPdxZamJyUX8c1uOxpQi nzNA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="yS95/Jfv"; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46c873314b4si80372061cf.22.2025.01.12.14.21.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:21:44 -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="yS95/Jfv"; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6Id-00010j-QE; Sun, 12 Jan 2025 17:19:16 -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 1tX6IS-0000l3-TB for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:19:05 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6IP-0006Ue-Me for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:19:04 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-43675b1155bso42576385e9.2 for ; Sun, 12 Jan 2025 14:19:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720340; x=1737325140; darn=nongnu.org; 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=YjOXcw3e6sngFlw7RAw10nmapkVZsHVwbnyM2hBKQkY=; b=yS95/JfvWIvdREGOAm0785hBk4vpe81EH/gqTfugDez1VyXRCBKRIxexvPK52Q7gHp 9YiKwnUNJNCSJwPQHroBQ0hZzYXeYTeHHoaOh3kYSixMCu+PSRjlTii3YYrfWRUS+18T KIIPofd+VWqp3eY8lOLOb7n1wk7USD9yweZ+KaBQx7DTLfyexz+I4iT3f3+F4tJseVrN vycjvML6z6oaKFKesS7XO+/Adfxu4UqsuJpeumtU8uQLhp+wN+e4uFyNvGu7pRJSR8KT Ao0ZrDAmWiTXHzodY5MNPauqscGohGWsxuw86SOPrxfHixFsOadNUezELXNE5dgKYJ4h Lv9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720340; x=1737325140; 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=YjOXcw3e6sngFlw7RAw10nmapkVZsHVwbnyM2hBKQkY=; b=sgCRlPCvRzJ9kAg3vpDVaoTitS3CErCLk1gvWn9jIcK7Axf0fnzAGRtjpTbgSDVIRV /iD4zS3mq+QqbdlFmjw6+OuXpJA7CO06t0EpfjjonzGzavo36wKVofcz3gB+6CSrTMC6 QgT9ZJNz6iwqIZLyLT0k9Jin5aC8g2pSPfB+OVY8l7WCbYX7z5HOCfIWtxi0yQzB1ieE 4nJURMnLGlq4LiD+kS1CgH/TwLN++AdlqvAL1fi8dZA20VoXU1TWbiVO9dTkb+SajVQL 1Jv26nJIwwxdmpEJ32d24else+GHk15H+56dnwknrFg22axQImFC7jj7yvIfr/TSDp0r kecw== X-Gm-Message-State: AOJu0YxZiUVTRwkJUGD0LkhgY02HuCRxjGnVsE9pZjbcZg1lx+/2vYbK j/2x8asyN3MHkb4aaZ04lkop5TbTX6bOrQn83oxmTsIAHI49o4bjE/TbXIK2632CtgAZOfUGl4M +Qvw= X-Gm-Gg: ASbGncuWJG0+EnHAcHaZsVSb59z02c4vdF44CZknbN/vB3WYy6+x+Dleq0XytgjOW+g gs3qmg7pCbgm5zzV3OaZTslhhF4m//vqKejPbUOYYgrpkDJgmxkVc4ZD9+uSUmmN1SPqjCAkdSw f1xLXNrsnB+fH2ytjbZ/JYd48kp2LMkfaFEEy0WBf/y1Iz5MRXBFOBYfkLyK3h5X+6TmMTCaTr7 wxmIX8s425Z0f0SuX8E+2K/BTtA2KMNrnVUu3p3jUpba7fNZGgd2l2sr0K0MYknJ00U3HnMum9u AxV5M8lbMTPUHRRsSbdyOtr2nIrqs/I= X-Received: by 2002:a05:6000:1561:b0:38a:9f47:557b with SMTP id ffacd0b85a97d-38a9f47568cmr5614344f8f.40.1736720339681; Sun, 12 Jan 2025 14:18:59 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e2da6336sm158466635e9.8.2025.01.12.14.18.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:18:58 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , "Edgar E. Iglesias" Subject: [PULL 18/49] hw/net/xilinx_ethlite: Map the RAM buffer as RAM memory region Date: Sun, 12 Jan 2025 23:16:54 +0100 Message-ID: <20250112221726.30206-19-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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 Rather than using I/O registers for RAM buffer, having to swap endianness back and forth (because the core memory layer automatically swaps endiannes for us), declare the buffers as RAM regions. The "xlnx.xps-ethernetlite" MR doesn't have any more I/O regions. Remove the now unused s->regs[] array. The memory flat view becomes: FlatView #0 Root memory region: system 0000000081000000-00000000810007e3 (prio 0, ram): ethlite.tx[0]buf 00000000810007e4-00000000810007f3 (prio 0, i/o): ethlite.mdio 00000000810007f4-00000000810007ff (prio 0, i/o): ethlite.tx[0]io 0000000081000800-0000000081000fe3 (prio 0, ram): ethlite.tx[1]buf 0000000081000ff4-0000000081000fff (prio 0, i/o): ethlite.tx[1]io 0000000081001000-00000000810017e3 (prio 0, ram): ethlite.rx[0]buf 00000000810017fc-00000000810017ff (prio 0, i/o): ethlite.rx[0]io 0000000081001800-0000000081001fe3 (prio 0, ram): ethlite.rx[1]buf 0000000081001ffc-0000000081001fff (prio 0, i/o): ethlite.rx[1]io Reported-by: Paolo Bonzini Reviewed-by: Edgar E. Iglesias Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20241114210010.34502-18-philmd@linaro.org> --- hw/net/xilinx_ethlite.c | 81 +++++++++-------------------------------- 1 file changed, 17 insertions(+), 64 deletions(-) diff --git a/hw/net/xilinx_ethlite.c b/hw/net/xilinx_ethlite.c index 5ab8ae43b2b..758226a65dd 100644 --- a/hw/net/xilinx_ethlite.c +++ b/hw/net/xilinx_ethlite.c @@ -2,6 +2,7 @@ * QEMU model of the Xilinx Ethernet Lite MAC. * * Copyright (c) 2009 Edgar E. Iglesias. + * Copyright (c) 2024 Linaro, Ltd * * DS580: https://docs.amd.com/v/u/en-US/xps_ethernetlite * LogiCORE IP XPS Ethernet Lite Media Access Controller @@ -30,7 +31,6 @@ #include "qemu/bitops.h" #include "qom/object.h" #include "qapi/error.h" -#include "exec/tswap.h" #include "hw/sysbus.h" #include "hw/irq.h" #include "hw/qdev-properties.h" @@ -38,18 +38,12 @@ #include "net/net.h" #include "trace.h" -#define R_TX_BUF0 0 #define BUFSZ_MAX 0x07e4 #define A_MDIO_BASE 0x07e4 #define A_TX_BASE0 0x07f4 -#define R_TX_BUF1 (0x0800 / 4) #define A_TX_BASE1 0x0ff4 - -#define R_RX_BUF0 (0x1000 / 4) #define A_RX_BASE0 0x17fc -#define R_RX_BUF1 (0x1800 / 4) #define A_RX_BASE1 0x1ffc -#define R_MAX (0x2000 / 4) enum { TX_LEN = 0, @@ -72,6 +66,8 @@ enum { typedef struct XlnxXpsEthLitePort { MemoryRegion txio; MemoryRegion rxio; + MemoryRegion txbuf; + MemoryRegion rxbuf; struct { uint32_t tx_len; @@ -100,7 +96,6 @@ struct XlnxXpsEthLite UnimplementedDeviceState mdio; XlnxXpsEthLitePort port[2]; - uint32_t regs[R_MAX]; }; static inline void eth_pulse_irq(XlnxXpsEthLite *s) @@ -118,16 +113,12 @@ static unsigned addr_to_port_index(hwaddr addr) static void *txbuf_ptr(XlnxXpsEthLite *s, unsigned port_index) { - unsigned int rxbase = port_index * (0x800 / 4); - - return &s->regs[rxbase + R_TX_BUF0]; + return memory_region_get_ram_ptr(&s->port[port_index].txbuf); } static void *rxbuf_ptr(XlnxXpsEthLite *s, unsigned port_index) { - unsigned int rxbase = port_index * (0x800 / 4); - - return &s->regs[rxbase + R_RX_BUF0]; + return memory_region_get_ram_ptr(&s->port[port_index].rxbuf); } static uint64_t port_tx_read(void *opaque, hwaddr addr, unsigned int size) @@ -254,53 +245,6 @@ static const MemoryRegionOps eth_portrx_ops = { }, }; -static uint64_t -eth_read(void *opaque, hwaddr addr, unsigned int size) -{ - XlnxXpsEthLite *s = opaque; - uint32_t r = 0; - - addr >>= 2; - - switch (addr) - { - default: - r = tswap32(s->regs[addr]); - break; - } - return r; -} - -static void -eth_write(void *opaque, hwaddr addr, - uint64_t val64, unsigned int size) -{ - XlnxXpsEthLite *s = opaque; - uint32_t value = val64; - - addr >>= 2; - switch (addr) - { - default: - s->regs[addr] = tswap32(value); - break; - } -} - -static const MemoryRegionOps eth_ops = { - .read = eth_read, - .write = eth_write, - .endianness = DEVICE_NATIVE_ENDIAN, - .impl = { - .min_access_size = 4, - .max_access_size = 4, - }, - .valid = { - .min_access_size = 4, - .max_access_size = 4 - } -}; - static bool eth_can_rx(NetClientState *nc) { XlnxXpsEthLite *s = qemu_get_nic_opaque(nc); @@ -356,6 +300,9 @@ static void xilinx_ethlite_realize(DeviceState *dev, Error **errp) { XlnxXpsEthLite *s = XILINX_ETHLITE(dev); + memory_region_init(&s->mmio, OBJECT(dev), + "xlnx.xps-ethernetlite", 0x2000); + object_initialize_child(OBJECT(dev), "ethlite.mdio", &s->mdio, TYPE_UNIMPLEMENTED_DEVICE); qdev_prop_set_string(DEVICE(&s->mdio), "name", "ethlite.mdio"); @@ -365,6 +312,10 @@ static void xilinx_ethlite_realize(DeviceState *dev, Error **errp) sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->mdio), 0)); for (unsigned i = 0; i < 2; i++) { + memory_region_init_ram(&s->port[i].txbuf, OBJECT(dev), + i ? "ethlite.tx[1]buf" : "ethlite.tx[0]buf", + BUFSZ_MAX, &error_abort); + memory_region_add_subregion(&s->mmio, 0x0800 * i, &s->port[i].txbuf); memory_region_init_io(&s->port[i].txio, OBJECT(dev), ð_porttx_ops, s, i ? "ethlite.tx[1]io" : "ethlite.tx[0]io", @@ -372,6 +323,11 @@ static void xilinx_ethlite_realize(DeviceState *dev, Error **errp) memory_region_add_subregion(&s->mmio, i ? A_TX_BASE1 : A_TX_BASE0, &s->port[i].txio); + memory_region_init_ram(&s->port[i].rxbuf, OBJECT(dev), + i ? "ethlite.rx[1]buf" : "ethlite.rx[0]buf", + BUFSZ_MAX, &error_abort); + memory_region_add_subregion(&s->mmio, 0x1000 + 0x0800 * i, + &s->port[i].rxbuf); memory_region_init_io(&s->port[i].rxio, OBJECT(dev), ð_portrx_ops, s, i ? "ethlite.rx[1]io" : "ethlite.rx[0]io", @@ -392,9 +348,6 @@ static void xilinx_ethlite_init(Object *obj) XlnxXpsEthLite *s = XILINX_ETHLITE(obj); sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->irq); - - memory_region_init_io(&s->mmio, obj, ð_ops, s, - "xlnx.xps-ethernetlite", R_MAX * 4); sysbus_init_mmio(SYS_BUS_DEVICE(obj), &s->mmio); } From patchwork Sun Jan 12 22:16:55 2025 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: 856792 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1179366wrc; Sun, 12 Jan 2025 14:23:34 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVckhJbrcCgbQtNr48fXcyt501I6GCRxl4nT0gfKStPIWWFDeYZ8LtGhhMs8HOveHkJKwiPSg==@linaro.org X-Google-Smtp-Source: AGHT+IFy4g2OZhDED0Mjamps7CByQJKQ1ubyZYrjYmw5kZvrLX/MIXMQh1uA4pLwXwoD/ABU1E1Q X-Received: by 2002:ad4:5b8d:0:b0:6d8:a091:4f5c with SMTP id 6a1803df08f44-6df9b2ddae1mr254840666d6.33.1736720614740; Sun, 12 Jan 2025 14:23:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720614; cv=none; d=google.com; s=arc-20240605; b=A/ytPksDpqtd+D2EJKz218s0Zh4cBH3X9C6FQrJy+htP5dHceQJaeEvR9j3wGlFQmz 4WX6CMQxakasn8Wugq5u+KFyxL3+llxfQ0n0Nu+R6EfidBwLVPbFLpnzqV+qjniwbDqy x0wr3ijJPliOZVEq+zAaXyk4aTLoQeS56HoWGzPLV44D/3mVL+YrRxbDyRjFrnlX5OYy Otb5I3BbT3uDT82Yz9e4oxCUOsspWJypfs2TnuqefqWgumRa7i2ukhlWnGX2uHngiFEy 4Ic4e98ji4SISlk34bgudN7dTvGPkey76j3egWzGSi+/LduBDiuvNnp6rHM5BzRqLQ6z AgAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=6K7t3TbXwHAqgGaxmfHNMiMSManKTTs7a5XM/qzWt5U=; fh=lA8KdGRRCLcXxei5dR52XWsTSutqQE1F1yBegzCCPPE=; b=i2PWGdrWq395GK5j5Bd9rWUEizIcuNVMbUc45jthTaD7NsL5HJ+ROK2czqNJRz7Ba7 1M0A/T6v/oWzCpEIz1IxYkRIQ1QemxZOEuZ6Om+kPSy2kGP+58FKzbqc18v2dGkCOFrY XU/cNeoULwOa6YuCOPwDteHkjvCrN1H1siwS7ilRJDfIcr1eVFF3Zfr2JGsCX2tYRpxi GS/vGluB+v9BRMEQuODqdE/w9l0xUZJrMuwE8SzmKuQk8a2/H9O7fV/e3XuPG+4lb0of b8oFI9kzepBPW8W71phfsUTJZr9C5TufRSfH61b0Duzrjt0qWIhWzxLN3F9L3h7IbPDK YnuQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Y7iYF4cf; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6dfae015e1asi81296166d6.442.2025.01.12.14.23.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:23: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=Y7iYF4cf; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6Iq-0001LD-8Q; Sun, 12 Jan 2025 17:19:30 -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 1tX6IV-0000pM-HK for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:19:08 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6IT-0006VH-V2 for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:19:07 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-3863494591bso1955543f8f.1 for ; Sun, 12 Jan 2025 14:19:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720344; x=1737325144; darn=nongnu.org; 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=6K7t3TbXwHAqgGaxmfHNMiMSManKTTs7a5XM/qzWt5U=; b=Y7iYF4cfsRFZVsgrPYLWEhLtQMjFJz7n59QaHSADyN8B2HhkUsj3qabkkpcqvt5Beq W12O4vZv3Nh/LFIZ6rwFhSXgJ31gAYA/Yv5dcHxuGxivwC7rzrMxZkNGRPF9xDmmvJN+ paIGnNVOfh/LCx2tZuhgpF2j6ivtn3HZhxdspCJhxI7wS6bM8QklJhPzB3H4GwiiRAy7 qKSZ8paKMBnNGZ3zabrVltvrkBIp93K5l4W8NQD+qfs1c4YiidtnS59hEH3uJhplIYcd FOeI6Omlm1NYe6EUxgZwBYSDDofM6QNQxoYaW7fTVhooQpy/xHSQqfvIkAA3mjZvWase 9DzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720344; x=1737325144; 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=6K7t3TbXwHAqgGaxmfHNMiMSManKTTs7a5XM/qzWt5U=; b=AUf1tGlNsM5nnkLrf0cL2nhneuY3soz1a7SSJzk1RqEQ7J82LU+Eu6PvXiJEuwiusk nnGpdSNjStob1t+ap+rriPmrTcyZPWeB3kFeYE/7Dxzz685lXbX+HLVvSPQoU4onJoEb Ab45cdBWPpGVMjRdjPqLmPzX2wd144xbmXps21avYAbm5m42u8fZAoFdWGLSHDX+iD8g OrxmB5poZK1/tlH6xD4fpOfA+D5QyEwacazLpS+g7B5MP1V4g8wgRXFo6Vy78toli4Sg 4TKjQ+lnvfcV+fw9oO44NOzLc/iK9M7FVde9IwxZUrDa37omV9YSzK2BA0TW6tFwoaZj llkg== X-Gm-Message-State: AOJu0Yy/ERGUvtR4MI59mrVQv3Lx15RaRoHfEmkTUdfjHaEFtKAZgyiF n44Aow5Ozb1cONT8i2+EXoOvzr34rKa/jlqRW3NHGrc1wFflAB/mpvQSZt+c1ldoC7TT+4gljPL ccn4= X-Gm-Gg: ASbGncsxMU4fgPL/+pnUlqMKVrKjLPGqT58CHVxTQ0TKPC09Y6Q7XOXY1AEl5WIUr6g 4v7/rXfD6vCvpTRvF3yToPilj14RgX5WB6n4pDMWak5iesIfjl5AjCP7VqaMMfH4p9qfMJzynzk iWoYCwBNRY+1tiqXIm3WMc20UVCC2e7F+c4AejWwzKR2V3RsfARJxQ22UbgO8qyUXaspwF/Trhs ehdzo0pinuWjrIkqnpSR5Gcbhhedw1rtWy77NcX0R0x2Zc3MEJtINXp+SqFKYhry2R1ye4dKHZO zG5MM8LxiOc7oTON7veWtD3cKHFS2hA= X-Received: by 2002:a05:6000:1f81:b0:386:1cd3:8a03 with SMTP id ffacd0b85a97d-38a872ec38fmr14919936f8f.32.1736720344078; Sun, 12 Jan 2025 14:19:04 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e383882sm10664710f8f.34.2025.01.12.14.19.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:19:03 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Edgar E. Iglesias" Subject: [PULL 19/49] hw/net/xilinx_ethlite: Rename 'mmio' MR as 'container' Date: Sun, 12 Jan 2025 23:16:55 +0100 Message-ID: <20250112221726.30206-20-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.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 Having all its address range mapped by subregions, s->mmio MemoryRegion effectively became a container. Rename it as 'container' for clarity. Reviewed-by: Edgar E. Iglesias Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20241112181044.92193-21-philmd@linaro.org> --- hw/net/xilinx_ethlite.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hw/net/xilinx_ethlite.c b/hw/net/xilinx_ethlite.c index 758226a65dd..a7f6d1b368c 100644 --- a/hw/net/xilinx_ethlite.c +++ b/hw/net/xilinx_ethlite.c @@ -85,7 +85,7 @@ struct XlnxXpsEthLite { SysBusDevice parent_obj; - MemoryRegion mmio; + MemoryRegion container; qemu_irq irq; NICState *nic; NICConf conf; @@ -300,7 +300,7 @@ static void xilinx_ethlite_realize(DeviceState *dev, Error **errp) { XlnxXpsEthLite *s = XILINX_ETHLITE(dev); - memory_region_init(&s->mmio, OBJECT(dev), + memory_region_init(&s->container, OBJECT(dev), "xlnx.xps-ethernetlite", 0x2000); object_initialize_child(OBJECT(dev), "ethlite.mdio", &s->mdio, @@ -308,31 +308,31 @@ static void xilinx_ethlite_realize(DeviceState *dev, Error **errp) qdev_prop_set_string(DEVICE(&s->mdio), "name", "ethlite.mdio"); qdev_prop_set_uint64(DEVICE(&s->mdio), "size", 4 * 4); sysbus_realize(SYS_BUS_DEVICE(&s->mdio), &error_fatal); - memory_region_add_subregion(&s->mmio, A_MDIO_BASE, + memory_region_add_subregion(&s->container, A_MDIO_BASE, sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->mdio), 0)); for (unsigned i = 0; i < 2; i++) { memory_region_init_ram(&s->port[i].txbuf, OBJECT(dev), i ? "ethlite.tx[1]buf" : "ethlite.tx[0]buf", BUFSZ_MAX, &error_abort); - memory_region_add_subregion(&s->mmio, 0x0800 * i, &s->port[i].txbuf); + memory_region_add_subregion(&s->container, 0x0800 * i, &s->port[i].txbuf); memory_region_init_io(&s->port[i].txio, OBJECT(dev), ð_porttx_ops, s, i ? "ethlite.tx[1]io" : "ethlite.tx[0]io", 4 * TX_MAX); - memory_region_add_subregion(&s->mmio, i ? A_TX_BASE1 : A_TX_BASE0, + memory_region_add_subregion(&s->container, i ? A_TX_BASE1 : A_TX_BASE0, &s->port[i].txio); memory_region_init_ram(&s->port[i].rxbuf, OBJECT(dev), i ? "ethlite.rx[1]buf" : "ethlite.rx[0]buf", BUFSZ_MAX, &error_abort); - memory_region_add_subregion(&s->mmio, 0x1000 + 0x0800 * i, + memory_region_add_subregion(&s->container, 0x1000 + 0x0800 * i, &s->port[i].rxbuf); memory_region_init_io(&s->port[i].rxio, OBJECT(dev), ð_portrx_ops, s, i ? "ethlite.rx[1]io" : "ethlite.rx[0]io", 4 * RX_MAX); - memory_region_add_subregion(&s->mmio, i ? A_RX_BASE1 : A_RX_BASE0, + memory_region_add_subregion(&s->container, i ? A_RX_BASE1 : A_RX_BASE0, &s->port[i].rxio); } @@ -348,7 +348,7 @@ static void xilinx_ethlite_init(Object *obj) XlnxXpsEthLite *s = XILINX_ETHLITE(obj); sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->irq); - sysbus_init_mmio(SYS_BUS_DEVICE(obj), &s->mmio); + sysbus_init_mmio(SYS_BUS_DEVICE(obj), &s->container); } static const Property xilinx_ethlite_properties[] = { From patchwork Sun Jan 12 22:16:56 2025 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: 856781 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1178931wrc; Sun, 12 Jan 2025 14:21:45 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUEMXmdZgIqGZ9HjEaGSTGP3jBYNaB9RVYNioWfKozzSwqbMAwGKC0Hze0eFqF2c71kXtKzEQ==@linaro.org X-Google-Smtp-Source: AGHT+IHyV43saZGXpMO1f7tUz9XbEKMfZPbpJW5dsLlXQyYA3CdPIuA6F1+blwMLJkaI60eR0hs6 X-Received: by 2002:a05:620a:45a6:b0:7b6:e207:c8a2 with SMTP id af79cd13be357-7bcd97d5673mr3220804185a.55.1736720505092; Sun, 12 Jan 2025 14:21:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720505; cv=none; d=google.com; s=arc-20240605; b=aHvOETWXmkhOlvps42ah4AFqWo5NFqtvfL7GT7KIVzH4Pi6PGvTi39lFDMOC1NBuek 5ZuqFMSk3SXozoh8rvu/bkIPE16nzTGoWNMPM9g3soLd7rpxrppqZpsKbaXfnJRxYOa2 i1pdxhHBQCWVyOTF+s6OlvO4q8drIs4TJS1Namgyz7RFP+2tA3plouRNikCda26JHCgm 7+yZ71JjB87mrMiHR0T/BijXZBlrcIxbjKHYFIqraE/fnaBvxG0cV7NWmaabGM4FMIsV IqR765Pw6+cryykyIop6YtYYNDX6WHyJsMnAWncKwkj7pw2jP0sKzp03ihCiO8Y5N5lc dsMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=tapoh0/SBib6qRzr75O/lv4A8ahdf/FQ6/7pfjWt9KU=; fh=KEPLpLQVO77v+WBSDPeXmXKEnOIOhNHYNw7geHkyLGA=; b=O8/c0/hrt9n99gUwGyIIgFVCp651sgnXcexPFCAnDBm4vs/djCWttYAKp9D+h+HFeF jC+UIfi1ITF4rtWfzvWHxkIdORefyEEQlWVtghRaHXBeuN98rvaN/J6COaKp8ZtI1SX5 B1s6DJJmsDfB5BxhadK0z4jkVJNVxSpgsgxMKGedXp+UXdxPvOL79q4C+NHMduUxi0Pb WH4aIdceB5SM3Hsotztpslw2XIEnmqgFN1FKLwnrUg4rGEoriPCNLqSGx8eHzSJEJ+x7 uDkRPRDuYGvdNQHfIdQXJVoGE6s2uaDjYD7V4/0HScIHIXkmrUe+opZf7nlDBuRsUSfz 79yQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vaYNeKuB; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7bce34fd642si931231885a.390.2025.01.12.14.21.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:21:45 -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=vaYNeKuB; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6It-0001WE-DN; Sun, 12 Jan 2025 17:19:33 -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 1tX6Ia-00015V-4J for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:19:13 -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 1tX6IY-0006W6-Cg for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:19:11 -0500 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-38a25d4b9d4so1885100f8f.0 for ; Sun, 12 Jan 2025 14:19:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720348; x=1737325148; darn=nongnu.org; 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=tapoh0/SBib6qRzr75O/lv4A8ahdf/FQ6/7pfjWt9KU=; b=vaYNeKuBclEElUtoZsb3ebh/ZGLR5GtZ94g5ocEF1X+BmGuoxGYzXYLW2d3YHVjuVJ j4oY0hsBgEtADtcqxc7/gy8hsde5TRHW1voRenxROOc31tQhK3vCwdE4cpaZnKLqxuOW pcH/AGMOtlX/0IN0cYZCUk/jniSafmxx4Fjv/6LJUnCBw1mMv+bQxzZzkPzW0YKw6mRO 6+le5znRi6rD2vXA0xtAfa849meCXaVplEXfxwi/MZKPRwFG8VZ6I59en4AZohiQwGMg 1GIYudEylnAIQJ5uV6swxT09/t3e5eyJjyzFscG0wjdTkB5s2J9Yoc9TDcEjz+ZLbxjA sKNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720348; x=1737325148; 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=tapoh0/SBib6qRzr75O/lv4A8ahdf/FQ6/7pfjWt9KU=; b=M/WIeKM6PdZ22aUIp4SPAuavGEgPZ7b1HA7HYzKPQvWcA6XhgbHLkWr1dbDD6ti4ft LTkM3MWhzbPdhIwhMEDnoPiGlzPgKqXd8Dhr4tQoRaGEbzH7/qOzK4msIJZBSUj1E7ok pgFhM/appAxDzYil1mwnsswQXFQ0dnIWttYvlCdjXyBKcS2HaUHiYMHJZ87sQ36ZT9Pc hW66uzJrjjQKb8+619rPCB0ogcyR3Wxom/q2LYtCajV2eKyF8m/5GYbXdLQ/G23i8oJe BsyZLtGo9I4nQ43um+N/BviAmwFYgEeHnIOYw/wNXEdBIjGovpl3ojJnBWHuEr4xOTdU B8cw== X-Gm-Message-State: AOJu0YwC48XmvtTF38MSLKbK3GgJY2bQCb+2dMiM/DKqQRtd2zkb/T4d OI8NW15c/D2SRcsRhijrW4b+6jzKEts0uNK9MfecmFyRJngF1hP18t6c2uPmm1vjwRTMPeqw7b1 bym0= X-Gm-Gg: ASbGncubWKqgex/ssPIQnepJl/XYdxG9N4KSQwW5+qglkK08tiJ9yobo617a221ETwY lF3oagVV+XoVk+PKTpaNIxGlN9qqGwSUSNX9AOCxvc0rhpJ0G9yk3gY7Ohj2y2TIYaixvr8tBFK tjuu3WldwUEoqzxzoxdfp6O53bvjxAtS2LTEC4fzcuZtVaMpaGM4KmdEtfYeYurk1/gP/VchiPA tbHOhHNbGcSpiKJu7FAcFpQbF0wp0OOQWdiHUSOmpOxywq8YBT7OnenFI+SvFZhIGBER/OOmCX7 Kxdl+8W5jBZ7xbyxZ9r2n6qTTMFD33U= X-Received: by 2002:a05:6000:1acc:b0:385:db39:2cf with SMTP id ffacd0b85a97d-38a872c943fmr14867664f8f.12.1736720348565; Sun, 12 Jan 2025 14:19:08 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e384f2bsm10503500f8f.41.2025.01.12.14.19.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:19:08 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?A?= =?utf-8?q?lex_Benn=C3=A9e?= Subject: [PULL 20/49] hw/net/xilinx_ethlite: Map RESERVED I/O as unimplemented Date: Sun, 12 Jan 2025 23:16:56 +0100 Message-ID: <20250112221726.30206-21-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-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 In order to track access to reserved I/O space, use yet another UnimplementedDevice covering the whole device memory range. Mapped with lower priority (-1). The memory flat view becomes: (qemu) info mtree -f FlatView #0 Root memory region: system 0000000081000000-00000000810007e3 (prio 0, ram): ethlite.tx[0]buf 00000000810007e4-00000000810007f3 (prio 0, i/o): ethlite.mdio 00000000810007f4-00000000810007ff (prio 0, i/o): ethlite.tx[0]io 0000000081000800-0000000081000fe3 (prio 0, ram): ethlite.tx[1]buf 0000000081000fe4-0000000081000ff3 (prio -1, i/o): ethlite.reserved @0000000000000fe4 0000000081000ff4-0000000081000fff (prio 0, i/o): ethlite.tx[1]io 0000000081001000-00000000810017e3 (prio 0, ram): ethlite.rx[0]buf 00000000810017e4-00000000810017fb (prio -1, i/o): ethlite.reserved @00000000000017e4 00000000810017fc-00000000810017ff (prio 0, i/o): ethlite.rx[0]io 0000000081001800-0000000081001fe3 (prio 0, ram): ethlite.rx[1]buf 0000000081001fe4-0000000081001ffb (prio -1, i/o): ethlite.reserved @0000000000001fe4 0000000081001ffc-0000000081001fff (prio 0, i/o): ethlite.rx[1]io Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Message-Id: <20241114210010.34502-20-philmd@linaro.org> --- hw/net/xilinx_ethlite.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hw/net/xilinx_ethlite.c b/hw/net/xilinx_ethlite.c index a7f6d1b368c..14bf2b2e17a 100644 --- a/hw/net/xilinx_ethlite.c +++ b/hw/net/xilinx_ethlite.c @@ -94,6 +94,7 @@ struct XlnxXpsEthLite uint32_t c_rx_pingpong; unsigned int port_index; /* dual port RAM index */ + UnimplementedDeviceState rsvd; UnimplementedDeviceState mdio; XlnxXpsEthLitePort port[2]; }; @@ -303,6 +304,16 @@ static void xilinx_ethlite_realize(DeviceState *dev, Error **errp) memory_region_init(&s->container, OBJECT(dev), "xlnx.xps-ethernetlite", 0x2000); + object_initialize_child(OBJECT(dev), "ethlite.reserved", &s->rsvd, + TYPE_UNIMPLEMENTED_DEVICE); + qdev_prop_set_string(DEVICE(&s->rsvd), "name", "ethlite.reserved"); + qdev_prop_set_uint64(DEVICE(&s->rsvd), "size", + memory_region_size(&s->container)); + sysbus_realize(SYS_BUS_DEVICE(&s->rsvd), &error_fatal); + memory_region_add_subregion_overlap(&s->container, 0, + sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->rsvd), 0), + -1); + object_initialize_child(OBJECT(dev), "ethlite.mdio", &s->mdio, TYPE_UNIMPLEMENTED_DEVICE); qdev_prop_set_string(DEVICE(&s->mdio), "name", "ethlite.mdio"); From patchwork Sun Jan 12 22:16:57 2025 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: 856784 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1179105wrc; Sun, 12 Jan 2025 14:22:24 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU/c76+jHLHFvv7asEGtUsW+90p0NQKF0z4Z9F95X0LeC1Uh/dE/57u8G+wpBa6epiafqbYxA==@linaro.org X-Google-Smtp-Source: AGHT+IG4NjeR3vG1KGpulGlj0fOswWfsMBISv40+3CZgrXayFlTOL1+Hd8hotXrMvQnq6ZVISkNx X-Received: by 2002:a05:622a:1a19:b0:467:87df:851a with SMTP id d75a77b69052e-46c710050aamr271446341cf.12.1736720544484; Sun, 12 Jan 2025 14:22:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720544; cv=none; d=google.com; s=arc-20240605; b=TTvg7pfY5leTcdxXEI5UxTJiS52ozL5xHbWiHpcTr2WK4PIXN9Oah2zHmjp6UHXXed d7mAKXAcpSuLOBO1i65IDkW1S9ssNW1gExqHnRas5hh8gB2lTLvVSyufqI0QJTSjG+l0 nfJFF/T7qR3UR7T6RRH7941v+Rwrid+QiCmTRaGITC8CpoK2ubK7CZMW6C/KtvZVogkO cq673HcRrbUnnpsWjvcMgNRtMPF1t6mk/eSxYy3Swh8MzdyqqVm+4D1VpiQzjcN2rAlX ug33iMlidm1O8snJpzn9BDRHLCSh8v4HGeTaDEuPbGHzptP/hNgzXoxvaBwDEMlzehfl cwWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=axL74DBGZ6nBWb/u1b/AX04nS7YLLg7dL20DomACELE=; fh=bkC6WjF1jfym67GYDD3fmCfvS42R54iNzek8F4CP+HE=; b=QXci7umix0Fkd0OvLlGLhPNHHPV2p4bYcJqJNyST/VEo2VHh5F6YetokBmGoUJu/c6 8a9MOkwj3nNWklWPFUng0NMV4kRizD3AMdh4F0m5OOHqTD3QbJ8dFlVmm4GRb7PiXlTL REzhmuG38FYHbQP3zfRag4862o25Ae1dFF34TcA+n64k6789webe9nD0hlojR3WeTjQc UGuCpHZZuOpnyDPPHAWqXOWKACFRf/EyKcjAE/PxdzDQlRMssoxnQ0KP1mM9IzVH+4qt EbUN94lG+Ei8La68AMtliyJzmnEoRUoGtJ+CMkah5CeMWM950DhtV/jpgoBcRJ8Th+qk ZVmw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S7imJtZq; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46c873fa499si79127011cf.357.2025.01.12.14.22.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:22:24 -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=S7imJtZq; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6J4-0001sP-Dz; Sun, 12 Jan 2025 17:19:44 -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 1tX6Ie-0001CW-T8 for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:19:17 -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 1tX6Id-0006WX-9e for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:19:16 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-38789e5b6a7so2017194f8f.1 for ; Sun, 12 Jan 2025 14:19:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720353; x=1737325153; darn=nongnu.org; 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=axL74DBGZ6nBWb/u1b/AX04nS7YLLg7dL20DomACELE=; b=S7imJtZqEQHPLzqYCg/XFQ7VHfHveCO11DyAlBDPSrhn8P7Z30DKY70vXzQ0t+utfn uiLVendte4X84Am+e6Z7N+ak9S3XKZ31TqWO7e2u3nc2VKDscyqPS79A0d/9EspV3FrH k+gjyG6kIX5h92ppCL7GQ9tc/1lbAdOz+yQ6LR4o4Zm/pfF+jBk2OabzRj4yqJMLdyWb F+JYilcBTthwtyJAFs6s1vTmlpve4aqj1ssjRq4ygu0Or5pTWamv6Jp/N4QTxuUpkF0z YeuI21AKhHlaCeT6zUiYgCwn1yMJZtkw45HnSSwvpDACOoDhlA2YgV+TbRnR1heIU2JA eW6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720353; x=1737325153; 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=axL74DBGZ6nBWb/u1b/AX04nS7YLLg7dL20DomACELE=; b=juTEMbUSTIqoanbMmN1JGG9yx4DVnqKEdmnX8hFkRFvAZqBQ9RXJSuuhxqNtaPLP7x A7aoTmYG1XFUVTxiGQ5YvPmuHNn5FWqukggCizv0EkyjeaKWbH6pnrs5gP4mb9QpQ7bx 5PA9VDM/ogueeBKToV4sQEFzvZNewNnif8RTc+KMKpqW2mL0GXvGpX62swAExSIol7MS asIAaWUEngq0imBAd6XE38QraMvQARXfdP2awSUQJoWks2LNTkAyFnYDvv23ZD1oAy3v hfewGIdzRS13j770L5VOY/dcVH6sjQQjGRrLKWJR/Jy/IWseizg0EVK4uKQrj+sGGrYn soXg== X-Gm-Message-State: AOJu0YyIgXpCiskzCijnqd7uoZiY8DfwKvswWlL5oWuB+esJVMDVrvYG y8X9StgzPcyiimzxN1K5qP8Uzoj8HhG+9ckh5dl7eKU31XySZdoAo4PhZCIT2A8RfuU9mcSgOCA 3bTY= X-Gm-Gg: ASbGnctHvJ9EjgfidrxHNyui/A1qE8qfoegJ33wOf9XsEqUlRiuAbrKJtY6o20hQenV eQDEaigOZloDWIpcDNOf7HNgdIEdE5BKEwZknnL/5VslQ0MDDyq+zTg3Dz53rXn1qRM3UtuZEQQ ZZXPHlyWnaDZiPW0xrGeYdstw2ZRo4Rttfx8TkicJ0zow+vvDbRyIkWcYOGqWCCK68BFKPcGDMI 0do3bcKkJ1Az9WR/3B4Ihf7nB+jzbjWTH3G7ehpMherY7dB/o4MZOuOC3yHfyTB5G7UPfpwc1pU GWBBkfG3JTf6n7owYeAjjNZI+mhRZVY= X-Received: by 2002:a05:6000:402a:b0:385:fa20:658b with SMTP id ffacd0b85a97d-38a8730a17emr14616705f8f.24.1736720353110; Sun, 12 Jan 2025 14:19:13 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e4c1bebsm10626974f8f.95.2025.01.12.14.19.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:19:12 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alexander Graf , Dorjoy Chowdhury , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PULL 21/49] docs/nitro-enclave: Clarify Enclave and Firecracker relationship Date: Sun, 12 Jan 2025 23:16:57 +0100 Message-ID: <20250112221726.30206-22-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-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=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 From: Alexander Graf The documentation says that Nitro Enclaves are based on Firecracker. AWS has never made that statement. This patch nudges the wording to instead say it "looks like a Firecracker microvm". Signed-off-by: Alexander Graf Reviewed-by: Dorjoy Chowdhury Message-ID: <20241211222512.95660-1-graf@amazon.com> Signed-off-by: Philippe Mathieu-Daudé --- docs/system/i386/nitro-enclave.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/system/i386/nitro-enclave.rst b/docs/system/i386/nitro-enclave.rst index 48eda5bd9ec..7317f547dce 100644 --- a/docs/system/i386/nitro-enclave.rst +++ b/docs/system/i386/nitro-enclave.rst @@ -13,7 +13,7 @@ the enclave VM gets a dynamic CID. Enclaves use an EIF (`Enclave Image Format`_) file which contains the necessary kernel, cmdline and ramdisk(s) to boot. In QEMU, ``nitro-enclave`` is a machine type based on ``microvm`` similar to how -AWS nitro enclaves are based on `Firecracker`_ microvm. This is useful for +AWS nitro enclaves look like a `Firecracker`_ microvm. This is useful for local testing of EIF files using QEMU instead of running real AWS Nitro Enclaves which can be difficult for debugging due to its roots in security. The vsock device emulation is done using vhost-user-vsock which means another process that From patchwork Sun Jan 12 22:16:58 2025 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: 856787 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1179211wrc; Sun, 12 Jan 2025 14:22:51 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXDYeIIISDoSQ2i+cEorNfHpWtwgaiUbn9XMmuUDR2h3j2uppUhGR6YEKiVBtFWNes6TFFz1w==@linaro.org X-Google-Smtp-Source: AGHT+IFd64upQcH80HZdFLEg4LzOJMnZd/V2vkbrTqJNjFiUc3ye0PrP+62heIWeaukZT5AVI+qj X-Received: by 2002:ac8:5f95:0:b0:467:6c5f:95c0 with SMTP id d75a77b69052e-46c70fd39e7mr227924721cf.7.1736720571407; Sun, 12 Jan 2025 14:22:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720571; cv=none; d=google.com; s=arc-20240605; b=PjcaxFrTvJUFKY9VyEaFjLd57Y5788lfezT06Scg+S6qp7wobw73IqADUFwfEpiqsi uwS5S/dbEStnlo9L5TgEyt8M6eqmFsCouFCakgtfLglgjqp9oJtNHSSz0usZLEDrbSK4 4okGRQR8FsqSTGJBdnLeaL5o+4X7gYp3js4LUO+2IzBmo9uFGidCBRWzqf0hBJpNXtHK s3c+6knO84smccSaN9cTB9Dlc1iqWsiX4X8TbzmiuP8vDndeAySGzjrQs7DbxMqQJ964 DJ9E1/Gxv7r4tkjB/3G63ivq2JmgaqUGEB5dQq2iCKXqvTjY7WZF6879KG6Y5lZNBsrr l54Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=kHYhV6C4zvi9bV3gw8In1CJAbx66/tuqvnD3Exk/IRE=; fh=3ZhHYSdHB65ls2ZcnTp+lX22kRJBIiwsLNglHqUd64c=; b=SX2UTKo6QAQrofsWsnLVddGG0F+h3Rfjwo5D8OWYlXT6KPaiX49ZwBIaSwj7IKI5Er JXK8xnpkHPR77ZwPGct+nYvd0jRJvEPDC4I6dajWNWe2pUni20fcvqdPLsr/PHRNXPM9 VFHDt9dewiJEVYN5kR+2oFwTZzE5h8ksY3kqvDhpwx3xC13dTOeEp/nTxQC+1jRw/F5k sjmfUEftG9NgAeFpB7bHK3DDiL8RavGCrdNuuqKvyQOCSQSsZF579AeRndvWVd5lX8S9 zWBAUg5Ze7zM44EGcBIrtJ1fV1w+MXNSVN+jkO7maZ2JeDhEZqJhIgYJdzuIIDg7azOT RBjw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BTkSB3yD; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46c8734effbsi74206591cf.181.2025.01.12.14.22.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:22:51 -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=BTkSB3yD; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6JI-0002Tn-DT; Sun, 12 Jan 2025 17:19: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 1tX6In-0001Pk-Mt for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:19:28 -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 1tX6Ii-0006Ws-8c for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:19:22 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-385e3621518so1913029f8f.1 for ; Sun, 12 Jan 2025 14:19:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720358; x=1737325158; darn=nongnu.org; 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=kHYhV6C4zvi9bV3gw8In1CJAbx66/tuqvnD3Exk/IRE=; b=BTkSB3yDGhN02LKeVGCMq17rJaV61mtjQvr9mnCntm50X1K5t3Y/eiDgualPRAPSqW L43ipEpxyRFw2nY0M8PKEe2Z57DfiCDBdRHH9GLiUKaTqWz3TkhbAZct4sy3sZTrzsK8 5ptygU1YAKuOFTpDwmfWhozhEXln19uvojO2xSO1lB4uRUjmpxlqBa9UYJezZZUBCtbo 1EiLnvVf9ViySqi3hBOw72apewD9NdFW/B8n6E0usZDs4ZU2+eWNteDHEwtLc0LmoU7f b1yuSl3XAvYJ8XWzcGJGYMiWIhae+3HmhlFPcy6kb30PPQvO1FK9AmPlO6AQPAZ3fKOg x20A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720358; x=1737325158; 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=kHYhV6C4zvi9bV3gw8In1CJAbx66/tuqvnD3Exk/IRE=; b=oWOuWpHtJwlojgs2ZS49oAUPxDiOEArAPIcE6KfSv3PhwbDmlm9If2tZOjZDdH30UC dZlaCvcURLmkn2zsf4HgQLWc60m6RBLDZXlPvckNR6CRhTXfwlhxylDU6v57vOJXLtGW 2QRbOLq/gP9TB/CJO77inlwp+IOQKHvJyQeZ+9O58GGY1ofnpresGCvTgwOTI6iXlyQm EHOhprcSu0VO3gbUojVW8qLQ7pERQ/1UDLMF/eRMULuWNWDmDwcJc71SGNmgYcjBQTWG 3zJBaBr2lMJQYyT41EICsxlPgde8hAjaq79XlEOzMECjpleHrGxpxPIMfw6h/6bFSSag L9mQ== X-Gm-Message-State: AOJu0YzPPWR+ZSXEvl5qQkeclPlodfRd/fKWBpPlKfO7FgSjD5umX3lc hnGylFHenV395tNtQ3QUmjfg3v34ZCRbgRaftlm8PKaIvz1iOawI+2uVmsmUDIQxVo01MJb5lC+ Fyks= X-Gm-Gg: ASbGncsrpunMQZpqzh0AfNDGANbXV6Q+rK9aKAdlS8KaCPs0x6BWiuSeVKEeMWgdNCc FoltQbMVQvp5vIPC/KLqFi05MM5P2px0JvY2HYCh6lFDE7Q9F7lMccFpxZ+AuhITUEsiRK0sDZ1 haVwXQz4qVOxiLunwyThSjrLCYzTIgCfT4pO1ndi+m+aqmAgN7UCeUrPLE5PsmKFktoaDCdPBod Lhcq5sVSyNYmvhUZICu4Xq+Mts7uNK2BOi6YmUhEqIIvIKFthcH98q/rD6zae62HxGXYeCPBFGD 0XUgrOizdg5u8Rx0n5WRV7aac+o1X6I= X-Received: by 2002:a05:6000:2a3:b0:386:4a0d:bb21 with SMTP id ffacd0b85a97d-38a8730a11emr16529015f8f.22.1736720358331; Sun, 12 Jan 2025 14:19:18 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e38428bsm10610306f8f.37.2025.01.12.14.19.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:19:17 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?M?= =?utf-8?q?arc-Andr=C3=A9_Lureau?= Subject: [PULL 22/49] hw/misc/vmcoreinfo: Rename VMCOREINFO_DEVICE -> TYPE_VMCOREINFO Date: Sun, 12 Jan 2025 23:16:58 +0100 Message-ID: <20250112221726.30206-23-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-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=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 Follow the assumed QOM type definition style, prefixing with 'TYPE_', and dropping the '_DEVICE' suffix which doesn't add any value. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Marc-André Lureau Message-Id: <20250102132624.53443-1-philmd@linaro.org> --- include/hw/misc/vmcoreinfo.h | 7 +++---- hw/misc/vmcoreinfo.c | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/include/hw/misc/vmcoreinfo.h b/include/hw/misc/vmcoreinfo.h index 0b7b55d400a..1aa44771632 100644 --- a/include/hw/misc/vmcoreinfo.h +++ b/include/hw/misc/vmcoreinfo.h @@ -16,10 +16,9 @@ #include "standard-headers/linux/qemu_fw_cfg.h" #include "qom/object.h" -#define VMCOREINFO_DEVICE "vmcoreinfo" +#define TYPE_VMCOREINFO "vmcoreinfo" typedef struct VMCoreInfoState VMCoreInfoState; -DECLARE_INSTANCE_CHECKER(VMCoreInfoState, VMCOREINFO, - VMCOREINFO_DEVICE) +DECLARE_INSTANCE_CHECKER(VMCoreInfoState, VMCOREINFO, TYPE_VMCOREINFO) typedef struct fw_cfg_vmcoreinfo FWCfgVMCoreInfo; @@ -33,7 +32,7 @@ struct VMCoreInfoState { /* returns NULL unless there is exactly one device */ static inline VMCoreInfoState *vmcoreinfo_find(void) { - Object *o = object_resolve_path_type("", VMCOREINFO_DEVICE, NULL); + Object *o = object_resolve_path_type("", TYPE_VMCOREINFO, NULL); return o ? VMCOREINFO(o) : NULL; } diff --git a/hw/misc/vmcoreinfo.c b/hw/misc/vmcoreinfo.c index b1fcc22e92b..145f13a65cf 100644 --- a/hw/misc/vmcoreinfo.c +++ b/hw/misc/vmcoreinfo.c @@ -47,13 +47,13 @@ static void vmcoreinfo_realize(DeviceState *dev, Error **errp) */ if (!vmcoreinfo_find()) { error_setg(errp, "at most one %s device is permitted", - VMCOREINFO_DEVICE); + TYPE_VMCOREINFO); return; } if (!fw_cfg || !fw_cfg->dma_enabled) { error_setg(errp, "%s device requires fw_cfg with DMA", - VMCOREINFO_DEVICE); + TYPE_VMCOREINFO); return; } @@ -95,7 +95,7 @@ static void vmcoreinfo_device_class_init(ObjectClass *klass, void *data) static const TypeInfo vmcoreinfo_types[] = { { - .name = VMCOREINFO_DEVICE, + .name = TYPE_VMCOREINFO, .parent = TYPE_DEVICE, .instance_size = sizeof(VMCoreInfoState), .class_init = vmcoreinfo_device_class_init, From patchwork Sun Jan 12 22:16:59 2025 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: 856805 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1179605wrc; Sun, 12 Jan 2025 14:24:45 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXzbB7TK6t8YD86E4KxYgNjujDssACJo2yt15ZIiiIxD/nDGwZWLmQKrAw+fAw3B0IME6Y+lA==@linaro.org X-Google-Smtp-Source: AGHT+IHhEWiMpOfzK2fme/HIcztaIrxT+staJPonMNvya5Mdv18UonY0hhw+fLqKJ7XIc4T4l5TM X-Received: by 2002:a05:6214:6002:b0:6e1:7b35:a0d5 with SMTP id 6a1803df08f44-6e17b35a3c3mr587406d6.7.1736720685244; Sun, 12 Jan 2025 14:24:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720685; cv=none; d=google.com; s=arc-20240605; b=BvUqqvysL/OGy4fuEdEpexCAO4d419aIEa8hXdevzdMVwgqx2bcIVZXw16JecK/7Ig jAH/WWVDuRkOX+j3lFms4nsjsHRixhVJMgOLb2tCj8aqt9K6aXX/qKaUZg9UsdCXqxf/ PKqMATvwwp0IoScjXe7uez9oI2HAu1CxsfSP6QsvFIC1l6uqBbwcQD61XtcdnoK/HF21 18gFGqAiPWLzQYnDQpEHpLj1dSbPU6k7GjSjIb+TKSGGWYTsu34WOfI0EBOzV2gY5C4g sxVXBdELC94XyCWCRFRvRTE6i3RVeQ20uPnPI8k9k8I/3QxdTZ/WNGQlCal42Cy28eHC HPzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=p6BLB98QOhYB9SJnN/K59or+VrLw70OVqLIYKmEsPfE=; fh=9WRnyL38aYsp8aAc4GCnnt6DPSS3ieJwiF5wkNbWJXc=; b=BKRB/p7INQNZUrwdiNbgKrZh1UG/WS1uU0I7jYi0gfs/dSpTbDVlIr9GMwTuYiyi1H EvuvL9v/AJj3xNF4FlVhN+5fo1kHtO6ks3DkwigZX0AW41h3zaTSrn3tvx0oQztKtLLl gE/bDwxxP4+5JqafT33I3WlK0go27XOabnQCm1SpG6chy0CFcjtBGsUfplITAWxe9DJD p+BkyZWhwNK16SiuOenJ+RrCmEflU3LW8hKYD+odUxmgsjvz2iPkAHrCoq9Iobha3r1l ymAFP/HZjkDCinP8WNP3V19DrtsHmaYCTuli22LaGUrntK7VGkeB4oAQm9xg8cnHlfax gkxA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=owbPDE08; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6dfade984dcsi75190606d6.221.2025.01.12.14.24.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:24:45 -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=owbPDE08; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6JP-0002cj-4r; Sun, 12 Jan 2025 17:20: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 1tX6Ir-0001X6-O1 for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:19:30 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6In-0006XI-SL for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:19:29 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4363ae65100so38321715e9.0 for ; Sun, 12 Jan 2025 14:19:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720363; x=1737325163; darn=nongnu.org; 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=p6BLB98QOhYB9SJnN/K59or+VrLw70OVqLIYKmEsPfE=; b=owbPDE08GxOZ3tqY3dP+Pb4+H//y8mWP2LNCoxvEznFamSagDvHWAyUXxYD7z/NBgj s2nORXU/S/4J/ZyeYYUtTvnl8GlghqA6rGY3KA8rZYjBFpS3DOAraY89+T7sT6EOz0j6 t6Yo8/yq1y/81U/9AhjALjkBKNB+VlNZ0BwW1c/ABOo16qgu288HWZb+yDdUcommWSoH lvDGRvf2EI6wsoq0+G/KN37sp8zlYpgVjHZ9IWt0KMDk53fdc3KxvB2v/IrtqrKc+qd4 KaVrpKNwLpEaFHawq6pedKTXk1jabT+87qNR+iS4z1W5a7ztaU83M8a9UMwjgWIZkkE0 kWDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720363; x=1737325163; 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=p6BLB98QOhYB9SJnN/K59or+VrLw70OVqLIYKmEsPfE=; b=TyF6zDwOgyH9Gn9AS+409h/0vFhkqYNtN5xiHuCuiE8p/jvJg8rApLuPvAfB83NIBC qkH7PavTcEuErZr3A+bDlSKa2akqLSJB0soN18XEUkheqt7aRw/Vz4CoPV3vJQNCZFb+ WG1+51sO8wTh1uLvXmFyBgJPEUkcHJ4rZnTgJSVAlymSlEq9pXBbjmHDjj1zRVhr7RAz 1eabTkqUdAkbPAk0w319XflV2GWqw7iCEStZ8yka3+RoEKO73d1yURShW+MH8/o/hZ46 37cd29iZaYI/h/gxRM11agt3hB5WTcZ/g/svgeyIGnGPt4Vcm1yWw7G5KbDfY0o4psn4 oseg== X-Gm-Message-State: AOJu0YymsuOwfrjNh6icZYT2OodhUx2tf3Ar78eMJMLlVXvDHvxCgR7M ToZLiGeMWpGE1/3uGOG36czMei6JoHWsyutnvOpK3L+oM4WAUfIJAJyr5QM9p3uNuyHC9AFVhvU BzYo= X-Gm-Gg: ASbGnctQNQHTfIuN5aD8CFZYBt1ss/Q3Qbsww7lsOpBea5Nj12So7jhTvi7osQRlF1N y21w7TKuX4O14kbwBXqdX7+QT/9tSDZGvRWJxYrBfFcSi9HIbpy9DIIiWd30ZQg+6Th8E/gNdW3 fteNA5bfusoVXGFxfWjE5PKwoQ3lmQeZ3qYXfp7WE2dp+5W39prE6Gvix6YXdQGK5glE33O5mY8 dqiXZasgWu9xR6ANuvhhlIQUggU5joMDb/xREdMUTBlr7H9JotJumfm8KEMwlowyFXI/iNVOJLJ ab3TSht9ZCs9ZdnlQRgz3jp8HI74AAg= X-Received: by 2002:a05:600c:198c:b0:430:57e8:3c7e with SMTP id 5b1f17b1804b1-436e26f2a30mr139775635e9.28.1736720362777; Sun, 12 Jan 2025 14:19:22 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436dcceb374sm151415725e9.0.2025.01.12.14.19.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:19:22 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?D?= =?utf-8?q?aniel_P=2E_Berrang=C3=A9?= Subject: [PULL 23/49] hw/misc/vmcoreinfo: Convert to three-phase reset interface Date: Sun, 12 Jan 2025 23:16:59 +0100 Message-ID: <20250112221726.30206-24-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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: Daniel P. Berrangé Message-Id: <20241219153857.57450-6-philmd@linaro.org> --- hw/misc/vmcoreinfo.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/misc/vmcoreinfo.c b/hw/misc/vmcoreinfo.c index 145f13a65cf..b0145fa5044 100644 --- a/hw/misc/vmcoreinfo.c +++ b/hw/misc/vmcoreinfo.c @@ -26,9 +26,9 @@ static void fw_cfg_vmci_write(void *opaque, off_t offset, size_t len) && s->vmcoreinfo.guest_format != FW_CFG_VMCOREINFO_FORMAT_NONE; } -static void vmcoreinfo_reset(void *opaque) +static void vmcoreinfo_reset_hold(Object *obj, ResetType type) { - VMCoreInfoState *s = opaque; + VMCoreInfoState *s = VMCOREINFO(obj); s->has_vmcoreinfo = false; memset(&s->vmcoreinfo, 0, sizeof(s->vmcoreinfo)); @@ -65,7 +65,7 @@ static void vmcoreinfo_realize(DeviceState *dev, Error **errp) * This device requires to register a global reset because it is * not plugged to a bus (which, as its QOM parent, would reset it). */ - qemu_register_reset(vmcoreinfo_reset, s); + qemu_register_resettable(OBJECT(s)); vmcoreinfo_state = s; } @@ -86,11 +86,13 @@ static const VMStateDescription vmstate_vmcoreinfo = { static void vmcoreinfo_device_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); + ResettableClass *rc = RESETTABLE_CLASS(klass); dc->vmsd = &vmstate_vmcoreinfo; dc->realize = vmcoreinfo_realize; dc->hotpluggable = false; set_bit(DEVICE_CATEGORY_MISC, dc->categories); + rc->phases.hold = vmcoreinfo_reset_hold; } static const TypeInfo vmcoreinfo_types[] = { From patchwork Sun Jan 12 22:17:00 2025 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: 856797 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1179438wrc; Sun, 12 Jan 2025 14:24:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX5Bx7UeP+XckZng3iXO0GU4x47EVhMGvC21fqQrNp42kWUVBdqcAc80FLQ4PXKQpQkvbnMQA==@linaro.org X-Google-Smtp-Source: AGHT+IELHa1PNb6kjh48gY1IcHiBqH1u/6hL2rjMDwcYfiAcbZYFZPKzEHHmCUu4SfcyJJzudUab X-Received: by 2002:a05:620a:370e:b0:7b7:142d:53c4 with SMTP id af79cd13be357-7bcd97a71f6mr3529657785a.54.1736720639964; Sun, 12 Jan 2025 14:23:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720639; cv=none; d=google.com; s=arc-20240605; b=Tog/DKm+q+uv7MoshIe6qCV6lRa2iLlebe50IzA1fceQMnVERI9UoPBix7SwHoELNf YDgiye9b+hHcCcsmNK2Yn8lDNdA6cVIsY1BgJOZhmT3qN//l9eLqoNPdAsdE0RHtSU1Y Pr3qIBAu4PqMvVigrEx8kHWMcSF4wolC96YtQQskP10H06Rkjzx+P0cXzoRBHd84qTED fyyFb/W1iFV/3iMnls94gVQ1QDkV72s8ojCdxU8q9M7ERQv/HDnvodVGlGOcE0mRl0iG 5wzAarG3MdR2LKHdYDzQr1xN9KLIO3YxAIezvkxzzCpVmH6Y+qlhQEidV8XhgKW90TM0 OFUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=1OAhYKzZLI8lTOKGbMAAzPTEW29D2+vTIYkkz2t6RXA=; fh=XFr5VEWnexyeyL31SttPR8eP70bUFi12UNF9+gSdaQ4=; b=bKIVJLTrAAAceTGYVRJhVzDsET4p3a6X0uc0HFVla7ASCRXHQ8Rce9BytIkokpLXXX EV0BBQXXnTAJtIwO0kMdxhfdpcJHP4XeTB3R1NtieOzH8iYbkuA9+e/UcTBnHQk++epv GRj5ry8Am4Z+kr37qrGw+I49jICFb5GjtN8cerBUDSHj/51FzqeX3p+j53ztsN3a6cC6 wMIEDXjPvUeqMXI5WgDEuhbgwho32wrOMnzrHaLkbASWUeDNeZ7Aj4njRz0KWVGJWdQx HDiBywY/xLaFMhWcwGutMdCs4JB63MTp/gEj4+nB3NGUUQFbOvzWFbNcjGexq/F6DDst 3wHQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=N9TWEKQ5; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7bce34fddf4si927371085a.421.2025.01.12.14.23.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:23:59 -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=N9TWEKQ5; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6JY-0002tX-HU; Sun, 12 Jan 2025 17:20:16 -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 1tX6It-0001a3-5T for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:19:32 -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 1tX6Ir-0006Xm-9c for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:19:30 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-3862d161947so1872219f8f.3 for ; Sun, 12 Jan 2025 14:19:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720367; x=1737325167; darn=nongnu.org; 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=1OAhYKzZLI8lTOKGbMAAzPTEW29D2+vTIYkkz2t6RXA=; b=N9TWEKQ5OLf4BHLDsx7zWwTtQSGqAMhAGaVDlKJmJh5SVRH5Lfbypn1Fi3mhWK3Bnz 2k7vqFwmAP14gQnNNFeNtxKGLLzSQ5lpabaAdtcH4WtzyJnKq7N83faCuxYWLCgA/dwh M54EHDgmZ2NIWReuqci0Rk4Me9jvrWBAmB5iyX+x89NZB2OLGQ9xqzUooEqA2vFUM6j8 jYkGgCGvtCyIjX5MbU7rACZy6r9KxSQQY1o6kiAtCe/DbILQx3+3EtTYM1V2f0Yjaosd FNqtdYEAHhqrTtqCMm4tzUZkfqYdmZpHTG4LTPhwkY6cdeqWlWin8i6BIXEaJ/tAzGq+ C0kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720367; x=1737325167; 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=1OAhYKzZLI8lTOKGbMAAzPTEW29D2+vTIYkkz2t6RXA=; b=mCFJHcT+UuDbYxK+ITs1XLqdI9HCRM1XX5x99ju45wpDWnqTVwES+Bdk4ezQGHmxJq azgqjXAnFOR9iJUth2xrpqGnwPoIVnX55AIoMIa9AzyVzfS87E/aK7s70qBupfXmswb5 FnU7UqfyEHuKkEuaQ+J0AInn0xd4/RQVUY5e69vyo3qceQ7xqZWvnJL5PtTodJZA+o7P sccjEIWUwRc/HoX8HuhsyXuS/XlkO7Lds/8eA2ifqZV7jnwY/bw1/IMj32MkNNAj9mr0 EZCVJObKPV+hshXP+vp75W0ScIMf344NyjbVhQbJfSRRhndJ/dJUB+1V+ks6Vk7Zr3OJ AFcw== X-Gm-Message-State: AOJu0YwpDAKTrzZIh42RSP6IzUxMBJ/Fs2vmQteo2Nqngh0gMMAiNXGr RZMA7w0i8et6Pvn7AcLmDJ177YoDc5tXN6ZFBq/O6WKflhXsK+fQLf3YgJVCGgebLH462G7h111 EocM= X-Gm-Gg: ASbGnctBJRgbZs/MPOV0sdpYxJBWKmXX3RMybPYOeoXMUyVTYtB2Q7AZW12cgSGPK07 S57ijYVXlLVeIVZo7DymdY11lNi73AWeUbXRBrW+Nv5sD1k1KrIPypHG20Xnmc3eaE9F38Ut1FQ uRCUTt76b7AdC+/U5OfHsGAgh9P2K+rqP6OFori03r5mdu82Gqw5YNQJlPBMpOniPzPwDQ9MGtT M8+9IKY4L0C8Vc/k6wN2+vbPd23LAyupLaDCD/JqS3bVm1mG25ew0YcN10PShJrn0yDuUG+rp2S EXsnibG2B+AfIiH07Cb/x5MibFXRVnA= X-Received: by 2002:a5d:59ab:0:b0:385:fa26:f0d8 with SMTP id ffacd0b85a97d-38a872f6af0mr15624682f8f.8.1736720367214; Sun, 12 Jan 2025 14:19:27 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e4c1dc6sm10636757f8f.96.2025.01.12.14.19.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:19:26 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Akihiko Odaki , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= Subject: [PULL 24/49] hw/pci: Rename has_power to enabled Date: Sun, 12 Jan 2025 23:17:00 +0100 Message-ID: <20250112221726.30206-25-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-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=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 From: Akihiko Odaki The renamed state will not only represent powering state of PFs, but also represent SR-IOV VF enablement in the future. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20250109-reuse-v19-1-f541e82ca5f7@daynix.com> Signed-off-by: Philippe Mathieu-Daudé --- include/hw/pci/pci.h | 1 + include/hw/pci/pci_device.h | 2 +- hw/pci/pci.c | 17 +++++++++++------ hw/pci/pci_host.c | 4 ++-- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index cefeb388bde..4002bbeebde 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -674,6 +674,7 @@ static inline void pci_irq_deassert(PCIDevice *pci_dev) } MSIMessage pci_get_msi_message(PCIDevice *dev, int vector); +void pci_set_enabled(PCIDevice *pci_dev, bool state); void pci_set_power(PCIDevice *pci_dev, bool state); #endif diff --git a/include/hw/pci/pci_device.h b/include/hw/pci/pci_device.h index 16ea7f4c19b..add208edfab 100644 --- a/include/hw/pci/pci_device.h +++ b/include/hw/pci/pci_device.h @@ -57,7 +57,7 @@ typedef struct PCIReqIDCache PCIReqIDCache; struct PCIDevice { DeviceState qdev; bool partially_hotplugged; - bool has_power; + bool enabled; /* PCI config space */ uint8_t *config; diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 78907527f2e..2afa423925c 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -1598,7 +1598,7 @@ static void pci_update_mappings(PCIDevice *d) continue; new_addr = pci_bar_address(d, i, r->type, r->size); - if (!d->has_power) { + if (!d->enabled) { new_addr = PCI_BAR_UNMAPPED; } @@ -1686,7 +1686,7 @@ void pci_default_write_config(PCIDevice *d, uint32_t addr, uint32_t val_in, int pci_update_irq_disabled(d, was_irq_disabled); memory_region_set_enabled(&d->bus_master_enable_region, (pci_get_word(d->config + PCI_COMMAND) - & PCI_COMMAND_MASTER) && d->has_power); + & PCI_COMMAND_MASTER) && d->enabled); } msi_write_config(d, addr, val_in, l); @@ -2963,16 +2963,21 @@ MSIMessage pci_get_msi_message(PCIDevice *dev, int vector) void pci_set_power(PCIDevice *d, bool state) { - if (d->has_power == state) { + pci_set_enabled(d, state); +} + +void pci_set_enabled(PCIDevice *d, bool state) +{ + if (d->enabled == state) { return; } - d->has_power = state; + d->enabled = state; pci_update_mappings(d); memory_region_set_enabled(&d->bus_master_enable_region, (pci_get_word(d->config + PCI_COMMAND) - & PCI_COMMAND_MASTER) && d->has_power); - if (!d->has_power) { + & PCI_COMMAND_MASTER) && d->enabled); + if (!d->enabled) { pci_device_reset(d); } } diff --git a/hw/pci/pci_host.c b/hw/pci/pci_host.c index 4510890dfc1..80f91f409f9 100644 --- a/hw/pci/pci_host.c +++ b/hw/pci/pci_host.c @@ -86,7 +86,7 @@ void pci_host_config_write_common(PCIDevice *pci_dev, uint32_t addr, * allowing direct removal of unexposed functions. */ if ((pci_dev->qdev.hotplugged && !pci_get_function_0(pci_dev)) || - !pci_dev->has_power || is_pci_dev_ejected(pci_dev)) { + !pci_dev->enabled || is_pci_dev_ejected(pci_dev)) { return; } @@ -111,7 +111,7 @@ uint32_t pci_host_config_read_common(PCIDevice *pci_dev, uint32_t addr, * allowing direct removal of unexposed functions. */ if ((pci_dev->qdev.hotplugged && !pci_get_function_0(pci_dev)) || - !pci_dev->has_power || is_pci_dev_ejected(pci_dev)) { + !pci_dev->enabled || is_pci_dev_ejected(pci_dev)) { return ~0x0; } From patchwork Sun Jan 12 22:17:01 2025 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: 856802 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1179587wrc; Sun, 12 Jan 2025 14:24:41 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV9w9P1PK9f46Jh9w+yEvoD223lfPYxlxoYVwDhkRTGa70xRsfJLGnOLntbkm7lu1247Jokuw==@linaro.org X-Google-Smtp-Source: AGHT+IFDBiwe73jPsPBLymwULDf+McyFdu9EZ+/HPeQRsU/Gfd+O+yKZUQdT0UuUAAAKxyP3dKvn X-Received: by 2002:a05:620a:410e:b0:7b1:3f19:b81a with SMTP id af79cd13be357-7bcd97d1965mr3392997385a.53.1736720681706; Sun, 12 Jan 2025 14:24:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720681; cv=none; d=google.com; s=arc-20240605; b=U3iUley7/j5ILJBnr0Prix0pJRLqYsvubLLShnXG7uv9nIm5dZ8g5EIEn2nBNnKMh7 mbDLElcj+w5V1tTXnRWsM3hxVgRBlKscpR1O6y5fDC2Ajpr4DyA1aKOE1c0UkmTwgj6u TdIYXiQgWHsT/OYM2zNyqZIrakP1bgOYnp4faIY3PtIzQbh49W5nKlIg3b1UdoHRUI// lpYDTB9RjPW1FsrWL9mnDx2D6YYMsM/btSydwF61zqdO/DZO5KxDsdEWK5XFVsH+YSU0 O7sFdWIIK/pfdYKzhND+zAzADEkldOl+fPjxexDjOz93TR3OJ/zq+mg23U7xzGZOOb9s GT2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=ng7p8uEQsgEiT4/xccHokv2a4110PAynaA5YHFbpMeA=; fh=8b+jzOz2r1uo2neUrhcs8vEAC8s07EDZhm5fEcEwG+g=; b=CsQcMfhl5uq1jWgS+f6l7NjgYQB5OV/nky9g3UPxKSVlpJxFidV4jQvY1LhuP1ZgAA FL3M60Ue+XRs5vb7UegatljavTX0omgunlv6MRihlSuBswMAiCaPxmpglCBIyG1kJ/Cz uxMmPllw9MMzQUEcB/fNmDX5Rc1lzkGod1CbKouyeSuas2MDqYdwYJXOaw4bQjRsaIIz Lc2/ZGFa2iMdXUzCBfIKRny0eatcpYncATxTxxp+EX5yo04G3Wrf9Y9FAfSL7RlokaVz b4vUfV5OXFLORk6I+4Ixqy1OC7lVQh5i7nLqCGpqc0y5WsTKR0TStYBQc1MYK5cQ4ZZL D0Bg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rx0She0J; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7bce3238632si961620285a.197.2025.01.12.14.24.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:24:41 -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=rx0She0J; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6JR-0002ix-Dn; Sun, 12 Jan 2025 17:20: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 1tX6Ix-0001j9-3q for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:19:37 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6Iv-0006Ya-K2 for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:19:34 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-385df53e559so2972793f8f.3 for ; Sun, 12 Jan 2025 14:19:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720372; x=1737325172; darn=nongnu.org; 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=ng7p8uEQsgEiT4/xccHokv2a4110PAynaA5YHFbpMeA=; b=rx0She0JgICXStgVSoTNRrbzTbufO57krtHz+ujrKzUlM4ej6fuuV400OuCbgP0Iiw 6WqSr3+wsASclAaFcga9Ozl7o8ZtFSo8Ma7PZzgDKwUbjT29r1D5CEWijBW4897G2dXB TfgG8c45xXf27vNc7wC8xJrXX3H+r0wH5w/ZprdKbM6MYVfbN4tTr8WfsRbY+/pyHjHB hKxMr1qLPQy5LDdRYq8Tyji6bLyiGe/gfJUm1Qld7LB14gaZSp1JUsB/31J0IkHCO0gC eR8PGan41Wl/SKZpPGdHr/wWzWBgGYHLyyTuahPrUTPUymjOnpEJfgLACEUPsY0/F2A2 jVYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720372; x=1737325172; 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=ng7p8uEQsgEiT4/xccHokv2a4110PAynaA5YHFbpMeA=; b=ENv9R3GSkJcrnVQiTZyv2kxnZtpJun3ooYAwpfmUu4akgeP+vwx6wlLPCo8L65W8Y/ s0xCsvmV9ekw8Ql8d2LUnqONejGN8fYp5LxPs7l0gBhMhxW5NQAca4e/RxYyfC5pgu5C 7glMIJjte822caUHFev9HtL/R/66/Ii0AF1HSmQBYkGXp95ygDEQ5iv7bD/Mn6ea02l4 eNbqkG7tRRS3btyUL5K0pfih9fRQWgTYUGpJhGnFhwl+3qKSUjp9itbGL8foaSe6c9x+ Q3y+WvNbpTRsLA6XKcyqfAGcINZ7wTML5C8vz9Soa5djPMCeasr6RrQvDT72rzkGdn37 +cow== X-Gm-Message-State: AOJu0YxfZ5UHU0xwfMnrE4y8Scq5A3xJF8pqlFaqf4hT1lQo/a8wz3lP xq4jKgjLoJzKpHKtSQt/gKa3/bhNl9NQm0HBU7qFqXGlsmg8vjZRtZpgwd0zPgZIwWjrit7Djjs OwHM= X-Gm-Gg: ASbGnctqvUc4cJLMrFqTnFERMWAdtoAFR5dmDfy7TjVrP+s/D5c38loOQx2iV1rF5IE Imn9nBT5pWS3lb+XqltNxexsq7b/dRQaaLoEJF5yVhfGK54BI3fudygmqXGVwA0GkYFF4zzBLYS IlpnsmAvsc507+84y11SZJLX1pXwqKPwdnsmfzGDVv7uvclUVvQG2mWSUKSUpu+gOmHXh7qVFLE XJDUQCOdoA7p25T3m/5YqqUHfQxi0tfI5ch9kxLQKTacB09r2g1joBIduf40GWqV8gKwtVD3JDK PD8HzcbJizdweqtAMVUn77JzB3PjCHg= X-Received: by 2002:a05:6000:2aa:b0:385:fa26:f0d9 with SMTP id ffacd0b85a97d-38a87086c15mr17848108f8f.0.1736720371683; Sun, 12 Jan 2025 14:19:31 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e9e6236bsm122243305e9.37.2025.01.12.14.19.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:19:31 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Keoseong Park , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Jeuk Kim Subject: [PULL 25/49] hw/ufs: Adjust value to match CPU's endian format Date: Sun, 12 Jan 2025 23:17:01 +0100 Message-ID: <20250112221726.30206-26-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.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 From: Keoseong Park In ufs_write_attr_value(), the value parameter is handled in the CPU's endian format but provided in big-endian format by the caller. Thus, it is converted to the CPU's endian format. The related test code is also fixed to reflect this change. Fixes: 7c85332a2b3e ("hw/ufs: minor bug fixes related to ufs-test") Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Keoseong Park Reviewed-by: Jeuk Kim Message-ID: <20250107084356epcms2p2af4d86432174d76ea57336933e46b4c3@epcms2p2> Signed-off-by: Philippe Mathieu-Daudé --- hw/ufs/ufs.c | 2 +- tests/qtest/ufs-test.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/ufs/ufs.c b/hw/ufs/ufs.c index 8d26d137918..428fe927ad0 100644 --- a/hw/ufs/ufs.c +++ b/hw/ufs/ufs.c @@ -1164,7 +1164,7 @@ static QueryRespCode ufs_exec_query_attr(UfsRequest *req, int op) value = ufs_read_attr_value(u, idn); ret = UFS_QUERY_RESULT_SUCCESS; } else { - value = req->req_upiu.qr.value; + value = be32_to_cpu(req->req_upiu.qr.value); ret = ufs_write_attr_value(u, idn, value); } req->rsp_upiu.qr.value = cpu_to_be32(value); diff --git a/tests/qtest/ufs-test.c b/tests/qtest/ufs-test.c index 60199abbee7..1f860b41c06 100644 --- a/tests/qtest/ufs-test.c +++ b/tests/qtest/ufs-test.c @@ -145,7 +145,7 @@ static void ufs_send_query(QUfs *ufs, uint8_t slot, uint8_t query_function, req_upiu.qr.idn = idn; req_upiu.qr.index = index; req_upiu.qr.selector = selector; - req_upiu.qr.value = attr_value; + req_upiu.qr.value = cpu_to_be32(attr_value); req_upiu.qr.length = UFS_QUERY_DESC_MAX_SIZE; qtest_memwrite(ufs->dev.bus->qts, req_upiu_addr, &req_upiu, sizeof(req_upiu)); From patchwork Sun Jan 12 22:17:02 2025 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: 856813 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1179685wrc; Sun, 12 Jan 2025 14:25:16 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXjmZHbr27OZRypfBinx02CNbgzwkZub87B7UNsWP0GR3R5nfpvzw9PH0mC6izOJG2BBXZ8LQ==@linaro.org X-Google-Smtp-Source: AGHT+IHQiN6e2hikjvdZa5+QF6Nw/IVEqFSmBZ5nPI6vj2nI0G89jkHI6Z0Fe8v7r8DK6LQE3wIj X-Received: by 2002:ac8:5dcb:0:b0:46c:79c3:5cbe with SMTP id d75a77b69052e-46c9956ce46mr118989181cf.2.1736720716354; Sun, 12 Jan 2025 14:25:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720716; cv=none; d=google.com; s=arc-20240605; b=Kcd+Wi5ao1YOzHZIg9S/UmeUbZBJE6kk2z4MKnxVeyC0YvSeO3z6+sE6D0BYLlaOUj LSgsJ0mWppjla4SM7q4PC5PU/8pRl5R1N3a+FxMAMVomQaRheFflWWwOo8U9fFT0DzkL V9ms47eJAU1bDo6ulO+eR7qUkObi439woijsvNPOVGNuRzIy5l4zi3BA5bji3rXES27a dPI1AfXMtlskN3+blPAfzZvYgGr7ofgM+t6aBIvtMlF6F9a7+TNAU17pT8vBI/cX3ZZf jwwFMKUzhOhCWbNfPHUTqd1YD82011U8sva2d2Nnat/fZP9arrxYruuiOjwmxjvp1ki/ 7fRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=EmxRTGMWROJpEWZSo1u+jDCiV46gwFTHUKYAuplU0Gc=; fh=pGYVoKmEbmBJXedzdvuKSuqi1EMwZm5z032l2+Fj52I=; b=I1Rcml0AisIDCGrJxNB9uRmyi0l1czrNupvsvhPQ2rWXLm4DcxpEHvNB01Ca1nITlq QbcpbAqKKsmzG/u1td4EvSLMbEGVhC0UzDrkhDu2cYH2d0VLruYVMwLQiXDTQTETe7Qu MJXqmZezxzhNfK1aHKBUXF/zH5OilzXnkLjCD/OBTQebCIHRayo0ABTnXE/LMMck8mhM /1e0O8dbSvSGBJTrj8zh8Dgeg3dHkQrX1Qbnh9e9qHjF5AME2OiuBkem51MTk3Uur/Dp rDDh6lDmcjD1Is+ZFVZkVv7inImk4QlYbjxiCNrdNnV12Dbn+TK7qFIuU/knuMAXBhkK Isdw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SXh4O31D; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46c87331351si73818521cf.75.2025.01.12.14.25.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:25:16 -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=SXh4O31D; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6Jn-0003Ns-UA; Sun, 12 Jan 2025 17:20:27 -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 1tX6J1-0001sB-Hz for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:19:40 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6J0-0006ZL-22 for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:19:39 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-436202dd7f6so42825605e9.0 for ; Sun, 12 Jan 2025 14:19:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720376; x=1737325176; darn=nongnu.org; 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=EmxRTGMWROJpEWZSo1u+jDCiV46gwFTHUKYAuplU0Gc=; b=SXh4O31DEXF6kSz35CPArjT7T5ZXu5R8snUd6ZksTHwJxzF9uwukxAvdSwJSw3CLiI +Go90WcgA23g2hDJvJ7/yRwD+hfSaSYeGYAZGrqxrI7FaIG9xDtFh9GEm6vvdrffTary NEImkh5Nw3f8eYyKmqFoG0+SESSgMI/9XVhU7uIvfKzvZ8mtqj3tLGHkZPXf85AZDBni FgFm4KHc4ciSlM0Me/SAY5i9W7QK8I2257FlL0Ad3hTcfQ14TIZGtM5cTbpTZXUpeLVK sOggDhZzduy+Q32fYp/IBePwdShXEVE7/20xaroTAzySEvYy9Yvy3ITfnk0MDIF8KA0M CEUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720376; x=1737325176; 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=EmxRTGMWROJpEWZSo1u+jDCiV46gwFTHUKYAuplU0Gc=; b=gVkR6NP5G3RoyXUlCq5QbUnkDdsQfQ3wCdbew/eUH8DMrNM0cmb1yhATjh+WhR2X3i 3lwIVNyQhyfrueCeAqMPnEuzF4Obx8Wc/eIneJEQGtFVBeu6luf35xP8o0XTsmPK23iz /4OBjvKjuXXXYBkeodKOKrbDm6CoZX7PnF7WHq8VbsAS9ruEk72HQux0MkWdEBLWrjbf RrqlgjoPgdpqhIt3Vhm5xMtcD49Vypq2ew1FkCTLff7shFRhxH46ScsEccIi1/zHrijn wXIfrnBJOND0c9fHNRcKta+Bggq8W/0VBXR2nn+FJlCgRRmSz6pBqZS8fGxAUKh4W0Z3 Njpg== X-Gm-Message-State: AOJu0YxsJhdYPrBDeLYtRXB2ZsTLx44JaBvhElVBTeh3gzNTHdVZMDfL CZEbXRRShV90HpPMWevZKYFvDaaSpYArU6zO/GWhz43ckxBbu7Gkg6T3AB0b9ykALDKUDP/j0VO bKnI= X-Gm-Gg: ASbGncs/3IdnfTZlH4Wit7GLOTpwpaNKWc8wTvJif3YbdYIaxq2qoRqmxWlkBOxRQIk F0sT7rNw2Q65wE66Qw+++8j+2SyJTyr5+ucWVpmKwgZQ/iiiWPxFDdGc8ZBgbXah8CdwP5noBSz 4ccZvlMhrKqKw4C8tRM3DltdFT+yKS7j6VijwWEJehcLSA/V+bxC6pEy1V9bJX+1k9kiCBvP+aO isoIpnO/aba+x2C1TMetVzAJ297o90+OMvtiLa3mg5MMNbhGtGVuqOrq/Yy43XFUheqdiKPAJGF 0XDqNosrjbjXDNzTkuvMIltaNlj3128= X-Received: by 2002:a05:600c:4e0b:b0:434:a7e3:db5c with SMTP id 5b1f17b1804b1-436e26aeeeemr183787435e9.11.1736720376145; Sun, 12 Jan 2025 14:19:36 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e38c697sm10782948f8f.52.2025.01.12.14.19.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:19:35 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PULL 26/49] hw/sd/sdhci: Set SDHC_NIS_DMA bit when appropriate Date: Sun, 12 Jan 2025 23:17:02 +0100 Message-ID: <20250112221726.30206-27-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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 From: Bernhard Beschow In U-Boot, the fsl_esdhc[_imx] driver waits for both "transmit completed" and "DMA" bits in esdhc_send_cmd_common() by means of DATA_COMPLETE constant. QEMU currently misses to set the DMA bit which causes the driver to loop forever. Fix that by setting the DMA bit if enabled when doing DMA block transfers. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20250108092538.11474-2-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sdhci.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index 299cd4bc1b6..a958c114974 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -665,12 +665,13 @@ static void sdhci_sdma_transfer_multi_blocks(SDHCIState *s) } } + if (s->norintstsen & SDHC_NISEN_DMA) { + s->norintsts |= SDHC_NIS_DMA; + } + if (s->blkcnt == 0) { sdhci_end_transfer(s); } else { - if (s->norintstsen & SDHC_NISEN_DMA) { - s->norintsts |= SDHC_NIS_DMA; - } sdhci_update_irq(s); } } @@ -691,6 +692,10 @@ static void sdhci_sdma_transfer_single_block(SDHCIState *s) } s->blkcnt--; + if (s->norintstsen & SDHC_NISEN_DMA) { + s->norintsts |= SDHC_NIS_DMA; + } + sdhci_end_transfer(s); } From patchwork Sun Jan 12 22:17:03 2025 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: 856808 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1179666wrc; Sun, 12 Jan 2025 14:25:10 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWHd5r0EzWJK5D4XQvj8g1KB4Mn1fjqRaVJshEhU/20o9vWpAm0/bN+8V4gfMbZgx4R7dFQxg==@linaro.org X-Google-Smtp-Source: AGHT+IGL89UQp0KBRg/IgEtZWH3QKVoDEx99hYs5lb/ArNejLprv+6Bw/WGmz6lKpwocAAv5BKyT X-Received: by 2002:a05:6214:e83:b0:6d8:a754:9647 with SMTP id 6a1803df08f44-6df9b1ed616mr249381546d6.17.1736720710409; Sun, 12 Jan 2025 14:25:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720710; cv=none; d=google.com; s=arc-20240605; b=AU8FQE9Ham29JcAczbn1w5vhTW32v5hKH9zVvARSChs5OjXvz1zQxRdPrkXfqFQklS +cY3wVR+oQ3sjOmpIBkC27IwTGCWC/PfomXIDdxlP+IeOIY57rDOx5i+9V7ZYEMc/vSj TCUwxkTve1MSE8A3qTsaSniYV7T8AYS/BOdxzGB+trU/8K/xFOhqFqc3HM2rDLCtSJYd TCuJAHtlEJvHYNqagWsDRyV8me0iUtn1V6vVJ2C4Fx4taWgi5BInPZE8+Ih23wjBErHo UzohdYcFHKHsfLXbIpdzBXIyfXo/PA0HCZ61/rKagnM6bBQxjPzzQ0g5cyz6zf/rMj1Q bL3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=iAeWlekp0I6VowiluDZapbh9k9d5Kq9MZ32VfBn8/0g=; fh=KmKVruiDNL95GNq5JxPdWbzg4eKXVidFW2OqgJg9tc0=; b=kvf1ve5LRqpePlyPY5BbfjDdrcDjohxb8/tKHAmk5qZ9l4H4ZVIPhx/K7oKp/flj5I qDLivKCHjR/CGxvOpT/TLt2P0y8zBcSWjOeEDMWgvlx0e0impPbuFlPOwn11aUSV45bf hVGTtz1bMsRHg5T4DQiULwMBJTErGt/u2CM0srZAz+vZSttu/ctmYKFKhcv9DyoSrYvd lX/ioScA5KjhHXYDRAFp54NMuwuYEmYVD5tCqSeR1haQbWYz/JM6IQ1gCBN4nFUFVadm sg8SgJxlBhqVxnAL6eOViu5XTezpy9iVG0vz4TSP2RWFjZ7L6kcLcICdczuH4fwvsmju KuYQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qlC36qKj; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6dfade98267si77034586d6.205.2025.01.12.14.25.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:25:10 -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=qlC36qKj; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6Ju-0003sW-Le; Sun, 12 Jan 2025 17:20:34 -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 1tX6J5-00022d-RA for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:19:45 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6J4-0006Zd-8z for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:19:43 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-436ce2ab251so26231395e9.1 for ; Sun, 12 Jan 2025 14:19:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720380; x=1737325180; darn=nongnu.org; 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=iAeWlekp0I6VowiluDZapbh9k9d5Kq9MZ32VfBn8/0g=; b=qlC36qKjjyf4bFXKd4dnt3lPO/cNxp3CFTs1LqBglnJ20O5n75e69hG3ACuS6uNKtx a3bhlnnU9y8UQLERdt7uV2Kv5beNyoPdFB37yP9PwJLjZi1eCwm8mDcI1NXClaplewEH 5Vv4R+1QI/VqJvV3Ndx9g+Wt+aRuXy1ALXdqBZtH/l0z8wXALBCu5/2zSkKeDcgC5Svo Cj3GgLFRDvWfR0nXpkCIJqgO5cbXgytwhXf2ye5XqidmKmTjd9EOXFo0uRmlpMkv88De 38kYrtHxFnRk/CC53oC7qaql0NGUA+0w0ylUuFXSo0vnt+/DpXW8FAFkswYYRGyLgs4f /PbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720380; x=1737325180; 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=iAeWlekp0I6VowiluDZapbh9k9d5Kq9MZ32VfBn8/0g=; b=PKlvyHy2l5c7PQA90674c01Nz/zyMVaFNv5mOD/K5WadeRjCASjZRFSm9K94FLMwCQ xwPxx40mWfTpieFb66jUZFw7Os/sRcfx8cr1NoOCGx/Nbgc8mW+LtTwaj38LBAfC8eBg PkCSYtsU+xuwDPPdOtd2v1iiYttnKVuVcn4mj4CSX8KRKsaBQ2JIP/WZRO9uGrFPYmYt FYPZtfMwMveiv2QU4tzJ9udg8j6KXQ9mWNq9Z1HMmvmU+WkZj/8nWeGHyoh0LZdCsiXu Xj7NrFAk/u221d9CAGKus2u24jTFDsJldfGkei5P4QjsIlcp7+yA9WGizKtq6xbvgaeY uXdQ== X-Gm-Message-State: AOJu0YyS8e5g5nbOHdV3L9C4t53UrWnrWVTkJFu/UMW3strino90gAQD SyktYKD0cHe1YTHEswFwHd2HlK8Iqg47j1OPGPStVJ0NFIbxZRkcqvuWCZhbERW1LoVSlI/eVzS FnEE= X-Gm-Gg: ASbGncvyqTjeHi4yPdldKIsSROr7A3XuvYtDP2rznBDMJzjCG7I7fQUUH7cZF5m4Y91 mlHwhZqsWdho8oq8s2D24EcNU6CPiQqmqwmTrG8jnrhgqcMcSUNXF4/b34SrhEi2fgZQB2wuAeq X6bnG5yfbbCIzlesdNIhPt21Mqk6oZaoCJiYjd0+ksK6E9cWCen4KeGucW0E9MBTexnC7gu211Q gNizWzsNAaF9HYTVNqMWuIBMxD/NuOVO7GDVesqKjkcEFsnse5Avp3a3wUc4+YxLL9LaXvJczpD Vo13Ti0zzT5xHSDk5uznGbjpqELRYG0= X-Received: by 2002:a05:600c:3b8a:b0:434:f270:a4f0 with SMTP id 5b1f17b1804b1-436e26dda80mr139563475e9.21.1736720380606; Sun, 12 Jan 2025 14:19:40 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e2dc0babsm157488615e9.14.2025.01.12.14.19.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:19:40 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Bernhard Beschow Subject: [PULL 27/49] hw/sd/sdhci: Factor sdhci_sdma_transfer() out Date: Sun, 12 Jan 2025 23:17:03 +0100 Message-ID: <20250112221726.30206-28-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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 Factor sdhci_sdma_transfer() out of sdhci_data_transfer(). Re-use it in sdhci_write(), so we don't try to run multi block transfer for a single block. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Bernhard Beschow Message-Id: <20250109122029.22780-1-philmd@linaro.org> --- hw/sd/sdhci.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index a958c114974..318587ff57c 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -699,6 +699,15 @@ static void sdhci_sdma_transfer_single_block(SDHCIState *s) sdhci_end_transfer(s); } +static void sdhci_sdma_transfer(SDHCIState *s) +{ + if ((s->blkcnt == 1) || !(s->trnmod & SDHC_TRNS_MULTI)) { + sdhci_sdma_transfer_single_block(s); + } else { + sdhci_sdma_transfer_multi_blocks(s); + } +} + typedef struct ADMADescr { hwaddr addr; uint16_t length; @@ -930,12 +939,7 @@ static void sdhci_data_transfer(void *opaque) if (s->trnmod & SDHC_TRNS_DMA) { switch (SDHC_DMA_TYPE(s->hostctl1)) { case SDHC_CTRL_SDMA: - if ((s->blkcnt == 1) || !(s->trnmod & SDHC_TRNS_MULTI)) { - sdhci_sdma_transfer_single_block(s); - } else { - sdhci_sdma_transfer_multi_blocks(s); - } - + sdhci_sdma_transfer(s); break; case SDHC_CTRL_ADMA1_32: if (!(s->capareg & R_SDHC_CAPAB_ADMA1_MASK)) { @@ -1179,11 +1183,7 @@ sdhci_write(void *opaque, hwaddr offset, uint64_t val, unsigned size) if (!(mask & 0xFF000000) && s->blkcnt && (s->blksize & BLOCK_SIZE_MASK) && SDHC_DMA_TYPE(s->hostctl1) == SDHC_CTRL_SDMA) { - if (s->trnmod & SDHC_TRNS_MULTI) { - sdhci_sdma_transfer_multi_blocks(s); - } else { - sdhci_sdma_transfer_single_block(s); - } + sdhci_sdma_transfer(s); } } break; From patchwork Sun Jan 12 22:17:04 2025 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: 856809 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1179671wrc; Sun, 12 Jan 2025 14:25:12 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWxfhgbDB4Zslz+8hq6kY2PM78tnefuzHLqIznXazN4V1XKx+Sm7Xgz8QwvACwxOGEjKlWQFg==@linaro.org X-Google-Smtp-Source: AGHT+IH+NiIm/bfVgYHv67Jlgh77511AvmGVS8C2xBWbvujTY673ImNgrk8+/R7QlUdusCTvUtCl X-Received: by 2002:a05:620a:2416:b0:7b6:e697:2090 with SMTP id af79cd13be357-7bcd96ed1d2mr2706342485a.2.1736720712359; Sun, 12 Jan 2025 14:25:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720712; cv=none; d=google.com; s=arc-20240605; b=OgVQwlxEVBd1uD6gWWJXi3ac7J13IZY2YMCBzwuKAOz8GE95vBSbaMzFyD83y7hTof J6GtSg2MWWUAv3CjTDRUEsA4ei+BfZtf2f8M1Rapw4zls+hGYF3o+UgISp5ig9niRORf 9sn22JYRZgw3wEAcunVmxcV3jXu9BdtqJRhWDeLb/iwVaMCxlPu9hC5umsDQF+7oyuEP j082t1vvXoN8XlNW6u21sj2Vx2wHEkgZQy6/W0NTiWJC+jxlAQb+2aBuj5akludvRTJ2 VeaHgDUO2D1DUaa+EUdQvBeDJ6HrTOYkkG2Dm87qcZ0tJrk/2YvRJOcjhq2PM47u/xtZ Y6DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=ypXBSvYmGiFDPRAAmIeWBvHigmsiA58P6W0SM1nQp5o=; fh=19RnvGrNSkJoz8QRsrI0ezqY3mV+qwuMHi7W+r3geRo=; b=I+5sk+HHN+JPyOSSs72gPe4Oj+FbtFleldXKhigASwqj4GL48ZCVIJjxChVgtYvv64 PtxOLERC3+4WLiOBfqFSvp8AVqZ8IXYrezbqBYSNvpu519en86WuZk+u680zTkTRdtjE 9zpWtjTaWwJREG7sOr4IqZUI9kQudnanpGevo0dlFEIRq8FUDLbzbIxk1rzylexnlRKx z7TX5AjbPfjLASUsnV7/Hhr8AZO0I5OcQ5T+atA+BLI5a7J5HvpMIIPP0QRLE5iv+Yau OwTECwgXbBx21PiJZ2kpd6A2IXkIpkbxdINXGPWg1gDFrjY1Bj2DJykfvjLJ3bchg1nG gEjw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rOPnAVPW; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7bce322a3besi972681485a.135.2025.01.12.14.25.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:25:12 -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=rOPnAVPW; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6Jx-00044U-KL; Sun, 12 Jan 2025 17:20:37 -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 1tX6JB-0002KY-Oe for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:19:51 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6J9-0006aA-Rs for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:19:49 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3862d16b4f5so2192640f8f.0 for ; Sun, 12 Jan 2025 14:19:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720386; x=1737325186; darn=nongnu.org; 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=ypXBSvYmGiFDPRAAmIeWBvHigmsiA58P6W0SM1nQp5o=; b=rOPnAVPW3T1SQ/j1ySJxovZlf0ilzN3/16aiJeNB/SCgzZNN4yP2+Jxq7nC0dfea1w Q17y7SxzATIA4mpRuekgMxtAhTIGLp+vK9jy5nEGk3z9wMxnwoIt1vzQIbSH7mL7Mkgx oV+7QkLNCTrOp+fpMW+6Jdj2W5PJIxfaGcR0RVvv2uJFbJlhXdqb38pHnCdCfKFdUH6S 5LRyouAzx7ArJsmK/1eXfsdxUMIP58HS1IrfybT0eXMI6Fau0NGQWE4uVpqFh9g+09mN RUpKMd1Xxmg4+Mx6fyvOQXnjdOA/bOP1YFb/Gc+xmAGUIrlWVHJig3UCBRFXpBO/fyyV eFMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720386; x=1737325186; 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=ypXBSvYmGiFDPRAAmIeWBvHigmsiA58P6W0SM1nQp5o=; b=pNAS9VFy92n4xWeFZfQz5BlCjWnnTKZRZxgy+sDJbqrSQL1Ne5EKo0ermHlrtIzE71 ISH87SPGzlifmdDH4OvauxCeSd63jNAsQM/DZE1My3kISARydcYjlDq3K/90EN+vMgO3 Zk8jLVDSSRyTD6vVj8k92jiQtOIKWkObcqmiZHsdpAG7LDco+rumgj1EHVxHy4XQcaNN LSGJYy/oMXy7KoTt9ZQ7OdcAU1baDHX26gqvEPPNzfb/I/Zr2h3LrQWA5y0jW5dvNzxo 6WDnB7obI4QjqsWONYlJKNPbUgcXG7FilKrmD2zSoFwxnTB0mr3vql3JEEVdoq5fR51a MCqg== X-Gm-Message-State: AOJu0YxKD2a/Nn23pctKQZaEtrxPb0u/93ncTEeFOYv+hsS05g3ll0O8 e4GuuapZW3hDSw5lo6Yf9IHdDXrNo0S94msBekgBE/Hz1tWo+t7iFXwYK/Mrfl5HY0ZepOS6WSn F3a0= X-Gm-Gg: ASbGnct4niknzBqcJyPY3Z1GcfaqfVcDMg/+pFKEz1S40Dd9jP0+4UYe9abqP3++GTl EXNiVrgGo4kL4ha7VXgPTP894crqmoXrOxx2HHwug7zKH1mxVzo5nvBmvs1bTSJu/u2hUpoZohG n+YCaSiC/Jm8Rp4IvSXvKpsmBQ5h5V7FpVAmSC17FDLX10wwqDsfYmp96GecRCeJ35jPUvakFwG xjkzxMFzj02fE5i0WlakKtb8BnnpD/4wWkILQz1YM/tY0O+3NdxjQHLn2du/UPaM/j+7RUYMNcA 8IE1yRnNL/Kl1mMhSyTQ90aK7AUOno8= X-Received: by 2002:a05:6000:1aca:b0:386:3bde:9849 with SMTP id ffacd0b85a97d-38a8b0caa82mr12288534f8f.12.1736720385950; Sun, 12 Jan 2025 14:19:45 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e2df2faesm158881605e9.26.2025.01.12.14.19.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:19:45 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Nikita Shubin , Nikita Shubin , Alistair Francis , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= Subject: [PULL 28/49] hw/char/stm32f2xx_usart: replace print with trace Date: Sun, 12 Jan 2025 23:17:04 +0100 Message-ID: <20250112221726.30206-29-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.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 From: Nikita Shubin Drop debug printing macros and replace them with according trace functions. Signed-off-by: Nikita Shubin Reviewed-by: Alistair Francis Message-ID: <20241220111756.16511-1-nikita.shubin@maquefel.me> Signed-off-by: Philippe Mathieu-Daudé --- hw/char/stm32f2xx_usart.c | 49 ++++++++++++++++++--------------------- hw/char/trace-events | 6 +++++ 2 files changed, 29 insertions(+), 26 deletions(-) diff --git a/hw/char/stm32f2xx_usart.c b/hw/char/stm32f2xx_usart.c index ebcc510f4ea..87882daa715 100644 --- a/hw/char/stm32f2xx_usart.c +++ b/hw/char/stm32f2xx_usart.c @@ -30,17 +30,7 @@ #include "qemu/log.h" #include "qemu/module.h" -#ifndef STM_USART_ERR_DEBUG -#define STM_USART_ERR_DEBUG 0 -#endif - -#define DB_PRINT_L(lvl, fmt, args...) do { \ - if (STM_USART_ERR_DEBUG >= lvl) { \ - qemu_log("%s: " fmt, __func__, ## args); \ - } \ -} while (0) - -#define DB_PRINT(fmt, args...) DB_PRINT_L(1, fmt, ## args) +#include "trace.h" static int stm32f2xx_usart_can_receive(void *opaque) { @@ -67,10 +57,11 @@ static void stm32f2xx_update_irq(STM32F2XXUsartState *s) static void stm32f2xx_usart_receive(void *opaque, const uint8_t *buf, int size) { STM32F2XXUsartState *s = opaque; + DeviceState *d = DEVICE(s); if (!(s->usart_cr1 & USART_CR1_UE && s->usart_cr1 & USART_CR1_RE)) { /* USART not enabled - drop the chars */ - DB_PRINT("Dropping the chars\n"); + trace_stm32f2xx_usart_drop(d->id); return; } @@ -79,7 +70,7 @@ static void stm32f2xx_usart_receive(void *opaque, const uint8_t *buf, int size) stm32f2xx_update_irq(s); - DB_PRINT("Receiving: %c\n", s->usart_dr); + trace_stm32f2xx_usart_receive(d->id, *buf); } static void stm32f2xx_usart_reset(DeviceState *dev) @@ -101,49 +92,55 @@ static uint64_t stm32f2xx_usart_read(void *opaque, hwaddr addr, unsigned int size) { STM32F2XXUsartState *s = opaque; - uint64_t retvalue; - - DB_PRINT("Read 0x%"HWADDR_PRIx"\n", addr); + DeviceState *d = DEVICE(s); + uint64_t retvalue = 0; switch (addr) { case USART_SR: retvalue = s->usart_sr; qemu_chr_fe_accept_input(&s->chr); - return retvalue; + break; case USART_DR: - DB_PRINT("Value: 0x%" PRIx32 ", %c\n", s->usart_dr, (char) s->usart_dr); retvalue = s->usart_dr & 0x3FF; s->usart_sr &= ~USART_SR_RXNE; qemu_chr_fe_accept_input(&s->chr); stm32f2xx_update_irq(s); - return retvalue; + break; case USART_BRR: - return s->usart_brr; + retvalue = s->usart_brr; + break; case USART_CR1: - return s->usart_cr1; + retvalue = s->usart_cr1; + break; case USART_CR2: - return s->usart_cr2; + retvalue = s->usart_cr2; + break; case USART_CR3: - return s->usart_cr3; + retvalue = s->usart_cr3; + break; case USART_GTPR: - return s->usart_gtpr; + retvalue = s->usart_gtpr; + break; default: qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset 0x%"HWADDR_PRIx"\n", __func__, addr); return 0; } - return 0; + trace_stm32f2xx_usart_read(d->id, size, addr, retvalue); + + return retvalue; } static void stm32f2xx_usart_write(void *opaque, hwaddr addr, uint64_t val64, unsigned int size) { STM32F2XXUsartState *s = opaque; + DeviceState *d = DEVICE(s); uint32_t value = val64; unsigned char ch; - DB_PRINT("Write 0x%" PRIx32 ", 0x%"HWADDR_PRIx"\n", value, addr); + trace_stm32f2xx_usart_write(d->id, size, addr, val64); switch (addr) { case USART_SR: diff --git a/hw/char/trace-events b/hw/char/trace-events index 59e1f734a7d..140b994fd4d 100644 --- a/hw/char/trace-events +++ b/hw/char/trace-events @@ -125,3 +125,9 @@ xen_console_unrealize(unsigned int idx) "idx %u" xen_console_realize(unsigned int idx, const char *chrdev) "idx %u chrdev %s" xen_console_device_create(unsigned int idx) "idx %u" xen_console_device_destroy(unsigned int idx) "idx %u" + +# stm32f2xx_usart.c +stm32f2xx_usart_read(char *id, unsigned size, uint64_t ofs, uint64_t val) " %s size %d ofs 0x%02" PRIx64 " -> 0x%02" PRIx64 +stm32f2xx_usart_write(char *id, unsigned size, uint64_t ofs, uint64_t val) "%s size %d ofs 0x%02" PRIx64 " <- 0x%02" PRIx64 +stm32f2xx_usart_drop(char *id) " %s dropping the chars" +stm32f2xx_usart_receive(char *id, uint8_t chr) " %s receiving '%c'" From patchwork Sun Jan 12 22:17:05 2025 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: 856803 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1179594wrc; Sun, 12 Jan 2025 14:24:43 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVeAkFkv0kp3nk24GixQuQlgw3q1bDViD6lGNXXsQSEe6ebQ6wPDXuEdkHdAnQ4AJG15Bduug==@linaro.org X-Google-Smtp-Source: AGHT+IF8xZuj2YrJTxaeHjXmmsnLeyn6Oi9amo1riTxFzc8BezG7Rl4dbUBKCPzuGoQ1xy5Ef75F X-Received: by 2002:a05:620a:1a1b:b0:7b3:5751:42eb with SMTP id af79cd13be357-7bcd97a4bb5mr3336396285a.54.1736720683078; Sun, 12 Jan 2025 14:24:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720683; cv=none; d=google.com; s=arc-20240605; b=ZoubuG3/2Qmx412nKDEaCsav7PcJDcFf1ebScNBFT4MyQH1/JqgST28epOsINUAvRr LOR3DuieOA0Jo0unTQoQJCgMNgMf5wNLVL2wNasf6ObzDIftQXqAM9B7f7MoJyFPk4Lj UnK1gWU+/RWRZTGxaWoJIh+FIffbQl7AY6m8CSfpeVh2+Sd3xYrR6D26kCRRUOxgwg7d LZW0YnTAbgpdRDFsxmgD/qOlx/laFWVKduPUc62xcLfSG2ixP1frsWvG2oSq2uyWJEJ7 EudXjxoHTyN+k+HPzU9FE1AcNzEahZSJC+VPh3uWHDcbC5Bqq6tJtu9u2vVy8WJAizsu 6yXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=6igD5E/nbtwSQ78SmLcXDRAtrSWvkZ+A6IpBZtctTjk=; fh=pGYVoKmEbmBJXedzdvuKSuqi1EMwZm5z032l2+Fj52I=; b=UnckcQz4JGx9d7RRJQtfxiY6gjYPQ4lxF5ssP96ZGkFObbTq9WXdYRJUkbfzRHPn8D 2/sF/Azn9vmlYDf2ihm12xVe9JtOYQSrbyroKjjNHxMC4dT4dptC2XnFD3kscO548Xow VLXVttcvCKacZ0BCY/8k5x2nnYSibkNXGv811CyhYzR2RqvzQIEk9gl1n6t2aioF2vep 1dWPqR479WL5opBNdvv+2JSJuCOC7b5nZT2XYCtXKbixFsz7+mJ4sf9AfdzNDpHEGv4j xtpGiaw1axnKaAH83+8ohyr7e97Fzm+RBG8V9nbtGw83tXtA3fIZTU07nbUFWlbf6bAS HdjA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IsABqRQE; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7bce34fcf15si941896185a.404.2025.01.12.14.24.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:24:43 -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=IsABqRQE; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6K5-0004DH-0B; Sun, 12 Jan 2025 17:20:45 -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 1tX6JH-0002Wt-56 for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:19:56 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6JF-0006aY-Mn for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:19:54 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-43634b570c1so26191985e9.0 for ; Sun, 12 Jan 2025 14:19:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720392; x=1737325192; darn=nongnu.org; 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=6igD5E/nbtwSQ78SmLcXDRAtrSWvkZ+A6IpBZtctTjk=; b=IsABqRQEF9txkWLm0Tg8XvN+2m0qLFM+8OyS8GxgH4Lo/AcIHsk6Eb9X5/tCiOo07Y PrIvWLZTaDSz2Sw2zmlkNWYoV318DA/BqcbZ/OOv66MEuCAvMrTkHoy9vQ3qdXhE4iUM xlJ0gVyRCjX+yaBgvgfClp6+MsG+3J+n8jAmJJu304Mi9Ez5EWDRKJfyNWkZkM7gOFUP azhxx+2BkmJlg2u7AsmRvpiATJ09USLqo+V38FxHY2asgeJ8d6RhhYUR9QxP6Yng02dE 5RQgpRRku9DTPLQ6N8M6Cs8CsNpzcbtRh6RFrb3uBWzj7NCI61luFncU24RxVQc15uuV wpfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720392; x=1737325192; 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=6igD5E/nbtwSQ78SmLcXDRAtrSWvkZ+A6IpBZtctTjk=; b=NU5DyftATnFATFJOLo3k8d1CyQ7JeMFjaO7c+LUXvSljIhBuean0SdSpfsL0Pxca2y 1Oiq2H2bDUhfUhwCfpMLPhPYMK/UmOQzUUnJQVP6jkghWYZU9sAEviAzC+S8tV0YKfI5 QDPYZ7QsBZ8VXbW4ntVOwyvk6iXaqIqc56HlU+Y84pt+cgRNs4qG18eyoPEB1l2uUf5A jzRgdcnvAE79CAmIAK3J+F8r9OiOwCrs8krYv4GlbQP/ZgVY6OC0+nzq9A0RAImDC+Tx cwzmDrV7yc/aobUU5XZg0x4r7I0SsFb4oKoCzbo3dbXapPAsidlPlZjeNYdy450Ijg4O 6b8w== X-Gm-Message-State: AOJu0Yw9mt//hJB09a9qH6+gim3Q85mFhIY+/mfuavbXM65GbMAIudnj SQ5V9EysHB1JWMxzZ/o+CKDj9De/4/PzkjaK9iylv40x7mQRZJt6cagGfLp/PYNSLvqswoB1KYH 2sBY= X-Gm-Gg: ASbGncs0rnUB6DdNheumN1hR3mfGN0XfpxPLhdro65YwOx7XW7DeJ1UloY8WPGfpDH8 XcqtL+XPP8kHa/ocbWaciZ3c/LnIT3Ga2bqQf/sjrxtWDR4sX1odEU1ZQDNsFE7/Jre8TF79XV1 stwm1HhLsV6ZKEQwFVPshCAAM5TIm6r9sTkQnn1tnDh7IvSKWjb9g1O9Pvn+uYnSBkxOS+Weowo bH2zuU/UHXkGQD3RnAGLCXkSjn+HYVqm2fQZKU2tQ6IA4+66Zn1lyRNBvaAhV31KdVs1Lt7uJmj GzK3OcfbxZwKSF4QeJu7JT3pOE9DC+8= X-Received: by 2002:a05:600c:510a:b0:434:faa9:5266 with SMTP id 5b1f17b1804b1-436e26adfc9mr164276005e9.13.1736720391870; Sun, 12 Jan 2025 14:19:51 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e384f2bsm10504560f8f.41.2025.01.12.14.19.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:19:50 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PULL 29/49] hw/timer/imx_gpt: Remove unused define Date: Sun, 12 Jan 2025 23:17:05 +0100 Message-ID: <20250112221726.30206-30-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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 From: Bernhard Beschow Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20250108092538.11474-11-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/timer/imx_gpt.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/hw/timer/imx_gpt.c b/hw/timer/imx_gpt.c index 2663a9d9ef4..11eca9fa4df 100644 --- a/hw/timer/imx_gpt.c +++ b/hw/timer/imx_gpt.c @@ -20,10 +20,6 @@ #include "qemu/log.h" #include "trace.h" -#ifndef DEBUG_IMX_GPT -#define DEBUG_IMX_GPT 0 -#endif - static const char *imx_gpt_reg_name(uint32_t reg) { switch (reg) { From patchwork Sun Jan 12 22:17:06 2025 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: 856795 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1179407wrc; Sun, 12 Jan 2025 14:23:47 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUjlXnxhSQizo45RDqsE16qw2G5AFA+0bY47hNL754bGwSevWlz/lKpt99kvb9ca03tk1Bk7w==@linaro.org X-Google-Smtp-Source: AGHT+IGGzBlpvl4y9ICxfks1TS07PeJhNQmVCS8nWsU/uhDYE/dCj7yF+zIewz6EgY8Td+qzDbCx X-Received: by 2002:a05:6214:48c:b0:6d1:7433:3670 with SMTP id 6a1803df08f44-6df9b1f4590mr276330546d6.4.1736720627741; Sun, 12 Jan 2025 14:23:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720627; cv=none; d=google.com; s=arc-20240605; b=PIc+tVWfvZZA6e8LW89sWf649MdeX5mrZpj0ung7lI/K3i5rYq5SHOps7kYolAKJun Ox2qLKkifMaG5tOPGvUFE0SmnkyXBJl1GbQa8vmhLBuYrIrYa/qYJgfa1ri9KdUNp99y ++n3UJXagmBD+pDXinXycIx0OpIZTfJkGX3PkjsskG9OrbvobxkXk2BaVSMwDoj3Us8Z Irs6FUxfwKCcqP2tfR8VRx1qE/Vwe3vjY0IJOe2mNKXAhkWSdoD0Bnnns+uC81uenV1n JDSjysV+rdXBRPT9hbJKsRCeDyXdFrBcDdXe+cQ9N5hI+2ceMuEilKppJ7OGbXEUhyrz 313A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=JNNKD3FB/GFpxFtn1SMHag0AGZZmeK3Dg8kU3DWDxRk=; fh=d8JhE7Oez74STnxlSuZYmsoz7Y6n0cgPXne3l0h62eY=; b=LvtebGmVrqV27s25TJVHW462c7GWCORZqF0T+L5H+4IuCFFRKGiZ0XL+7zbHSlmu1X /f3z+hRXMeV8dy/yQMKOVlho3nkWTqfliccgwm0KYAY0sUrFB6qPMC3h8uHwfLy5Pql3 /lUBgLHjP6bZpN7rEgE2A7Kwj84LVs6igXPLwXgAvVQn9uk5bqLtRU2wowAD6nIb/ETo M+Ki9zF/PN4XyoaiW9dec5j42peSVNPx10JEQwnLjxSkSJvGt+5NZh+fUNgIZoKUWc1U fGMGMtvRSWLfnijqLHmRH+ZvC8Cy9SFisXtOd9JY0BFb1IV56uYoc3nzaIlPfFvqgKtR 82Ng==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FK9JQ7z6; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46c873fced9si74614341cf.388.2025.01.12.14.23.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:23:47 -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=FK9JQ7z6; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6K8-0004Hs-M2; Sun, 12 Jan 2025 17:20:48 -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 1tX6JO-0002hY-3k for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:20:02 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6JL-0006ay-MX for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:20:01 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-43635796b48so22731575e9.0 for ; Sun, 12 Jan 2025 14:19:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720398; x=1737325198; darn=nongnu.org; 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=JNNKD3FB/GFpxFtn1SMHag0AGZZmeK3Dg8kU3DWDxRk=; b=FK9JQ7z6Wns1zd641kz5O0qr4jwS6oIPaaHus6oF2NUhUkOFeUfxz77c85orEeuQuT 4/SjvwinyaLwv2S2YDVwN9Wo7Ud/n8Jp2NJ+XIk1vfYQFfsaftsEpUQ+ooRXZOqj1oA7 SOVzOyuAqxuovQFD3ZManbCH7VT1lOLVw8Cfz2bYhQjVp1iWXCAeWIhbM3vSaK1RIi/Q /BHLhjdvhZM+H6K0WxxjlTe2MDfRweVx0VtTZzzAgwpuof5E7rxIQWGzhhI4HxsRtBah Zka9fJGou3A6xOuB785FgWO8ZQTwYls+CSfY04ITZpuAjOaUKS+zfDeN+ZmoBqq8EwAs AaCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720398; x=1737325198; 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=JNNKD3FB/GFpxFtn1SMHag0AGZZmeK3Dg8kU3DWDxRk=; b=E/uYaF4QRcLjCMBRuvNTNy4Fhfv2mPKcqn8QWp0SQNuBcWAbd17UUMZ+oZiPdVqWf3 sAkHk303zvQW7rxpcBlafOrCHF2GvEErcPOGNDs+RWX0+KiikpvTFy91tFR6P3Yk9vN1 qHUf2RZX662YEztnNra8kSbqKf/jCNHoj30SypAp9CdB6L5ATB0CUsGDnrCmzw52psYQ dR6mRUqfuQNDjf77ZQQspLG+R7U5XOnzbmezX0K24cIWpoy1/BrkYG7kRSJiNndUk3o9 p3X+zoXBHZVrN8NgtcuvwGzlFFlxVG9bOMMJnFep4UYqcNmv905o5WZJimrurjxAJEpy dVAQ== X-Gm-Message-State: AOJu0YwMSilztwMVQEUEiucFBWSJ91iCom6wP2jl42nhdfSuXWf4rvFM HDCH0FMXh2mNbsboJPLqOeKAX6NS0jUi6dj3mOIl0cYkxSNwQwx3550+PhNwvkhrYQ+Q6j0ksOs 6NxM= X-Gm-Gg: ASbGncuwZbTtssVK54slvU+lrRleiPI3bQIIv8v/94AYhNK65Y9DbnRH8xvpPNBSdxR rZPgQ9wM3EMkFUvqITMHScazU6zihhU48wc0bdSv+DmVCQD+COdpU7i3HrArMgXNAScNc+Yxq/f /QnjT7zQYS/R48o1EXlj+YjH0MEVZ95B1K5PO/NmGR8W1c2yexegkQHZLunjRcl4U46loufDFz6 9vGmiXBlapiLGqF99eLqLuWpi96udbWNqqY8CCnk1ln8WRxgRO54nfNre/x96aJ3Uw/8sicMssi le2IWMPjZO2HOILTj2R5dOPC1iRx5QY= X-Received: by 2002:a05:600c:83ca:b0:42c:b8c9:16c8 with SMTP id 5b1f17b1804b1-436e9d7b51bmr119415385e9.10.1736720397797; Sun, 12 Jan 2025 14:19:57 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e4b7ff0sm10651711f8f.77.2025.01.12.14.19.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:19:56 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Fabiano Rosas Subject: [PULL 30/49] tests/qtest/libqos: Reuse TYPE_IMX_I2C define Date: Sun, 12 Jan 2025 23:17:06 +0100 Message-ID: <20250112221726.30206-31-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.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 From: Bernhard Beschow Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Reviewed-by: Fabiano Rosas Message-ID: <20250108092538.11474-12-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- tests/qtest/libqos/arm-imx25-pdk-machine.c | 5 +++-- tests/qtest/libqos/i2c-imx.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/qtest/libqos/arm-imx25-pdk-machine.c b/tests/qtest/libqos/arm-imx25-pdk-machine.c index 8fe128fae86..2d8b7543439 100644 --- a/tests/qtest/libqos/arm-imx25-pdk-machine.c +++ b/tests/qtest/libqos/arm-imx25-pdk-machine.c @@ -23,6 +23,7 @@ #include "libqos-malloc.h" #include "qgraph.h" #include "i2c.h" +#include "hw/i2c/imx_i2c.h" #define ARM_PAGE_SIZE 4096 #define IMX25_PDK_RAM_START 0x80000000 @@ -50,7 +51,7 @@ static void *imx25_pdk_get_driver(void *object, const char *interface) static QOSGraphObject *imx25_pdk_get_device(void *obj, const char *device) { QIMX25PDKMachine *machine = obj; - if (!g_strcmp0(device, "imx.i2c")) { + if (!g_strcmp0(device, TYPE_IMX_I2C)) { return &machine->i2c_1.obj; } @@ -86,7 +87,7 @@ static void imx25_pdk_register_nodes(void) .extra_device_opts = "bus=i2c-bus.0" }; qos_node_create_machine("arm/imx25-pdk", qos_create_machine_arm_imx25_pdk); - qos_node_contains("arm/imx25-pdk", "imx.i2c", &edge, NULL); + qos_node_contains("arm/imx25-pdk", TYPE_IMX_I2C, &edge, NULL); } libqos_init(imx25_pdk_register_nodes); diff --git a/tests/qtest/libqos/i2c-imx.c b/tests/qtest/libqos/i2c-imx.c index 710cb926d62..6d868e4cc4d 100644 --- a/tests/qtest/libqos/i2c-imx.c +++ b/tests/qtest/libqos/i2c-imx.c @@ -209,8 +209,8 @@ void imx_i2c_init(IMXI2C *s, QTestState *qts, uint64_t addr) static void imx_i2c_register_nodes(void) { - qos_node_create_driver("imx.i2c", NULL); - qos_node_produces("imx.i2c", "i2c-bus"); + qos_node_create_driver(TYPE_IMX_I2C, NULL); + qos_node_produces(TYPE_IMX_I2C, "i2c-bus"); } libqos_init(imx_i2c_register_nodes); From patchwork Sun Jan 12 22:17:07 2025 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: 856806 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1179637wrc; Sun, 12 Jan 2025 14:24:55 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVnsDtZR2t1Q21Yfv5Dbfu57kAn7axnRJY2vsK7z/sqQIYVSn/IrZYaK1Bu4TLj8e3sQTupyg==@linaro.org X-Google-Smtp-Source: AGHT+IG70cqzN8IO6INkI2MAEOBiPNH8XGc1S6locxm6aLsPE1VgXTeYIuP4Oqy0w4l2EHu4MtGj X-Received: by 2002:a05:620a:4626:b0:7a9:c333:c559 with SMTP id af79cd13be357-7bcd9762164mr3065306885a.48.1736720695664; Sun, 12 Jan 2025 14:24:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720695; cv=none; d=google.com; s=arc-20240605; b=J0KBZNH85rQyGmzd93W0t5pZM5t5CNrorVDUS05NGI/0RwJopb1xCEImnGP12fmDNu VYRnyYx2duKnJ+g2lpKxfAH0bVBJflPmkrKy1jhubFqz5E1BsYKltCQk2Ya91uTY9g0o Na6MwwVl4g9oQBFkkP1/svMfwkI5So1u05l+GdIvt+5Fbs6HrjNSL/vAC6Qo2i3Z4Flj fjS+TL+VlUdsjTqBbdMeUpX6+oggALzO6Ph1pG1K9AjwKnSCK1wJWuGtGeE4e536mMTr BNyE4i+dFYmBk6aeFXDRXw7zJBMBihCp3U6FrPS/iad87NCIGixujuf6idLiAnLjcMGF 7yFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=uEXTfVWwEyfI2ErBw07cb0pz0mwpOOYlmcjjIUHCrbM=; fh=pGYVoKmEbmBJXedzdvuKSuqi1EMwZm5z032l2+Fj52I=; b=fNHaV45BdG+yVtlihVRl2MoIBkKjJlZ5e40X3D/X8TTYoSVCYS48qBN8NHTHR/nQ5k 4lwFe1QG78dzTlCynt/ZHddqpBS5Vp3hct2c6VbwluzjBzQ+LKSnxFI8xuXZXnjN5Qid PQT3nOxlpGUDvW/lVGXaTw4TcX95XCpD0Czmi4pozIuusNaSAydwCQ39DA15C8FAy7uh lsQ7QhKC1qwB22vsYUkhll6bl9J/2QLojG+e3bl6cS09IoBmgTyUVVwcLWTeO+1TQb5j G0ISpLI5mOgc8izMYoSBpuyr7yWl2QUejizNYWb6sKt1rHqKpm8vllP23uT2ZNIBdyum xlfw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="cwV/jg47"; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6dfad8ace96si73739576d6.56.2025.01.12.14.24.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:24: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="cwV/jg47"; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6Ju-0003sk-OP; Sun, 12 Jan 2025 17:20:34 -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 1tX6JS-0002q3-9V for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:20:08 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6JQ-0006bb-Ca for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:20:05 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-385eed29d17so1818423f8f.0 for ; Sun, 12 Jan 2025 14:20:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720402; x=1737325202; darn=nongnu.org; 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=uEXTfVWwEyfI2ErBw07cb0pz0mwpOOYlmcjjIUHCrbM=; b=cwV/jg47TslB2qloUXHBRbQP70zhivWhEnKsfoH2crsavZOGsqMYm+2UyrsZ7BpdoE ssBTdEntwU/1bNeNAN2nMRTtLb1ZcyjgORIyb3ptc3R2ioVNRjoBqbsnjIgLKgwxRi+u fMj1TJcUg0CuvFfXvZAjmdhxLzePynB1BG53G+ltP1cI5xbddc8sE0TBSytgAFOVkNMO Ql0B+zlD+NaSf+xV0dMEKSHB85jCG/nQlJUMrgJoFjLY4FDREspjFfRTWQF/DeDw0ejc 09S4kjswpFBNhqLWE8U8wLWNxIPUYaTq8G/VNLLnT+Q1GyHLvlIayRWjnkZV3Ka2ygt3 xvIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720402; x=1737325202; 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=uEXTfVWwEyfI2ErBw07cb0pz0mwpOOYlmcjjIUHCrbM=; b=Umkv4bTrvrdAjrh43lX6KICNStfOO0DxzAxCuHBQIxCr7RPucWVTcg0DzkdWJg//sN Sq36hvCDlzQM/BH/THvBJStNQR72IANxaHj4drs+1tSQe+An7tVB+YMC8jjQX6P0wpiA Jr4ZTIwFSZM13ibtqiEzp4r9ZjMwaxM1spmuLIs4XnR8m+8Vhy+YVLPFalEIVItQyDp/ QivM+hMMDExfGX8dEiimybbdUX8bbn8CrUmEjGXxyVWOU6WLGFf18IK4A9FB1jZVPYZM CcUJcTdMwUd3jnIXdRnAixTAVCCSKo8X6EA8xy2SaBfX4D86UdGJbB3P+WiSvSVpIhaM 0Oow== X-Gm-Message-State: AOJu0Yz0U39Vb2X2f6tIeK6/DybWJqw3qid1ndUvfhhGQtbB9dnoyMRA MCtg3khpxzciLnhvJO4omwPtOcdynfyaPKlQEMhvWHdpxPU5CW5AOTaTn6rgRMIhM8uOAE5K/+w xRdU= X-Gm-Gg: ASbGncvEOZXZqeykhgFU/jUoRCRv7Qc3tMLnKk4IPDOYLtojsELDBFZgiyv++Qc3O3E k1spjWOENa2kqu1vdmZSO5hpSaaZ+/sEKmm6RGYAE0oCVH4dxhUPajOYT5dvhRxpASJhPWgZWwR 4dTk5D49GLcPg0QpUEFeJfaj/46Ue6XXPGvH8Rrud3fxZu74ZnX1VArPKHzMe7p5A2XhOUdZp06 XGLh/bWyRlhBONH4bQdlYpbNZiTd68SB8J/q2YzOXHNH+YQufgpYaez2yADUjpll5bnyUNUazC1 WxP0Vu+OwC9KTeBu5pv70n/1FVF8AOQ= X-Received: by 2002:a05:6000:1a8c:b0:38a:4b8b:c57a with SMTP id ffacd0b85a97d-38a87336f7amr18319885f8f.44.1736720402251; Sun, 12 Jan 2025 14:20:02 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e37e36asm10377281f8f.5.2025.01.12.14.20.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:20:01 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PULL 31/49] hw/misc/imx6_src: Convert DPRINTF() to trace events Date: Sun, 12 Jan 2025 23:17:07 +0100 Message-ID: <20250112221726.30206-32-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.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 From: Bernhard Beschow Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Message-ID: <20250108092538.11474-14-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/misc/imx6_src.c | 23 +++++------------------ hw/misc/trace-events | 6 ++++++ 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/hw/misc/imx6_src.c b/hw/misc/imx6_src.c index dc6a2b92ba4..06cc46292ed 100644 --- a/hw/misc/imx6_src.c +++ b/hw/misc/imx6_src.c @@ -17,18 +17,7 @@ #include "qemu/module.h" #include "target/arm/arm-powerctl.h" #include "hw/core/cpu.h" - -#ifndef DEBUG_IMX6_SRC -#define DEBUG_IMX6_SRC 0 -#endif - -#define DPRINTF(fmt, args...) \ - do { \ - if (DEBUG_IMX6_SRC) { \ - fprintf(stderr, "[%s]%s: " fmt , TYPE_IMX6_SRC, \ - __func__, ##args); \ - } \ - } while (0) +#include "trace.h" static const char *imx6_src_reg_name(uint32_t reg) { @@ -87,7 +76,7 @@ static void imx6_src_reset(DeviceState *dev) { IMX6SRCState *s = IMX6_SRC(dev); - DPRINTF("\n"); + trace_imx6_src_reset(); memset(s->regs, 0, sizeof(s->regs)); @@ -111,7 +100,7 @@ static uint64_t imx6_src_read(void *opaque, hwaddr offset, unsigned size) } - DPRINTF("reg[%s] => 0x%" PRIx32 "\n", imx6_src_reg_name(index), value); + trace_imx6_src_read(imx6_src_reg_name(index), value); return value; } @@ -134,8 +123,7 @@ static void imx6_clear_reset_bit(CPUState *cpu, run_on_cpu_data data) assert(bql_locked()); s->regs[SRC_SCR] = deposit32(s->regs[SRC_SCR], ri->reset_bit, 1, 0); - DPRINTF("reg[%s] <= 0x%" PRIx32 "\n", - imx6_src_reg_name(SRC_SCR), s->regs[SRC_SCR]); + trace_imx6_clear_reset_bit(imx6_src_reg_name(SRC_SCR), s->regs[SRC_SCR]); g_free(ri); } @@ -173,8 +161,7 @@ static void imx6_src_write(void *opaque, hwaddr offset, uint64_t value, return; } - DPRINTF("reg[%s] <= 0x%" PRIx32 "\n", imx6_src_reg_name(index), - (uint32_t)current_value); + trace_imx6_src_write(imx6_src_reg_name(index), value); change_mask = s->regs[index] ^ (uint32_t)current_value; diff --git a/hw/misc/trace-events b/hw/misc/trace-events index 0f5d2b56660..cf1abe69285 100644 --- a/hw/misc/trace-events +++ b/hw/misc/trace-events @@ -253,6 +253,12 @@ ccm_clock_freq(uint32_t clock, uint32_t freq) "(Clock = %d) = %d" ccm_read_reg(const char *reg_name, uint32_t value) "reg[%s] <= 0x%" PRIx32 ccm_write_reg(const char *reg_name, uint32_t value) "reg[%s] => 0x%" PRIx32 +# imx6_src.c +imx6_src_read(const char *reg_name, uint32_t value) "reg[%s] => 0x%" PRIx32 +imx6_src_write(const char *reg_name, uint64_t value) "reg[%s] <= 0x%" PRIx64 +imx6_clear_reset_bit(const char *reg_name, uint32_t value) "reg[%s] <= 0x%" PRIx32 +imx6_src_reset(void) "" + # imx7_src.c imx7_src_read(const char *reg_name, uint32_t value) "reg[%s] => 0x%" PRIx32 imx7_src_write(const char *reg_name, uint32_t value) "reg[%s] <= 0x%" PRIx32 From patchwork Sun Jan 12 22:17:08 2025 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: 856788 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1179216wrc; Sun, 12 Jan 2025 14:22:52 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVmjHQF3Z/IIDR/5vWkZQVCWtWxAewau6Aa7ZDeqecrvY1Nk+F8hrNZjevZ3pHkBi70gOEVZg==@linaro.org X-Google-Smtp-Source: AGHT+IHE5iOHMC8TO2rak46YTUilGQ+8LJsaws2kIu3MibKDYtFYnbWHBUNFyzvS8Lc7tCH6KMdd X-Received: by 2002:a05:622a:34c:b0:46a:3176:f787 with SMTP id d75a77b69052e-46c71081dedmr333165171cf.37.1736720572314; Sun, 12 Jan 2025 14:22:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720572; cv=none; d=google.com; s=arc-20240605; b=UOiAyq5j7GKx0uOUifigOBx8rT5TBZlga8QjsZOPPEO1LITX5Exdv27R65OZGrbbiK CJ5kLdrGV1PJPGfdehS1n9hHzyMeqz6w8lGIZrNPNWsY05R2vsAvRhr5OqaK2LgHdtLE 7KK7qvF/xakTnxbvAxY9IfX2hUL8rk8ZlxmQDdvnGYesAvWi3dZ/p0KIu1bRuRQXbXn3 qA1k3PQ/Jogqm8Uv12ImfFvIcqk5gwVQu2Jcn66A5w2jZiyahXyFbXR2y7JHfg/sFukd YJYvrrIQA+rd1as6L+j0pxiC3dmjeslJTet+iSispHPJ/0EQSHBOxY2nivUBn82M5qet Pf9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=14berGsIUi+LxFrCmkN7HjTFiZfCOUVRI5Z+rVUDf/Q=; fh=pGYVoKmEbmBJXedzdvuKSuqi1EMwZm5z032l2+Fj52I=; b=RiQ4QSzvtNw4sK0camxI4jcTnf0w1edFm+tQZ2jHWWSM/hKeJiylSBrzbGZi2gZria EBaPtx5/ZHVnJAns8Pg7Ux34mH95WXfypd6WwGknQZuIMaUnoOSO9ILAKt+kGb9FJzPn dknLtHIoKJ0Pk75ZTstonLBOUT7VL00ngv3sGyp2nv9LE+waFKzL2SH70eWQVKeEzWEt psjxGnqxyif6I2IgLumMK7mR9aeCEKX1QnHvQiWU1WBM0AyzjLZ/hYrg7JqOy6ELd4O2 7o8zNXyeQKi6YVuw0WKWQyW/Ykc75Z838JCR54aeqXRgC6qPeHtaXnM66H254AqHSXO/ 0Yzg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UtAB7HYy; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46c87414ee4si73498801cf.576.2025.01.12.14.22.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:22: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=UtAB7HYy; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6Jt-0003pA-58; Sun, 12 Jan 2025 17:20:33 -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 1tX6JW-0002yH-NT for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:20:15 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6JU-0006dF-Od for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:20:10 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4361b0ec57aso36069265e9.0 for ; Sun, 12 Jan 2025 14:20:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720407; x=1737325207; darn=nongnu.org; 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=14berGsIUi+LxFrCmkN7HjTFiZfCOUVRI5Z+rVUDf/Q=; b=UtAB7HYygHXqaDaZRTSE9ruCpDss3YYY8MlTTLsqXvZHTSZOzmVN16ZUpPuibQPSWy 4UKNEb6S6BG+vgNelVN5JUeXJSC1nhfX1r7K/vbfaZjnnRcWeUTIKLVDeHhgbWjBregE ZkV8eKFnKSpGmh9o7etYPr3hHMJEdVqisNbeACIKhDScDoBYzEvQHR0wY9oPfth4/Ptj JuSs1x0gRrXcfyioO2MiAIZpfL6p6uwg1PHxVIWUEdPdX0iiJib4AHZAQL7sPVGRfcym dPEhGYOyJRVjfatMQ8cHFrnA9Fsg1Lb/FimRD5d6pqhVbVtrNo0cBO4obgpgNSPRUEa0 TaWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720407; x=1737325207; 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=14berGsIUi+LxFrCmkN7HjTFiZfCOUVRI5Z+rVUDf/Q=; b=ujCgojSxgihiZn+74iyiF/hJp3/vefqcedFkJNht5H7np0vmKD41pUfTzDrdl+obNI VkySwHGe3kyfWOHdbdSvPUX1J2z2gkiuiNURIfmipO7BE7o7ClxK9Vq4U7ceOEKcdk09 LfZPszln+HeUNMbpV3DjYaBfqUgFdyn2nCHF9hxlETUrCIh4dt/PU/2KvRrDbpmJQRha oCu3yXx0zcXW4NueqahlzjTNBJ6EqDNeP7wpOwMbbosGw11wOldQd6OKZRoNsFUu0d39 rc9m+/Z15y7k/fa2EkEnJNVpHl8OailGWEBe7ltwGmZbpVpZkKNvFkct76n3+sYloEs3 AyyQ== X-Gm-Message-State: AOJu0YztNlREmqOVz2j+8W1V6TN5UZ/k6QCiey/oipNrvx/Y71OYAX9P v/YxYWQ4bhi+yKrL0LNVokuDzxF9LkG9IxcBw9E0UHknUqrlSt/HXOPoRdRruCu/RNya6bHm748 seig= X-Gm-Gg: ASbGncu/+QaTvvNtY7EzMw3LG75/RhbnSO6wo0opvsoh2pwem1H+ADyFQ4wcdT6G7Vl 1Ve6ZwsyHQhh9BMWPCo/hYzAUeFyOYn++4mygIRr2RLYJiGzJ68i/RLt30r9/Z24uY08x7px3QT nh8hF5q+OxKjLRo7Y99lJRyoTkCaS0XEP0QkeL8qzZ6MndsXUQyZJnCo3uYdMSOu8KkjubNnPM5 6M58KQvh+Ofs9wx8MX0wMDoNuI/wulp3YhgDoGrvEn1ltBysRFaOD/GYjixbAoV8Z1Y0e1H9D/h ia8YPNbL00Tcb0aj4b+yR6M6e/UX2GQ= X-Received: by 2002:a05:600c:3103:b0:434:a746:9c82 with SMTP id 5b1f17b1804b1-436e26ae9b1mr182304575e9.5.1736720406807; Sun, 12 Jan 2025 14:20:06 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e9e03f49sm121928255e9.19.2025.01.12.14.20.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:20:06 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PULL 32/49] hw/char/imx_serial: Turn some DPRINTF() statements into trace events Date: Sun, 12 Jan 2025 23:17:08 +0100 Message-ID: <20250112221726.30206-33-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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 From: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Signed-off-by: Bernhard Beschow Message-ID: <20250111183711.2338-9-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/char/imx_serial.c | 58 +++++++++++++++++++++++++++++--------------- hw/char/trace-events | 5 ++++ 2 files changed, 44 insertions(+), 19 deletions(-) diff --git a/hw/char/imx_serial.c b/hw/char/imx_serial.c index 12705a1337f..7c353fde509 100644 --- a/hw/char/imx_serial.c +++ b/hw/char/imx_serial.c @@ -27,6 +27,7 @@ #include "qemu/log.h" #include "qemu/module.h" #include "qemu/fifo32.h" +#include "trace.h" #ifndef DEBUG_IMX_UART #define DEBUG_IMX_UART 0 @@ -184,10 +185,10 @@ static uint64_t imx_serial_read(void *opaque, hwaddr offset, unsigned size) { IMXSerialState *s = (IMXSerialState *)opaque; + Chardev *chr = qemu_chr_fe_get_driver(&s->chr); uint32_t c, rx_used; uint8_t rxtl = s->ufcr & TL_MASK; - - DPRINTF("read(offset=0x%" HWADDR_PRIx ")\n", offset); + uint64_t value; switch (offset >> 2) { case 0x0: /* URXD */ @@ -208,49 +209,67 @@ static uint64_t imx_serial_read(void *opaque, hwaddr offset, imx_serial_rx_fifo_ageing_timer_restart(s); qemu_chr_fe_accept_input(&s->chr); } - return c; + value = c; + break; case 0x20: /* UCR1 */ - return s->ucr1; + value = s->ucr1; + break; case 0x21: /* UCR2 */ - return s->ucr2; + value = s->ucr2; + break; case 0x25: /* USR1 */ - return s->usr1; + value = s->usr1; + break; case 0x26: /* USR2 */ - return s->usr2; + value = s->usr2; + break; case 0x2A: /* BRM Modulator */ - return s->ubmr; + value = s->ubmr; + break; case 0x2B: /* Baud Rate Count */ - return s->ubrc; + value = s->ubrc; + break; case 0x2d: /* Test register */ - return s->uts1; + value = s->uts1; + break; case 0x24: /* UFCR */ - return s->ufcr; + value = s->ufcr; + break; case 0x2c: - return s->onems; + value = s->onems; + break; case 0x22: /* UCR3 */ - return s->ucr3; + value = s->ucr3; + break; case 0x23: /* UCR4 */ - return s->ucr4; + value = s->ucr4; + break; case 0x29: /* BRM Incremental */ - return 0x0; /* TODO */ + value = 0x0; /* TODO */ + break; default: qemu_log_mask(LOG_GUEST_ERROR, "[%s]%s: Bad register at offset 0x%" HWADDR_PRIx "\n", TYPE_IMX_SERIAL, __func__, offset); - return 0; + value = 0; + break; } + + trace_imx_serial_read(chr ? chr->label : "NODEV", offset, value); + + return value; } static void imx_serial_write(void *opaque, hwaddr offset, @@ -260,8 +279,7 @@ static void imx_serial_write(void *opaque, hwaddr offset, Chardev *chr = qemu_chr_fe_get_driver(&s->chr); unsigned char ch; - DPRINTF("write(offset=0x%" HWADDR_PRIx ", value = 0x%x) to %s\n", - offset, (unsigned int)value, chr ? chr->label : "NODEV"); + trace_imx_serial_write(chr ? chr->label : "NODEV", offset, value); switch (offset >> 2) { case 0x10: /* UTXD */ @@ -373,9 +391,11 @@ static int imx_can_receive(void *opaque) static void imx_put_data(void *opaque, uint32_t value) { IMXSerialState *s = (IMXSerialState *)opaque; + Chardev *chr = qemu_chr_fe_get_driver(&s->chr); uint8_t rxtl = s->ufcr & TL_MASK; - DPRINTF("received char\n"); + trace_imx_serial_put_data(chr ? chr->label : "NODEV", value); + imx_serial_rx_fifo_push(s, value); if (fifo32_num_used(&s->rx_fifo) >= rxtl) { s->usr1 |= USR1_RRDY; diff --git a/hw/char/trace-events b/hw/char/trace-events index 140b994fd4d..3ee7cfcdff2 100644 --- a/hw/char/trace-events +++ b/hw/char/trace-events @@ -52,6 +52,11 @@ escc_sunkbd_event_out(int ch) "Translated keycode 0x%2.2x" escc_kbd_command(int val) "Command %d" escc_sunmouse_event(int dx, int dy, int buttons_state) "dx=%d dy=%d buttons=0x%01x" +# imx_serial.c +imx_serial_read(const char *chrname, uint64_t addr, uint64_t value) "%s:[0x%03" PRIu64 "] -> 0x%08" PRIx64 +imx_serial_write(const char *chrname, uint64_t addr, uint64_t value) "%s:[0x%03" PRIu64 "] <- 0x%08" PRIx64 +imx_serial_put_data(const char *chrname, uint32_t value) "%s: 0x%" PRIx32 + # pl011.c pl011_irq_state(int level) "irq state %d" pl011_read(uint32_t addr, uint32_t value, const char *regname) "addr 0x%03x value 0x%08x reg %s" From patchwork Sun Jan 12 22:17:09 2025 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: 856796 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1179419wrc; Sun, 12 Jan 2025 14:23:53 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUpFMnW+dk1tfn4VCQPKLchSExui//YoAkvfWIVfb+bsAU7AdKJWD8N4fJ0UaKh/d4oR6kVEw==@linaro.org X-Google-Smtp-Source: AGHT+IHSsRJ2EiWZzCfftDnoXj4p+pV0Xm7qHfQFZ4+fw7AUSKkOkMTEA1WNOy3mh6dMdZ/BCSzG X-Received: by 2002:a05:6214:5015:b0:6d8:a64d:da51 with SMTP id 6a1803df08f44-6df9b1cdd50mr292965386d6.8.1736720633014; Sun, 12 Jan 2025 14:23:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720632; cv=none; d=google.com; s=arc-20240605; b=RAkqjZIZbZo8CHUH1CgBK4j9dw1sGJ0dZ1ikcjH5A0oSmfS049/FpTqx0g4SqLh5OR 4S2RI550Nq6lRZ3unqmPm0elX8Tt0Bx8mHNopnlCKNnoGvaAZU2WRuClLv0MipLwY63Y ljVaWLkkpTA9BeAbZA2S+JU82av4k1ECw6hHDF57HgcFEtnCuh6/mV7TuKvk1p8cl0RV ATdoJziUsgUU/sGYBjfcXrN1lgisdcEt4INZ0tG0rNs8s33eRkAQurTvYXawoYT7xaPF IFtMpNEel2z7Zq1GhT6ToKVS7u/qqU24PE5GHLsPSuoKt1Yf+3fJm/Xli7+m7AqrngDd ar5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=c4IJJIqOzzzNLl0UmDXFVSLVyGwrdjjTtkcnLuHaGvM=; fh=pGYVoKmEbmBJXedzdvuKSuqi1EMwZm5z032l2+Fj52I=; b=CAaPsbmGOsr6qczs4tq1cPQTYcjj9P+6qSgac7f7MzrBLHIsfxE2h6O0OjaeGYpECo rdcQg9/v1vxo4B6Og74GnkFUz5viwPiHhVI4PpYO1YyCnQyy2U+3CWv2gU15Lu/szU8q S/F40P9euORkhZv2JHiTB6V3Qf9XbmjQ8eOkmkii9IFvV+K17wCyEs+6TcP96bkuvQKb TLKOpiIxvX+Cv9EHlElNijH5B6vdI1wuI0ujGg7sShqttHTA81Uv4LOoytMQBR1Xixmk 0Re7qZkYSTRjpidBu7ubGisEkw+RCHEe52yJAFXyyFmSULlhx/eHN4Ehd7JYxLPrK4y4 lm+A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NHoju27v; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46c873325c6si80222481cf.116.2025.01.12.14.23.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:23: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=NHoju27v; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6K8-0004IK-Rc; Sun, 12 Jan 2025 17:20:49 -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 1tX6Jb-00034N-6C for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:20:16 -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 1tX6JZ-0006oW-IQ for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:20:14 -0500 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-38a25d4b9d4so1885273f8f.0 for ; Sun, 12 Jan 2025 14:20:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720412; x=1737325212; darn=nongnu.org; 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=c4IJJIqOzzzNLl0UmDXFVSLVyGwrdjjTtkcnLuHaGvM=; b=NHoju27vwIkWLI9DJPePVEhKbcn8oV6o6LBaVUoyEdpLn8l1awmafn2pPNLsA1H7Nz 0eJJXh35sRWgzC6sxKKZhhp71N1BDXaPToV7baz6bePcuFhSzHNs7cwUtCYd9UkaQXUe UzrAAlgveP5mG6sCIvvaAOjzB/1gE3XAhXAw2UbS31+ZK8Xcoy3Qy76/iBG7DlhX9KzU uqrBi2Vqkag9a9T96DI0BlvOoSVN3Nr7cuTwBI7p7RdSwHKJAkMRwn0ea3Y25A10kByP +n1Hl2/IJyK2/MKHNaKdWtHiZv1BzAgF+zOZlOgu+WtJ/5wkiOA07xR0/w+CWNwcKDv8 dnXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720412; x=1737325212; 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=c4IJJIqOzzzNLl0UmDXFVSLVyGwrdjjTtkcnLuHaGvM=; b=EExf9hAEi+NVOD3KRU539b7VdaSu6HcqTZn4VULyovlaNYxUcMKYH2GfDKcE+fxlaB 4FQMJktoRHXVD3qCCQaEW0SUPrZRwlcil1QtYg2HQDlrlP91JwrbN3683H/eeiG4tghT RuLuJn4Y1ywmjF++Rch3nu49nh4v2ZUJqaHsz+AsdemEF11zxBrfUpDGLkxyMRmRRc6o EnOvCBO4N7BB9pfHKnM3rfKGIONLuwVDSU5wjmXpterADFIvWAPWEKHvd1cZNlXayJP8 U/tJFJYvehdgDHFDr/T/SZKhvkrI0WKCbZjv1hzD4azODmuM2Q5HlrJb6l9wOJqpNBSu YP2Q== X-Gm-Message-State: AOJu0YyGmD8Idf6f+wJw2S9y5KUvkKu3DKU7vP7a5434/WJ1DnlxMWno exXCabNzRV8M2ucU0Sg/jKiON4QZO+HTRcE/R5spVEJRevPum3tae59fqpeBvRCc/DJY90SO1nJ B28U= X-Gm-Gg: ASbGncujMunN/2HQuWTOkBHtdaVGU2GsRahRwp63BcaNoddYS40U55Y+4cHSu7bPFia z6Eat0vcsfbml+eZwLBrgFVJeCNfEYIqr6AOkrt1GbTA379uWwSEmSI+uHsxxs4sca/VHCQGzw/ 7Tlm9vPr2Yqab92/zCZYngGOE5rZ82PGU9LN2ilE8KDBUXQ6vo5w+K5sTznepqtFoQlichY31fu YmeB5E6llwxZVJPtTCws/TBjMs0KVUvOkN5g2R2R0rE486jccnEX5JzdLoV29xxiC/pc14kR/qe FHMpqOR3e+B01+vB5BZBo8Ii5yOtNL4= X-Received: by 2002:a5d:5848:0:b0:385:f7a3:fea6 with SMTP id ffacd0b85a97d-38a872da434mr3776732f8f.13.1736720411752; Sun, 12 Jan 2025 14:20:11 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e38c697sm10783886f8f.52.2025.01.12.14.20.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:20:10 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PULL 33/49] hw/i2c/imx_i2c: Convert DPRINTF() to trace events Date: Sun, 12 Jan 2025 23:17:09 +0100 Message-ID: <20250112221726.30206-34-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-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=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 From: Bernhard Beschow Also print the QOM canonical path when tracing which allows for distinguishing the many instances a typical i.MX SoC has. Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Signed-off-by: Bernhard Beschow Message-ID: <20250111183711.2338-12-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/i2c/imx_i2c.c | 21 +++++---------------- hw/i2c/trace-events | 5 +++++ 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/hw/i2c/imx_i2c.c b/hw/i2c/imx_i2c.c index c565fd5b8ab..d62213b9e0f 100644 --- a/hw/i2c/imx_i2c.c +++ b/hw/i2c/imx_i2c.c @@ -25,18 +25,7 @@ #include "hw/i2c/i2c.h" #include "qemu/log.h" #include "qemu/module.h" - -#ifndef DEBUG_IMX_I2C -#define DEBUG_IMX_I2C 0 -#endif - -#define DPRINTF(fmt, args...) \ - do { \ - if (DEBUG_IMX_I2C) { \ - fprintf(stderr, "[%s]%s: " fmt , TYPE_IMX_I2C, \ - __func__, ##args); \ - } \ - } while (0) +#include "trace.h" static const char *imx_i2c_get_regname(unsigned offset) { @@ -152,8 +141,8 @@ static uint64_t imx_i2c_read(void *opaque, hwaddr offset, break; } - DPRINTF("read %s [0x%" HWADDR_PRIx "] -> 0x%02x\n", - imx_i2c_get_regname(offset), offset, value); + trace_imx_i2c_read(DEVICE(s)->canonical_path, imx_i2c_get_regname(offset), + offset, value); return (uint64_t)value; } @@ -163,8 +152,8 @@ static void imx_i2c_write(void *opaque, hwaddr offset, { IMXI2CState *s = IMX_I2C(opaque); - DPRINTF("write %s [0x%" HWADDR_PRIx "] <- 0x%02x\n", - imx_i2c_get_regname(offset), offset, (int)value); + trace_imx_i2c_read(DEVICE(s)->canonical_path, imx_i2c_get_regname(offset), + offset, value); value &= 0xff; diff --git a/hw/i2c/trace-events b/hw/i2c/trace-events index f708a7ace18..1ad0e95c0e6 100644 --- a/hw/i2c/trace-events +++ b/hw/i2c/trace-events @@ -56,3 +56,8 @@ npcm7xx_smbus_recv_fifo(const char *id, uint8_t received, uint8_t expected) "%s pca954x_write_bytes(uint8_t value) "PCA954X write data: 0x%02x" pca954x_read_data(uint8_t value) "PCA954X read data: 0x%02x" + +# imx_i2c.c + +imx_i2c_read(const char *id, const char *reg, uint64_t ofs, uint64_t value) "%s:[%s (0x%" PRIx64 ")] -> 0x%02" PRIx64 +imx_i2c_write(const char *id, const char *reg, uint64_t ofs, uint64_t value) "%s:[%s (0x%" PRIx64 ")] <- 0x%02" PRIx64 From patchwork Sun Jan 12 22:17:10 2025 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: 856812 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1179683wrc; Sun, 12 Jan 2025 14:25:16 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW+rKNmoRwMMAGEM0jjiIMg9RRmBGyxOnQzbLI+u/M8F62oKJby0fCPN/IUWsVfGNjJp4ulLQ==@linaro.org X-Google-Smtp-Source: AGHT+IEZu256IgMO1sOEnnwiZaecrvgb7DDGGXD3L0LT79mp9Q3PpG/JoVWLh8QB6FZqTsHGSmbF X-Received: by 2002:a05:620a:219a:b0:7be:3d06:9a02 with SMTP id af79cd13be357-7be3d069b7cmr278879485a.28.1736720716024; Sun, 12 Jan 2025 14:25:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720716; cv=none; d=google.com; s=arc-20240605; b=Rw4Nb8Vny0tBcuISttsW9OUEnkjiGTM1EqItimO6o/yEXyLTPUYTRd+Kb40NBqfOq/ mB35/ImStamjSRWK9g0FNBQNJl1gjwRkGdMaJ/v802dwvToAZtKZ5MP+qUIwYs20wHtZ v4dIbKl9JtFDSJG4VgBDSMoNJvdtG+VoYUIU+07RCZHPdIXoA3EVtDaAjsttDp+gjw1P O4x1hmbDinKiCVx6MYBnf8sZh/3goRRe/FCI56DiHuPumMReLCQDg2346rJBfoXFWiXP M6WuANC2MBHqmbeyXA71hYPCi8NangyQZRH0y45kikNp5n7mf/lPqQa/D5xy89io5d62 a+bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=cFQoJdzHdUvE38GYcn/jd9wG7NJypEZhq9jeSgdzCu0=; fh=pGYVoKmEbmBJXedzdvuKSuqi1EMwZm5z032l2+Fj52I=; b=Z9Fif63acuXIAxnsSn6D2JlYryNQdz565zu50f+EoukbIJ/7ZGI1mLI/V+9vOseOGu qhcUEmWVQ8CAK4GLLTiQYboa1Y2qdn8cQkMGWzQmBlBL1XEglOwiA8fWLGMRK29R7oOx Dbt+2CWM75XAi+kabreRt3pU6Z2sFhUisizQbhEAsYAFGJ7zq5Yl1y0tqefRrPXVsMoS XkxYSUa/lOHVXwy22iZkzu4lBp0GknGPt/x5+11DO2dhMRrjxCn1f5mb6GSkK/trHwDO eU6F8ldA4ACPW4kixLQHwOfM8AIRcxDLX1ro060CdljjucAqRi/+cdpW1PvWzRdx3K1P +jTQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RrLyFnd8; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6dfad9cf69dsi80565776d6.118.2025.01.12.14.25.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:25:16 -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=RrLyFnd8; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6Jx-00044K-96; Sun, 12 Jan 2025 17:20:37 -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 1tX6Jk-0003Bh-HQ for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:20:25 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6Je-0006ox-Os for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:20:23 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-435f8f29f8aso26174655e9.2 for ; Sun, 12 Jan 2025 14:20:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720417; x=1737325217; darn=nongnu.org; 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=cFQoJdzHdUvE38GYcn/jd9wG7NJypEZhq9jeSgdzCu0=; b=RrLyFnd84LMv06DOormNC19mdDnWuiJLeHlPVtxQuluxFvEO15HOjnhfhalOQiRtX4 O2bQX0OXBbC2UgwFNx4S24EIKC8h/8L21VJ+/r1f8Jns4d2uPnPC24pqgTKKfMDFmc0k f/xnwYw+g4OKGGkvQbkYI/CQ0UKGcbQnduLn2hk6PlJDc73NmtPT+Xk4o2hug628rPm+ tY0zWZ9tmjIn3Ee0mMU2BPBFaT6dzYUxekSIzcttKeetDDgCtsQa4se18V3IIi1shE79 BTDIq1D5s/UUI261IAu8Km1u0IUHN6BGjP1lgcBhgxxDKV4c6FYmHe5kTh31lyWhOAA/ q/iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720417; x=1737325217; 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=cFQoJdzHdUvE38GYcn/jd9wG7NJypEZhq9jeSgdzCu0=; b=YhKXsfcmwAdBoRG/gWHxD8SZl1kTXBCZ0OVwD8ew63ISyseQBO1OFscTHXTPTyU9qi 83tdDY1nh6pc5xs6p5Ag18eH7d+qsPg7jj3maTTf/RBpMi01c8mqKGkGjG6immRWUbah FXycZ5en2oc0Rb7EFKD9hyVo8uMORhCB+I30gpUZhmAZc01xv4t6+7JkJNw4KsX8WO2+ hL7Or4OA9+aRhXJ2Zt9IV7ix0QZ0f64QwXOGhmy+ixCu8/qqsiutmZQJNzToEr0nNi54 08wnFb0/Qhat6n04SVh33SHc4BUO9mAdM30hi08NsoHie2OOoNezQsUqE11arXfXfE8G jftA== X-Gm-Message-State: AOJu0Yz0iAP+iX9DgmEoHX6ZMAyHfXLsUbVvW/Xxr8jWDhD78zpSGhWQ v8UWLoq+IsaA5NHFKV/ICLKIq2om7XXRuYS8lxDHjB1iYq43KBSEOwOQ3EiivT4LTMBMY+W7J13 dYdU= X-Gm-Gg: ASbGnctvVhONyF0u6OoxDpUeLGbARMfjlZXW0/kDfsAr1y2a7ZmkeJopiiN6Ek2QTKZ CTzwhRQEp1pnC4SyuQVtClYas+JDlSdXjDyOdBq/NSq9/jBlmjwhJjTsodthGDa/yOD/06P6o6Q GxBDvzU+HucjWQ96RPhSGrAdbHG2gkfjrZEC2h8b7N2UFbv1+UteHYDwKZrdx8dqkTTPpysD2xh nsQ+GXL4nTqcUIhLj1cPxtKFlOsyPRDrQLzmEXWsl9IBxOrJx8+aMJUVQ1s54Q5GPOClmJQ7Oyz aK+esAzL6nYmiJBu7UhQFkVT86L+OPo= X-Received: by 2002:a05:600c:3143:b0:434:a929:42bb with SMTP id 5b1f17b1804b1-436e26b9d45mr181464985e9.18.1736720416869; Sun, 12 Jan 2025 14:20:16 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e9d8fc81sm124757555e9.5.2025.01.12.14.20.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:20:15 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PULL 34/49] hw/gpio/imx_gpio: Turn DPRINTF() into trace events Date: Sun, 12 Jan 2025 23:17:10 +0100 Message-ID: <20250112221726.30206-35-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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 From: Bernhard Beschow While at it add a trace event for input GPIO events. Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Signed-off-by: Bernhard Beschow Message-ID: <20250111183711.2338-14-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/gpio/imx_gpio.c | 18 +++++++----------- hw/gpio/trace-events | 5 +++++ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/hw/gpio/imx_gpio.c b/hw/gpio/imx_gpio.c index 898f80f8c83..549a281ed79 100644 --- a/hw/gpio/imx_gpio.c +++ b/hw/gpio/imx_gpio.c @@ -24,6 +24,7 @@ #include "migration/vmstate.h" #include "qemu/log.h" #include "qemu/module.h" +#include "trace.h" #ifndef DEBUG_IMX_GPIO #define DEBUG_IMX_GPIO 0 @@ -34,14 +35,6 @@ typedef enum IMXGPIOLevel { IMX_GPIO_LEVEL_HIGH = 1, } IMXGPIOLevel; -#define DPRINTF(fmt, args...) \ - do { \ - if (DEBUG_IMX_GPIO) { \ - fprintf(stderr, "[%s]%s: " fmt , TYPE_IMX_GPIO, \ - __func__, ##args); \ - } \ - } while (0) - static const char *imx_gpio_reg_name(uint32_t reg) { switch (reg) { @@ -111,6 +104,8 @@ static void imx_gpio_set(void *opaque, int line, int level) IMXGPIOState *s = IMX_GPIO(opaque); IMXGPIOLevel imx_level = level ? IMX_GPIO_LEVEL_HIGH : IMX_GPIO_LEVEL_LOW; + trace_imx_gpio_set(DEVICE(s)->canonical_path, line, imx_level); + imx_gpio_set_int_line(s, line, imx_level); /* this is an input signal, so set PSR */ @@ -200,7 +195,8 @@ static uint64_t imx_gpio_read(void *opaque, hwaddr offset, unsigned size) break; } - DPRINTF("(%s) = 0x%" PRIx32 "\n", imx_gpio_reg_name(offset), reg_value); + trace_imx_gpio_read(DEVICE(s)->canonical_path, imx_gpio_reg_name(offset), + reg_value); return reg_value; } @@ -210,8 +206,8 @@ static void imx_gpio_write(void *opaque, hwaddr offset, uint64_t value, { IMXGPIOState *s = IMX_GPIO(opaque); - DPRINTF("(%s, value = 0x%" PRIx32 ")\n", imx_gpio_reg_name(offset), - (uint32_t)value); + trace_imx_gpio_write(DEVICE(s)->canonical_path, imx_gpio_reg_name(offset), + value); switch (offset) { case DR_ADDR: diff --git a/hw/gpio/trace-events b/hw/gpio/trace-events index b91cc7e9a45..cea896b28f6 100644 --- a/hw/gpio/trace-events +++ b/hw/gpio/trace-events @@ -1,5 +1,10 @@ # See docs/devel/tracing.rst for syntax documentation. +# imx_gpio.c +imx_gpio_read(const char *id, const char *reg, uint32_t value) "%s:[%s] -> 0x%" PRIx32 +imx_gpio_write(const char *id, const char *reg, uint32_t value) "%s:[%s] <- 0x%" PRIx32 +imx_gpio_set(const char *id, int line, int level) "%s:[%d] <- %d" + # npcm7xx_gpio.c npcm7xx_gpio_read(const char *id, uint64_t offset, uint64_t value) " %s offset: 0x%04" PRIx64 " value 0x%08" PRIx64 npcm7xx_gpio_write(const char *id, uint64_t offset, uint64_t value) "%s offset: 0x%04" PRIx64 " value 0x%08" PRIx64 From patchwork Sun Jan 12 22:17:11 2025 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: 856783 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1179114wrc; Sun, 12 Jan 2025 14:22:25 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVg0KxYuEKRhvUbPykvxavUJ8mdFIrKbg95MWkxqzZBkqpZgy+8elTb3hmYCqyRuFLy8+4lXw==@linaro.org X-Google-Smtp-Source: AGHT+IGOU6RvbP3qM1eqAn07pZsiMGYwoNDVvd9dXf9Oe+2puO5mp+Tayxd3yh6sdIuaptE6UGXi X-Received: by 2002:ac8:5a86:0:b0:467:6833:e30c with SMTP id d75a77b69052e-46c7102ce55mr280402991cf.30.1736720545673; Sun, 12 Jan 2025 14:22:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720545; cv=none; d=google.com; s=arc-20240605; b=F9goWqmzJ6X/04zDsMtCXzsdiHytvCHFXA9hGlIlS9ptglRso8DcvzqOQL/O9f3sha eqhV6HXiuLSrIrNHZUS26JezMrM+8Ut+IZqnPQIEuCo8bnAlhubOY/xcB/6PQ5OYPlQU luXMayC2qms8XWtFek4C3k4RLTvJfgTqDLVrMgfowgHA421jQHYGJOpLmfmlGG5oCyHC cLSyQlsXVh0AuiYcfK+qVSbvuq2QeG86eVy5LWBGQf/54A725Ld0MhPXIGiqqUHRYEbw uNiYRMtZ89BXtVjikbnSoKy4Wh58aPwz8NHhGr+i0z2HyA1jvZI9uAVbreLNyZHF7Tn8 lW0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=NrAERIRi/4iWN1y29jrfSTmeSOjPW3PD2Bfh20J+jkc=; fh=vRX95Sf0va4UAgm+V8ltaB+/ZGslF7gLd0I5nNr59Uo=; b=ba7jHhtEotsnVHnCyztAD9RJ1O4Kv2pGk8hjlS5HptfN1G2NDKmbZOEc5HXpigm3AX Eo34YVOO4LVKA88k+n9F2WZIq5XucXy+ygBIg51mWeqjiNZrczL4TbSWLVUbize7XcPm LrftNuZ/pVyIXhkwfY7mjBEiExEWFQhpsAggwb7s44wPx8RiwLSJdMKGaJpxsh9DSs3a wfYtbwnYkxVTZyokNIHZM6dJLzlo3j5lOE9IMrC9bILcfqRireyUJ81ufEhbTjM+APqX h4OMxhdBOWQniRggNz1KSdSEvmoP+EwRVLNUhVG0mCQbVvmrIQ4VAAAbAIVMZLa/Slzz RTnw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eDeWCywk; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46c874265eesi71518271cf.656.2025.01.12.14.22.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:22:25 -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=eDeWCywk; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6Jq-0003g9-VF; Sun, 12 Jan 2025 17:20:31 -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 1tX6Jl-0003DI-6S for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:20:25 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6Jj-0006pO-AM for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:20:24 -0500 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3863c36a731so2642931f8f.1 for ; Sun, 12 Jan 2025 14:20:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720421; x=1737325221; darn=nongnu.org; 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=NrAERIRi/4iWN1y29jrfSTmeSOjPW3PD2Bfh20J+jkc=; b=eDeWCywkFmCcx+e0JWUXJ4h5HYHNsbZNk5gtKor7b9i2I0NKeXpVTUELXGBiMurfZz Dl2OAcf00mRnGUj0iW4xYxwGmGzdwris2aQi/FHFPIdCvsItZm3YBQr9MZzgDOEzNLAx xdadFUlRUTjntkjCpxpHagBf2B41JPwqp676e9Gel6WDcqecpozFFF0sxoFXixz32XAn bP/5wGKz27DnjYpSxsJEiz0qWQ2TQiVa98ZBdsKHQM+yp0rZncI7FMqogHnZekY88m+K e+Qq5y7Q48X0SpLksKYyVWLmPtXKy9N6GUXnX2zyWAkgwQnJIP10iCl3nutZDSeg2Ga+ eD9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720421; x=1737325221; 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=NrAERIRi/4iWN1y29jrfSTmeSOjPW3PD2Bfh20J+jkc=; b=ahR1RJ67ayv1QVJjJjJj7tr0UckxOwvm3IcIyhzp05lHqqpwE7ZcDUWAnN25/ypdKP D+OPKlfEBA2JH18q9g0MvohSkzBKhKM5M9s0eVLKzaNA5vAfR//ghbEsTO79jEk3lM9G wUAUAeDdNmV5pjF6HRRSxaShZu+DWrUcQbiw3CpUWYWL98f2XS3uVv9znwymXi0+5+je ZEFlg6m24g0QR2/LVfNjdwHcXZT69fFGTz2pkAbSWujVh+rdBJrGenbcXxnqO0ZXIo1G JwRHmWh40vROy9U6CdnXQmNhV3wcBGBzgicjjiJBXqX4/tdCfQEUQVj0TL7l8UoCZaW9 sjnQ== X-Gm-Message-State: AOJu0Yy2JRMpD+trj+Y72TEI6HlD3UXXEfwB6dO0yNn8pK5Mkr6/UA1k 5Be9n4g+eoP6fQwLpj++qv5jg8fItOS7gRMV0NSFsVK8DMhkz2uO3X5xbKIoZZ0yRdy3WdoF81C P/50= X-Gm-Gg: ASbGncvzhXi05sTKhtN9jCVGHkfTzSsXZG9QJMLFkIULajn5u3WSH2srFF4lxXeSIUP VhghgyrsqbaB0sr9sUqBDt/QMsBUrSvI8AOLWUyA+wvgEQanLRmyt3owGYATONpKkuAsdSKjWX0 y86s9NX0GUpp2BC7QdmMmfF9t28ik+XsEwQIZIPOXxieKt+XLNVU8befodERJoNBX9md+qWeycr njdQYJmKwMtET1+IbNnMqJOicYws4ihUXedxyiRydx5wrI6on4hn7x7LgCo1zv4FPM1ep2pEHCY 0Kji8TtWiKwXFZajhXTsjJJw/+tXlJM= X-Received: by 2002:a5d:584f:0:b0:38a:68f4:66a2 with SMTP id ffacd0b85a97d-38a87312bdfmr16851999f8f.31.1736720421419; Sun, 12 Jan 2025 14:20:21 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e3838a3sm10658965f8f.33.2025.01.12.14.20.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:20:21 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-stable@nongnu.org, Thomas Huth , Richard Henderson Subject: [PULL 35/49] tests/qtest/boot-serial-test: Correct HPPA machine name Date: Sun, 12 Jan 2025 23:17:11 +0100 Message-ID: <20250112221726.30206-36-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.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 Commit 7df6f751176 ("hw/hppa: Split out machine creation") renamed the 'hppa' machine as 'B160L', but forgot to update the boot serial test, which ended being skipped. Cc: qemu-stable@nongnu.org Fixes: 7df6f751176 ("hw/hppa: Split out machine creation") Reported-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Message-Id: <20250102100340.43014-2-philmd@linaro.org> --- tests/qtest/boot-serial-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qtest/boot-serial-test.c b/tests/qtest/boot-serial-test.c index 3b92fa5d506..7759e8c9702 100644 --- a/tests/qtest/boot-serial-test.c +++ b/tests/qtest/boot-serial-test.c @@ -185,7 +185,7 @@ static const testdef_t tests[] = { sizeof(kernel_plml605), kernel_plml605 }, { "arm", "raspi2b", "", "TT", sizeof(bios_raspi2), 0, bios_raspi2 }, /* For hppa, force bios to output to serial by disabling graphics. */ - { "hppa", "hppa", "-vga none", "SeaBIOS wants SYSTEM HALT" }, + { "hppa", "B160L", "-vga none", "SeaBIOS wants SYSTEM HALT" }, { "aarch64", "virt", "-cpu max", "TT", sizeof(kernel_aarch64), kernel_aarch64 }, { "arm", "microbit", "", "T", sizeof(kernel_nrf51), kernel_nrf51 }, From patchwork Sun Jan 12 22:17:12 2025 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: 856800 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1179560wrc; Sun, 12 Jan 2025 14:24:33 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUvltJZ50N6wz4mx4i9rack0CcUoCS5RJXC8ZJ8jIRyqueJSsNwhONwZbCGlfEVXbHYs5+q8w==@linaro.org X-Google-Smtp-Source: AGHT+IHlf9K9Z4LtH2qtuFoOsPsDWlw352IaLQuME1YJffsx2B4dZ6BUTlihGrYI1ntmyfWu9dz7 X-Received: by 2002:ac8:5916:0:b0:467:6461:e143 with SMTP id d75a77b69052e-46c710b2087mr297949391cf.33.1736720672748; Sun, 12 Jan 2025 14:24:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720672; cv=none; d=google.com; s=arc-20240605; b=b1AymIcLQZArpNRnJVcr2yRg26jzU+TNx0QhiRV7Ty7GbAOmxA+g17b6sPxkf2hCs6 3q9XuCZyGwUS/jJWjZ+XdO3qEd/2NQfB7yjjmA6KxLfrDW6YeuWAyT/rnb93zsbHjRSv 8//cVVvHjBwQg9UmBB+JIJyITo5H5jFYHAujBj7JSJkAtYSAdiKRAKlGzoI7f9a65c64 iH2jDuWnnjsSizCzrs6UcUzOn7ctwwEFB5fqaLlJmEUTrXC3VK8MzLXYI0OXLF0s2QjW uvDSBujrjsFRR4OZZO0ZH/rBfwOlWpmTqlanLwhgRpSfxKVjY+R+QDJhrXvotHzUV8wm vhjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=gox+mQXvKnTFBCqTtoOMoUjxZD4B4okZw2yrEckqptY=; fh=kzOQA4z+KJikGolDevghSutFJa3/2YiEUUElSM4Aywk=; b=An9CBRT9JMAlsET2D/HDISWAgp9OkIP1nw6XT/ZeV35cHDhmHwwjwY8/ztfqkLpPvw dE4gCHu9CZxdNID78ylaIw0B3K/fIGZLdqLfOcSPFzlNy+KAM2yeT2Vnww98a13pWEb2 ngNHbTnVSWUW+lgZejJkLHCG3RbLahmZQE3Xgv/0WdYRlhANunKqDcPy8dlcu9+lqw7v o7pnEmf7vGKw6ohZbfqwMINSnkg/JY5bcceA4XfSfgmQkoMxhGUYulS2+ASha9peQ9sA hAyeyz86n+ZOAD0UhC/cmuTVrqs7ChEXKH1Ltn5e1EvWFtkdLxQOrNV+8LND15U2c6tw GHzw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="B/xOerJB"; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46c9e97053bsi41684571cf.313.2025.01.12.14.24.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:24:32 -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="B/xOerJB"; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6K5-0004DI-0p; Sun, 12 Jan 2025 17:20:45 -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 1tX6Jq-0003f5-9a for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:20:30 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6Jo-0006q7-BI for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:20:30 -0500 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-385d7f19f20so1901610f8f.1 for ; Sun, 12 Jan 2025 14:20:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720426; x=1737325226; darn=nongnu.org; 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=gox+mQXvKnTFBCqTtoOMoUjxZD4B4okZw2yrEckqptY=; b=B/xOerJBd90kjwW8Xm+ppNoJyzPubdJfP8IuF8kV4WhBkSkG19hC5DTrmzGKeNmw6m FTAToq07+qZobPF4eQIJgAwpqAWibUC157b8ItPJk2p+XeIktwLH5XqdN/z+7u8lgyzJ W99znRIC9JaoKtEXsg3bMi/KZwRTwWaci/z3rq7lI84EQAGJ31S2fXm4QQzcKwovdLaI FLcpZLbgVOC17m4N6X27nVtBK0w234QS1uTlgoGniF/Gx0ESLqEKLFpbBybg69SsEZaR /suYDgsVkOUEILfhw5Iv2yxB2hbr3ZvDU2dpmkY6CX69ZHdqRXCOXYYTuTfngSXpdi1F 4Pag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720426; x=1737325226; 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=gox+mQXvKnTFBCqTtoOMoUjxZD4B4okZw2yrEckqptY=; b=wCBPDiYFN1uPIJHoRU+o3U1omsPJBbvd9RWxLvSvip6Qalhx67KxzWgrtlNBrvVdup zvUDhvBz2eEUEiOGOn/CAhQ+++j+YMqrjZFI8N4c59CD+c4hV/R+DDWiO+KYby7d4n13 DsJ+DtLwv5sZklMHlWJmXBoxgsifi7aMpEw5QoRBTrDWppTiI22ErxbHCFjw21QEBz45 mu15oKTLpMocZcc8IjoFkhxfddDtbk25HqLRhTz7vc8B99Koit8bQxB2mjnONSK0S6nZ 0oTsSLVpvRs4TCRkTtV+5Jvf6+RvAdbgEAYgwXiBuuUA1uVczp8Qv7fUrgMl2D2lqGum Tizg== X-Gm-Message-State: AOJu0Yxpbb6QcIjxO7seEMi0Mh+rFXWW6eaPtPP/Kw4StALvKiDends3 jeQnkuJN3PbJa4J9ys7IXBu0Ht9PGWEZ3V8xkhzG+bhuf3horeZLMhdjxLexlZBY0J631kbml0t 3nVw= X-Gm-Gg: ASbGncvUbaf3LvkN38N9pFI5H5EaTMiAfP1zT9Qw96Hma6vhxZ2D4SQfpjnjORDo7Ca LnMGJLlZFIur0NZD4WnXiB3M+ngN6z1MuPm9Y8Oo7IjzfkYZrntHQu/emM69gCM1rDeJMSojdpr WJc/x1YMiiNr3roKy1sur6nUXR2ry8F2SUJaFAeREBLbHvm/Gh2f3hGeBSGkIyhfcBKAbebSdOr KkALOtjdk1Ff2gFSKLBOsa3OxOWh/kQgmQPQJg/SYQ8qabF/PXkwqFiKhrA9bypdrs67ZkOwXlD Q0z/k9iyOt3zVZoKek43onZcpyUxVc0= X-Received: by 2002:a5d:5f52:0:b0:38a:50f7:240c with SMTP id ffacd0b85a97d-38a8735760fmr15270966f8f.47.1736720426655; Sun, 12 Jan 2025 14:20:26 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e38c596sm10637730f8f.51.2025.01.12.14.20.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:20:26 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Helge Deller , Thomas Huth , Richard Henderson Subject: [PULL 36/49] tests: Add functional tests for HPPA machines Date: Sun, 12 Jan 2025 23:17:12 +0100 Message-ID: <20250112221726.30206-37-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=philmd@linaro.org; helo=mail-wr1-x431.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 Add quick firmware boot tests (less than 1sec) for the B160L (32-bit) and C3700 (64-bit) HPPA machines: $ make check-functional-hppa ... 4/4 qemu:func-quick+func-hppa / func-hppa-hppa_seabios OK 0.22s 2 subtests passed Remove the duplicated B160L test in qtest/boot-serial-test.c. Suggested-by: Helge Deller Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Helge Deller Tested-by: Helge Deller Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Message-Id: <20250102100340.43014-3-philmd@linaro.org> --- MAINTAINERS | 1 + tests/qtest/boot-serial-test.c | 2 -- tests/functional/meson.build | 4 +++ tests/functional/test_hppa_seabios.py | 35 +++++++++++++++++++++++++++ tests/qtest/meson.build | 2 +- 5 files changed, 41 insertions(+), 3 deletions(-) create mode 100755 tests/functional/test_hppa_seabios.py diff --git a/MAINTAINERS b/MAINTAINERS index 2101b512175..770bbf9f233 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1203,6 +1203,7 @@ F: include/hw/pci-host/astro.h F: include/hw/pci-host/dino.h F: pc-bios/hppa-firmware.img F: roms/seabios-hppa/ +F: tests/functional/test_hppa_seabios.py LoongArch Machines ------------------ diff --git a/tests/qtest/boot-serial-test.c b/tests/qtest/boot-serial-test.c index 7759e8c9702..7ea24855072 100644 --- a/tests/qtest/boot-serial-test.c +++ b/tests/qtest/boot-serial-test.c @@ -184,8 +184,6 @@ static const testdef_t tests[] = { { "microblazeel", "petalogix-ml605", "", "TT", sizeof(kernel_plml605), kernel_plml605 }, { "arm", "raspi2b", "", "TT", sizeof(bios_raspi2), 0, bios_raspi2 }, - /* For hppa, force bios to output to serial by disabling graphics. */ - { "hppa", "B160L", "-vga none", "SeaBIOS wants SYSTEM HALT" }, { "aarch64", "virt", "-cpu max", "TT", sizeof(kernel_aarch64), kernel_aarch64 }, { "arm", "microbit", "", "T", sizeof(kernel_nrf51), kernel_nrf51 }, diff --git a/tests/functional/meson.build b/tests/functional/meson.build index a5087fcb34f..999d5b930f3 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -104,6 +104,10 @@ tests_avr_system_thorough = [ 'avr_mega2560', ] +tests_hppa_system_quick = [ + 'hppa_seabios', +] + tests_i386_system_thorough = [ 'i386_tuxrun', ] diff --git a/tests/functional/test_hppa_seabios.py b/tests/functional/test_hppa_seabios.py new file mode 100755 index 00000000000..a44d1a3eebe --- /dev/null +++ b/tests/functional/test_hppa_seabios.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python3 +# +# SeaBIOS boot test for HPPA machines +# +# Copyright (c) 2024 Linaro, Ltd +# +# SPDX-License-Identifier: GPL-2.0-or-later + +from qemu_test import QemuSystemTest +from qemu_test import wait_for_console_pattern + +class HppaSeabios(QemuSystemTest): + + timeout = 5 + MACH_BITS = {'B160L': 32, 'C3700': 64} + + def boot_seabios(self): + mach = self.machine + bits = self.MACH_BITS[mach] + self.vm.set_console() + self.vm.launch() + self.machine + wait_for_console_pattern(self, f'SeaBIOS PA-RISC {bits}-bit Firmware') + wait_for_console_pattern(self, f'Emulated machine: HP {mach} ({bits}-bit') + + def test_hppa_32(self): + self.set_machine('B160L') + self.boot_seabios() + + def test_hppa_64(self): + self.set_machine('C3700') + self.boot_seabios() + +if __name__ == '__main__': + QemuSystemTest.main() diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index c5a70021c50..ab296a97a78 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -140,7 +140,7 @@ qtests_alpha = ['boot-serial-test'] + \ qtests_avr = [ 'boot-serial-test' ] -qtests_hppa = ['boot-serial-test'] + \ +qtests_hppa = \ qtests_filter + \ (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) From patchwork Sun Jan 12 22:17:13 2025 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: 856814 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1179688wrc; Sun, 12 Jan 2025 14:25:17 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVxwSb7CL0bFygly/DFkbWskLEnP/Eluu/BIuA1SW4OU4VZPwr91HRoVoJOKSF/IImTdPUZ5w==@linaro.org X-Google-Smtp-Source: AGHT+IFyibF/79NBRL7kbrlqUFzsMJ90mV1MSltASre6NCLOC1QpwSaoL2ooh6TOAvAIRhURgT4o X-Received: by 2002:ad4:5dec:0:b0:6d4:1425:6d2d with SMTP id 6a1803df08f44-6df9b2d62b2mr287197566d6.43.1736720717149; Sun, 12 Jan 2025 14:25:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720717; cv=none; d=google.com; s=arc-20240605; b=XNv/lAMElR8M3zqysEA+tcrsqPCflRa/gctTY6N29s3esuP2hwnYAndDTx1zQuq1t0 HcbGumwuvpSDxqfep8JuSx3H20JuX8w+LH6vUND1AUNwJPnZyiGN6Ztea5TeNrGLpm4z hcRvLBqUBqHgdqA/F9tRy0ROtrQryBeBcmSc4Kk0o/SH0hNiE4afE8DYAGbzMTFg0UxN m8MJ3yJbVjEaxZph36Peet6781H5DXX6qTT2fF8dAkpHJyrjOOR8EhldRpN5KG1RLch/ jPthRZkP9OiCR+QhnKk3S4BwAvEZqPLjNRW9p8xmFjSE+Ji5lnChA+IHXHvgYQ9p+kj4 bIhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=jil+o2IQDaDmjXLDPhi86OTUn7ZHj1cgkkurPDaXzxg=; fh=3//KcqJEsa04kIBt5Nb/DJuP+2GuH1NwDRxnSl44zdw=; b=cq2aObGvlH0leXxuk1UsDwmx/OXyOn9dzJ+Y3Vj5cRNBqR4wOYUjZ3yXIPObJeHEDd CxB2O9xd/PSsqdVxiFfP9pMeGkBISDDLKFDgT//vUWNqQmjoNCZ7Q7S8p9hx18dFgBVm 5Nwt6gt8Gwic7s6SvSDf1dkMX4RaezEgB7+svTKW8zeWF0i45GIMzLtK/xpp2yDoKXMx wJAgJw3VV4p7idrVzG4YTr5bxt70tpvLTNZI9ZS84KxUCdlis5Ner8CZPG0zsTxGIsnz jSxmxhCLgPYvkzK726WRw3gvhwD+r4vvY4iNd5YERkQ1oBb5ILj/nvjEQFy/RJBhGRyW D0lQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="k/GjommW"; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46dd5e08d3fsi21758041cf.551.2025.01.12.14.25.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:25:17 -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="k/GjommW"; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6K0-00047z-JH; Sun, 12 Jan 2025 17:20: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 1tX6Ju-0003wg-Mr for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:20:34 -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 1tX6Jt-0006qQ-0A for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:20:34 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-385e27c75f4so2617385f8f.2 for ; Sun, 12 Jan 2025 14:20:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720431; x=1737325231; darn=nongnu.org; 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=jil+o2IQDaDmjXLDPhi86OTUn7ZHj1cgkkurPDaXzxg=; b=k/GjommW4zSAdoxD62d4MC6jYl+JR3Wp5W6q1MvjRase5aDpE7DcViIF4W7lBLpDuG iSJPxuwnZKa82HZepdypTC0o6NQ4YltQpbePtyYFvi7yTFnTtn4FFSkBxj6hExwTqjte ZICpq4IREe86Mj+Oj4IdUJRjbLYsD8EhKNu74bgtGbQIOKTF6uex5C9YNxIGY8PY/8jV DAOQb2vh91ffM7oL17kHNHGhJIwlVl/G3MeOhza7nXC9jagh8kk0OaLHrEd5ycw+thmV GHD5f3cYYWgJD2smrJRavqzY4eU3ulafGInefcAeIdO/NAzp0ShKIBW+FWTQZYp9dcbX JHZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720431; x=1737325231; 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=jil+o2IQDaDmjXLDPhi86OTUn7ZHj1cgkkurPDaXzxg=; b=CgQXdBelGUuqn/OLUgbOg+JukMBaAZFWqiIOZF5RUJqiEB7VusYcEh2DtmOO5/vV3y poig84v2pzVUAvM9Y9rg9HV3C26qJlE7TqwfutlwyY40NIvaG2dtei4KXMdrcBojpyvP z3ctke/LY9KQDn/Du9rclaFtRim0CsurQmiNYYJzqBYRT1AcJ+kOol4y01DB7gRVYTpj OukD3dIM7TQd5td6On2FWgOo2cKQ8MzKkyNjeXjY0xd99ZUrQZ2fxiNbCAq9/OrvbIzp a273mms0Kik2S9W1gk4tYOz3Mv1ubDNNf6htJiiTgxngIp0HxnE7XV7rF3+xrlEsfm22 aG/g== X-Gm-Message-State: AOJu0YzaFWQi436CTENbkDTDY2ydBjRxgz1hvvLle/PBNZVt7qoe6FHI P5cNLWay65swp5OaBt4vqBEh5TtmBR/BzmMjOMqyz+kPUUl/C1QBeRow/nAH7QaBWaUoHiRSC2c thVo= X-Gm-Gg: ASbGncuFQnTKb8v4sp0z5Z7wh3stWCu8EGr5Q+KytW84PGDH0yJeeANmZAAxZNR/y1k fjWdsIeyAZWQNRUjkEwLSKg6O9BW/Ok/IIs/Nwd17TGiUrq+iJ6EfjlhKKW0qLaMGPDZ/3O74US ws+LycfV9iczMExTFh4cdidpmPIkglffjKd+3JmVgtQugQyWEW4OFGWU8DPVgc7lrbmWGZj4ekC 8UUA1DGk/kkAWxJaNhK2aq97iMq44Z7ZTW2pSuX5aVZlOe+twjBYdp4T+QKZEuJEJFdWK+e4JCC HtFzYD/CKr+29Ewgvo/fvsfC3Bb7Ubc= X-Received: by 2002:a05:6000:1445:b0:385:df6d:6fc7 with SMTP id ffacd0b85a97d-38a8730ce5amr17874848f8f.25.1736720431179; Sun, 12 Jan 2025 14:20:31 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e4b8180sm10563092f8f.76.2025.01.12.14.20.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:20:30 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Helge Deller , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 37/49] target/hppa: Convert hppa_cpu_init() to ResetHold handler Date: Sun, 12 Jan 2025 23:17:13 +0100 Message-ID: <20250112221726.30206-38-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-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=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 From: Helge Deller hppa_cpu_initfn() is called once when a HPPA CPU instance is initialized, but it sets fields which should be set each time a CPU resets. Rename it as a reset handler, having it matching the ResettablePhases::hold() signature, and register it as ResettableClass handler. Since on reset the CPU registers and TLB entries are expected to be zero, add a memset() call clearing CPUHPPAState up to the &end_reset_fields marker. Signed-off-by: Helge Deller Co-developed-by: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20241231190620.24442-3-philmd@linaro.org> --- target/hppa/cpu.h | 5 +++++ target/hppa/cpu.c | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 22a6510e087..c1d69c1a835 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -263,6 +263,9 @@ typedef struct CPUArchState { IntervalTreeRoot tlb_root; HPPATLBEntry tlb[HPPA_TLB_ENTRIES]; + + /* Fields up to this point are cleared by a CPU reset */ + struct {} end_reset_fields; } CPUHPPAState; /** @@ -281,6 +284,7 @@ struct ArchCPU { /** * HPPACPUClass: * @parent_realize: The parent class' realize handler. + * @parent_phases: The parent class' reset phase handlers. * * An HPPA CPU model. */ @@ -288,6 +292,7 @@ struct HPPACPUClass { CPUClass parent_class; DeviceRealize parent_realize; + ResettablePhases parent_phases; }; #include "exec/cpu-all.h" diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 47d01609557..d784bcdd602 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -193,13 +193,20 @@ static void hppa_cpu_realizefn(DeviceState *dev, Error **errp) tcg_cflags_set(cs, CF_PCREL); } -static void hppa_cpu_initfn(Object *obj) +static void hppa_cpu_reset_hold(Object *obj, ResetType type) { + HPPACPUClass *scc = HPPA_CPU_GET_CLASS(obj); CPUState *cs = CPU(obj); HPPACPU *cpu = HPPA_CPU(obj); CPUHPPAState *env = &cpu->env; + if (scc->parent_phases.hold) { + scc->parent_phases.hold(obj, type); + } cs->exception_index = -1; + + memset(env, 0, offsetof(CPUHPPAState, end_reset_fields)); + cpu_hppa_loaded_fr0(env); cpu_hppa_put_psw(env, PSW_W); } @@ -242,10 +249,14 @@ static void hppa_cpu_class_init(ObjectClass *oc, void *data) DeviceClass *dc = DEVICE_CLASS(oc); CPUClass *cc = CPU_CLASS(oc); HPPACPUClass *acc = HPPA_CPU_CLASS(oc); + ResettableClass *rc = RESETTABLE_CLASS(oc); device_class_set_parent_realize(dc, hppa_cpu_realizefn, &acc->parent_realize); + resettable_class_set_parent_phases(rc, NULL, hppa_cpu_reset_hold, NULL, + &acc->parent_phases); + cc->class_by_name = hppa_cpu_class_by_name; cc->has_work = hppa_cpu_has_work; cc->mmu_index = hppa_cpu_mmu_index; @@ -269,7 +280,6 @@ static const TypeInfo hppa_cpu_type_infos[] = { .parent = TYPE_CPU, .instance_size = sizeof(HPPACPU), .instance_align = __alignof(HPPACPU), - .instance_init = hppa_cpu_initfn, .abstract = false, .class_size = sizeof(HPPACPUClass), .class_init = hppa_cpu_class_init, From patchwork Sun Jan 12 22:17:14 2025 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: 856799 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1179487wrc; Sun, 12 Jan 2025 14:24:12 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUVpC+pdJ/VLTXAxy408rmJz24j4zO6ahHrcZe1cGR3VeTRpJtrxCxydIHwJBrC8XRmPZNOUQ==@linaro.org X-Google-Smtp-Source: AGHT+IGmSnF9vmOAelSII6uwuKRArcNnV677FboNcZtWopr0k5gQhWQ6ZybNcGyl+ngSiv7Km4X+ X-Received: by 2002:a05:622a:e:b0:467:5d5d:fabf with SMTP id d75a77b69052e-46c71026369mr262243261cf.25.1736720652357; Sun, 12 Jan 2025 14:24:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720652; cv=none; d=google.com; s=arc-20240605; b=JLJbRmOc9N+u4yfkQPvfPZXALA/pbnphaBh7jr2EPjqGeN3UrvHW8g5ZjfZDtrLD7D MYW84MdLTAzaRyt9itHjPSK2tA7T2wfGhseiaoF4PIzAYzCV0ZlEOqWHwJqPmBL41Y2a QI0C1zhBO+N0V6liaQMVJaMFfAgo/IaUKy3X/QKfPdrtY11Ez4TvL3NjBj4q/hwl2q8T c9uuH3m/wFGoGmT3X0OK0GT6+sBSkrz0EEqMwh9GheqyfMsxKJKR6vWfMtrhaQEGiecS 1amNQ5XCTpHo9alTadTE426GIUZFOxaBsQAEaOzbVCMuHvzuhUqeWHU/0av+nZ86jb1i MkGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=sio+Ya9Jtq0ztZ7UXdsNT1P9BXGr2RmzsMYT4fsV77Y=; fh=3//KcqJEsa04kIBt5Nb/DJuP+2GuH1NwDRxnSl44zdw=; b=J35kbYYz03Q7MOcgSXnnkM6e8apsTSblFwebWw3rKf+oBDWn2gFIdQ2DQyySRHHL+v FR8t9zUIM5GqRBJ4qFHl7PiGo6F7SZjcqsER2cUK0ReS+rLl5pfmSNPa2QqOeTv6QPf2 5Zzvps88JXMdf6WO+mOczjLgFIkaLs0FGYDUUw/86DvL29ptUNzziS1452ebtTtvl4Wc OwvN2CkWrqdMj6NEdoCrPnLy5bwh6Ue8qMytt6+eqJy2OKjwcyGYEb5Mz8eXrhg2ozh5 zJujF7Wr7QjcSRFKvu1jIXXtdIdtxPPkqUfe5RR4AyU1+KDGNbVnVkW+5rUNqBVVD5hH cu5Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BpQvceSe; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6dfadf660fasi79318196d6.350.2025.01.12.14.24.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:24:12 -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=BpQvceSe; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6KE-0004OE-CT; Sun, 12 Jan 2025 17:20:54 -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 1tX6K1-00049H-2b for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:20:43 -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 1tX6Jy-0006rI-8B for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:20:39 -0500 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-43621d27adeso25505175e9.2 for ; Sun, 12 Jan 2025 14:20:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720436; x=1737325236; darn=nongnu.org; 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=sio+Ya9Jtq0ztZ7UXdsNT1P9BXGr2RmzsMYT4fsV77Y=; b=BpQvceSelT+Mjhm/2roZD8LtxHJXMB1LXP2iAHVGfpc2Aj3VGmaQtn4Q/AVDwIXDzU D7qqMB61ST0Cx5wmZl9gouRXj6IDTc8H5n5oJNy9hy/qXUHYrThxHWx1+oXP/P1Wk2z0 w5ktSP9Bupg4qCoGAQNUGtb1XJKrCBeOp3txKpa7eBxsms+YEPi3NMqnOgt8ACjFyycZ 7jwJOjifAtHi2LJCCRTJLJrotZFVqbPVEiAa8NMUL6gFfc18CLp5Jyl1SygY/eabjpN4 LaGrRjI7RVc2jJFzyGMilJqjmSLRLUagt4jYcX1ljQqNWw8r2khl5BLeFBRlD7rYb08l r0Ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720436; x=1737325236; 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=sio+Ya9Jtq0ztZ7UXdsNT1P9BXGr2RmzsMYT4fsV77Y=; b=onNgmcWu+2KDBzharZtePa/XWF+1yYXswFbeM9pWzaQdefdBmnkdD6T9en4brxF7Bb +2gEuDBJGtDlJiv9rDMNdqeojDqHsjzZ7UigYLklHi9zgcAjhyDwoiH7uqiHf1ika3oJ yF73hUNscpQ8IoZFKfJIVOB4XhzSMIEdywRll0Zc6wulVAdRRqZxah94Ah8Y/3bdG2kT m3fu7wApncyF5Ck6NljQBb4ID83YZSKwJE8lTWKhZq+p0/HSNfbu5RKxczKtBnOic62t 1Dsg6Zl5dqjysDbTIfTY4KJLsl5tt3mMz3+1duMu1qWLECPv0BQ3J85QTxVyLxJtgEaf 9/DQ== X-Gm-Message-State: AOJu0YzLHCmdQF9CANJJHzePojvuuUFkAmxY8PTVZ2tX+NzpbNZkaWb7 bWbUrX6+VKh0WS7DeQihv6qGSvjNhCAotS2965gi0rhY/ZVHdtEFmN4iUmt4cqZfwShamND49fj GRqQ= X-Gm-Gg: ASbGncuQhLD90UgItWEe0fKxsu5pHPya3xdtwwBTMeDVTKrOspQa+EhwO4WtQRX9uCo G/uOL+ojHbTVpIQ1Jpic03HkLLueox9TAku2/2cWgYrBnOqKM9guHqEkBlNWSwKgYlUlG3T1SZQ 3Dwwyk/CTNVc5Qafx9yl3EsemSu+4GYLihbUlE09cIQRgr4S98THfJ8rdyfUDjQc3lxbSpGDwyv HRW2ArPauYxX3IB349omzh7VRKBSPFTUbbWBt20NLLUpgxNjI8sH4M1ZwAqQCNxyD6mZkdSogqK nIiBfvgoXPZTTGDvMm5k9CSYqvJMIIQ= X-Received: by 2002:a05:600c:871b:b0:434:f297:8e85 with SMTP id 5b1f17b1804b1-436e26932eamr187966275e9.10.1736720436296; Sun, 12 Jan 2025 14:20:36 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e4c1bebsm10629170f8f.95.2025.01.12.14.20.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:20:35 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Helge Deller , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 38/49] hw/hppa: Reset vCPUs calling resettable_reset() Date: Sun, 12 Jan 2025 23:17:14 +0100 Message-ID: <20250112221726.30206-39-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-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 From: Helge Deller Rather than manually (and incompletely) resetting vCPUs, call resettable_reset() which will fully reset the vCPUs. Remove redundant assignations. Signed-off-by: Helge Deller Co-developed-by: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20241231190620.24442-4-philmd@linaro.org> --- hw/hppa/machine.c | 6 +++--- target/hppa/cpu.c | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 65259308e2e..8230f43e41c 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -655,12 +655,12 @@ static void hppa_machine_reset(MachineState *ms, ResetType type) for (i = 0; i < smp_cpus; i++) { CPUState *cs = CPU(cpu[i]); + /* reset CPU */ + resettable_reset(OBJECT(cs), RESET_TYPE_COLD); + cpu_set_pc(cs, firmware_entry); cpu[i]->env.psw = PSW_Q; cpu[i]->env.gr[5] = CPU_HPA + i * 0x1000; - - cs->exception_index = -1; - cs->halted = 0; } /* already initialized by machine_hppa_init()? */ diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index d784bcdd602..41538d39d62 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -204,6 +204,7 @@ static void hppa_cpu_reset_hold(Object *obj, ResetType type) scc->parent_phases.hold(obj, type); } cs->exception_index = -1; + cs->halted = 0; memset(env, 0, offsetof(CPUHPPAState, end_reset_fields)); From patchwork Sun Jan 12 22:17:15 2025 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: 856786 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1179153wrc; Sun, 12 Jan 2025 14:22:36 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWlrRl1LZMOV2Yfv5P7yWtzPlGz3lHihjHriW2A7C8tnm2Ha0B5aTRV2RXsO8ae+wmpzoG2eg==@linaro.org X-Google-Smtp-Source: AGHT+IEm1tpJbjp1x2C47KHU2PnGx09IEs2frhYKqYRybRYLa7WtohFvNAASPC289ghu3rsyPkbi X-Received: by 2002:a05:620a:460f:b0:7b1:1d91:5d06 with SMTP id af79cd13be357-7bcd9759e0amr2889354685a.46.1736720556353; Sun, 12 Jan 2025 14:22:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720556; cv=none; d=google.com; s=arc-20240605; b=IJrQzApGGIgK7nwzFKQnKSUkiIDhBNf+jhpsD13hf67sMfsRG9Fn6i1p2gbslimV4h Oq4GxMPXmYh3uFXe3YeLFwytonmTWSckGg4qFvny2NRPwd9s8p9w/kw4aIMZoAtPgLgl jrTeCLOuwYdzuApyafLfr/xyX2gfi7JNipHD4zBcgrJtWNiqxR8ueSlNTP4HDMDt1v35 70Nhz+6ehXbthJ6AYEmPK7NaoctqJd+3rG05UBRiu0ZIX5Ye74LfJ6lfdJRtsanf253O MLQvseGqDzXWyxRMxvVF+2uHScS3WSudZmzj0KjHLrFbDZbQaK8qaJEzcU3+KHLuNZtg Bl4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=LHQwz6WpRZiIMj0pKqCUWLnwCFUQnRWpgUl34aEsFJg=; fh=G0NodtoLUMhKR6pPncKXd0kw6+54AeSvXTR8kR6ypiY=; b=csZIXqlt+7vU/TLFTs+/bWt12yjW2iGTpryZpCpvuj+5Fo2BveYjbKEpfZ5lUdYUwr K1RU4Ne33xLUJqknJahcqi+CRAqJS4bZHNzQx0oATR93N5uvRwpvkT2nqni4KESxjEc/ aaHC0P31YzH9Y6jGGjTjASXjB6966k4cMTMDh0EaFD2yU6oVsPlrus1015JbA3HO9VCK fMwN4EWKc5qa8aAjAnKNKwB/p0BZO0MRcxiljBOX4sWcEq20ex69lZgwgYF6PHKBrOjS 9ew5YT/dLUY5VFDiyvDbXgxGbJgHuDBBEmLm+1qMJE/2XL8aEWe6f0SVXdvVqRX88D3D SkCQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qkTnQYUb; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7bce3307274si928472385a.325.2025.01.12.14.22.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:22: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=qkTnQYUb; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6KC-0004Mn-RE; Sun, 12 Jan 2025 17:20:53 -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 1tX6K4-0004DZ-VX for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:20:45 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6K3-0006rh-Dg for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:20:44 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-4363dc916ceso28861005e9.0 for ; Sun, 12 Jan 2025 14:20:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720441; x=1737325241; darn=nongnu.org; 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=LHQwz6WpRZiIMj0pKqCUWLnwCFUQnRWpgUl34aEsFJg=; b=qkTnQYUbPKXkPKJZykx/i9/XOxZm4bJYXYT5ErJ3vBrPhU96MQyHqfTkRa6a9SCbfE 59d3qWNFKQDcL2wAgoJ9JyOkJXYC/WvFiYDERo+yTU3VAwKYVOg3DukPBQG216lH/SNj K4ligzaIF4GzlxIsT3nP16o34uRZRG0XzIhpNfH4LAK6FijEcQGU44sP8DXXr0kdw9qz d0gUqKFKDaPdCyDA4zBERIBGT1hYxiK09uINHBQL/qfaDX43vcBPpvS0xJNdAwh46EZJ BJ3Vc0zJ+WFSnAvgrbxYSsXPqqMsT3Mgj8cAWcFRkS0mioKOzokiWs2sIU0rCMW6VR3h UNng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720441; x=1737325241; 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=LHQwz6WpRZiIMj0pKqCUWLnwCFUQnRWpgUl34aEsFJg=; b=eVMa8HJFPGOWVvGjO+xRQiWE71hSBmvRsXhKVF31CEjBIcUAOmmLwpF6yjo8g5xAJD Vu0ktcsZRvqj12RJar7pm6Kd4zII383SFSPEdemnPU6oVmi6mtaeQM7/1Aug8zSP1i21 /5alM6nw6LbpJkRAOYqu6C/D/6dybSv3emNum4VECqMhwDTyZ19dwiNdvJP0rLgisF9S fJqdL48WXWxCBtkm1C3gvX5HR6rKYw3M7meg7hRykrpatN61rg2lEKM4iROz8SZZ9O3E 6dS7Ms/xUOqPk6/YEyBPBZfCVEfxKXLQpvgrGhWfnIIqMs9nC2MbkB9ENsMAEW73IjBt +KGA== X-Gm-Message-State: AOJu0YzpGVHOSanE5tSin5LkEE4PseB1Sw/W8l7v2KrDZ8UFhjia5OyE 4YepQurwJoWhbrE+eo6axor7dkwygwETzVB4Kl7uZGft+hAQPBQnKUKq9hxickcde8rQ2tWTOR5 8SbI= X-Gm-Gg: ASbGncv6kcJ+5R3xrFIerlDZKKZMMQIDyUi5/v456ibOZ6hFbgduZW970VHooO6l0P7 NWkSS22qt60y66A3++jcTmQD3iSyD0y4T+p4AzRhAo7l9mAHPLopfqLwzy56J/qOjs/tnyJkRPp 1dWs2RD2iqjib8AFj3SawHSETblxA3ufU3ocd1ycK6cb6hZIaXcyWfa6ZW/pzzg/nFO2nrEBneO v+bIezomxFjyLqd4DlN2eyM88+csFYdZZ3yJ8VdWTm8Omg//tCbyO0Qv0S7PcMuVMBwXqPu6Qi8 Z3yFvb2V+IsIp7omNsaBG5IH455ASGo= X-Received: by 2002:a5d:6c6c:0:b0:386:4244:15c7 with SMTP id ffacd0b85a97d-38a8b0faaadmr13529907f8f.25.1736720440745; Sun, 12 Jan 2025 14:20:40 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e4b81e4sm10752645f8f.64.2025.01.12.14.20.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:20:40 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Helge Deller Subject: [PULL 39/49] target/hppa: Only set PSW 'M' bit on reset Date: Sun, 12 Jan 2025 23:17:15 +0100 Message-ID: <20250112221726.30206-40-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.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 On reset: "All PSW bits except the M bit is reset. The M bit is set." Commit 1a19da0da44 ("target/hppa: Fill in hppa_cpu_do_interrupt / hppa_cpu_exec_interrupt") inadvertently set the W bit at RESET, remove it and set the M bit. Signed-off-by: Philippe Mathieu-Daudé Acked-by: Helge Deller Message-Id: <20241231190620.24442-5-philmd@linaro.org> --- target/hppa/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 41538d39d62..dbd46842841 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -209,7 +209,7 @@ static void hppa_cpu_reset_hold(Object *obj, ResetType type) memset(env, 0, offsetof(CPUHPPAState, end_reset_fields)); cpu_hppa_loaded_fr0(env); - cpu_hppa_put_psw(env, PSW_W); + cpu_hppa_put_psw(env, PSW_M); } static ObjectClass *hppa_cpu_class_by_name(const char *cpu_model) From patchwork Sun Jan 12 22:17:16 2025 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: 856785 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1179119wrc; Sun, 12 Jan 2025 14:22:26 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV9i2LR0DofAA/2yxQUSFHo7SUWDvtBw0GMaPrz02QtsLLr8YRcrRKh3orgjwKl0fv5nVJ+vA==@linaro.org X-Google-Smtp-Source: AGHT+IEsG6TSrtBtlsQ2puIJdS1/JG2KUM5ACSH4qhsO8mH9Dr2vwAHfk+3aKcIizlk5h1XGPJl1 X-Received: by 2002:a05:620a:2452:b0:7b6:c92e:2e6f with SMTP id af79cd13be357-7bcd970e1c8mr3050519085a.22.1736720546319; Sun, 12 Jan 2025 14:22:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720546; cv=none; d=google.com; s=arc-20240605; b=LQW69c0+vZaB0UdHCj6fjzIMNnrzU3Q9ymw9bhJxu1Qqv6XVlRWPvR8MZnIzvEoFLU X+fdGlOxidpoxDqDb53VwFQfvjPZYckrKIRxJoZhiTGqukHEri9dtIvjBHsrXWyCDwJg Ovv4EhCpA+4t8gLxnCAlOFFungL4mB3jioU4YdOu99FLCbKC8KuIMr24NlulsLQorCPz jSHehKKNPqHuqsqmNRs2SsOOeTQWUOXr0vTHoCLolivHglPomMDUjdnFLlmUbWHko51C 8t3kpspmqNuTlDtvU1WXe2OPfD4746+lnQyPf6Sh5rh1re1xhWUugCJLNowlNsrogqF3 qEOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=qItHc7tFgKciRuiRbnX0eajyd0aKzZOQ+m27ZqV/yQc=; fh=3//KcqJEsa04kIBt5Nb/DJuP+2GuH1NwDRxnSl44zdw=; b=FpE+KvMZ7+S0f5P6rQMmaBLFXxArROsXepa2768w6weNMTFgVZPN0E02Svtssc/F4r +FcJA6pqJAmdlmCgPBHT2mkbGIhYfgaQ2vvGniowcNl24cQwdsVfOo6YlNMprHbd91vX JIgRxbTvgw521Ccb46Qk3sQjBMkoDGxCcHiCeBBNdULKDJQj+cc1gqAbywEwT6hVtMgV sSmD3TF/tcWK3z68q7K38QmXZkPMxlFXaQYhbY1jEQkFrCGwyT3W0vLhYM+Jhm09mae7 SfRVS/3Lz2DXYtXHCMRqFxRJBi3ovezjINehzGElqGoad21xpigcQ6a8e8M3MIwQZOPP 4JCg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uhY22ixQ; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7bce322b3besi939497785a.47.2025.01.12.14.22.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:22:26 -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=uhY22ixQ; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6KH-0004Ro-Ho; Sun, 12 Jan 2025 17:20: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 1tX6K8-0004IH-IH for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:20:48 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6K6-0006sA-QP for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:20:48 -0500 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-385de9f789cso2682609f8f.2 for ; Sun, 12 Jan 2025 14:20:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720445; x=1737325245; darn=nongnu.org; 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=qItHc7tFgKciRuiRbnX0eajyd0aKzZOQ+m27ZqV/yQc=; b=uhY22ixQhLPrq1Z2GZcMkF9mHn3x+w7LOCMgSwoAGNAUs7+6ZpqStcD1O00ogPJnax SDV+qTB2mPNZdE6yHI9xNq0KH92EUrJMg96nYZtBZReglikEkOB/RMtI6gkQH0uTZRjK 1BFWpja3dX8FJ+SrI7gnc8mRRH8yzMKDxnhxozrAdKgtqYzO8xTB3Feg9DlSvQqiaaZy mm4fX+72bu9gAP8pARW0NMH6FwwgMVCNi1lGDNbkpIldPQCzC2vVsPR+3fFtpT18Nwgr 3eMtsCJmDlk2Pd1i3D6DNg4pFV01zVQqCiQUAg4cdJWgOpzSnvwzl6zf3VeVheW1mDB1 URsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720445; x=1737325245; 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=qItHc7tFgKciRuiRbnX0eajyd0aKzZOQ+m27ZqV/yQc=; b=sSFNzVC9wKz17DLo2oc7IxIolSC5ZqiDWxmt63xE/i5UjJVCigKHGaWXCVsWmXJ2bi 4uNXVDTL/AJeXN0cgSY929hVzyY/2RiVRTsi+hVIiSUiB5KWe6LNUda6lur7lOhiYHXm aHNDJAfHY1d7MktnW6rRfqc59/Df180AGW6uDBkEwnby17EJAjOVfgQQqGDl0eoj5yF3 kgtK49vRLeY8ZDazjEHBUfeQpq/GI/zpQiYu5eULNOXOqvRzaZBrNZeJtr2HhYeovX3X AZw+n4u1upTikqiqYqdbc+WK3hln9e1mjKaf6yoQ8ywqlmkUwu9sx68/QgAIdKPqfaem 5msA== X-Gm-Message-State: AOJu0Yy/SMZLUkw+JOJ8BH6gkZzU3REzUsuG6HSDpAc//pFbsE0iE3U0 i5N53Dzuh52Eat9bu9Y/G4YcqmZtyMiiQEAvJ1M36AZjKBXOBYfl3peUE4zwQ/XIInmAEoDxdOV 3lj4= X-Gm-Gg: ASbGncviN/cmOrUVxIuOf1sWTA4ERBgNSVJxvs5Ss7AgEVquvNCktUC8fRPFeLiXKNF o4NIQDye1X/hhFQB3XyIh5q/jQM3UBLLhrba7IayBr+Ny5itNbvdUOFKYjqWPtLa+NPC3D7GheS L68XTyF8kjQBA6RxWGyB+QdUlSpr9IgvEJ1EpTnwIVpKU4+kxnPjNwUVFrH0Aoxk2o+8F2uUBPJ SFr8vgkyUgC7GbfZGIi3FexXHlR0v1sYU+23RJoLOZ9mZfCjucVVajgC/Esl5l5Y2ac8lqh98u/ kpO8Brjtj++6NIjird89lyu/s9UxnfM= X-Received: by 2002:a05:6000:186b:b0:386:1cd3:8a08 with SMTP id ffacd0b85a97d-38a872d0006mr15505335f8f.5.1736720445127; Sun, 12 Jan 2025 14:20:45 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e9e37d3bsm122515855e9.31.2025.01.12.14.20.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:20:44 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Helge Deller , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 40/49] target/hppa: Set PC on vCPU reset Date: Sun, 12 Jan 2025 23:17:16 +0100 Message-ID: <20250112221726.30206-41-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.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 From: Helge Deller On reset: "The CPU begins fetching instructions from address 0xf0000004. This address is in PDC space." Switch vCPUs to 32-bit mode (PSW_W bit is not set) and start execution at address 0xf0000004. Signed-off-by: Helge Deller Co-developed-by: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20241231190620.24442-6-philmd@linaro.org> --- target/hppa/cpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index dbd46842841..7278b7ca6b5 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -205,6 +205,7 @@ static void hppa_cpu_reset_hold(Object *obj, ResetType type) } cs->exception_index = -1; cs->halted = 0; + cpu_set_pc(cs, 0xf0000004); memset(env, 0, offsetof(CPUHPPAState, end_reset_fields)); From patchwork Sun Jan 12 22:17:17 2025 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: 856810 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1179681wrc; Sun, 12 Jan 2025 14:25:15 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWEr0bY9Iqw9TZb9VnQ2h5D6sCwsSfUESHh+kcKdEEQ25p7T47JFDk7IzBufVfVW0EZ3HlIRA==@linaro.org X-Google-Smtp-Source: AGHT+IGYehEogcEmxKnR+Jspt7mlNBhyGUSSC8os7j5r9i5xgsHzkq8iNvn8HGnJRhb6/bUwEcDF X-Received: by 2002:a05:6214:4303:b0:6dd:3c07:ae48 with SMTP id 6a1803df08f44-6df9b2fef4dmr320477636d6.37.1736720715759; Sun, 12 Jan 2025 14:25:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720715; cv=none; d=google.com; s=arc-20240605; b=jQo61e4CUiB3u7xLMtbBHBqOxXycIxpq7nqC1NJ/CIzxUSbxqz+zAM9i89IshKNyst i2KSvlBmes0ALbKxUOlMgKLdiHhtbIxPhDkVovacPtab65XbDnvoIs+b7ccaUY5buGaP eSOGkh02LoR1bqSO4cj3nRhGct5x41vsGbFZ1sZFknhwxz8wljykAvpqUKPjr6ehkd66 gZEQ40utyi4TZ7InXbyHARZDiRxft9ZS/BVHbdpme710xZ0LSPdKxmiwgPZgsC/rHPNr CsfP+hu/6ZGo+igSRLaB5p/h55ZGWn24qjxgMI+7NW5kCXY5JrrAyyCbSWRWr4GpgT+u 0Lfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=bHPlQnm3HsPVLvOhysF1ew4D4qv91kBHvXEYj4oE07s=; fh=3//KcqJEsa04kIBt5Nb/DJuP+2GuH1NwDRxnSl44zdw=; b=b0H3A4rPs/6kIqck2bqITtSrHgECYaBSFD2G+seOgsKX9ZM0BjS3/vd7A/hoFDzCCq cSeN8/NO0IxSkwA54IXoU3ZwjwADsCLVsCYRWq0+0/K0U7dpVytYvzJIn20TOfXIR9hW +JW0yrcZ/xB5dubPyxxzdd3/WUGvzgmfGfCuxTKmM+DlLfJRVrqSQgg6u8nWPbswUUfp TQq4d2VZeS8pFpElRpczguRR0S1fk5utS92SWS10TvuwyLsstBz2uF874mNsKCfngG/O ywC/6m5x7+8x7Ps8r6kDocP/biBo5+AeI6jQEuByNbgJXNvRFSq+sCbgQT1lBgRDPbUY 5ZvA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ajjHndTv; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6e169b96670si30879396d6.361.2025.01.12.14.25.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:25:15 -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=ajjHndTv; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6KM-0004Y1-B0; Sun, 12 Jan 2025 17:21: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 1tX6KC-0004NN-V0 for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:20:53 -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 1tX6KB-0006sQ-B3 for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:20:52 -0500 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-385d7f19f20so1901655f8f.1 for ; Sun, 12 Jan 2025 14:20:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720449; x=1737325249; darn=nongnu.org; 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=bHPlQnm3HsPVLvOhysF1ew4D4qv91kBHvXEYj4oE07s=; b=ajjHndTvXUg6vWDIFD7LqbQ756CN6ykYQqyH7xFb4A7Jl7QXLBw9o4kFDIPZwLxgQ5 VrdGLlxi/HvMKC/botmTr0Kg8LdA7yGLZ6dteYZUxdzL/2NWx3oAKml2aC96AvCAOMLh 5lOH7ZlsXebmwt5uP2ouKS/gwdS7QdyMrV9uA30o/T8J1HkKO7igfMTjCDZRy7SRZD4r 840X94ftBjAUi5iQGWrGp8mbDqsRAXXzCII41A6sLt4CWtjyrgW/+QNWsgTPr4kXv3rd 7/JJOLTYI44RvM1EB6DVDbT20AQlGP35CqTZ7otFHva44PqOujYbl9obiMI5QDYvG9IE SKgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720449; x=1737325249; 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=bHPlQnm3HsPVLvOhysF1ew4D4qv91kBHvXEYj4oE07s=; b=mDMaXADIbRCfdR/CW/HmbXnL9eYalE6NfT/kSlDTmBeef7vdK+pY5qd8YkXsgGGeed 5vaC4FxxQ1AWmQH32sZ8Nbn5iKoXhdGe/fUvfvoGvV6+sfyqDjp/MXE1AQM3qiPN7Rjj rvFxUfDMxvJ+ooj4v7GYSketTqmkZ+SCbdUtsW0FU0CcEhFO2yEZYKOSF8y159o4Vap3 2QbN1xt70gvqmiCqeHFEhIbdOMZsDZPSnRcbenQWtDiKujAmG2f1KLLzfpRTie3x6GGa qXtQ2fE0Hr8/y8zqibiu6V1LUWNVs1wNeQEz5okp5NshpBB8pRctYTQkRpMH0OcqHPt7 sagw== X-Gm-Message-State: AOJu0YwMVCwAcauTULTh/uTw4YgRgWeVK4WQj/TFwha383/0p4cwDz2S HcwOSD6SJ4xuGNyNVOgRvpYu7RqPK+26lRZALQ+MzkO0tMlZ1bhJF66dL2UrJqx0hYIGUlsfFoq Gt9A= X-Gm-Gg: ASbGncuZscP+VUBrWE4zFQMUIptvCEVPmEVYpt4ixqcKA9bi21b4A9jHj/m1z8zosz7 eFcUG2HoeDDi0lRpG/sHul72tYcfAsq4bF4VyavjDF3nCck8BFhYO75eaMFY2BKOa85JT/2t6bB rmqA7tI6eGzqGjLbkmHxvu3OwAl68MZdtswA+RN2XDzj68ubHRO/K+gw7dJp1VZFFF5vSKAD4Bp tLWNPp3fF8YmXvRQfUvlXBZ55tw9nPu1+HzL0q81sWqf8FkaIMMq5Wi1aYjmp8Jmp/N+6qlAf5P T/9qAjb2mM2/l9V4a6GTeuSahhcc7Dc= X-Received: by 2002:a5d:47c4:0:b0:385:f892:c8fe with SMTP id ffacd0b85a97d-38a87306ddcmr19966676f8f.21.1736720449570; Sun, 12 Jan 2025 14:20:49 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e9d8fc51sm124668755e9.7.2025.01.12.14.20.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:20:49 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Helge Deller , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 41/49] target/hppa: Speed up hppa_is_pa20() Date: Sun, 12 Jan 2025 23:17:17 +0100 Message-ID: <20250112221726.30206-42-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-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 From: Helge Deller Although the hppa_is_pa20() helper is costly due to string comparisons in object_dynamic_cast(), it is called quite often during memory lookups and at each start of a block of instruction translations. Speed hppa_is_pa20() up by calling object_dynamic_cast() only once at CPU creation and store the result in the is_pa20 of struct CPUArchState. Signed-off-by: Helge Deller Co-developed-by: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20241231190620.24442-7-philmd@linaro.org> --- target/hppa/cpu.h | 6 ++++-- target/hppa/cpu.c | 8 ++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index c1d69c1a835..083d4f5a56a 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -266,6 +266,8 @@ typedef struct CPUArchState { /* Fields up to this point are cleared by a CPU reset */ struct {} end_reset_fields; + + bool is_pa20; } CPUHPPAState; /** @@ -297,9 +299,9 @@ struct HPPACPUClass { #include "exec/cpu-all.h" -static inline bool hppa_is_pa20(CPUHPPAState *env) +static inline bool hppa_is_pa20(const CPUHPPAState *env) { - return object_dynamic_cast(OBJECT(env_cpu(env)), TYPE_HPPA64_CPU) != NULL; + return env->is_pa20; } static inline int HPPA_BTLB_ENTRIES(CPUHPPAState *env) diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 7278b7ca6b5..b0bc9d35e4c 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -193,6 +193,13 @@ static void hppa_cpu_realizefn(DeviceState *dev, Error **errp) tcg_cflags_set(cs, CF_PCREL); } +static void hppa_cpu_initfn(Object *obj) +{ + CPUHPPAState *env = cpu_env(CPU(obj)); + + env->is_pa20 = !!object_dynamic_cast(obj, TYPE_HPPA64_CPU); +} + static void hppa_cpu_reset_hold(Object *obj, ResetType type) { HPPACPUClass *scc = HPPA_CPU_GET_CLASS(obj); @@ -282,6 +289,7 @@ static const TypeInfo hppa_cpu_type_infos[] = { .parent = TYPE_CPU, .instance_size = sizeof(HPPACPU), .instance_align = __alignof(HPPACPU), + .instance_init = hppa_cpu_initfn, .abstract = false, .class_size = sizeof(HPPACPUClass), .class_init = hppa_cpu_class_init, From patchwork Sun Jan 12 22:17:18 2025 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: 856811 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1179682wrc; Sun, 12 Jan 2025 14:25:16 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU1D+drhZ3OHwByMTobxeWROrL0HnlFkx2A/mNdzru94DoNPt90D/iyF++awQSPENSpBPQ1NQ==@linaro.org X-Google-Smtp-Source: AGHT+IFAKhe8oOhT1kjHW4KVxq6CG2kJwU2pM0oi8mhvSCYypOynRjQNu8N5yHnWxd9dJiNIG67t X-Received: by 2002:a05:620a:410d:b0:7b6:cef9:4f10 with SMTP id af79cd13be357-7bce11af00emr2177158585a.3.1736720715886; Sun, 12 Jan 2025 14:25:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720715; cv=none; d=google.com; s=arc-20240605; b=Nn2LRAaXHrJXLBcGUPoChr+YrW/eY4tgogyS5GOvJApmnTJlOu+Nb5CHOkT/JI6Hrg O32LkxF8TNabQ4+gZbfSqqYC8Btmh79HEr1nVc2JReRz2fBg0ruduGYzd2nqx1EZCYvG ewVROPIPtRX0L1WBMJLVG+eAewMK+gnqdqF8aAwmasUIfAjazUvQvlCH8T47Ze4DozPi kUOoEfT4pHDYdVHFwmF/Q3xlrkL97iEkDClOwX8liJiApZ5gVfcmew7CYrQDFHEDS1g6 oLcenGacLkZoV/5zIQI670V4/O36QDREPhH5L33CM7IFetvvUlzdNhZvQzb1I0HkcdCw qnew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=PY2xzaJd4C4roXkkRjiU6ex9RApXwoXOgYcP70nq+ss=; fh=aDCAagW5mxSPqHysMllZYr05yrz1yhx7v9Wal9sL76A=; b=i0UxWrk3qRValQl2cOzfxaLD0GVKBRxoKqE8+IW7DnbJjVpN3Qe1Ql+wmvxX9hlLLB 4vT3arDvjYPUwkXupl0arY5vJGU/Q7YwwivGcotMuuvftQUYDtk9t4f9VT7a2B2+8Dxr /elCI51XIPaj+65Paubs8EK3N6/t0lehpPd6oJRC31a75PiUEsW0E6xQJpc0ivRLhB2g hQBJNWcM3xKzuxQufgfewJLWPwvmqK5CM11j+lKOO78mDVT8QWQvJPUN4hvVzO7m7aPN gl0bmCamC9F7GNImbu5SJuyg6vH9qEm8ESL97GDVBGBscUF5RKj+CPhj0yXs+yljvYSp 41UA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sGXUVGBW; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6dfadef4a1bsi79475456d6.324.2025.01.12.14.25.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:25:15 -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=sGXUVGBW; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6KM-0004Wy-1B; Sun, 12 Jan 2025 17:21: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 1tX6KI-0004TW-MP for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:20:58 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6KG-0006sb-J8 for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:20:58 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-386329da1d9so1904494f8f.1 for ; Sun, 12 Jan 2025 14:20:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720455; x=1737325255; darn=nongnu.org; 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=PY2xzaJd4C4roXkkRjiU6ex9RApXwoXOgYcP70nq+ss=; b=sGXUVGBWgWMVrDfOwzXmrax/Gfq/xRUB9TLlQnT9nuYngPlv8rKPyjoi4zehciyjuj TUKJzRHJvSr0pnd1NMX46V24bFC57FaCFKD/eiF03GhHlPlwrJ4EZ97T8C5Vj/U9fKMv LOVwnzZco5TRgEeMsVtlPFn1b2awfiigVMLU3FnKtIE1rGL9z5TL+oG8556yQ4G5sb4K snCPyVbFqKrc2RPvYIqcsokN3mX7BRKFTNew3qNxw7Dpwz3Ng1vQMV8EhdSBOQfvkwyy 0vWoaRIVImgORirzhw7B1pAO+iT9wbenkwVmRTQSg7hCvucakM9PDia7rHGEs1+42s/L QBEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720455; x=1737325255; 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=PY2xzaJd4C4roXkkRjiU6ex9RApXwoXOgYcP70nq+ss=; b=ZnSP7GKFu9ah3uO4xcIa72BaTq70OQhLqc6V0jL9Oibkt1x9tWgBHQ5+f63b+II5p1 WYASD0WjEFcbALVXT/1shs+prMIimiNoBisFE/FLPuHcxnYqfzh3p7x5tH3AXosSCmtO dUSQXI9ePnIacv9Q95lR3CG4EgSiI0Ndrspu8BhDoV9OZxa77DcsEgxFAv5cexzr3gQb 7jvmz7gFRhAW0q94pcvxNRVO/ZgLn2lUOO7D2TN6ZKbVUyRuiQKg+aP46+EIEZdoVfPp eAzDssuZkyvAm4ssTTbR/iAR3xoRTIT9Bt5YVCEGUxfZQhfKeWljS1fhJZejfzw22Vlw iA2A== X-Gm-Message-State: AOJu0Yy4fq0rl3wjoY+i+0OEdAr7KdSilSH88a1FYa5i7Yx6ggLyWyvv RYkxdgyO9Oqckfveu02BOi4yHIJ6WzKLDi+0khGoHO2g0aLpmmcUoWRsWv0bESE0ZNrj/QjH8Te axEE= X-Gm-Gg: ASbGncu+cC9UxJth3J+KiRqflH6DsgkoRwy5xBsI23mQaQi0cI1lnF5qQ8jQ/3rtfV0 y95KQRAkb1laKVcydFzNUjQ4gVEBbKPslfr3n2IHfOZpZJ+gzQ2FIjWl2X6m6PIjgxbvBkab62k gOVMiARO5LpjsMhVIUGDBIgUIAu5c/RXdo+VWD3d+6FKEXfJIgv6AoH2XOP8H06xB/YCY70Hzvk xdTzVJAupHeQ345W9ytwlLDnvXudiRHzjmn6QgVTwEHH4Pvdolu4VBbLa8ume56DjEp7ghA5rX8 UZpWRZt8TyQs6z5DYB7cWvHfEgTyaU0= X-Received: by 2002:a5d:47a3:0:b0:38a:4184:2510 with SMTP id ffacd0b85a97d-38a872db629mr18532819f8f.23.1736720454772; Sun, 12 Jan 2025 14:20:54 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e3840bfsm10782722f8f.39.2025.01.12.14.20.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:20:54 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bibo Mao , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 42/49] hw/loongarch/virt: Checkpatch cleanup Date: Sun, 12 Jan 2025 23:17:18 +0100 Message-ID: <20250112221726.30206-43-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.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 From: Bibo Mao Code cleanup with directory hw/loongarch/, removing errors from command "scripts/checkpatch.pl hw/loongarch/*" Signed-off-by: Bibo Mao Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20250103064514.2660438-1-maobibo@loongson.cn> Signed-off-by: Philippe Mathieu-Daudé --- hw/loongarch/acpi-build.c | 3 ++- hw/loongarch/boot.c | 4 ++-- hw/loongarch/virt.c | 8 +++++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/hw/loongarch/acpi-build.c b/hw/loongarch/acpi-build.c index 9eb5fb68bff..fdd62acf7e9 100644 --- a/hw/loongarch/acpi-build.c +++ b/hw/loongarch/acpi-build.c @@ -456,8 +456,9 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, MachineState *machine) acpi_table_begin(&table, table_data); dsdt = init_aml_allocator(); - for (i = 0; i < VIRT_UART_COUNT; i++) + for (i = 0; i < VIRT_UART_COUNT; i++) { build_uart_device_aml(dsdt, i); + } build_pci_device_aml(dsdt, lvms); build_la_ged_aml(dsdt, machine); build_flash_aml(dsdt, lvms); diff --git a/hw/loongarch/boot.c b/hw/loongarch/boot.c index 241c0eef1f0..bd8763c61c3 100644 --- a/hw/loongarch/boot.c +++ b/hw/loongarch/boot.c @@ -292,7 +292,7 @@ static void reset_load_elf(void *opaque) cpu_reset(CPU(cpu)); if (env->load_elf) { - if (cpu == LOONGARCH_CPU(first_cpu)) { + if (cpu == LOONGARCH_CPU(first_cpu)) { env->gpr[4] = env->boot_info->a0; env->gpr[5] = env->boot_info->a1; env->gpr[6] = env->boot_info->a2; @@ -354,7 +354,7 @@ static void loongarch_direct_kernel_boot(struct loongarch_boot_info *info) if (info->kernel_filename) { kernel_addr = load_kernel_info(info); } else { - if(!qtest_enabled()) { + if (!qtest_enabled()) { warn_report("No kernel provided, booting from flash drive."); } } diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index df56d75a6e7..db37ed6a717 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -331,8 +331,9 @@ static void fdt_add_uart_node(LoongArchVirtMachineState *lvms, qemu_fdt_setprop_string(ms->fdt, nodename, "compatible", "ns16550a"); qemu_fdt_setprop_cells(ms->fdt, nodename, "reg", 0x0, base, 0x0, size); qemu_fdt_setprop_cell(ms->fdt, nodename, "clock-frequency", 100000000); - if (chosen) + if (chosen) { qemu_fdt_setprop_string(ms->fdt, "/chosen", "stdout-path", nodename); + } qemu_fdt_setprop_cells(ms->fdt, nodename, "interrupts", irq, 0x4); qemu_fdt_setprop_cell(ms->fdt, nodename, "interrupt-parent", *pch_pic_phandle); @@ -815,7 +816,7 @@ static void virt_devices_init(DeviceState *pch_pic, * Create uart fdt node in reverse order so that they appear * in the finished device tree lowest address first */ - for (i = VIRT_UART_COUNT; i --> 0;) { + for (i = VIRT_UART_COUNT; i-- > 0;) { hwaddr base = VIRT_UART_BASE + i * VIRT_UART_SIZE; int irq = VIRT_UART_IRQ + i - VIRT_GSI_BASE; serial_mm_init(get_system_memory(), base, 0, @@ -1175,8 +1176,9 @@ static void fw_cfg_add_memory(MachineState *ms) size = ram_size - numa_info[0].node_mem; } - if (size) + if (size) { memmap_add_entry(base, size, 1); + } } static void virt_init(MachineState *machine) From patchwork Sun Jan 12 22:17:19 2025 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: 856790 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1179333wrc; Sun, 12 Jan 2025 14:23:23 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW50/mBVFyR4iifRjsyZuFrjPNzVrHiNqKXn6F9tEojg1BeyMVNUebAl5IfrjpSLOcg+yG7qQ==@linaro.org X-Google-Smtp-Source: AGHT+IFxQgZsrhSLrK7zkyu1ApM4Zz6cGg8F7Kvt5Pr4aqOmuz4D3AMhB9SHBXhlkizSks+w7F4X X-Received: by 2002:a05:620a:318b:b0:7b6:d631:2669 with SMTP id af79cd13be357-7bcd974a342mr2718275685a.21.1736720603564; Sun, 12 Jan 2025 14:23:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720603; cv=none; d=google.com; s=arc-20240605; b=ED8tlcxMeFLu222pC5F4VnxP+4d0AqqxXS7tFtX47Eq5WURaFviQlMWTv/X4UbtzV2 ODUGygIrpfg0hR6S85SWlTWYuOPzlVG1Je3yOGwpSrThi/oD8Gdrq2LelatAiw+5yJse N4yE2seAOy+ERiRoWqkNcBfdFtzMaxiaINnuGnzMz/1fDIzacxJ4LSiBX77Rk/fAImsk PgVDCe++u/ygy4vUnl1fa/ybyAuQ0WVnHLQ1ihRjKwtjLeMl+0UjBcBnC+3xMFNEvkp7 5Oh7tvVcHTLJiOzQShOineB8bJi3Ej9ln9RfZehqcvUDdHpLpDoTAcxGzsg6MCwJRTTM IPrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=whxePkoV2Yp+9MA9t/3hISIV5oW+krMfOXhVnA0z9Fs=; fh=ihUid1ruN6T1pMSWWW/QClUJql+RE1nLvC5gAFjTLYM=; b=QMx8nBxL3O7TkFyvAL3sK1lQGdRsILNVYiFRMTaFmido+lvqKJUfZ2uNHGhOdCiKJu mdlvm7mbsT5BGjMI3yjdlQRhl+ShqDld5ASIY1Dm3Ban0kGdTQknt7TfTm6LrJvaMcbA 7AwUWwoW2+qcgvKnvPJkoxKvV2czmzB/ybnSnspLVItA3af9YoIc/Wv2kOHhFEx+L1fP P8yYoAX6FhUgRrPd0BnH+CpKO6/wV7LJW9eyF1fu2fOkItBfR/hXWIMYrNCg8TyIW0W5 c2W6lYgxbgIgZP0OVMTsWf5o44Gd0VrjEY9ENg32OoKrZxJHNggDsjA1ikxMgTBt5prC Ec5w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MmNloycs; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7bce3307bcasi952979185a.215.2025.01.12.14.23.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:23:23 -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=MmNloycs; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6KQ-0004i3-G5; Sun, 12 Jan 2025 17:21:06 -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 1tX6KN-0004b7-9o for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:21:03 -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 1tX6KL-0006sl-9v for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:21:02 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-385ddcfc97bso3161334f8f.1 for ; Sun, 12 Jan 2025 14:21:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720459; x=1737325259; darn=nongnu.org; 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=whxePkoV2Yp+9MA9t/3hISIV5oW+krMfOXhVnA0z9Fs=; b=MmNloycsHGBCEOGKpwHrMoqdICQ+BmY5akb/Z68dcxepkr1dxCRPJZjBMJQxvNN43J BSQCQkztcc05x7t2ljf9eDx650F8RGpnsHjKIcVXNxGhW/cJZIshFFEaOb4D2KzrEIbq VvSmf+pocfyk6GUN9G83uLwRRelErtmTscaHGjUd9ulhmvi1wN1+b8NRGJOQBd2/vonw WZDG2osy7Tr1xRFnNWRQ6nIt50UM3+FjBoWGvE2G8l2x2qU1TC7kFUX0BsbDcKDbxzrO i6q+QGK2m6JlsHVCYc35hF3H1dtRi8eG5CDO40Fo0uJcTjdjIRcVbM1LMTSp+ybOVwgq Q04Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720459; x=1737325259; 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=whxePkoV2Yp+9MA9t/3hISIV5oW+krMfOXhVnA0z9Fs=; b=aCXcGJyAsA7B8DQDCPxClDQHJ9Fxjsmrz/8vQbjZwGPaKgAMDQyeZscSrXFXi0ysNG mq3Pw/LCbtVDkLgrQmgPII9xiikemy9LHaWR7SYPIVgr+DNHtfiEamBEcJlIIbiSwtBr aO05R3M96iHoF0BY61dM4MrOJ090SV8rV0yp+1V6SVR82ovd6sGsV3GoLZ5nL7F9HsKT hzwuIlxrqqghsCnRtrr6s/OpC8BJWI9bgj5O2MGCiaIs67CUGXStMWmFvykN9ToAKmOT ikIY4820lw3cqP6w1HmmSEM9heq9lytPSGPdUxwHHf2qLtDxU9wNiMP3Z9UiO6Fhd7LZ 7FQQ== X-Gm-Message-State: AOJu0Yz4cSslqi2dHqOucDrLKHcdf4RKuB4ApD6NLZFBaGyF7hRs7LQc 5MusM4b5i+bdwe3i1IJyZ/upq3hmI5YAbZBLdB+UK9URNzxbpwloIc90OzTRTgDV7yWgrDHKclR T7ns= X-Gm-Gg: ASbGncs+C2KOSA/ZYLtNmvDvab6nxim3/eQeYTs5rNzu4mWBNXWJ6kaMiq2Sgd+l5cA dj0Re7NeVx/1UuY8R1Wyz/zENTEe2bnLwmx/sfSFo8zI2X8d9U4DjmOjvUFGOY2ii1Rlpu+UXR4 MzB5Z3Z7IjyNVj4kZmQ6gM/nAW5qCgm4g1cwHhtIPlSM2/5UI6tGMWrYHuUreJ/I+tzYymWL8Gg 6s8juULfYV+hPw7GE0Ij4ZGPr2X1+rm/7tSXYC2C5ubRHOy61zR7KEVWzQuZfMLePZM9hot2/0H 32BBi+a8jXXSVgG/kFFM1BEU2XkBQmo= X-Received: by 2002:a05:6000:490e:b0:385:ef39:6cf7 with SMTP id ffacd0b85a97d-38a872ec3c7mr15044296f8f.32.1736720459313; Sun, 12 Jan 2025 14:20:59 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e38378csm10521280f8f.25.2025.01.12.14.20.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:20:58 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Gabriel Barrantes , zhenwei pi , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 43/49] backends/cryptodev-vhost-user: Fix local_error leaks Date: Sun, 12 Jan 2025 23:17:19 +0100 Message-ID: <20250112221726.30206-44-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-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=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 From: Gabriel Barrantes Do not propagate error to the upper, directly output the error to avoid leaks. Fixes: 2fda101de07 ("virtio-crypto: Support asynchronous mode") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2714 Signed-off-by: Gabriel Barrantes Reviewed-by: zhenwei pi Message-Id: Signed-off-by: Philippe Mathieu-Daudé --- backends/cryptodev-vhost-user.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/backends/cryptodev-vhost-user.c b/backends/cryptodev-vhost-user.c index 43efdf97477..3295c6198a7 100644 --- a/backends/cryptodev-vhost-user.c +++ b/backends/cryptodev-vhost-user.c @@ -281,8 +281,7 @@ static int cryptodev_vhost_user_create_session( break; default: - error_setg(&local_error, "Unsupported opcode :%" PRIu32 "", - sess_info->op_code); + error_report("Unsupported opcode :%" PRIu32 "", sess_info->op_code); return -VIRTIO_CRYPTO_NOTSUPP; } From patchwork Sun Jan 12 22:17:20 2025 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: 856804 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1179598wrc; Sun, 12 Jan 2025 14:24:43 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWk5kzf6EE2tIJncF8olQ7dbc/j9CPoi52SHNMQz4B+gaFOBAyZCGmKJ8kCMprMZebW6e6Nig==@linaro.org X-Google-Smtp-Source: AGHT+IH36rEWIRL5JUPiEdtXKHRkBWkhMowYmgKWS2xhc8k/ZGFHXhxB+CSagVgqHsMdEUVffRbA X-Received: by 2002:a05:6214:20a2:b0:6d8:a967:8387 with SMTP id 6a1803df08f44-6df9b1f6a6amr230773356d6.1.1736720683563; Sun, 12 Jan 2025 14:24:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720683; cv=none; d=google.com; s=arc-20240605; b=doSrdc2kmphB1lDBax/kHgNhNHENXvHSZYn66nzBKh3uHlrUrtMDEhOFnCEQdS9Dpj gb9BIT9BS+LsRMYQurzvVmrJ5kVeOlp+xYz7hBGGCH4V+tNeMMMrCEnhfoRUgX0dvo+0 blUB5wPg8Ckz1x1LNeX0rvdZ13fgmcWh0nzq/qwuADgRJ5OeX+QJ1qdcDmz24gUfdqak 7a/xLRZoCcy0+6LTJ5zzlh8AH0LEPU0dm/V6XGFXQ6BJSaHDiDUXPfSEuhHrUdIyyheg 0Yl/R7kUPGjRt2PENRc7pUbfFIDWqBk9vnuo3xsrCBs0/sy48P8eXje9P4OUSa+R06dK pMxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=STm3h0ab+xe29Vo/LMzsJN1pZufVzApUsosxR88Bje0=; fh=WFBdicru1D9bSpCyezuvlbmKZ6DpYs++MhPzIQUvDzA=; b=P58vGXqLNUHJYsu7MNb9+Y8wFmZMiOQXFhD4nA6eyqGJrD5GipzQ05YKTrBN/K92Z5 snI814ZuzMbFCwvQRIheGcmuIMJVHKGVUNTpS3l411TKXqEY8iSTzRlYTOvGj3Lgaavk IvR1yqzvlPDJu56Oufx2inl6/yPEoIR7WbE7aYGDhmwbI/9HUW8WOBSmEmi2xNrJ8+lf 2DDXSxi90yLrtTKxf2EU8QQJV+25+O3lTfSsJXEjTx6dV9ydtwtFpbhSz8sJ8pb1aJ7E 6DTbRupp3XOuAtSMXAQsOnARO+zZBOWpWHhQJffcS8fGMsdyukIQIP2fcj+3CX6rAg1A ie+A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Xb5neO9Z; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7bce3307e12si951228685a.343.2025.01.12.14.24.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:24:43 -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=Xb5neO9Z; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6KU-0004oN-Fc; Sun, 12 Jan 2025 17:21: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 1tX6KS-0004l0-1u for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:21:08 -0500 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6KQ-0006tB-EK for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:21:07 -0500 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-385f06d0c8eso1949396f8f.0 for ; Sun, 12 Jan 2025 14:21:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720464; x=1737325264; darn=nongnu.org; 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=STm3h0ab+xe29Vo/LMzsJN1pZufVzApUsosxR88Bje0=; b=Xb5neO9ZGEJj5ujgvitJk32BDQDKoStpuuKnqyNq1KLKBABAJV1cqh3o+JW0t43Sao 6jFDZHxO5Cr0ulCedo2AgD4PQuvYZnPNQSPtm2TSw6Ckyf6exBDjqvxV4LfsmyAb/xFE bUYiDSWsr/bKwo/YsncsK0cf/rTdqMudOTBMjbhOOYuZyO32Cr0cCIwZ0XH79K72WDT0 PX5G4q+IoHYscalu/DgF7utFR2utkNOJrJ7Khsl0SsPQrsVaulHZrFtdkjo0F863UXC3 p0JIxQFeidVyNDVC2oUUjGUZfL3941KajOT8AR6fwofnT5CaF4Sdiwx34qDDg3tI5+2D CIAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720464; x=1737325264; 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=STm3h0ab+xe29Vo/LMzsJN1pZufVzApUsosxR88Bje0=; b=M7DnXwRbHC5DAfo3hhPNFI7KOXRlKpbfpK8ebJLA8aZN/vHCLgev6tP/t9R9RK3lBf DjP5HTAIk9F2FX3isQuhvE+FUyOiNHAhOGeYzYI5vR/XibrSFNLZI7UthUU9QwsWFa6T CtJhBfiHSkB0DLSxMArMBIvUBl6mPHsF0hwpd3CcHF3wb7vuU4/9CVL4HmP1dbV4rvID k1NWEekNEv2HuKCql/0u488o9CSm5v6MwNbCm11qx0RPI9jQdtDLljN8FF6RIlj2zIyY paekRY6koWz7vDr0tPUbvaRWBKDyscmlP6Ge3cfm+ctLlEAZSGN77sYsYyGEsLZBu7WI ecyg== X-Gm-Message-State: AOJu0YyT8IXaKJqcdTd8N7fiWBQMv6E63dAOISVFZXNYwfDAskQ4zVUY /m/g+Wjwu/W24crsRyFjHU/k+Z9I9RcOoa6em5sDjrUTKANGCufIKi+++0nYUKTejWb6HH3lcn5 gw34= X-Gm-Gg: ASbGnct9dk99273eUuW2R3oaxbtFCHptO2pb9goYXpg82r06nTwMi/YmbGg/vGHH2zv 7WWCkr/zOwUMMLfl6R/mRFHLH4h2UqmQOi1kSjfBDqXswCsN61utuRhSiMQ2xSs2vsFZGx6UUPx 9ZRGjtuVfzqRI/iC89ullZVas6A4jAAUhYSZN2A+otWMf/qroRMsFBUCIoGeweVzauQbPVFZlbU AwUkvH+SoQWaVl1u1wvXKqyVfwtfMp9OUXQ8oBZnCAe811tZtwNb+RTQ0vRJUeMwX+NACw9xYzY X3DeWunZ09zVrNFuAC5h31fBLCp53qk= X-Received: by 2002:adf:8b5b:0:b0:38a:88bc:aea4 with SMTP id ffacd0b85a97d-38a88bcaebfmr10831027f8f.30.1736720464504; Sun, 12 Jan 2025 14:21:04 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e4c1d13sm10686761f8f.91.2025.01.12.14.21.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:21:04 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Phil Dennis-Jordan , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PULL 44/49] hw/usb/hcd-xhci-pci: Use event ring 0 if mapping unsupported Date: Sun, 12 Jan 2025 23:17:20 +0100 Message-ID: <20250112221726.30206-45-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=philmd@linaro.org; helo=mail-wr1-x430.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 From: Phil Dennis-Jordan The XHCI specification, section 4.17.1 specifies that "If the Number of Interrupters (MaxIntrs) field is greater than 1, then Interrupter Mapping shall be supported." and "If Interrupter Mapping is not supported, the Interrupter Target field shall be ignored by the xHC and all Events targeted at Interrupter 0." QEMU's XHCI device has so far not specially addressed this case, so we add a check to xhci_event() to redirect to event ring and interrupt 0 if mapping is disabled. Signed-off-by: Phil Dennis-Jordan Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20241227121336.25838-4-phil@philjordan.eu> Signed-off-by: Philippe Mathieu-Daudé --- hw/usb/hcd-xhci.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index 7dc0994c89c..00d5bc37792 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -644,6 +644,10 @@ static void xhci_event(XHCIState *xhci, XHCIEvent *event, int v) dma_addr_t erdp; unsigned int dp_idx; + if (xhci->numintrs == 1) { + v = 0; + } + if (v >= xhci->numintrs) { DPRINTF("intr nr out of range (%d >= %d)\n", v, xhci->numintrs); return; From patchwork Sun Jan 12 22:17:21 2025 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: 856789 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1179264wrc; Sun, 12 Jan 2025 14:23:07 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU6oUdNDqNpP6ibXuSjne7jN+Fw/I0N/Nv5LCxZsrpvhnXPYh3fjZDw0HeaWWE7TFO1GD1tMg==@linaro.org X-Google-Smtp-Source: AGHT+IFTDNjA+fNH8vLn7Wm2DLdZciOnWmiHoV2MqCMiL2zgkP6kqr3R1E9ysKqHd7unpxWfKmgO X-Received: by 2002:ac8:59c8:0:b0:467:73bf:e2ca with SMTP id d75a77b69052e-46c710f9bc5mr319457581cf.46.1736720586820; Sun, 12 Jan 2025 14:23:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720586; cv=none; d=google.com; s=arc-20240605; b=Cg5oarXHnsv23O0JZ5izZtFZqJWT9KVGu/AYKKsJywBTiybgOVt1LK5loE69Cvg1UV eAWY9JzxKQsY6HSbWx0nsSqP9kht5kKa+mDwEYJLP+kJNCcha7PwM4kkBDlBRAP87dZg vQYinCU1yTqUK/UO6CUFsYP2G+5bcweyFSPeRMSTfbB3qxQ13AasasV0QOv7Yn/yhM5N aoztTs9mm2aY7yV9rQJ6ark18j7VSfqsSvKPSy8JYxmXbjJqYWXzgjaoXiq9JXGRoguR 8nmPfoLXNOd7RSQr7YXBxldgG7XZ9wWWp1aEDpKElsU7zltsQVoibR3Gzj0cf2K3HjjF cZ3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=xIb8JuttOpsx6n0lGPjJoZH2kDKEyQKUDAozyZfVQNI=; fh=tFHAzq3dvVBnhaer94rf1GStDBXzi83x3/hMnEAenoE=; b=PdxK7yCNKPaw7Orf+iFSWhbhdcsbYVDjQLsQNcv7x6dfQ7SAz0ucj5NCR+riHUWMZQ eCrsarN07s9bGgi4NX7nDSk6Ae9IbGcRX3tyXadqcApxIV8Gr500lFPNA3k1s0UPnRas rNQok00GvCjhQ+xW0FYkKn2bTiwbK9BVM6e1GnoXJxrfDYDf2OR0ww3FQ7yJ3CaG2fVO jeXIQxC1EH/+LYhajfDw/kDK2Efz5CgGYk1GIgiQ5KeffsFtt69gehHuf/WzkanrhOKb fcRomE7TILkgDP1L2uboG2tZiHj3bQMR8aTtHFpijDPJiTMerHpTKzwg66E/CWSxTjnD 4GPQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A66GUq5p; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46c87413e9bsi76201341cf.569.2025.01.12.14.23.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:23:06 -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=A66GUq5p; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6Kb-0004x2-Le; Sun, 12 Jan 2025 17:21: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 1tX6KX-0004tj-D2 for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:21:14 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6KU-0006to-NL for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:21:13 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-435f8f29f8aso26176525e9.2 for ; Sun, 12 Jan 2025 14:21:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720469; x=1737325269; darn=nongnu.org; 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=xIb8JuttOpsx6n0lGPjJoZH2kDKEyQKUDAozyZfVQNI=; b=A66GUq5pwM3+pcjNcxe6chbLk7SSNG43CcbN+wX28YQzwJES5C34IIooADC/LbhK8H XBlFXskOU6W0QBFAHZIP6nkzCgYfi7tXzFryJuMO8UrdTVRjl5mlVbGnoVyyMdsr8teA t217kHLS6htCoDiPnGTcJmeUxjbOAfjQOLVTjMgbVCsA4ocF47Aph7KNdo9fit128JKm 7mt7yL6hoQq+fewvHYZ4zrjS/d4JcdUwwSEUeZ+UrjMYvq3zazDderErWVt6RIxvGnIr m6lJEm166uThGi5kdNTLfW/hIOQzvsaM03Mdhq1pHy39PfSKgcZ3Bh3YMZ5rj4Ma782X e1sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720469; x=1737325269; 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=xIb8JuttOpsx6n0lGPjJoZH2kDKEyQKUDAozyZfVQNI=; b=alerIpDsoo0LnQcx+t2Olr0YxQtjTyn6pBX/a+c/vdYCCGY6+R+sr/713KH2JpBNBm EhQuPannPVrux85EKkby9O9sirhXoZZ2o00A7orJHSPKYBb4VO0BQ1ekIx8hW5JBj7ec 6mI9shBtSOaUKU566N0fONezHs8KBU29maM6IXc0PLPV6PMUA7E+Rx4Bd/nPDXtzYCBp 74RQifSxIEumL2nNT4csub1+woxxKqER4cRBMkPX1vCVTP95w1ytLTfpMIwaWZDDl1i0 evbOUiK+p38v/ve5mWuox6qlD3QH10pQC/7IZQV8F4RRjCtwoPwQuiJNI1MAE6lfNiNL rNbQ== X-Gm-Message-State: AOJu0YxVHqnezVzlsniU72s0Bsly4tODm9MAZBUfNmsyg/w0AEG8QeiF Q1KNUU+xtbrsSJi9qcdzXLomWLqDheFrJ63ThazRPjMKrrlrljhUYfsHaqD7efzw2snLF2TLwPu +BOw= X-Gm-Gg: ASbGnctDKBhl1RtPRJzf/Sq7au/+O7blpQK54MBvqdMeXauGfePTR+Z67m+f9w2ttsH oZB73Lp6ousI0fB1rQiBV/Lw6PT2tO79kaiIQmYJtlEmUBVEL73v7aGKZgxvxT0xzYpnje8DIKu 64OyiBNuoUqoD196Utc2a+s5+njgAFCyVdND55K7sNWwQB1lLtkg7G7vCDmwre8r81wbsQzRlev Ni77N4vsQUJ+EeG7uWwAjEiTmwWXi/MpG0nDVRDEdAlR+69004i2JoI+OTur/celxhpHwZaXKBd KydHO3RxEnWdHL6F7QdiRhOoWUcriLc= X-Received: by 2002:a5d:59af:0:b0:382:31a1:8dc3 with SMTP id ffacd0b85a97d-38a87313151mr17382755f8f.35.1736720469017; Sun, 12 Jan 2025 14:21:09 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e38c76esm10367540f8f.47.2025.01.12.14.21.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:21:08 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Pierrick Bouvier , Bastian Koppelmann Subject: [PULL 45/49] hw/tricore/triboard: Remove unnecessary use of &first_cpu Date: Sun, 12 Jan 2025 23:17:21 +0100 Message-ID: <20250112221726.30206-46-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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 triboard_machine_init() has access to the single CPU via: TriBoardMachineState { TC27XSoCState { TriCoreCPU cpu; ... } tc27x_soc; } ms; Pass it as argument to tricore_load_kernel() so we can remove the &first_cpu global use. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Pierrick Bouvier Reviewed-by: Bastian Koppelmann Message-Id: <20250110180909.83165-1-philmd@linaro.org> --- hw/tricore/triboard.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/tricore/triboard.c b/hw/tricore/triboard.c index 4dba0259cd3..9cc8d282ff2 100644 --- a/hw/tricore/triboard.c +++ b/hw/tricore/triboard.c @@ -31,11 +31,10 @@ #include "hw/tricore/triboard.h" #include "hw/tricore/tc27x_soc.h" -static void tricore_load_kernel(const char *kernel_filename) +static void tricore_load_kernel(TriCoreCPU *cpu, const char *kernel_filename) { uint64_t entry; long kernel_size; - TriCoreCPU *cpu; CPUTriCoreState *env; kernel_size = load_elf(kernel_filename, NULL, @@ -46,7 +45,6 @@ static void tricore_load_kernel(const char *kernel_filename) error_report("no kernel file '%s'", kernel_filename); exit(1); } - cpu = TRICORE_CPU(first_cpu); env = &cpu->env; env->PC = entry; } @@ -62,7 +60,7 @@ static void triboard_machine_init(MachineState *machine) sysbus_realize(SYS_BUS_DEVICE(&ms->tc27x_soc), &error_fatal); if (machine->kernel_filename) { - tricore_load_kernel(machine->kernel_filename); + tricore_load_kernel(&ms->tc27x_soc.cpu, machine->kernel_filename); } } From patchwork Sun Jan 12 22:17:22 2025 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: 856791 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1179334wrc; Sun, 12 Jan 2025 14:23:23 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXHhy29LSlEFuwGbeGIrVa9QnBDibwFD+OYcWYIZ/6pOFJPTKOKPYRmOfo6Jsu1mmbMBGOSQg==@linaro.org X-Google-Smtp-Source: AGHT+IHi+tjDstoaNzKl++9gtdkCTkQShLlATBX/dKv5LrxT/G/6XBqvhrlkn05TCFExSeaRk08R X-Received: by 2002:a05:6214:20ce:b0:6dd:d24:3072 with SMTP id 6a1803df08f44-6df9b1f453fmr296561276d6.3.1736720603545; Sun, 12 Jan 2025 14:23:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720603; cv=none; d=google.com; s=arc-20240605; b=EzKcYlRwklbsk96wue/HFo/jLj+U0Fa4gzrTIpipqGrn8fweYrpIUueQLeUn0ET9T7 l3NR5rppLgp/VkkneiDNepHQbRIAywfbTxqNuRRLD6XccadTvCg3fF4DEpXqq6kj80Cc ODdhfuQs6ROeRFsejxgt1Kp1n7+dPotvZ+5De4wS1vfpPgR2qVD5XMOBi2KTzf6X+qxv yOD6lFFPygrlzNLPOMfEVwuOnTel6A9RFdP5gnQ2tiZm1B27an4DI+46MhnNriax8npG ILB/oJ94ef8ZGtKdt+iRW8Vef0qDRIqotm43eWb46HzfQWr5HMKBq/kP3qsmBXnBGFiH YQYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=jtVBq+1S8gj7ukLJ3NiNvNBhPg5TIcwGGRynG81nGiQ=; fh=6NNKPkNqxaf8vHpdu19P4hktk3YirMddDS48E3xLHAE=; b=VKV/QOlGc+zomA0Xn6mSpPW7NlpgQnaTWuhhiLmi0RlOciO+BMNELhHylUGS6hVpif qzAI/bvAPGhjka5w8O5SICm0hwY1TGWksZnwMfJrY82McCvvZT6+fuhnSjy4uNc6tZe7 MFQrSfW5lyjwrQp/ZN/ZaWyFzBN2+ipN1JDG9wdprnoq6zYFOkQ7EsZf8jsXoyXM2AdJ 503A0Pz7qEbbyaKeUoeTj5FrxtRRigimzF2VWq1vfoEbXnEdlgWawFw3LMt2D4asOM64 cXiSW46TN5M+Ah5uvD6t1hsw74IeWu/bw25xV7KeT7T1msmiSYIUisYK66hrVPAEX0VN SXvQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ST8f3yKr; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6e169edfa6fsi28187326d6.95.2025.01.12.14.23.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:23:23 -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=ST8f3yKr; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6Ki-000566-LZ; Sun, 12 Jan 2025 17:21:24 -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 1tX6Kf-00052A-Bc for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:21:21 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6Ka-0006uK-JU for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:21:21 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-385e27c75f4so2617724f8f.2 for ; Sun, 12 Jan 2025 14:21:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720475; x=1737325275; darn=nongnu.org; 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=jtVBq+1S8gj7ukLJ3NiNvNBhPg5TIcwGGRynG81nGiQ=; b=ST8f3yKrmJx6qiX+G9ZfLhVk0SBloDUqGo2OQRv5KjDQDeauEMdHzSwfAbT/hAfrJN YmUzbvxLG2ETgUzSv89LseTHN6PYCMYphgVI/mHO4TusHUzKEMzqYfyHm5f74DvRPXxE +cdbCE5JhV42qJRFYLW+JnKlTN0J45nCVcAUouCiVpn++DERVc8oxfCmCO4B+3TDcL1Q Ty6KNLjBQLcz+xjD7Cy9Ofz1eLnRukWfxmsxcUSD5D868//OOIXifoavg/OBEFMoypF9 VeWTItwgSfXF+8wkARYWI6OfkALVKKWZ12cTj462wFbELm+1yrtGx3T2uUPOLVGinjcc PmoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720475; x=1737325275; 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=jtVBq+1S8gj7ukLJ3NiNvNBhPg5TIcwGGRynG81nGiQ=; b=gargckGJWv74FV2LVYh4fUSoIW/8vseWp6L3owUhk95TmphjRJ+l5s5lIJtiH2IXYb KterMVlMp9DRxGK+BJjGBcwCy5C8nD/x3R/5o+BdLSHHNAiUYtcks0Kkt9cH4ubq1fwW lUsTr9/Y98wIfRvyZgQxHL5wQrlphKxPI0RNguSiHaNqSYyentjXdDQD1jyEpEMFvhD8 mpJkhAw/hVC2Prw3UmzY2BSI/YNpPTsXV/vilAqzLF9etgMn14Htk7teM6s+xI3Z5bJJ YxAwC9E/QrIYFXJ/kU3/hivcyM0G9IvK0G1xdKRsdKPz8zK7WvXiBQ52XsPL1zDvAKzn 5uPg== X-Gm-Message-State: AOJu0Yx1zFbR2NBZcYFj2e0MvcH64HW3CZ1MxoiYWtAbXSoxrthXfpYf w9UfPRuoCOcQ6XlGABl+gOnOWmNpI4kftyDQ61iwDGbTXP2lEYORKgaLkmhlRAp952ViIPOgbFG 99+E= X-Gm-Gg: ASbGncteGMSQaCk2Nh5F6zE45hFl9uI8G2gBtB9lDfGEQ/YCfOUTZnfQejulJ4PJ8OR RzlY6CkJ/w3M50XFUvbCYnBgv3sHkMGfaEIBOID6B4a02jPPst9uvjkp/E5PyqhMk4ZeCxFG+3F Zu103FjIyxuPwRpdOdy7/dsHwoPubve5S5G6pdBlQzAwHGX+rRzGjWKXg2N1UjKckUcwdDFul4v 6ndgAD+hN/iGlnhnGVVqTvkLzV5aL8lxOQfnw0SriHTHls190oElhlRfqbMenfcwTZLi3oamoyl KVY1ZOXvEL2wdY7/kwdR5L4UEY8Bkes= X-Received: by 2002:a05:6000:4714:b0:385:fc70:7eb with SMTP id ffacd0b85a97d-38a872fc1bfmr13807502f8f.12.1736720474942; Sun, 12 Jan 2025 14:21:14 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e38ef6asm10834186f8f.60.2025.01.12.14.21.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:21:13 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Marcin Juszkiewicz , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Leif Lindholm Subject: [PULL 46/49] MAINTAINERS: remove myself from sbsa-ref Date: Sun, 12 Jan 2025 23:17:22 +0100 Message-ID: <20250112221726.30206-47-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.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 From: Marcin Juszkiewicz I am ending my time with Linaro and do not have plans to continue working on SBSA Reference Platform anymore. Signed-off-by: Marcin Juszkiewicz Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Leif Lindholm Message-ID: <20241218123055.11220-1-marcin.juszkiewicz@linaro.org> Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 1 - 1 file changed, 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 770bbf9f233..4ca3981dd25 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -923,7 +923,6 @@ SBSA-REF M: Radoslaw Biernacki M: Peter Maydell R: Leif Lindholm -R: Marcin Juszkiewicz L: qemu-arm@nongnu.org S: Maintained F: hw/arm/sbsa-ref.c From patchwork Sun Jan 12 22:17:23 2025 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: 856794 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1179404wrc; Sun, 12 Jan 2025 14:23:47 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVCCOBm/tYICxM7qvW4q8va/vmkUO6/+uLGqbZFDpIxgtciu+2N4YGxj7Lqk0e8Um4FHBxldQ==@linaro.org X-Google-Smtp-Source: AGHT+IFQ5Utcc0pBjmoICGjw4/kDkqD6orkmIK6Xue7oB9pUpHGorUlOp7rKJv+2wzA/bT4NMH00 X-Received: by 2002:a05:620a:2729:b0:7b6:eed4:694e with SMTP id af79cd13be357-7bcd9799d3cmr3161750785a.37.1736720627146; Sun, 12 Jan 2025 14:23:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720627; cv=none; d=google.com; s=arc-20240605; b=EGPj0MAe5rJGCIODEHwtXisrt1BFZYajy1cHjwapew9I8W5EYFcIMZ0fyzmrMfFIsZ BbzBJ9WF6L0Kid1a5G6e3cls9DjKf/DPGwFnS7amaWVBs2WtcV4mQ/eNjmvuBitBlxGi ASpizJl3iEYqjs9UJJ7NiItGfgtzkG1f65TDF9eL3a3bNCCra/oNHVW/PySL11/eD09l j4zxWZl9IOdzlhk3SokmCWNuDSe0YIT5EfohJ9IzDh1JLnda5t6CooE6owFWBvWWDV3v tP3zhyRm6nf/rh4bTMrgmS/Fdj5Qoc8PsFIehT/0Vb7dmizieQ6sWfnNWovPA01kzx7a YIDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=jplKRfSDPgYgS9ZhmEN8q4tNBprQ5haG9I8GfDv4PBI=; fh=ePyGoEiUVsGq5muf6+HqrCJFUwgxhWNYwaYwKs9b+Tk=; b=PVeI8mhY/4fHgynG6vBpMXCsrP/FnlfF8oEJ5logSxK9aiU7rtUkW0GAnOBBvhRobp SgWensNTRYghDK8ThnAVNS+f8VlO9Y8viHXYv0dqBgq46mJkpKFE3WGo/8CRQ55lVZRh RX1M2PsQ9q5YoRLp2ep4Jkd4qPFx+mDn9e2k63gE86Sv078d7qifZJzbZXI83btkeK/0 6pILoGNBQZxzco2Vb74P8cXPONhuLSjAaHDj4XaL/CICPTcRj9C/KzgR7CS+flKtr5HY yWJyrcyQ9xBaJKF7SXCJulf+bJA/HWLcV+RzPl6mYvEgp2nqC5otjqC9q849drCO4jSG xd/w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mnBERZIi; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7bce322a409si1029570585a.98.2025.01.12.14.23.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:23:47 -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=mnBERZIi; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6Kl-0005D2-Gg; Sun, 12 Jan 2025 17:21:27 -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 1tX6Ki-00056o-Nr for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:21:24 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6Kh-0006ug-52 for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:21:24 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-43626213fffso28747015e9.1 for ; Sun, 12 Jan 2025 14:21:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720481; x=1737325281; darn=nongnu.org; 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=jplKRfSDPgYgS9ZhmEN8q4tNBprQ5haG9I8GfDv4PBI=; b=mnBERZIia2KueuTYtHRRsPReAtumPCWCRydYTqSKnJeLaItHg353D3ef2oTcuG+iS3 7akIQQDIn4+FhVbRvu0auQgGvyjfJPDZa2RFfMd9qom9Dt25DOFLM+YM0O65zSMkrY7S PyTOxFdUKasfOKhKTBXqu2UMmFgdQgK5Sh4CrnCtRmVCxDwoNU9dPzZLFTI1PU3Oc6Th LgpLPyrlUB/8Ty6zuMjc13HmX0703QcF03NUH5JIo9wZZV9TPdS7QQWJV6o1EH0HmCP9 5SHx59nUbSbLZJagpHV+fpgHAAITDzpzFuAhVaa0jr8jd4sKvsw1HqE4u2SvIkqWj5wN g2gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720481; x=1737325281; 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=jplKRfSDPgYgS9ZhmEN8q4tNBprQ5haG9I8GfDv4PBI=; b=bJFEdZI0dQYnM+K+X75Vxvrc7obrlmNO93GsJeV9Si/gSIklHr5guneXrFmt3dA+bZ dfiM3hN8lOWHwu91xp0/Nh/mjfIMReKAuehXarkIuLu2bp+K/4cOgRzpPriMy7kGqBAI zWpLg46LKceJ+MeTNRAE5U9Gmmd6di85mM6GY3Ik9mQ5n0Ylm7ycuftBvFcvA+oOfrZR 026lVkhh0676T9BIErFU8OOteSKjk6Qh/1XQREOYb9ZNmA+JWVPIxohCp0/0jHKnBtXX KYxCts+UTCspBzlGMLCgv+I/QQRrOJHoHXB50m0CmLe8ekIjMo9ugTV8OWyg7jocDYBt LTuw== X-Gm-Message-State: AOJu0Yxgc221PUXzJkqu+DC31K1Qq2URLd5+2B6cAqrPAMycNeqE5oIw 85PT9TuYho4PWbj5uJ9EyiUvj6AI8YI9plT4wTiNRzflm+MK4Rd+W0aV7L3X9e5owjeXS2Rmaka V7Sk= X-Gm-Gg: ASbGnctzKQOsf2QVvgbxBY8MwP+I1wz7ogex/gGQwheMyChf0bkIcSLHHQFvSKKreJA m6d8CcHgBEN3NxFd27gOMxIIMhxhMvnvWEugD53Lcy+m0Q3HNSbBEhSUUOeAOKo9WqKCazX9NvN gGRLu/nYuB64PhC6MRfKdILWXHLrgwcP2Br7kt2omOTyl5htFY7WRDXtWflekFbSDOAXMp1qBP7 Xj7EU+0pSnKx1lVyy6M6PuvbyMj/Jd/T3zfI9ui+zdgIZZhZnU70N1HNeEeMg6rIxZJ840HxjsO sCZgqLMb6RGCqxll64uk3PGGp7Jayzw= X-Received: by 2002:a05:600c:1d02:b0:434:e69c:d338 with SMTP id 5b1f17b1804b1-436e9d6ff89mr105295795e9.5.1736720480817; Sun, 12 Jan 2025 14:21:20 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e38f0eesm10778429f8f.61.2025.01.12.14.21.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:21:19 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Gustavo Romero , =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= Subject: [PULL 47/49] MAINTAINERS: Add me as the maintainer for ivshmem-flat Date: Sun, 12 Jan 2025 23:17:23 +0100 Message-ID: <20250112221726.30206-48-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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 From: Gustavo Romero Add me as the maintainer for the ivshmem-flat device. Signed-off-by: Gustavo Romero Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20250107015639.27648-1-gustavo.romero@linaro.org> Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 4ca3981dd25..0727579cdec 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2785,6 +2785,13 @@ F: hw/hyperv/hv-balloon*.h F: include/hw/hyperv/dynmem-proto.h F: include/hw/hyperv/hv-balloon.h +ivshmem-flat +M: Gustavo Romero +S: Maintained +F: hw/misc/ivshmem-flat.c +F: include/hw/misc/ivshmem-flat.h +F: docs/system/devices/ivshmem-flat.rst + Subsystems ---------- Overall Audio backends From patchwork Sun Jan 12 22:17:24 2025 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: 856793 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1179372wrc; Sun, 12 Jan 2025 14:23:37 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWF3xq3byGUtgReyArn0zu0Fg14RwuPm8MhczybXg68/qWY86qYpbyBrbW2MV8eVeCwjDXiKQ==@linaro.org X-Google-Smtp-Source: AGHT+IH3vCVeBrMs8tOq9jJqq1Suxmg+CM29ZVfwt1Q7vvilpiWDutTQt3KwCHP92Hpi5TctE+S6 X-Received: by 2002:a05:6214:dc4:b0:6d8:7e03:c434 with SMTP id 6a1803df08f44-6df9b1f44f9mr303141396d6.20.1736720617095; Sun, 12 Jan 2025 14:23:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720617; cv=none; d=google.com; s=arc-20240605; b=KxVF8iPM4tIibLFhVNq2B4oI3p86S2va32Y+h28OQ4D4k49LXcUsW46pAOhO+jtJ5z JHQSvgZpqo5gnY8DmWEM4/nJ85etatVSdFgxwf7DY/Sgfno/GjbQ8dQw6bS7uUwUG0zz iOQjoGKT10kE4QrkInCLyAffB4kI+vzsk2Wk+1AZCxJHyaNNbPWABIJqOtXT4ShlavPN VTfJUTCwgVGkgbJeCvdG1gLpXDqOws2C84rjmt0UI8JIMHnz0U5GCvXp0YAlEBwu7zI9 P+WgtdbMvXKe4Nq84MRLxVe7apo/IOUsBlSeUaa/twWFC2qp1VrHb3qTqXoEkmrVlblh lhzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=OZ+oTr2+oExZOJr5kMbRlsZawz728meOH00rrdIgtF8=; fh=tbqQvKVc/gJ0W2yRnKYHRUhKgMkQ05UQBG7BljJMgIM=; b=TLNI7Ay4LlpSOswsPVPtKlNqvCP9OSRId8IdfT8WSru7NJvZYek9qcpnmw5vvvfCzw o0LWmywbd57IcnFpVMbZAcjJVZhxEa1td4CT5klLWeWMHAj98KiyDX84zOiuOIDRZFEi Je3gi/y4ajVZ/4VwZzykNZamJZx2WhEV0TVJ+yJjY13aIr/rSjMQCZ8A+FEVg9E4zyWP r/4srpTuqgIsvexIduEtLG7uUH/uY0G4k5q9jq9hYepeMcsbHSrbnnMIfY8Qzg9zLbgT 51b1AOi5eXtXWYdE8QdOONhjox933uwj+JJI/spMraD9DsS8sT0UsG6X5ftoBwkkI/La p8Sg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ieTdYGu0; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6dfadfeac89si83269366d6.404.2025.01.12.14.23.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:23:37 -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=ieTdYGu0; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6Kp-0005S5-Fx; Sun, 12 Jan 2025 17:21:31 -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 1tX6Kn-0005J5-C7 for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:21:29 -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 1tX6Kl-0006v0-Pt for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:21:29 -0500 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-385eed29d17so1818706f8f.0 for ; Sun, 12 Jan 2025 14:21:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720486; x=1737325286; darn=nongnu.org; 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=OZ+oTr2+oExZOJr5kMbRlsZawz728meOH00rrdIgtF8=; b=ieTdYGu0GQu+O+cp4g4bGpJLQQjSUOqiPKjgxweyqNRq3oNLC61jCfFY4e9DTxVIOk ojInaBdoYJMmoSGQOfb5WGusuAknagx2rwNredsB/XZk1UczOLOSX8MrtMeWUGUUDRL9 5ocN5JUYWFd8xo2tFw311InGMs4vU3eDIdlMuSnBf3SvFjC10wp2dkg85XMt7RBZcGdN 5VsyTIUKFWApNd/AG3uKpQI561gowglOXRmqNNinUoaFCa5H0154WPtEgDsVpIF4xrCt T/3Sz2TAnOrmSTheWqGPMEEBBtd/pNHsopb3XfoxQxYkTC6EsLz2BGVDcD2cS0ADsQ57 C9aA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720486; x=1737325286; 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=OZ+oTr2+oExZOJr5kMbRlsZawz728meOH00rrdIgtF8=; b=YEi9zUuWTU4xvez36fCbm3Pb0wFJ5EN3KxTZJ+6G6PZ4nFfu/YLSevE9KqgP5TOCg5 6IdIihwUfk6dNmSOTJRb6ytfHADkL8O/fwiiegXmda/saYN/Vuo85Ujp0GOkl4ZZfoXv 0ioIHGwwoZytI3deCOdiJcJyXM4WWmCduyU4/OVsoBSn5CcK2T9BthOxuiKu7WqipFEK g4s7zuDjbWZ3hAY9Fne3RG42wtLiIiyTsnn1Lj+7mf4dtsEUk1pBzTkdYIopnnsV0L4g t6xtrm5WZT+kCMD/bGD5qVOWKECUwA9sKTRIu0o9f9oAjf6+TiaRdxTYCRguTpJ8TPJv TsqQ== X-Gm-Message-State: AOJu0YzKtJcw1ilrOpHzqvVS7FwQ6O4SKbLnxCsR4CO2nT/3aytpGNXB IEwbvVx/quns6t5eeK+GXz2eMggiuZTo7/ueKf+H0fZY45/lGAsrh8vaBC8NVRD8FS+inLFo53R wYEM= X-Gm-Gg: ASbGncu8l83fYuDPJKq/gM5eqhFsoA7RymYiA3S6E15iZKtWlEGnTfC+UPYcME9VNVq hKrY44Cifo6bxXEfl3P6ujUg0/IMq6/2pYynolanUCiG3B1l55l3+nW43NsBL4W1Znk6sUdNG2U EUoGiX/DztBU1DTvZUdf5V2OkpqTTzm6Pbk8F2Z9dNjKdapRFc3pCSNHMFFzmrdnOndY+ptyLrS sIM5Hbr6Y+PpmTR6WZXIs0jh6d1TlaeYL6092eKwvdI/rhETUvdEy/ccWNscD4N8dD3ihSiukP4 jpVVjkXOJA7QXhSli3LpgrdTWUwCGJA= X-Received: by 2002:a05:6000:1569:b0:38a:a117:3da8 with SMTP id ffacd0b85a97d-38aa11741d0mr4699287f8f.49.1736720486129; Sun, 12 Jan 2025 14:21:26 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a9fcb7a11sm5065626f8f.75.2025.01.12.14.21.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:21:25 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Akihiko Odaki , Christian Schoenebeck , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= Subject: [PULL 48/49] MAINTAINERS: Update path to coreaudio.m Date: Sun, 12 Jan 2025 23:17:24 +0100 Message-ID: <20250112221726.30206-49-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-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 From: Akihiko Odaki Commit 8b46d7e2dc8e ("audio: Rename coreaudio extension to use Objective-C compiler") renamed coreaudio.c to coreaudio.m. Signed-off-by: Akihiko Odaki Reviewed-by: Christian Schoenebeck Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20250111-maintainers-v1-1-faebe6ef0fec@daynix.com> Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 0727579cdec..ec898a3cbc6 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2800,7 +2800,7 @@ M: Marc-André Lureau S: Odd Fixes F: audio/ X: audio/alsaaudio.c -X: audio/coreaudio.c +X: audio/coreaudio.m X: audio/dsound* X: audio/jackaudio.c X: audio/ossaudio.c @@ -2822,7 +2822,7 @@ M: Philippe Mathieu-Daudé R: Christian Schoenebeck R: Akihiko Odaki S: Odd Fixes -F: audio/coreaudio.c +F: audio/coreaudio.m DSound Audio backend M: Gerd Hoffmann From patchwork Sun Jan 12 22:17:25 2025 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: 856807 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1179643wrc; Sun, 12 Jan 2025 14:24:58 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVoPt8Q4G20U+9MomJQ0e/Knb/UmP+WlR62jD69EjgiLzqlDGAInSc+9UbsmyVQbqtRhPU+Og==@linaro.org X-Google-Smtp-Source: AGHT+IHfJWuKBX2QjERMFFlFLYfEirdi7acaL0JHpV5v5Fk9ISEA5D6g2HqO/3YrB4qWXFawd+Wo X-Received: by 2002:ac8:590b:0:b0:466:8a95:d1cc with SMTP id d75a77b69052e-46c7108ef25mr320936261cf.47.1736720697849; Sun, 12 Jan 2025 14:24:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720697; cv=none; d=google.com; s=arc-20240605; b=KoRPaA3CA5zvVTGswEM14wPVuzERbvhm5B0EYThfdE4EDKP6kJCJ6ZeJTMriXnLk6H 4w040ha5HgdST+mbycHSwCjpjrR/zvscbvxL49EsVnAFHg4T9ABak6bfiTp/KaJx9DXp cT5vG39wJrky9eWk3hjbKV8NE74TQfZr3oWRuVzYPwGanbTMRk92mWa//jSH3Y6VYGow jjYUz1HtcAejaAKpP9xwL39vQdoK1VN+0/DdUlCSD8a76osd5MsHYi7Lr+SkCxqMNKL4 vYkPynLi37ADXRZj8ElorhBzSeKbt94+w7EiBq8GwXfUCuvIs7pHUEhAKNfGIT+l707v Kg6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=VIJbA99zO6H6feDMStmcLuf9WLOoJAXMvP2ITp16sic=; fh=VLoBKQbFMlzRbsMYzkJiJ+BGo/GTHSJUCe+Rui8l45g=; b=S3QUtyn02zMWdvf7qrr+vLBnAS24Z0BGaS+254P8cmEsvm1aE/3f/O+459v+PO1txT L6LBaKMQE07sRzRVJA7EglR/y00lh/cEBWkHf7MWsvEzfYYw2YofLPmFIEVOlVWiNVOu X+NTnTETAL8qwkFA9oWsaTaCGh1Eg4HkhyvdzxttXYZ36J83qIXOp7PI9w7S9aR4bIFg 76qHE11BCQshfKmEvjKUmIDsXgTk0Jv6snw52v0eZ8echAvXgBPufXfJb415RA5SOtZN /GYT9LjvpLskIjmNfgcoMOc6ytyTjrYCiB5JG4StrOhFR/MFVS7eZxm+IGHDXtdGZYIr BVbA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZkPnTU6X; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46c87350d88si79661301cf.196.2025.01.12.14.24.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:24:57 -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=ZkPnTU6X; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6Kx-000651-Bv; Sun, 12 Jan 2025 17:21: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 1tX6Kt-0005oS-VV for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:21:36 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6Kr-0006vU-5p for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:21:34 -0500 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-38a25d4b9d4so1885574f8f.0 for ; Sun, 12 Jan 2025 14:21:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720491; x=1737325291; darn=nongnu.org; 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=VIJbA99zO6H6feDMStmcLuf9WLOoJAXMvP2ITp16sic=; b=ZkPnTU6XdWl/EA5RYiqZWadJTNyEA4qJw/5eD6KRsX2o/o9IS7KtTsh+G7hXo2I02N t1rwfr9hPTJF0oPi9RKsJzGhvnsCOj5PwFBgkoaBtleb9MrAmGDNOyvF/fFvV5Fy1OIc OAhG9kviuGIGhoEOw1Tnd0couaoXS905sPsls5QTFx8tNAHaM5kf20W7/hDe3RfQEId0 VjHqPVpMi/40OCxnlt3ay0I2b7HFt+D5DnHfgqCHvVnI0L1qtB684RogC9ZSb8wjd4U0 IxdDcnLkNp7XWnjaAvT+T1vkdXNpCXr5BCHF6NqHp4FOuuFtaoaYerxXA44wD+JtHRdG TkwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720491; x=1737325291; 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=VIJbA99zO6H6feDMStmcLuf9WLOoJAXMvP2ITp16sic=; b=aZj6sFoKInuIzd8+pV8CqeMMcrFdGEP/srLjAANG3OHo8PKh7U9nbcCQ8I188u/m1E BrX/NOwCng2sZf8UrwW+s60Dqm6hBSPNUpTYP1aY3MDtWx5uZyGScZHOqa2FG9AqwMR1 JhvRsoJaz1JZl4F88m8hN10KFgT+8+m/BGMPa56xlBiuPsmwesyU5TDH2aDOoRRby7ps AFp4HznqfqWYIcsYn9siO3Jm8PvXTdIdP1WMysfJgB4+cFygUlWDcKghOXa4y022VSx/ 5+hpIyrJI4aHQjtbVxNxGg0mBCTALJNUjb9vkmK6f1rdhblJLokOF7qsN8i7O6idQMxy 9Lgw== X-Gm-Message-State: AOJu0YwZUVO69Swsf9Jjudxi2DemSIIuTeoOBClqxsxnbe4S2prF7bTD 6KWVT9X3dtBcvJ6GKMe4OsSlNFzuuI/piZiPo+66i1mt+TEvXTk//Hwa/wWlmFg9frvD2Pd3FTT Z0zM= X-Gm-Gg: ASbGncsWFkpF9DnK0VVNhYtEfuTfgfyf2ln+ShTowcU3urMKtUh8sJNiUARKVDoG3mI KdEdzLQPw/Ui7NSKgrev+tpfyY3Wd1KLU0WpDri1Hh7CesTnjYaBOvPwVEXZp/g8R17MiQ9th79 2c6CLB/ffNQFbsU+XMyvCtAZzSv3BxIVeOnZR78MFswElFQjLrzgJnCTqsCBY1ksoM/5NsNdlSh zJw7ajKOCTpzFJwMEzFKPuLgIjHH3iV4cBm1JfOkbPJg0YfLavKdu1yeRy+P1HihfB0CwYGWmQb VLnS7enrYnwCz/Ww4ihwM6JykDId7rI= X-Received: by 2002:a05:6000:4612:b0:38a:39ad:3e2f with SMTP id ffacd0b85a97d-38a872cb1e1mr15568909f8f.2.1736720491441; Sun, 12 Jan 2025 14:21:31 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e38c990sm10655419f8f.56.2025.01.12.14.21.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:21:31 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , =?utf-8?q?Signed-off-by=3A_Philip?= =?utf-8?q?pe_Mathieu-Daud=C3=A9?= Subject: [PULL 49/49] Add a b4 configuration file Date: Sun, 12 Jan 2025 23:17:25 +0100 Message-ID: <20250112221726.30206-50-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.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 From: Jiaxun Yang b4 [1] is a convenient tool to manage patch series with mailing list working flow. Add a project default config file to match QEMU's mailing list conventions as well as adopting differences on scripting. Examples of b4: ``` $ b4 prep --check Checking patches using: scripts/checkpatch.pl -q --terse --no-summary --mailback - --- Signed-off-by: Jiaxun Yang --- Changes in v2: - Add lore masks (philmd) from: https://lore.kernel.org/qemu-devel/20241224135054.10243-1-philmd@linaro.org/ - Link to v1: https://lore.kernel.org/r/20241222-b4-config-v1-1-b3667beb30a4@flygoat.com --- ● cc5a4c890fed: Add a b4 configuration file ● checkpatch.pl: 27: WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? --- Success: 0, Warning: 1, Error: 0 ``` ``` $ b4 prep -c Will collect To: addresses using echo Will collect Cc: addresses using get_maintainer.pl Collecting To/Cc addresses + To: qemu-devel@nongnu.org --- You can trim/expand this list with: b4 prep --edit-cover Invoking git-filter-repo to update the cover letter. New history written in 0.02 seconds... Completely finished after 0.06 seconds ``` [1]: https://b4.docs.kernel.org/ Co-developed-by: Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Jiaxun Yang Message-ID: <20250102-b4-config-v2-1-cc7299e399bb@flygoat.com> Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 6 ++++++ .b4-config | 14 ++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 .b4-config diff --git a/MAINTAINERS b/MAINTAINERS index ec898a3cbc6..0c71eb3f925 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4310,3 +4310,9 @@ Machine development tool M: Maksim Davydov S: Supported F: scripts/compare-machine-types.py + +b4 tool configuration +M: Jiaxun Yang +M: Philippe Mathieu-Daudé +S: Odd Fixes +F: .b4-config diff --git a/.b4-config b/.b4-config new file mode 100644 index 00000000000..4b9b2fe290f --- /dev/null +++ b/.b4-config @@ -0,0 +1,14 @@ +# +# Common b4 settings that can be used to send patches to QEMU upstream. +# https://b4.docs.kernel.org/ +# + +[b4] + send-series-to = qemu-devel@nongnu.org + send-auto-to-cmd = echo + send-auto-cc-cmd = scripts/get_maintainer.pl --noroles --norolestats --nogit --nogit-fallback + am-perpatch-check-cmd = scripts/checkpatch.pl -q --terse --no-summary --mailback - + prep-perpatch-check-cmd = scripts/checkpatch.pl -q --terse --no-summary --mailback - + searchmask = https://lore.kernel.org/qemu-devel/?x=m&t=1&q=%s + linkmask = https://lore.kernel.org/qemu-devel/%s + linktrailermask = Message-ID: <%s>