From patchwork Thu Nov 14 19:07:15 2024 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: 843188 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcc:0:b0:382:184f:390f with SMTP id e12csp458237wrc; Thu, 14 Nov 2024 11:09:05 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUL+C3qZHg0aLZZjXpRVnlOViU0+JWaHz8luyTHzrUOjRBCZJcQ84ZY7Xbohe81cpbGzyeMkQ==@linaro.org X-Google-Smtp-Source: AGHT+IEApEGrqD1PBrzpdL+aaZspzck0j1GFDwuqCgJf32x2oMZ22Pyx+nwY5lVgFORCI73CmdL7 X-Received: by 2002:a05:622a:5b06:b0:460:bb95:5937 with SMTP id d75a77b69052e-46358f6f95dmr43487631cf.32.1731611345636; Thu, 14 Nov 2024 11:09:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731611345; cv=none; d=google.com; s=arc-20240605; b=iN4wGurWmlIjVqheMdzkLRH7XHItsUIUscNmL7rzJjPmAlQdGnQQwWloOn+r/zYRS+ Q0XcfTjwQNgEM0P0gSdIWD3FvIuuXiT0qKJczzi2w0geSvnnXwq43AjkxX9eySARL58/ RGZWhUCOwjztnkiL5wtDl8tShAjbgcRfJnXfoyImwSORLjSoYayLW/Eg0KkEekLWrPUb VMpcrbT5XT00AD2Kf7OL7JKKYf/XheXGHvlMXqOR6Z9eYRzE+9gctL9x3dpObPnDTPEa 9+7NtxSXgbJokrWpf6J9VRYin8ffrcvlgKgiqpk84q/E9HmYjoZG0fzfXpBlSR9Tq7Vz JdSQ== 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=dxalhuJA3V9Mf8DxAADrs85j1mYwG4uCtR+wwxiXnFU=; fh=r1YWHW+JER/GvOZYm06wed+1eXrVa96t2WYC5DQqqmA=; b=gH5oshxE80Eci0sCk4qPJq3AG5XIcLeVPQDo8knHKylVc8x5+iBFubCEin7VK7cDjj N5f6J7VMJUF7YhRRAlYgrV3F90RFkGNPDgkMKWKmq8iWP/DDt4sTUWaocHJ15nEORp6o rvuf92efh9Xf3gHkaagUDqxysToqIwo6DtkagUa5DrzieG/5DeUyppiUPy5JOBatP40w S+xe9UB8p8w1KdHsOGUE0mMmVHzI+NE6hPPoouGbiRzUlu/d7oOafFDRdye6DOcqAlAM GF7q1FMfH5ODug07ZQsuFTYrRYJuJsHfmAAKZ74xowXzYv6Vdf4i2BYxtu+rxJYyj9cn egEg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Gq5FBebU; 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-4635ab31e63si16743651cf.512.2024.11.14.11.09.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Nov 2024 11:09:05 -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=Gq5FBebU; 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 1tBfC6-0004GS-98; Thu, 14 Nov 2024 14:07: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 1tBfBz-0004CD-2O for qemu-devel@nongnu.org; Thu, 14 Nov 2024 14:07:50 -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 1tBfBx-0005V9-0I for qemu-devel@nongnu.org; Thu, 14 Nov 2024 14:07:46 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4315839a7c9so8979345e9.3 for ; Thu, 14 Nov 2024 11:07:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731611263; x=1732216063; 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=dxalhuJA3V9Mf8DxAADrs85j1mYwG4uCtR+wwxiXnFU=; b=Gq5FBebUOPzHyv/KQrMpEOOseclpPCN22l+fZU+ikZucZ+wahkibEqa9FVp/B7Jn54 wq6MiF7Zg2uLyPnJLf11YmrZzPIYpBoHOTH6/INOy3aH/3iUetJ/GtAWa3m03MEDKWQZ A3rgdIBUqfRWeVVrWt+UxtnOgLQsb01LY8ZJZJZDWAeDXZf6Aa62KJ4N2HpCS4+rjl2e rzPJfJB6drqFUlVc6msPamBCKrFOUyxAjARgPtU28jWMNFsgONx5zD2VdU1397RRAURR qgoKpXCoz62atGTJ1yV0jOrLjzf4YU+TUdrVX+5LgA+C9YR0Hsk6Jm1siylbKkH/x6YT rUvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731611263; x=1732216063; 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=dxalhuJA3V9Mf8DxAADrs85j1mYwG4uCtR+wwxiXnFU=; b=hZJX8nBQGcG6E31rqgQ3zgeXojKnrYGZ6jRnrC9T7f59E9YfUOAuEp3tiz3dWj/qDg ZOt/OoxiapdIXi3AH/vkTx6oPbJUuOwCPuer2FadZYoPZgrg7ogxySEgFvkZOxp6tt4L ZjatEtWXDHuorFJMhrFzntERjwchMcPDbyABFEvZoUN2ug8qWB7BkWKQ5WFWk78YXkD4 93m30G1+UY0GJ5/OSZDj8sDPYcPNrUepD63LHUnfCfyfgQJF+asd0IeijjN5xD9hK9IY dkHqVs/qziw+XEiS2vc4Vdlo8KOvjSSQSLobECLkKwxw2qcJeq+4zb79r1i95kEh3wpk 30Mw== X-Gm-Message-State: AOJu0YzF2ajgI2VbO3SHGPyR0es1roHR/l0ylfTB6eDMGzVluocZYvb/ tdDKhDsd+hREhVr2k3XpD7hZabJmHQaHQc4ogXhng+JgcxYM4GLXDirPHyah7TYrLlpOEHqfT/l Y X-Received: by 2002:a05:600c:3b82:b0:42c:bb10:7292 with SMTP id 5b1f17b1804b1-432b74fc98cmr213441365e9.1.1731611263083; Thu, 14 Nov 2024 11:07:43 -0800 (PST) Received: from localhost.localdomain ([176.187.209.228]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3821e073e0asm1721415f8f.30.2024.11.14.11.07.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 14 Nov 2024 11:07:42 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , Paolo Bonzini , Anton Johansson , Gustavo Romero , Richard Henderson , =?utf-8?q?Marc-Andr=C3=A9?= =?utf-8?q?_Lureau?= , Jason Wang , Alistair Francis , qemu-arm@nongnu.org, Peter Maydell , Thomas Huth , Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 01/19] hw/microblaze: Restrict MemoryRegionOps are implemented as 32-bit Date: Thu, 14 Nov 2024 20:07:15 +0100 Message-ID: <20241114190733.33902-2-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241114190733.33902-1-philmd@linaro.org> References: <20241114190733.33902-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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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 --- hw/char/xilinx_uartlite.c | 4 ++++ hw/intc/xilinx_intc.c | 4 ++++ hw/net/xilinx_ethlite.c | 4 ++++ hw/timer/xilinx_timer.c | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/hw/char/xilinx_uartlite.c b/hw/char/xilinx_uartlite.c index f325084f8b..3022b3d8ef 100644 --- a/hw/char/xilinx_uartlite.c +++ b/hw/char/xilinx_uartlite.c @@ -170,6 +170,10 @@ static const MemoryRegionOps uart_ops = { .read = uart_read, .write = uart_write, .endianness = DEVICE_NATIVE_ENDIAN, + .impl = { + .min_access_size = 4, + .max_access_size = 4, + }, .valid = { .min_access_size = 1, .max_access_size = 4 diff --git a/hw/intc/xilinx_intc.c b/hw/intc/xilinx_intc.c index 6e5012e66e..8fb6b4f1a5 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 bd81290808..e84b4cdd35 100644 --- a/hw/net/xilinx_ethlite.c +++ b/hw/net/xilinx_ethlite.c @@ -170,6 +170,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 32a9df69e0..383fc8b3c8 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 Thu Nov 14 19:07:16 2024 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: 843187 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcc:0:b0:382:184f:390f with SMTP id e12csp458086wrc; Thu, 14 Nov 2024 11:08:44 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX74bUptpdljxQy56QFHMXkT7XoJ7pgAu2nczEWl8MpoJ+2u4ufjzOEbQ/mQP+au7I5nKJdDg==@linaro.org X-Google-Smtp-Source: AGHT+IHfHJ9ytRQs9ID1fdL7IiNZnv4eWQIq4W3jcdjYqchs51+dSc+pBABlIykroryp+qrpENsA X-Received: by 2002:ac8:5ad0:0:b0:460:8360:bf2f with SMTP id d75a77b69052e-46309411ac9mr349724951cf.40.1731611324373; Thu, 14 Nov 2024 11:08:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731611324; cv=none; d=google.com; s=arc-20240605; b=HTV6UczeEYU8SdLac/yb8IOhk4dEK2q15Cjgb50g1SedBVWMfKaxLQO3uZXeK9Q02V 5zyu6p4GNyIutgYxE3chWF59ptsOZyKb5JoSU2pF/VcFl5Te5uKABcZtcFZyESRPP7bp URO7ghZp5nV6STWBjllNB97OWf5MZpnYXKXzHKjt7HLHuqFueIRwQcE/kypZCwGlv9uL HJ2JdnoB12vOrPL8oDNXxs8DPm6GypMJHzH7kQ9DfjmOcKjRkF6Br3jJNNRUjMlXzp8p QYFoXZ1DKBuJ8TreKAsNnkhIy6IyYJ2V4Ro/AHxIm0dfMXpCfzaqpaqUAWzkjIzVmY86 lh2A== 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=YlgtA2w+nkGpq6odlZPv7GuJkitbYlthMfvxp2Wzgbg=; fh=7A7HBWtA9NzznsD1t3i/7lzKxqnriI1QQDKZkQ1XHRo=; b=EVTx3h0w19ITCHUB0HS+lBn8rsXrwpBakUAhSvmLxpVmbUU612RCc7GU1ZyvT/3iSu g4X14oPUp50fB1qHi1NpSqFeMDM/yUWZKd0L+JLLFX+OC+lLENhnf2npvintUCc2I17c ZM+Lq1UZzVkD6at6mB+gQ7ZL3gOXKzzFKPUnqWZyH4e1kYAJ6vxL/Na6f4CMkd+DBBG0 a3Rb1XX2DvQ2YCpgN4sxbw35eMQLkboihChWy0ufWF7dt8fRTg6wAXO0LZmPeN9OcvII up1MqvAHMw3ehXuPOjpycn0DLGmtW3ZBf0mAP8FT5YAIhJikCQ5nwQigLXnYVPF5sJ2y Vuxw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="dY+g/+42"; 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-4635ab3d027si16067021cf.554.2024.11.14.11.08.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Nov 2024 11:08: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="dY+g/+42"; 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 1tBfCB-0004ST-9a; Thu, 14 Nov 2024 14:07: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 1tBfC8-0004LR-W3 for qemu-devel@nongnu.org; Thu, 14 Nov 2024 14:07:57 -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 1tBfC7-0005XY-Gk for qemu-devel@nongnu.org; Thu, 14 Nov 2024 14:07:56 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4316f3d3c21so8346775e9.3 for ; Thu, 14 Nov 2024 11:07:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731611269; x=1732216069; 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=YlgtA2w+nkGpq6odlZPv7GuJkitbYlthMfvxp2Wzgbg=; b=dY+g/+42FyI0V6lVWCXfLwHUKYLu8J3Smt++UxBb/z3g4eLRnas8+gYBbs43NvmZ41 Yd3WOai3BCARrmgp+MdAaGmLVlF+NJBSujO/pjMtym8IN9vSqoHffn7NdnY887x7CKkC C4J4AlOWust0O0zAzqDFxkXXRM8uZlyXPYGiXcaTSG3qdGPUQfSayXD5vD3CSCbZun9d zAcu+eHrKRqlM8/A0+CPUvWvHs4jYaIEeY7LsbH29RMiVeihEwLDlMhJe1tMUd1VRaNL WYQO5Fg7WZMSU1Kah5stgDOgAgifsCwTI+RNwHrFSbYGi02kG3XneUlFuHxWc1R4uwCd H7JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731611269; x=1732216069; 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=YlgtA2w+nkGpq6odlZPv7GuJkitbYlthMfvxp2Wzgbg=; b=vCk2sRmJuD/ID0/ZklxRlsyXAALcf06op4Gv7eJp9RRwE3yHQm0rYvj5t/HfIACYbL e8TZyAd0+iMMRRuMEELsW+ukuR/kJ8/2a+Qe73f4tE9SksiW1w5Wplqm8GUCwbyBYq9c RiMCaHCKsS8vPpayEUwjGYfvMR/XpipR4RrWCyvxHRC4Ecthf0FF5DXMLoVVu02vof/J k1kRrdMnhXzJs+63bsaWzEab68y/fljcgMHeFi57H8RHypKemjdGRprZb36d1IinXQ06 puwJGrFc7+7/qFddXtQ7rYrWhagS6z/nsDBZpghIZPkh3Uo6d2EvKwzsPa7UQdYmFUNd BquA== X-Gm-Message-State: AOJu0Yz985JgEQINdfGH3+zMHYEiJRzOfq6msIfXaCqUGN/aZXq5+Paa 3/oBGzDNdb1u5DnNJj12ZDHRGkRHaVtNcReKzhz10KlFznhyybVddJ4leOOOUfMTVNt9Zb6oLu1 o X-Received: by 2002:a05:600c:5123:b0:42c:ae30:fc4d with SMTP id 5b1f17b1804b1-432cce6805dmr97191465e9.7.1731611268857; Thu, 14 Nov 2024 11:07:48 -0800 (PST) Received: from localhost.localdomain ([176.187.209.228]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432dab721efsm30627335e9.4.2024.11.14.11.07.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 14 Nov 2024 11:07:48 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , Paolo Bonzini , Anton Johansson , Gustavo Romero , Richard Henderson , =?utf-8?q?Marc-Andr=C3=A9?= =?utf-8?q?_Lureau?= , Jason Wang , Alistair Francis , qemu-arm@nongnu.org, Peter Maydell , Thomas Huth , Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Edgar E . Iglesias" Subject: [PATCH v2 02/19] hw/net/xilinx_ethlite: Convert some debug logs to trace events Date: Thu, 14 Nov 2024 20:07:16 +0100 Message-ID: <20241114190733.33902-3-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241114190733.33902-1-philmd@linaro.org> References: <20241114190733.33902-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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Edgar E. Iglesias --- hw/net/xilinx_ethlite.c | 5 +++-- hw/net/trace-events | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/net/xilinx_ethlite.c b/hw/net/xilinx_ethlite.c index e84b4cdd35..bb330a233f 100644 --- a/hw/net/xilinx_ethlite.c +++ b/hw/net/xilinx_ethlite.c @@ -30,6 +30,7 @@ #include "hw/irq.h" #include "hw/qdev-properties.h" #include "net/net.h" +#include "trace.h" #define D(x) #define R_TX_BUF0 0 @@ -198,13 +199,13 @@ static ssize_t eth_rx(NetClientState *nc, const uint8_t *buf, size_t size) return size; if (s->regs[rxbase + R_RX_CTRL0] & CTRL_S) { - D(qemu_log("ethlite lost packet %x\n", s->regs[R_RX_CTRL0])); + trace_ethlite_pkt_lost(s->regs[R_RX_CTRL0]); return -1; } D(qemu_log("%s %zd rxbase=%x\n", __func__, size, rxbase)); if (size > (R_MAX - R_RX_BUF0 - rxbase) * 4) { - D(qemu_log("ethlite packet is too big, size=%x\n", size)); + trace_ethlite_pkt_size_too_big(size); return -1; } memcpy(&s->regs[rxbase + R_RX_BUF0], buf, size); diff --git a/hw/net/trace-events b/hw/net/trace-events index d0f1d8c0fb..2b36cd967e 100644 --- a/hw/net/trace-events +++ b/hw/net/trace-events @@ -511,3 +511,7 @@ xen_netdev_connect(int dev, unsigned int tx, unsigned int rx, int port) "vif%u t xen_netdev_frontend_changed(const char *dev, int state) "vif%s state %d" xen_netdev_tx(int dev, int ref, int off, int len, unsigned int flags, const char *c, const char *d, const char *m, const char *e) "vif%u ref %u off %u len %u flags 0x%x%s%s%s%s" xen_netdev_rx(int dev, int idx, int status, int flags) "vif%u idx %d status %d flags 0x%x" + +# xilinx_ethlite.c +ethlite_pkt_lost(uint32_t rx_ctrl) "rx_ctrl:0x%" PRIx32 +ethlite_pkt_size_too_big(uint64_t size) "size:0x%" PRIx64 From patchwork Thu Nov 14 19:07:17 2024 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: 843190 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcc:0:b0:382:184f:390f with SMTP id e12csp458273wrc; Thu, 14 Nov 2024 11:09:11 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVHYUho9Lczmb3eUOLBVDXguBNP6twYpBq33C/EZPFnGP65hgJrt5JlYXS7CDaqW5VTANDC0A==@linaro.org X-Google-Smtp-Source: AGHT+IH4uHwczfWaiWc0ea1+6L3zermSvXnWRQzSiE/Rih300DjjbTyO9LBy39xbUC/zKmFdOmgm X-Received: by 2002:a05:620a:4411:b0:7b1:4053:71c1 with SMTP id af79cd13be357-7b3622b097cmr4923585a.18.1731611351326; Thu, 14 Nov 2024 11:09:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731611351; cv=none; d=google.com; s=arc-20240605; b=b5V+5CO76qMx2d5+aGqp/6tQiuJHH1NWShxv/oc54S9cYhZmaw+KGM8+iSIIvXYFNQ Xj5RNbfEkzgpUmfEvcu8TSZOFBwoo4pNtuMjGq2isERqn4aPdf+I767x68lYMYuo7+PI e4V0lbJi3FqywXf5FpIS6gH7bgQsvuOtlVTrr7ubepOnsnTN9TU9sL6klG/1zBTYUyUL q65MJgDNzmSSb+eZXUgdxZz74MPPGoSAT1KTAWKbJTzbsi+5UBTc1t/bCannCUkNSSj4 2jlPdxIyo3mlc1oy09vNPLypjeYfnvFlDZgSW4sZ8xZHe2gLy5T0emgroS1fJIlR+26Q 9ZiQ== 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=yTK4l6Ykvzc6k9RKpIP/b45MtLRJEjbQSCPD8FRx8u8=; fh=7A7HBWtA9NzznsD1t3i/7lzKxqnriI1QQDKZkQ1XHRo=; b=hZUuAsffbDeOXf8A44hmRXfsvoZ9Whnz523m7YQfn4ZQsefIX3CwJBiubRmoDBiSLI PEkl3GPxREOqV0UKsagwwncBATrQ1jkNoBKRRpDFDm8ZyPLYao81r43fy69LjD2sj6cQ cIU2o2qNO/UuVKb4TW43bjIFiI3nvNO+VtnipF34TJQssmSRBhU8rQ0NvCLmS+HMZ8sH siQCCPDfMo5slicUHGmMjNj4QDW01JxgVhFhfqDl/z6CHoof3Dfiwmpz1GVIyxeE/4AD AP9yk2Rnnp9MVa8SZu4T38mlM2az4sgTlHKw0nBa2p8R/orR64dkudAf8+IEnfdS1/NI tFag==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ezAM2rTg; 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-7b35ca86474si171993985a.418.2024.11.14.11.09.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Nov 2024 11:09:11 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ezAM2rTg; 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 1tBfCG-0004gc-Rl; Thu, 14 Nov 2024 14:08: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 1tBfCF-0004d9-Ly for qemu-devel@nongnu.org; Thu, 14 Nov 2024 14:08:03 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tBfCE-0005Z0-1C for qemu-devel@nongnu.org; Thu, 14 Nov 2024 14:08:03 -0500 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-37d49ffaba6so657654f8f.0 for ; Thu, 14 Nov 2024 11:08:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731611276; x=1732216076; 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=yTK4l6Ykvzc6k9RKpIP/b45MtLRJEjbQSCPD8FRx8u8=; b=ezAM2rTg5pEXstch3YjJO60KdLwSiX4IKSBYMZnZjmiXKIjqJte8+tC/30BlRQpyOs dpCGzb3cchV7s/pVFc9Ex+5aH7G+BXLCL5n5YJL45tiSSwHT/gtE6IZ/mEPwMjzvHH2Z p/ovp3KAS4Mo+5cP8MRTZjn2VB8w78iLSXBljXe8ZxXtnvUboAutVDRC6c36AqnW2Uyv K5zcubeJz1GqDwvGyo3KCDmbu9LngOegJyf/2BqugZZXBi0Mx9B9lYLvEtG2m5N6WgZQ WZhGjvVjPlrnji3K8/EgfDnzF9CQSqFChxBU9w5ONKeJ6f3aAqQEYTTPDqusafEH3GCL sr1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731611276; x=1732216076; 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=yTK4l6Ykvzc6k9RKpIP/b45MtLRJEjbQSCPD8FRx8u8=; b=KYaWmWakhT3pbUK5hBqd7RY4/1fGvfYqNk5lABqXf3EMXdNZwG3fUVfF6Uic/aWl05 u9chlg9wCrwUPYqU3YnBU6SmUAS4lJ2YpDcAAQphHllJqjFdC8ph/mkSp8PvTL0w2g8h 2wnR+vnB+zZxFOzFl7OD0F6Y6+nR2mFv+h8Z6EldWvnkwnBnUB4fbehFMB9lAc4tFlV7 7Va2LBZQWOIgj7RII19bqF+X5a05x7hRUYvEjB1eufaOX7JhD6nhl7eQSR9Yta8m5D3q ej9KeRqV33bfBJH++1la8nQmEDsXwY135Q6qCOhgVojanVRnBsWSM4ki4ttLRFg7Uo2E MNrQ== X-Gm-Message-State: AOJu0YyQha4tr2C04/E2ZCo9VrMbXTQJqjso+1kLuOwtxJZFvn8kEIsO 7sse6/iUNgjhiVCd/OJl/ILFaca3gnfBViHB466xSzVpxjXWbxeYsRUCeHU4KTF2FFf/BCA5rC0 m X-Received: by 2002:a05:6000:1567:b0:374:c17a:55b5 with SMTP id ffacd0b85a97d-3820810fdb5mr10354120f8f.14.1731611276643; Thu, 14 Nov 2024 11:07:56 -0800 (PST) Received: from localhost.localdomain ([176.187.209.228]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3821ae313a8sm2176218f8f.105.2024.11.14.11.07.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 14 Nov 2024 11:07:54 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , Paolo Bonzini , Anton Johansson , Gustavo Romero , Richard Henderson , =?utf-8?q?Marc-Andr=C3=A9?= =?utf-8?q?_Lureau?= , Jason Wang , Alistair Francis , qemu-arm@nongnu.org, Peter Maydell , Thomas Huth , Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Edgar E . Iglesias" Subject: [PATCH v2 03/19] hw/net/xilinx_ethlite: Remove unuseful debug logs Date: Thu, 14 Nov 2024 20:07:17 +0100 Message-ID: <20241114190733.33902-4-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241114190733.33902-1-philmd@linaro.org> References: <20241114190733.33902-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Edgar E. Iglesias --- hw/net/xilinx_ethlite.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/hw/net/xilinx_ethlite.c b/hw/net/xilinx_ethlite.c index bb330a233f..2b52597f03 100644 --- a/hw/net/xilinx_ethlite.c +++ b/hw/net/xilinx_ethlite.c @@ -32,7 +32,6 @@ #include "net/net.h" #include "trace.h" -#define D(x) #define R_TX_BUF0 0 #define R_TX_LEN0 (0x07f4 / 4) #define R_TX_GIE0 (0x07f8 / 4) @@ -100,7 +99,6 @@ eth_read(void *opaque, hwaddr addr, unsigned int size) case R_RX_CTRL1: case R_RX_CTRL0: r = s->regs[addr]; - D(qemu_log("%s " HWADDR_FMT_plx "=%x\n", __func__, addr * 4, r)); break; default: @@ -126,13 +124,10 @@ eth_write(void *opaque, hwaddr addr, if (addr == R_TX_CTRL1) base = 0x800 / 4; - D(qemu_log("%s addr=" HWADDR_FMT_plx " val=%x\n", - __func__, addr * 4, value)); if ((value & (CTRL_P | CTRL_S)) == CTRL_S) { qemu_send_packet(qemu_get_queue(s->nic), (void *) &s->regs[base], s->regs[base + R_TX_LEN0]); - D(qemu_log("eth_tx %d\n", 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)) { @@ -156,8 +151,6 @@ eth_write(void *opaque, hwaddr addr, case R_TX_LEN0: case R_TX_LEN1: case R_TX_GIE0: - D(qemu_log("%s addr=" HWADDR_FMT_plx " val=%x\n", - __func__, addr * 4, value)); s->regs[addr] = value; break; @@ -203,7 +196,6 @@ static ssize_t eth_rx(NetClientState *nc, const uint8_t *buf, size_t size) return -1; } - D(qemu_log("%s %zd rxbase=%x\n", __func__, size, rxbase)); if (size > (R_MAX - R_RX_BUF0 - rxbase) * 4) { trace_ethlite_pkt_size_too_big(size); return -1; From patchwork Thu Nov 14 19:07:18 2024 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: 843189 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcc:0:b0:382:184f:390f with SMTP id e12csp458268wrc; Thu, 14 Nov 2024 11:09:10 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVfOKUh102F2ITWtZhudbPc9NFcpAvte4oGi8Fm6niH2WsGWikqhGT4Z725NCXanLZ754G4tw==@linaro.org X-Google-Smtp-Source: AGHT+IH2ub5d4ezVrDZb5Z2ov8FH73qOwX4Eo1dPN4+E9vCVCNJ6GetqdEZVh18ZHFCkhZCcQZ3S X-Received: by 2002:a05:6102:26d2:b0:4ad:4c1c:9694 with SMTP id ada2fe7eead31-4ad62b4cdc0mr245998137.11.1731611349963; Thu, 14 Nov 2024 11:09:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731611349; cv=none; d=google.com; s=arc-20240605; b=bmkOrvbH4Aaa5B8/SvHvXBH+pOlHTFfSaC/WYA9cNxmIJyaQxGL3lYFxhrkFbaNZFR tui67yrzJ85Mwoj+sOYPbG0kH6wiOIiToHcnA1fEzTdlpKzSc7F/OCh0plLBYsNsXXo9 BkoK731fkTlwgyPLWm6DnGWhDnEvEP0SlcTthakjBGXc03KRKLDdDVNx42mnWTTcr9Y/ 31th6nhu4aZzfiCD5TNzkYXdux/LCqOa6uf0vxMlFSlQXIkd2C3+eVp+uCi01vDbj0tK RGoDJ8Q4TGY6dTlBUsMGPakGCHcj5/O9rEe/eOWeTTOrP4TFfXJBojVzawtj1+jqbw0w fDGQ== 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=GtXVKpSIpZsJQkvyHDSbG39GxcMu+Qe8sXh7gatQ/Yw=; fh=7A7HBWtA9NzznsD1t3i/7lzKxqnriI1QQDKZkQ1XHRo=; b=jK/A39bqRCPjz3tinJ8U4u67tUEeXaraJTJBom+pTkiJqBL4vXmfi/3vc7KqRuZdAq I7oF/nFhea+yhhaEvu3UTqF0IdjOfftPkfpywiOdNmMtdjpXJKUqANTDORui6MJrx3D3 MQr+CWppOCX36xPHTH969gpY9ROwAOV3qC0CWg44/XEa51ZhG6GBLrtJCUj/k6PHJMzl LVI8KnA6hN1FapK6EPanLPhaCnYqWqPDC2RXr5kF0Pe96P7Clm08Rlovbptb7oDuy/dh d9FJp08b4hVbH6hkEW1H0rkMieA71p3HnYcKs5RV36Y2Jb6qzhvgVbv8tgXar0UiwUpr amzw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="eRzoQ/7k"; 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 ada2fe7eead31-4ad5985b15asi714311137.455.2024.11.14.11.09.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Nov 2024 11:09:09 -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="eRzoQ/7k"; 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 1tBfCN-0004kc-Ft; Thu, 14 Nov 2024 14:08:11 -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 1tBfCL-0004kF-IP for qemu-devel@nongnu.org; Thu, 14 Nov 2024 14:08:09 -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 1tBfCJ-0005Zq-IT for qemu-devel@nongnu.org; Thu, 14 Nov 2024 14:08:09 -0500 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-37d538fe5f2so683903f8f.2 for ; Thu, 14 Nov 2024 11:08:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731611283; x=1732216083; 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=GtXVKpSIpZsJQkvyHDSbG39GxcMu+Qe8sXh7gatQ/Yw=; b=eRzoQ/7kq+i89RA4PXQxrvrgpPSr6KL3Flliu/zhN7RXqeqgoIjta9SW4bmZjHGZe3 KniYKK3X1TTcFdVJ0Bb2bRZ3AWJG0SbkQBIO1+KKxm6O9D24D6/L4hsZ/mZzJ6S9st3n i0vgCQA1DZa5fmfnHdWYjrUF4HOethRvRmky3g4SF01/+HNKwca7smF2JRvxP4mHO3lU 6xkBEuDT0aaxBdCfAFPI5DlNf8WCC+tqA3vjjjn0TRCOVEui673HOhhqqAUgI/vGBsin HZMGj3ERIJIYUg6cctpXkoal8yqkvj5+ylS2z4PlAUzyyr/7np1xz0JObrXnWUz1HkgQ L+wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731611283; x=1732216083; 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=GtXVKpSIpZsJQkvyHDSbG39GxcMu+Qe8sXh7gatQ/Yw=; b=KQ90Xvf+ieSHG1mop6wINnl/ferUDkSYqEGYiEyK2P1W2mo97R988R0VUxQXVv1V3L TDDpYIA/sJB1EPjEaBDz5aFqvlOt+Axh1s41ngIm+nM2AGOcFlXctqMpD0sVjKp67e7p PA8x/hc8/GtFYzStCHsIY1U2veOWVdos0LjmR9ee4GxfaS3YnvJ7bGQYQTP2K8PH36xF 9pgdhhEmtMSuPu3n+QbtMYk1pM8cGzd+7l5+mfUnEGe5iXm+kDYtYLUZjRe6uLgpCUp4 JWkQZGWI0GSJ6d9+E80+jX7gaqX1Krf64YaTpMK5bGJ1RDD691YWNI0YjWyAD+/cDCqb TpRg== X-Gm-Message-State: AOJu0Yx2GrkUCxxd2DfOb1eABolUcLpN+GdUlynJS8OKTVD8VRilFD3Z mEdr8bQtUXkyDvO+Gj1u8K7v9tlJO2I4wJFhTKX1hHdmNjQzydQBaX7wl9LoAwDPw1tQ/hOQtO6 l X-Received: by 2002:a5d:5d10:0:b0:37d:4f1b:35a with SMTP id ffacd0b85a97d-3820df6a932mr6081679f8f.3.1731611282791; Thu, 14 Nov 2024 11:08:02 -0800 (PST) Received: from localhost.localdomain ([176.187.209.228]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3821ae3100csm2192071f8f.91.2024.11.14.11.08.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 14 Nov 2024 11:08:01 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , Paolo Bonzini , Anton Johansson , Gustavo Romero , Richard Henderson , =?utf-8?q?Marc-Andr=C3=A9?= =?utf-8?q?_Lureau?= , Jason Wang , Alistair Francis , qemu-arm@nongnu.org, Peter Maydell , Thomas Huth , Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Edgar E . Iglesias" Subject: [PATCH v2 04/19] hw/net/xilinx_ethlite: Update QOM style Date: Thu, 14 Nov 2024 20:07:18 +0100 Message-ID: <20241114190733.33902-5-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241114190733.33902-1-philmd@linaro.org> References: <20241114190733.33902-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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Use XlnxXpsEthLite typedef, OBJECT_DECLARE_SIMPLE_TYPE macro; convert type_init() to DEFINE_TYPES(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Edgar E. Iglesias --- hw/net/xilinx_ethlite.c | 48 +++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/hw/net/xilinx_ethlite.c b/hw/net/xilinx_ethlite.c index 2b52597f03..0f59811c78 100644 --- a/hw/net/xilinx_ethlite.c +++ b/hw/net/xilinx_ethlite.c @@ -53,10 +53,9 @@ #define CTRL_S 0x1 #define TYPE_XILINX_ETHLITE "xlnx.xps-ethernetlite" -DECLARE_INSTANCE_CHECKER(struct xlx_ethlite, XILINX_ETHLITE, - TYPE_XILINX_ETHLITE) +OBJECT_DECLARE_SIMPLE_TYPE(XlnxXpsEthLite, XILINX_ETHLITE) -struct xlx_ethlite +struct XlnxXpsEthLite { SysBusDevice parent_obj; @@ -73,7 +72,7 @@ struct xlx_ethlite uint32_t regs[R_MAX]; }; -static inline void eth_pulse_irq(struct xlx_ethlite *s) +static inline void eth_pulse_irq(XlnxXpsEthLite *s) { /* Only the first gie reg is active. */ if (s->regs[R_TX_GIE0] & GIE_GIE) { @@ -84,7 +83,7 @@ static inline void eth_pulse_irq(struct xlx_ethlite *s) static uint64_t eth_read(void *opaque, hwaddr addr, unsigned int size) { - struct xlx_ethlite *s = opaque; + XlnxXpsEthLite *s = opaque; uint32_t r = 0; addr >>= 2; @@ -112,7 +111,7 @@ static void eth_write(void *opaque, hwaddr addr, uint64_t val64, unsigned int size) { - struct xlx_ethlite *s = opaque; + XlnxXpsEthLite *s = opaque; unsigned int base = 0; uint32_t value = val64; @@ -176,7 +175,7 @@ static const MemoryRegionOps eth_ops = { static bool eth_can_rx(NetClientState *nc) { - struct xlx_ethlite *s = qemu_get_nic_opaque(nc); + XlnxXpsEthLite *s = qemu_get_nic_opaque(nc); unsigned int rxbase = s->rxbuf * (0x800 / 4); return !(s->regs[rxbase + R_RX_CTRL0] & CTRL_S); @@ -184,7 +183,7 @@ static bool eth_can_rx(NetClientState *nc) static ssize_t eth_rx(NetClientState *nc, const uint8_t *buf, size_t size) { - struct xlx_ethlite *s = qemu_get_nic_opaque(nc); + XlnxXpsEthLite *s = qemu_get_nic_opaque(nc); unsigned int rxbase = s->rxbuf * (0x800 / 4); /* DA filter. */ @@ -214,7 +213,7 @@ static ssize_t eth_rx(NetClientState *nc, const uint8_t *buf, size_t size) static void xilinx_ethlite_reset(DeviceState *dev) { - struct xlx_ethlite *s = XILINX_ETHLITE(dev); + XlnxXpsEthLite *s = XILINX_ETHLITE(dev); s->rxbuf = 0; } @@ -228,7 +227,7 @@ static NetClientInfo net_xilinx_ethlite_info = { static void xilinx_ethlite_realize(DeviceState *dev, Error **errp) { - struct xlx_ethlite *s = XILINX_ETHLITE(dev); + XlnxXpsEthLite *s = XILINX_ETHLITE(dev); qemu_macaddr_default_if_unset(&s->conf.macaddr); s->nic = qemu_new_nic(&net_xilinx_ethlite_info, &s->conf, @@ -239,7 +238,7 @@ static void xilinx_ethlite_realize(DeviceState *dev, Error **errp) static void xilinx_ethlite_init(Object *obj) { - struct xlx_ethlite *s = XILINX_ETHLITE(obj); + XlnxXpsEthLite *s = XILINX_ETHLITE(obj); sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->irq); @@ -249,9 +248,9 @@ static void xilinx_ethlite_init(Object *obj) } static Property xilinx_ethlite_properties[] = { - DEFINE_PROP_UINT32("tx-ping-pong", struct xlx_ethlite, c_tx_pingpong, 1), - DEFINE_PROP_UINT32("rx-ping-pong", struct xlx_ethlite, c_rx_pingpong, 1), - DEFINE_NIC_PROPERTIES(struct xlx_ethlite, conf), + DEFINE_PROP_UINT32("tx-ping-pong", XlnxXpsEthLite, c_tx_pingpong, 1), + DEFINE_PROP_UINT32("rx-ping-pong", XlnxXpsEthLite, c_rx_pingpong, 1), + DEFINE_NIC_PROPERTIES(XlnxXpsEthLite, conf), DEFINE_PROP_END_OF_LIST(), }; @@ -264,17 +263,14 @@ static void xilinx_ethlite_class_init(ObjectClass *klass, void *data) device_class_set_props(dc, xilinx_ethlite_properties); } -static const TypeInfo xilinx_ethlite_info = { - .name = TYPE_XILINX_ETHLITE, - .parent = TYPE_SYS_BUS_DEVICE, - .instance_size = sizeof(struct xlx_ethlite), - .instance_init = xilinx_ethlite_init, - .class_init = xilinx_ethlite_class_init, +static const TypeInfo xilinx_ethlite_types[] = { + { + .name = TYPE_XILINX_ETHLITE, + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(XlnxXpsEthLite), + .instance_init = xilinx_ethlite_init, + .class_init = xilinx_ethlite_class_init, + }, }; -static void xilinx_ethlite_register_types(void) -{ - type_register_static(&xilinx_ethlite_info); -} - -type_init(xilinx_ethlite_register_types) +DEFINE_TYPES(xilinx_ethlite_types)