From patchwork Sat Oct 5 19:45:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 1993109 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=jElIT4t9; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XLbYC2g34z1xvB for ; Sun, 6 Oct 2024 06:47:43 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxAjz-0005Eu-OP; Sat, 05 Oct 2024 15:46:59 -0400 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 1sxAjy-0005EO-Dr; Sat, 05 Oct 2024 15:46:58 -0400 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 1sxAjw-0007c4-US; Sat, 05 Oct 2024 15:46:58 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-42cc43454d5so24094315e9.3; Sat, 05 Oct 2024 12:46:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728157614; x=1728762414; 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=NdkFcAo6SJarXbbtplTNN3BG2rXmHDAV05HAtHMlu7I=; b=jElIT4t9inY5HHLZDxD69IK1iaPJjdq3CTauPJKkPT2cGzKBtkGhjdSBAKPCsdtDG3 9L4IHemsNVNPagj0lEhQI/Zqmdidyc/bosiX65seaUCCvte1Y+Ulh6dj4jjBN/vdOBs7 XOvH29yUozdLp/ZmFQG2Inu75Vm77iKsP4fFaiJsGWW/zMZugEZ+CBlEnu+nv6ivj64O f7JnQrPF5I2rNU4/6jwJVWDNZzL0IK7ppVT59LkUQcgOtMZ/CDoOHMKfa9cq10pc0w9d n0wLNh9CETRXzXfy+TraUq2Jj5gywwESPGppgRbyPpFerDXKVJz2yWkySTv0nyvAb03/ w+6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728157614; x=1728762414; 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=NdkFcAo6SJarXbbtplTNN3BG2rXmHDAV05HAtHMlu7I=; b=A+vN4mMTNlqBmRHHVjYB1527SiFPlQuZgtHq5Y1omjExp+avW2byxas/jp/3uuJiiT fSxU6CG1OGr/VnKHU8jyLLlf6tojORvk6N8PRCEOr9E49suUORrAHmIVK5x6dJ59icDf ibwHFBrVrbGhZfr2qGYOAVLx8YF2/MvReYZ38evMganr7gTNi8U6PXfEK2+yLNf3/kWF 40DI14NV03lc1fdZo23lxb3vNMeZFUKk5xT67+hv/rMX7c3yRPCdh11pC2b7Cs97cMpL 1aV0mri5AaKC6oI3YqRvcARmisfe/MVLDzzFSP+tkEpJCBG7WF3Jea/5u0dFPFSTHH39 rMlQ== X-Forwarded-Encrypted: i=1; AJvYcCVq8WScioIcMMpCPqQ9911z3XY2+Wq8ip4tnJcykfPCIHZs1JKCm1cZ0I3IewGqmPbtw/ujISyIwSE=@nongnu.org, AJvYcCXZOjG4xk4oDxwZOX4O+njpPukdC2Y0l3wXZGqQiLZSnzjFFatZnDl5utYjd1SL8o8ZqI2m7vh7tZX7@nongnu.org X-Gm-Message-State: AOJu0YyxjAla4QBcrOrOGIPq3PxcyyPRk0/rbq5bSWXNheA/HO+I8CLg y9IfNJS9xWR4dC2ZSXXI6HntZbkFHpoZmjpDie6XcDNuGxpCa2TBtsZTLA== X-Google-Smtp-Source: AGHT+IGvu8EMVPKK2PQQgtoPp9bhnmgAJ6BHDImb7jXQD6fegFdhqTFx8p9xhCj7DgBqYOlO2vdf0w== X-Received: by 2002:a05:600c:1d16:b0:42a:a6d2:3270 with SMTP id 5b1f17b1804b1-42f8dcb8afbmr9434775e9.21.1728157613843; Sat, 05 Oct 2024 12:46:53 -0700 (PDT) Received: from archlinux.. (pd95ed790.dip0.t-ipconnect.de. [217.94.215.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42f86a0afc1sm47506775e9.1.2024.10.05.12.46.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 12:46:53 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Daniel Henrique Barboza , Nicholas Piggin , Bin Meng , Corey Minyard , Bernhard Beschow , qemu-ppc@nongnu.org, Alex Williamson , Hanna Reitz , Jason Wang , qemu-block@nongnu.org, Kevin Wolf , =?utf-8?q?Philippe_Ma?= =?utf-8?q?thieu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_?= =?utf-8?q?Goater?= Subject: [PATCH v2 01/23] hw/ppc/e500: Do not leak struct boot_info Date: Sat, 5 Oct 2024 21:45:41 +0200 Message-ID: <20241005194603.23139-2-shentey@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241005194603.23139-1-shentey@gmail.com> References: <20241005194603.23139-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=shentey@gmail.com; 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The struct is allocated once with g_new0() but never free()'d. Fix the leakage by adding an attribute to struct PPCE500MachineState which avoids the allocation. While at it remove the obsolete /*< private >*/ markers. Signed-off-by: Bernhard Beschow --- hw/ppc/e500.h | 9 +++++++-- hw/ppc/e500.c | 17 ++++------------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/hw/ppc/e500.h b/hw/ppc/e500.h index 8c09ef92e4..5654bb7907 100644 --- a/hw/ppc/e500.h +++ b/hw/ppc/e500.h @@ -5,18 +5,23 @@ #include "hw/platform-bus.h" #include "qom/object.h" +typedef struct boot_info { + uint32_t dt_base; + uint32_t dt_size; + uint32_t entry; +} boot_info; + struct PPCE500MachineState { - /*< private >*/ MachineState parent_obj; /* points to instance of TYPE_PLATFORM_BUS_DEVICE if * board supports dynamic sysbus devices */ PlatformBusDevice *pbus_dev; + boot_info boot_info; }; struct PPCE500MachineClass { - /*< private >*/ MachineClass parent_class; /* required -- must at least add toplevel board compatible */ diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index 3bd12b54ab..75b051009f 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -80,13 +80,6 @@ #define PLATFORM_CLK_FREQ_HZ (400 * 1000 * 1000) -struct boot_info -{ - uint32_t dt_base; - uint32_t dt_size; - uint32_t entry; -}; - static uint32_t *pci_map_create(void *fdt, uint32_t mpic, int first_slot, int nr_slots, int *len) { @@ -919,7 +912,6 @@ void ppce500_init(MachineState *machine) bool kernel_as_payload; hwaddr bios_entry = 0; target_long payload_size; - struct boot_info *boot_info = NULL; int dt_size; int i; unsigned int smp_cpus = machine->smp.cpus; @@ -974,9 +966,8 @@ void ppce500_init(MachineState *machine) /* Register reset handler */ if (!i) { /* Primary CPU */ - boot_info = g_new0(struct boot_info, 1); qemu_register_reset(ppce500_cpu_reset, cpu); - env->load_info = boot_info; + env->load_info = &pms->boot_info; } else { /* Secondary CPUs */ qemu_register_reset(ppce500_cpu_reset_sec, cpu); @@ -1274,9 +1265,9 @@ void ppce500_init(MachineState *machine) } assert(dt_size < DTB_MAX_SIZE); - boot_info->entry = bios_entry; - boot_info->dt_base = dt_base; - boot_info->dt_size = dt_size; + pms->boot_info.entry = bios_entry; + pms->boot_info.dt_base = dt_base; + pms->boot_info.dt_size = dt_size; } static void e500_ccsr_initfn(Object *obj) From patchwork Sat Oct 5 19:45:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 1993115 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=DSwxMiGj; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XLbZ94plkz1xtV for ; Sun, 6 Oct 2024 06:48:33 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxAk1-0005Gz-VR; Sat, 05 Oct 2024 15:47:01 -0400 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 1sxAk0-0005Ex-8W; Sat, 05 Oct 2024 15:47:00 -0400 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 1sxAjy-0007cH-Cz; Sat, 05 Oct 2024 15:47:00 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-37cd1ccaf71so2347901f8f.0; Sat, 05 Oct 2024 12:46:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728157616; x=1728762416; 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=kYmazEU3qUCGZ66Yek0cGHflV4Zj7SZa461SxhER5XI=; b=DSwxMiGj6CcyILn27qfFBd4PgSmkyGllVwlCNaziFyvqbhGq8N0qSfdCRFBSt+/Em0 nVvO6T4ahvgQyy/0hSP7LTEfkNQNEj4vJWZ5w3qENBnpGas3eADRTQsxHf+f3wM9+Xwi WjzpYBuVTOH4M9vPDwqvtyNRP7woHR2zi/YSc0zRjWoCwr12jybufIF7C48sYXDjfr66 dANbN2NNi+rIQtWFEWAweY9TknXgH92mZADgsk0M/lQ5fYBeY83RnwSFXkBLJ5sNhKFu xfoXnF+3YaOARGlwN23mUvJXbrdQGci3W5i3/eH8Qrf9OloRFYzr72Jmbr2V3Ux0oZ7F umAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728157616; x=1728762416; 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=kYmazEU3qUCGZ66Yek0cGHflV4Zj7SZa461SxhER5XI=; b=IvYbMTdT5f8HCAaagSGfO6bwpwc8HPXXGBNH0UinO7VUCoVKXPvEaOAIhHtnE35Yzf ymiu/xt7FwodoPyOTeMeY1JNzYe4ZkFhmIsW1Pc2jxh8ZC4tz9569RwOCek3/ReFQAPm JQkyLoH2xZMVbxDO5F8/awCvmIWcsJqW/mH5MKWwF7nkUB3+E1/0aFI/Lq2KW0Px4hCi wGol+ynOKVIG9y5+uCv9l6lA3ecAe7IOlqHMosXBo/w6QOsPRBZMWYI0/8V9dsLSA9pS 2bxzq7e5bQBhpQ8Ycami1Lygudk22+ey0MDTfoo2ivPOAph5MOjQMckAAvr75MzQ7/zH 927w== X-Forwarded-Encrypted: i=1; AJvYcCVyKlNn+YsFvbilI8PWXUc3jU+veEclAFQzdjPj9DDTznjrIKUyoLHQwpAVzCUq1K3CfcWbjhVKcUs=@nongnu.org, AJvYcCX245mZyOAU4P6YpHAeGM6Enz+0i/HnAItIPcpBzh6zYgikyzs2xq9MJu5dRP/Kb1wIh6Q2+NPa/u5/@nongnu.org X-Gm-Message-State: AOJu0Yy3FYowvN29dhH8tBCWqz/MxlQn+VXQ+37a+J8i/HSTbC4YT/C7 s3CgFqyiYNT6d9i+CgPOvLo7EQX8R/57RyN2hukr5T5dGCqvZoD14TPQJw== X-Google-Smtp-Source: AGHT+IFSI/0G9gVw12QLVvDnp5sSVKJ1jiHXw6CXivYnO5OxhXg8iW899DatuFN0nLBUssoJMa5CXA== X-Received: by 2002:adf:f4c9:0:b0:374:c7cd:8818 with SMTP id ffacd0b85a97d-37d04a576e4mr6458872f8f.22.1728157615482; Sat, 05 Oct 2024 12:46:55 -0700 (PDT) Received: from archlinux.. (pd95ed790.dip0.t-ipconnect.de. [217.94.215.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42f86a0afc1sm47506775e9.1.2024.10.05.12.46.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 12:46:54 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Daniel Henrique Barboza , Nicholas Piggin , Bin Meng , Corey Minyard , Bernhard Beschow , qemu-ppc@nongnu.org, Alex Williamson , Hanna Reitz , Jason Wang , qemu-block@nongnu.org, Kevin Wolf , =?utf-8?q?Philippe_Ma?= =?utf-8?q?thieu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_?= =?utf-8?q?Goater?= Subject: [PATCH v2 02/23] hw/ppc/e500: Remove firstenv variable Date: Sat, 5 Oct 2024 21:45:42 +0200 Message-ID: <20241005194603.23139-3-shentey@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241005194603.23139-1-shentey@gmail.com> References: <20241005194603.23139-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=shentey@gmail.com; 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The firstenv variable is never read, so remove it. The env variable is then only used inside the loop, so move it there to restrict its scope. Signed-off-by: Bernhard Beschow --- hw/ppc/e500.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index 75b051009f..f68779a1ea 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -899,7 +899,6 @@ void ppce500_init(MachineState *machine) const PPCE500MachineClass *pmc = PPCE500_MACHINE_GET_CLASS(machine); MachineClass *mc = MACHINE_CLASS(pmc); PCIBus *pci_bus; - CPUPPCState *env = NULL; uint64_t loadaddr; hwaddr kernel_base = -1LL; int kernel_size = 0; @@ -921,7 +920,6 @@ void ppce500_init(MachineState *machine) IrqLines *irqs; DeviceState *dev, *mpicdev; DriveInfo *dinfo; - CPUPPCState *firstenv = NULL; MemoryRegion *ccsr_addr_space; SysBusDevice *s; PPCE500CCSRState *ccsr; @@ -930,6 +928,7 @@ void ppce500_init(MachineState *machine) irqs = g_new0(IrqLines, smp_cpus); for (i = 0; i < smp_cpus; i++) { PowerPCCPU *cpu; + CPUPPCState *env; CPUState *cs; cpu = POWERPC_CPU(object_new(machine->cpu_type)); @@ -950,10 +949,6 @@ void ppce500_init(MachineState *machine) &error_abort); qdev_realize_and_unref(DEVICE(cs), NULL, &error_fatal); - if (!firstenv) { - firstenv = env; - } - irqs[i].irq[OPENPIC_OUTPUT_INT] = qdev_get_gpio_in(DEVICE(cpu), PPCE500_INPUT_INT); irqs[i].irq[OPENPIC_OUTPUT_CINT] = @@ -974,8 +969,6 @@ void ppce500_init(MachineState *machine) } } - env = firstenv; - if (!QEMU_IS_ALIGNED(machine->ram_size, RAM_SIZES_ALIGN)) { error_report("RAM size must be multiple of %" PRIu64, RAM_SIZES_ALIGN); exit(EXIT_FAILURE); From patchwork Sat Oct 5 19:45:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 1993117 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=RMmImgul; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XLbZL65J9z1xtV for ; Sun, 6 Oct 2024 06:48:42 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxAk2-0005Hc-LB; Sat, 05 Oct 2024 15:47:02 -0400 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 1sxAk1-0005G3-CT; Sat, 05 Oct 2024 15:47:01 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sxAjz-0007cy-Uu; Sat, 05 Oct 2024 15:47:01 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-42cb5b3c57eso30828505e9.2; Sat, 05 Oct 2024 12:46:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728157617; x=1728762417; 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=VyriMu6tk8vkCkzFH+eBMAjfV7kMksyL3Wc2FsaHuQg=; b=RMmImgulBCrDrwRSPrinbhI+UqDf/z7Dk9KC9BZ2bO3llG4rJ9zXGyDzj2VdzRMJHR 7AV6eac4izyjLp5Smb2rxYvhjFzi5vmiZgui+k6x3LoBN8wzt7tSeaJFvdI7L3s51XIa ttW55wXTmX/jBI9POHUnWISEaK+wztUjNy78n/o7USpZgrwzORsC5BMAEKKTpS0fg/ox MWdwS8FjH41xCAYL3tCA2JgkECKT9yBhD0/xSlWa91uDv8l+FqA6AQpzYafhJgGU7900 QkHzGF2FLocx4L4yMlbt70iwBn4v8TWI4d0DGFWrwHIE8pAWV4WFDThT1vTBd7J+PQdc 7Kog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728157617; x=1728762417; 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=VyriMu6tk8vkCkzFH+eBMAjfV7kMksyL3Wc2FsaHuQg=; b=KwH17WmA0450lEY5DZ4Dl7BftElw8tm79+guhENuE584CaVv0XcJdmBr1dARwmSnp+ clUPDu84U2NOdpw2puHY+ow8w4fKgI6ysRWlABg2PV1oiO/ACpMrcaEsYCcyNVZXITVt YMrBduZk6yYrjAvRNu+buKm6/uqXVgKG1kfaxxSdCfOLUfXZfMuLbIVLB4ArnaJcF4U3 FueRjWkx3YInPErBfRJZJagq6zW8O03CY9VrWU86althMGY4EzI92kKTBsr3LKxv7C9e sbm1msXKu+lLzcFbK/YXTrCdGZ5KEGAuk52vPOx9BylVbGbjYKB5RUHeclqfH1EaV2Ur +Kag== X-Forwarded-Encrypted: i=1; AJvYcCUIeBUmxCELHwfhQf10/empTsZ6Gb1uVAnk54gYKQX/WdwScA6BF3T5Hb83Cmvt03SVSxa9E/vKAik=@nongnu.org, AJvYcCVeu3XLysQT3ryRxlj0GWCxJSXSnRNGw4lQcEPJoBNgr20Yjm60s5t6Yby7UE7zwFUqzwPjyX/y/zLp@nongnu.org X-Gm-Message-State: AOJu0Yz5yHlzVkPLDn/dFbPO51ZWl5aKLvizEHVgISkMs104rwx+DekX 0G4d7GCNh9d13iMLcSth3Hv4GpEakbGkwbytxPUhkxiqh/sJOR65yYKMGg== X-Google-Smtp-Source: AGHT+IF11CXS2ICc87/lZ/U1mSLMH66t9V1ov5J3O4CZ+TF4jCUHhF89AOL5N4MPbCw9I38U3L4d4Q== X-Received: by 2002:a05:600c:49a5:b0:42c:bf79:78f7 with SMTP id 5b1f17b1804b1-42f89f7b8a4mr22210755e9.32.1728157617245; Sat, 05 Oct 2024 12:46:57 -0700 (PDT) Received: from archlinux.. (pd95ed790.dip0.t-ipconnect.de. [217.94.215.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42f86a0afc1sm47506775e9.1.2024.10.05.12.46.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 12:46:56 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Daniel Henrique Barboza , Nicholas Piggin , Bin Meng , Corey Minyard , Bernhard Beschow , qemu-ppc@nongnu.org, Alex Williamson , Hanna Reitz , Jason Wang , qemu-block@nongnu.org, Kevin Wolf , =?utf-8?q?Philippe_Ma?= =?utf-8?q?thieu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_?= =?utf-8?q?Goater?= , BALATON Zoltan Subject: [PATCH v2 03/23] hw/ppc/e500: Prefer QOM cast Date: Sat, 5 Oct 2024 21:45:43 +0200 Message-ID: <20241005194603.23139-4-shentey@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241005194603.23139-1-shentey@gmail.com> References: <20241005194603.23139-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=shentey@gmail.com; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Reviewed-by: BALATON Zoltan Signed-off-by: Bernhard Beschow --- hw/ppc/e500.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index f68779a1ea..32996c188e 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -1008,7 +1008,7 @@ void ppce500_init(MachineState *machine) sysbus_connect_irq(s, 0, qdev_get_gpio_in(mpicdev, MPC8544_I2C_IRQ)); memory_region_add_subregion(ccsr_addr_space, MPC8544_I2C_REGS_OFFSET, sysbus_mmio_get_region(s, 0)); - i2c = (I2CBus *)qdev_get_child_bus(dev, "i2c"); + i2c = I2C_BUS(qdev_get_child_bus(dev, "i2c")); i2c_slave_create_simple(i2c, "ds1338", RTC_REGS_OFFSET); /* eSDHC */ @@ -1057,7 +1057,7 @@ void ppce500_init(MachineState *machine) memory_region_add_subregion(ccsr_addr_space, MPC8544_PCI_REGS_OFFSET, sysbus_mmio_get_region(s, 0)); - pci_bus = (PCIBus *)qdev_get_child_bus(dev, "pci.0"); + pci_bus = PCI_BUS(qdev_get_child_bus(dev, "pci.0")); if (!pci_bus) printf("couldn't create PCI controller!\n"); From patchwork Sat Oct 5 19:45:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 1993110 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=CMrg7EZZ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XLbYL35Skz1xtV for ; Sun, 6 Oct 2024 06:47:50 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxAk4-0005Im-7k; Sat, 05 Oct 2024 15:47:04 -0400 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 1sxAk2-0005Hu-S1; Sat, 05 Oct 2024 15:47:02 -0400 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 1sxAk1-0007dm-0p; Sat, 05 Oct 2024 15:47:02 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-42cb7a2e4d6so31848255e9.0; Sat, 05 Oct 2024 12:47:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728157619; x=1728762419; 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=2BezNNdk3PkYioTUt7iat3P1nWyR9v8iNK3NeX7XEJk=; b=CMrg7EZZN7E69XS/vcRD2eb8Ex1691lP1qro00GCZJ1NVHCjH8Vn2SZ4Q/C/H5+ZTc yfVEa6xkWEWaqW21mn1ngh4toMUdPfFNcLRAnLRnB/bAOSvO6Z1z7XZITX85om8f5miu A848M/aqPkYXUMsYEnpcTqE4oIJEJyUQxXSHzHnj/ZgDqXYqwLXKD7cxtnhKMbNjpcBe wUeAlRjb/2a44pHpDjzm9d/0UTSkFcCPpepGCNLXGoD402SjsuPVeF0XOxHzV+iysXky ANB7aFle+T98UVqAtg7VjgId6/xn+wJjizot05rlG14T5LbMTdyorqrRez7BMI93IFwx XukA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728157619; x=1728762419; 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=2BezNNdk3PkYioTUt7iat3P1nWyR9v8iNK3NeX7XEJk=; b=j46PWGdMgW69adUFgQpT4VYJEKcI2gG6oSHdoYI4imRIOW8ympKUtHyS6AR3ubKdnw DxVDLnFhwyhqNjL3lwVrP6B7z+MUhJW9keKb5dUa4864Z4HLsWD8EQ1b3S5jqqQBejLK 2BTubMQf0lK2HMjYTN6F4qvg/bsaz03Ye2rAHjXr0iU8wVZ7lzhCFVV9Y6p3ifDYGVXv ATrRTK0cIE2NoNjJSpedVjPr6bsMnRX+bXBH49rClYuLfrhbF81Z8yvVF+JORfjOH6iu IgquG7ldsn86nFZLUnsk0AmFLWKOpWc9GmjmgxntxnqHe7aeCqjiARpUALuyrnjlztS/ TtnQ== X-Forwarded-Encrypted: i=1; AJvYcCUXeFkzJ7dRbGPy6MLfv+Fn/J7747N9d+B/CdcYNVrzIM2eKl5zQ4CRkFlb7v3Xd3WnDGJWlympeGDr@nongnu.org, AJvYcCWvUkuSA3Zb/FZuf8FH2bisXjOYYKm9dI0JQwyPt03Wj46BiDKogmyncCc0ak5EjrjKe7KN+pNRGYk=@nongnu.org X-Gm-Message-State: AOJu0Yzv4XvM5kA82Sofw5veqMP2leeit0sRaF59Ok8R986/Qbl7p4V6 SRT/H5Tn4aPc/C9w6hSmDvUeDExxW23BM6DfB+p2eaqwb7p0I+9Pax5eGw== X-Google-Smtp-Source: AGHT+IGFgBbGivkDy5FOm98fjJjeBpPC2RekHxbbgLD7+eRwJKg2lYf75ZfPH7R3MfKq270SkHlUBQ== X-Received: by 2002:a7b:c454:0:b0:42f:8ac6:4f34 with SMTP id 5b1f17b1804b1-42f8ac65216mr20162675e9.35.1728157618622; Sat, 05 Oct 2024 12:46:58 -0700 (PDT) Received: from archlinux.. (pd95ed790.dip0.t-ipconnect.de. [217.94.215.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42f86a0afc1sm47506775e9.1.2024.10.05.12.46.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 12:46:58 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Daniel Henrique Barboza , Nicholas Piggin , Bin Meng , Corey Minyard , Bernhard Beschow , qemu-ppc@nongnu.org, Alex Williamson , Hanna Reitz , Jason Wang , qemu-block@nongnu.org, Kevin Wolf , =?utf-8?q?Philippe_Ma?= =?utf-8?q?thieu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_?= =?utf-8?q?Goater?= , BALATON Zoltan Subject: [PATCH v2 04/23] hw/ppc/e500: Remove unused "irqs" parameter Date: Sat, 5 Oct 2024 21:45:44 +0200 Message-ID: <20241005194603.23139-5-shentey@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241005194603.23139-1-shentey@gmail.com> References: <20241005194603.23139-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=shentey@gmail.com; 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Reviewed-by: BALATON Zoltan Signed-off-by: Bernhard Beschow --- hw/ppc/e500.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index 32996c188e..228287b457 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -825,7 +825,7 @@ static DeviceState *ppce500_init_mpic_qemu(PPCE500MachineState *pms, } static DeviceState *ppce500_init_mpic_kvm(const PPCE500MachineClass *pmc, - IrqLines *irqs, Error **errp) + Error **errp) { #ifdef CONFIG_KVM DeviceState *dev; @@ -865,7 +865,7 @@ static DeviceState *ppce500_init_mpic(PPCE500MachineState *pms, Error *err = NULL; if (kvm_kernel_irqchip_allowed()) { - dev = ppce500_init_mpic_kvm(pmc, irqs, &err); + dev = ppce500_init_mpic_kvm(pmc, &err); } if (kvm_kernel_irqchip_required() && !dev) { error_reportf_err(err, From patchwork Sat Oct 5 19:45:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 1993118 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=Xxw1BwAt; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XLbZS6jPBz1xtV for ; Sun, 6 Oct 2024 06:48:48 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxAk7-0005LY-9r; Sat, 05 Oct 2024 15:47:07 -0400 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 1sxAk4-0005J2-Er; Sat, 05 Oct 2024 15:47:04 -0400 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 1sxAk2-0007e7-WF; Sat, 05 Oct 2024 15:47:04 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-42cbb08a1a5so31348055e9.3; Sat, 05 Oct 2024 12:47:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728157620; x=1728762420; 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=+Fp8HwTIonO2XomuIOPjS+r/ipl54dMPaCsUxMaTJz4=; b=Xxw1BwAtRNDTgdRzKkKG45a/DhiEOQdBX1/y549Z4yu98eEZw/CcgiY2ziBjr12HZi YxuF3dMyY3wnpK7nLDiAzoNynNOIfnSkI+BV4GagxzO/jx8FI8sgX8oYxvqOK6bEhLkA F5Bc26FVL/gbrw5kdDEs37htcAlGJQg2wjPAoOynmm5WFXyZUcanXnuU9f8zgoAzzmpE +NBH4IH4JD6DUGjRgb3sbTvZiSBgEltcEgmhOlKNe1m/FsKWscO0DInIlupC3gWYPPd0 sH3q48rMWZGwptMBJ4JMP8r7W0p7BWlsZNPz4vfVbAPyWt773h47WYXvkhk3ndV+4yEx ub7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728157620; x=1728762420; 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=+Fp8HwTIonO2XomuIOPjS+r/ipl54dMPaCsUxMaTJz4=; b=HUahKX80ojJWr52/9xduej0NaoKTRjCG+lz7OIb5k/76NCC5XrabmrwQFCUIfuIvB0 pF8/XB7QfAipyGq2yGwpsu1LG8M60kZ7BCUIyCT+0jirpvwlYHh4vKRkv/kxcgjuCViu XWoOmUo3sF81vZnnbq1+BVVSa0y0uLqqyybjWZCtSX9ArtmlNhH6Dd/nVEXtaLIhEz+O 79ZwrOq63CMhCfN7199Y85DKTo/9cG9iqDrfcW4wj3LqdMtVIkenkUx2xygnycLf1Hba OYia4Zr42yZDcNX0C/vQ9w5E4ZJqwbAC/ULU7DavmLci0T+SWwgZsr1KvbHXyHhgnvhN yKcQ== X-Forwarded-Encrypted: i=1; AJvYcCVC7KgBC9/phY6DOOZHCjCTiohzFURPT4gL+BRnHfPlQgLXleRKGHDJLyW4hQ/zHp5WX0ShlhGAFP1p@nongnu.org, AJvYcCVS8nDE1Wd0HE9tBdaqGXxORpErG0xaU+5FKwa67Msesx5ux2A0ZKBzZUpkuPRgFCsrTUgAkXgwK4s=@nongnu.org X-Gm-Message-State: AOJu0YwSDO8gC/ZQneMpG/+bLAoSoWXEa6XdAITZdLyq2gGCH2QQpLiw u4139ICtJ77jzVR4uCtQt2tpLiq+z3Na2N3GwDhtzZDhM0eZGIaTfC7nbw== X-Google-Smtp-Source: AGHT+IEDxi7Jj6zagMzFN1e0/myWtE5IgAW2hv47W3MrPmBlC8GpjNNzpDKyypxcw3DFCZqEtTz4iw== X-Received: by 2002:a05:600c:138b:b0:42c:b950:680b with SMTP id 5b1f17b1804b1-42f8ddadbd3mr9167475e9.20.1728157619957; Sat, 05 Oct 2024 12:46:59 -0700 (PDT) Received: from archlinux.. (pd95ed790.dip0.t-ipconnect.de. [217.94.215.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42f86a0afc1sm47506775e9.1.2024.10.05.12.46.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 12:46:59 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Daniel Henrique Barboza , Nicholas Piggin , Bin Meng , Corey Minyard , Bernhard Beschow , qemu-ppc@nongnu.org, Alex Williamson , Hanna Reitz , Jason Wang , qemu-block@nongnu.org, Kevin Wolf , =?utf-8?q?Philippe_Ma?= =?utf-8?q?thieu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_?= =?utf-8?q?Goater?= Subject: [PATCH v2 05/23] hw/ppc/e500: Add missing device tree properties to i2c controller node Date: Sat, 5 Oct 2024 21:45:45 +0200 Message-ID: <20241005194603.23139-6-shentey@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241005194603.23139-1-shentey@gmail.com> References: <20241005194603.23139-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=shentey@gmail.com; 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org When compiling a decompiled device tree blob created with dumpdtb, dtc complains with: /soc@e0000000/i2c@3000: incorrect #address-cells for I2C bus /soc@e0000000/i2c@3000: incorrect #size-cells for I2C bus Fix this by adding the missing device tree properties. Reviewed-by: Cédric Le Goater Signed-off-by: Bernhard Beschow --- hw/ppc/e500.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index 228287b457..e2a4f265a5 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -196,6 +196,8 @@ static void dt_i2c_create(void *fdt, const char *soc, const char *mpic, qemu_fdt_setprop_cells(fdt, i2c, "cell-index", 0); qemu_fdt_setprop_cells(fdt, i2c, "interrupts", irq0, 0x2); qemu_fdt_setprop_phandle(fdt, i2c, "interrupt-parent", mpic); + qemu_fdt_setprop_cell(fdt, i2c, "#size-cells", 0); + qemu_fdt_setprop_cell(fdt, i2c, "#address-cells", 1); qemu_fdt_setprop_string(fdt, "/aliases", alias, i2c); g_free(i2c); From patchwork Sat Oct 5 19:45:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 1993139 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=ezrrNo1p; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XLbcp4Tw3z1xtN for ; Sun, 6 Oct 2024 06:50:50 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxAk8-0005MZ-Jm; Sat, 05 Oct 2024 15:47:08 -0400 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 1sxAk5-0005K4-LF; Sat, 05 Oct 2024 15:47:05 -0400 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 1sxAk4-0007eL-3P; Sat, 05 Oct 2024 15:47:05 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-42cc8782869so31362305e9.2; Sat, 05 Oct 2024 12:47:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728157622; x=1728762422; 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=AG+Y+5gJzuPsjRokhUJksRfJzuj5XbN634xFpFT8fEk=; b=ezrrNo1pl9TH2WFZb7giO34SWbcbt4WCvrNsRcMbv6VrcWmFA8ykxlMTz8MOKrQPiB 9Y6w4SwY8kdPcCpJfiwOaj04b5ICBvsOCYPfbDIKqS2YN8IzhoVwtSWqS2yMBN/0gR/m 2OkrB2PYOFm54g8iVaD8IJJdzTF1r0Bj4kG6NPqhi2WdIRT+qES0M1Xv9pwW79Jr2Alb mQ5i4zguLADC9ksudXKhJzFuAGtDaRvzfH4eprTGMkIZtCDeZT+FCloO3Bvx9HG8TeJj cKLIcw6WEmxpKoN3LjMHtdtXMKCqw3RcjNvcMnZEmnyMPidX0uC6HYiUBfiBzLqlgUkr uerA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728157622; x=1728762422; 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=AG+Y+5gJzuPsjRokhUJksRfJzuj5XbN634xFpFT8fEk=; b=Lv+CXRWD5B+5ZeieGuWObqPA0MeYdUaU5Gz3KWzGI3UKlKbTLpnfNOfOSGXkFHL7XC ed8l8Lo5HAwEP2cJoT7zF++q4QOu/B44ljs1Rhl4X2kb1E3l2YA1y3xWWPn062lWnYKE iabKsb64vQ5u01ZuPcVtvlLreSHgQtoAbIJZuY3/suGJ2zsO6p9SkwpIKiGtTWB4fXGQ NMgCtVhj6/o2G6ga5ANLOBSqrZulqXz4KP831+fzU89XnkkZrymOUFvH+zH4zBAdfNWa W61rFBpjTw3xMb7wDUmDVSWsbFdVmNksWiz4PcvZsTmu8OZ3i5Uy0M/g4m5kNwL5WCEF mZPw== X-Forwarded-Encrypted: i=1; AJvYcCUTtipvVMNwoLe23qi0pJLchig9+X5oUGOGU1T/h/SlL6RghuK6/nIXGuMOZS4d7W8MCQxleedEFlpZ@nongnu.org, AJvYcCWt5zcOJuqE/odyZAOvsJZ8j6oQSIG3dr05+KfU7TL4QN9cwFQkjgjAas15OXEgF6TQFk/FiKpkZzo=@nongnu.org X-Gm-Message-State: AOJu0YyPdPbwLCIPPVQOb8El1nCst0BZH6llRfzbIi8dduoqGdNoI/39 M8wSeVt1ENdeVFKtWj1eJ36TTyfRa492GooDC5Tu9uS6ZZkfgeJ0qDnZAg== X-Google-Smtp-Source: AGHT+IHMnlgDi28En56nIgJC30XNtmsxCf3ECZfv1iNq6CZdbVw+wP6zhfxEGZ/bWa2e77vqhXh14Q== X-Received: by 2002:a05:600c:3ca6:b0:42c:b5f1:44ff with SMTP id 5b1f17b1804b1-42f85ae92ffmr53387145e9.24.1728157621309; Sat, 05 Oct 2024 12:47:01 -0700 (PDT) Received: from archlinux.. (pd95ed790.dip0.t-ipconnect.de. [217.94.215.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42f86a0afc1sm47506775e9.1.2024.10.05.12.47.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 12:47:00 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Daniel Henrique Barboza , Nicholas Piggin , Bin Meng , Corey Minyard , Bernhard Beschow , qemu-ppc@nongnu.org, Alex Williamson , Hanna Reitz , Jason Wang , qemu-block@nongnu.org, Kevin Wolf , =?utf-8?q?Philippe_Ma?= =?utf-8?q?thieu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_?= =?utf-8?q?Goater?= , BALATON Zoltan Subject: [PATCH v2 06/23] hw/ppc/e500: Use SysBusDevice API to access TYPE_CCSR's internal resources Date: Sat, 5 Oct 2024 21:45:46 +0200 Message-ID: <20241005194603.23139-7-shentey@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241005194603.23139-1-shentey@gmail.com> References: <20241005194603.23139-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=shentey@gmail.com; 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Rather than accessing the attributes of TYPE_CCSR directly, use the SysBusDevice API which exists exactly for that purpose. Furthermore, registering the memory region with the SysBusDevice API makes it show up in QMP's `info qom-tree` command. Reviewed-by: BALATON Zoltan Signed-off-by: Bernhard Beschow --- hw/pci-host/ppce500.c | 10 +++++----- hw/ppc/e500.c | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c index 95b983b2b3..97e5d47cec 100644 --- a/hw/pci-host/ppce500.c +++ b/hw/pci-host/ppce500.c @@ -16,7 +16,6 @@ #include "qemu/osdep.h" #include "hw/irq.h" -#include "hw/ppc/e500-ccsr.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "hw/pci/pci_device.h" @@ -419,11 +418,12 @@ static const VMStateDescription vmstate_ppce500_pci = { static void e500_pcihost_bridge_realize(PCIDevice *d, Error **errp) { PPCE500PCIBridgeState *b = PPC_E500_PCI_BRIDGE(d); - PPCE500CCSRState *ccsr = CCSR(container_get(qdev_get_machine(), - "/e500-ccsr")); + SysBusDevice *ccsr = SYS_BUS_DEVICE(container_get(qdev_get_machine(), + "/e500-ccsr")); + MemoryRegion *ccsr_space = sysbus_mmio_get_region(ccsr, 0); - memory_region_init_alias(&b->bar0, OBJECT(ccsr), "e500-pci-bar0", &ccsr->ccsr_space, - 0, int128_get64(ccsr->ccsr_space.size)); + memory_region_init_alias(&b->bar0, OBJECT(ccsr), "e500-pci-bar0", + ccsr_space, 0, int128_get64(ccsr_space->size)); pci_register_bar(d, 0, PCI_BASE_ADDRESS_SPACE_MEMORY, &b->bar0); } diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index e2a4f265a5..2225533e33 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -924,7 +924,6 @@ void ppce500_init(MachineState *machine) DriveInfo *dinfo; MemoryRegion *ccsr_addr_space; SysBusDevice *s; - PPCE500CCSRState *ccsr; I2CBus *i2c; irqs = g_new0(IrqLines, smp_cpus); @@ -980,10 +979,10 @@ void ppce500_init(MachineState *machine) memory_region_add_subregion(address_space_mem, 0, machine->ram); dev = qdev_new("e500-ccsr"); + s = SYS_BUS_DEVICE(dev); object_property_add_child(OBJECT(machine), "e500-ccsr", OBJECT(dev)); - sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); - ccsr = CCSR(dev); - ccsr_addr_space = &ccsr->ccsr_space; + sysbus_realize_and_unref(s, &error_fatal); + ccsr_addr_space = sysbus_mmio_get_region(s, 0); memory_region_add_subregion(address_space_mem, pmc->ccsrbar_base, ccsr_addr_space); @@ -1270,6 +1269,7 @@ static void e500_ccsr_initfn(Object *obj) PPCE500CCSRState *ccsr = CCSR(obj); memory_region_init(&ccsr->ccsr_space, obj, "e500-ccsr", MPC8544_CCSRBAR_SIZE); + sysbus_init_mmio(SYS_BUS_DEVICE(ccsr), &ccsr->ccsr_space); } static const TypeInfo e500_ccsr_info = { From patchwork Sat Oct 5 19:45:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 1993130 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=f6fYmIvW; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XLbZy3dDlz1xtV for ; Sun, 6 Oct 2024 06:49:14 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxAkA-0005N6-Ns; Sat, 05 Oct 2024 15:47:10 -0400 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 1sxAk7-0005Lm-Bo; Sat, 05 Oct 2024 15:47:07 -0400 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 1sxAk5-0007ed-IY; Sat, 05 Oct 2024 15:47:07 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-42cc43454d5so24094545e9.3; Sat, 05 Oct 2024 12:47:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728157623; x=1728762423; 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=QNoaLfp9Rephm7oujz2od43Jyyd4r2WL4l9Tyqyvzdc=; b=f6fYmIvWwUg/UlLzrl6/uiFNF6CklrzOS4N551y6z2ya1nJmL6g9fpimYblJnUcIog AjnoovKGla3vCbX8cqLDL7Wvxgcl9+vf4pIUxAiwkALfvZzY9KmgI8y6PmlCpJePXZ1M 73Gd89/kzbsYCVGunjrbx1hsOGNRNSrDExqubGj1vvAX5A5e2iU1xynxteUCalsn8NyC MZdr4ztGoApscxwGMm5Cf6l7oeyUgnpUc2VOT4e2y6kctcz75xWpOw59eJvGLtyKyHmn NEj3a5fVK+iNDCm0RhknQuIS8u9BE4hB2BElHsZQngb5FLTusmEhtj9o4Vdfn2Ce4vn1 uRVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728157623; x=1728762423; 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=QNoaLfp9Rephm7oujz2od43Jyyd4r2WL4l9Tyqyvzdc=; b=jN+VdpqZPXT77/u+IcUTowmlndvFRxlQCj5en5KF8acHSqTaXmmHzE2lPrh5dPOOz3 1ndeavb8NmU0l6C4nmZlbmjhLKeHehmrhmg21naD/AvCPcpB6V6uBJIX5x9AazEeWV9y MpeDdbxAiUJHakFxzFaCGSuTQaNnGlGG/4fLIDh4tnwr6IqkmYUgqKH5UO+RxujRntcd s+iC9FjOdw1vZ/oQOQgEpZEq9xvFHIQwsaoFkxFLcZfHIZ86ssevy823tfqw8C9AQ84H 9vUsYitUAoQBJBHvbsbKqpS8mL0mmkATLsEg+6JIJ43rMS0iAhdyydR+qSRzi9On+u/x NtaA== X-Forwarded-Encrypted: i=1; AJvYcCVDVGT5aUSUoKPjXYkpsm/+WFkBmgxy7rNA/DeFJ3TcBe4VuzribzBWNal1R/MSv7RbxB65M0kQtS7z@nongnu.org, AJvYcCWmzXNGjMoYVUPnC5XmhBxzoIZwkfFukPfqQ+e5LrYk/y43J826r0l0EA6hjLQJmdBInm4zyjYh7No=@nongnu.org X-Gm-Message-State: AOJu0Ywk8jC/DK98gedA2PNzwCj12HbFj9tEcMQYsAbQBcBEjVQwOfca fxWKNIxFz7Ne4rQ0oGUpar8bzSnSRuZY25qJ21BECJTa5d3U/hXq2ynOiw== X-Google-Smtp-Source: AGHT+IFIstMrZf0lEY79h+aqA4ZH7TB7Oy7zwsEXKJoiJmIih8w6Gr3DWF8WGrmSayee6vzK0PPBWA== X-Received: by 2002:a05:600c:1907:b0:426:6326:4cec with SMTP id 5b1f17b1804b1-42f85af412bmr45597975e9.29.1728157622738; Sat, 05 Oct 2024 12:47:02 -0700 (PDT) Received: from archlinux.. (pd95ed790.dip0.t-ipconnect.de. [217.94.215.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42f86a0afc1sm47506775e9.1.2024.10.05.12.47.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 12:47:02 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Daniel Henrique Barboza , Nicholas Piggin , Bin Meng , Corey Minyard , Bernhard Beschow , qemu-ppc@nongnu.org, Alex Williamson , Hanna Reitz , Jason Wang , qemu-block@nongnu.org, Kevin Wolf , =?utf-8?q?Philippe_Ma?= =?utf-8?q?thieu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_?= =?utf-8?q?Goater?= Subject: [PATCH v2 07/23] hw/ppc/e500: Extract ppce500_ccsr.c Date: Sat, 5 Oct 2024 21:45:47 +0200 Message-ID: <20241005194603.23139-8-shentey@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241005194603.23139-1-shentey@gmail.com> References: <20241005194603.23139-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=shentey@gmail.com; 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The device model already has a header file, so extract its implementation into an accompanying source file like other e500 devices. While at it rename the header file to reflect the name of the structure defined there. This commit is also a preparation for the next commit. Signed-off-by: Bernhard Beschow --- MAINTAINERS | 2 +- hw/ppc/{e500-ccsr.h => ppce500_ccsr.h} | 8 +++--- hw/ppc/e500.c | 21 ++-------------- hw/ppc/ppce500_ccsr.c | 34 ++++++++++++++++++++++++++ hw/ppc/meson.build | 1 + 5 files changed, 42 insertions(+), 24 deletions(-) rename hw/ppc/{e500-ccsr.h => ppce500_ccsr.h} (71%) create mode 100644 hw/ppc/ppce500_ccsr.c diff --git a/MAINTAINERS b/MAINTAINERS index 34fffcb5be..f1755c8ad8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1382,7 +1382,7 @@ M: Bernhard Beschow L: qemu-ppc@nongnu.org S: Odd Fixes F: hw/ppc/e500* -F: hw/ppc/ppce500_spin.c +F: hw/ppc/ppce500_* F: hw/gpio/mpc8xxx.c F: hw/i2c/mpc_i2c.c F: hw/net/fsl_etsec/ diff --git a/hw/ppc/e500-ccsr.h b/hw/ppc/ppce500_ccsr.h similarity index 71% rename from hw/ppc/e500-ccsr.h rename to hw/ppc/ppce500_ccsr.h index 249c17be3b..36cbb811ca 100644 --- a/hw/ppc/e500-ccsr.h +++ b/hw/ppc/ppce500_ccsr.h @@ -1,13 +1,13 @@ -#ifndef E500_CCSR_H -#define E500_CCSR_H +#ifndef PPCE500_CCSR_H +#define PPCE500_CCSR_H #include "hw/sysbus.h" #include "qom/object.h" +#define MPC85XX_CCSRBAR_SIZE 0x00100000ULL + struct PPCE500CCSRState { - /*< private >*/ SysBusDevice parent; - /*< public >*/ MemoryRegion ccsr_space; }; diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index 2225533e33..74836ebb64 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -20,7 +20,7 @@ #include "qemu/guest-random.h" #include "qapi/error.h" #include "e500.h" -#include "e500-ccsr.h" +#include "ppce500_ccsr.h" #include "net/net.h" #include "qemu/config-file.h" #include "hw/block/flash.h" @@ -61,7 +61,6 @@ #define RAM_SIZES_ALIGN (64 * MiB) /* TODO: parameterize */ -#define MPC8544_CCSRBAR_SIZE 0x00100000ULL #define MPC8544_MPIC_REGS_OFFSET 0x40000ULL #define MPC8544_MSI_REGS_OFFSET 0x41600ULL #define MPC8544_SERIAL0_REGS_OFFSET 0x4500ULL @@ -532,7 +531,7 @@ static int ppce500_load_device_tree(PPCE500MachineState *pms, qemu_fdt_setprop_cell(fdt, soc, "#size-cells", 1); qemu_fdt_setprop_cells(fdt, soc, "ranges", 0x0, pmc->ccsrbar_base >> 32, pmc->ccsrbar_base, - MPC8544_CCSRBAR_SIZE); + MPC85XX_CCSRBAR_SIZE); /* XXX should contain a reasonable value */ qemu_fdt_setprop_cell(fdt, soc, "bus-frequency", 0); @@ -1264,21 +1263,6 @@ void ppce500_init(MachineState *machine) pms->boot_info.dt_size = dt_size; } -static void e500_ccsr_initfn(Object *obj) -{ - PPCE500CCSRState *ccsr = CCSR(obj); - memory_region_init(&ccsr->ccsr_space, obj, "e500-ccsr", - MPC8544_CCSRBAR_SIZE); - sysbus_init_mmio(SYS_BUS_DEVICE(ccsr), &ccsr->ccsr_space); -} - -static const TypeInfo e500_ccsr_info = { - .name = TYPE_CCSR, - .parent = TYPE_SYS_BUS_DEVICE, - .instance_size = sizeof(PPCE500CCSRState), - .instance_init = e500_ccsr_initfn, -}; - static const TypeInfo ppce500_info = { .name = TYPE_PPCE500_MACHINE, .parent = TYPE_MACHINE, @@ -1289,7 +1273,6 @@ static const TypeInfo ppce500_info = { static void e500_register_types(void) { - type_register_static(&e500_ccsr_info); type_register_static(&ppce500_info); } diff --git a/hw/ppc/ppce500_ccsr.c b/hw/ppc/ppce500_ccsr.c new file mode 100644 index 0000000000..5d0e1e0e89 --- /dev/null +++ b/hw/ppc/ppce500_ccsr.c @@ -0,0 +1,34 @@ +/* + * QEMU PowerPC E500 embedded processors CCSR space emulation + * + * Copyright (C) 2009 Freescale Semiconductor, Inc. All rights reserved. + * + * Author: Yu Liu, + * + * This is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ + +#include "qemu/osdep.h" +#include "ppce500_ccsr.h" + +static void ppce500_ccsr_init(Object *obj) +{ + PPCE500CCSRState *s = CCSR(obj); + + memory_region_init(&s->ccsr_space, obj, "e500-ccsr", MPC85XX_CCSRBAR_SIZE); + sysbus_init_mmio(SYS_BUS_DEVICE(s), &s->ccsr_space); +} + +static const TypeInfo types[] = { + { + .name = TYPE_CCSR, + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(PPCE500CCSRState), + .instance_init = ppce500_ccsr_init, + }, +}; + +DEFINE_TYPES(types) diff --git a/hw/ppc/meson.build b/hw/ppc/meson.build index 7cd9189869..43c746795a 100644 --- a/hw/ppc/meson.build +++ b/hw/ppc/meson.build @@ -81,6 +81,7 @@ ppc_ss.add(when: 'CONFIG_MPC8544DS', if_true: files('mpc8544ds.c')) ppc_ss.add(when: 'CONFIG_E500', if_true: files( 'e500.c', 'mpc8544_guts.c', + 'ppce500_ccsr.c', 'ppce500_spin.c' )) # PowerPC 440 Xilinx ML507 reference board. From patchwork Sat Oct 5 19:45:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 1993133 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=O+OL3r9Q; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XLbb66WNcz1xtV for ; Sun, 6 Oct 2024 06:49:22 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxAkM-0005Pu-Fd; Sat, 05 Oct 2024 15:47:23 -0400 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 1sxAkA-0005NG-PB; Sat, 05 Oct 2024 15:47:10 -0400 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 1sxAk7-0007f8-MA; Sat, 05 Oct 2024 15:47:09 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-42cbbb1727eso31679335e9.2; Sat, 05 Oct 2024 12:47:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728157625; x=1728762425; 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=uWbe6sy8YDQU8OuL8fDc3zUrDVgXUCz7bTnLrmpVA0c=; b=O+OL3r9QYCrYfNcG1Pt0yZMY2yRizxOSDqeiDYg9t49SAKVI8x9hvCRKpFfRxq9fdU TngPFio9VKKhvFZZIDd6M/uPtHtM/HljOKT/jE1rMS4Ga+FPnyVerFnzMNC2DgsXgjWN bDIrVFoK9790tFf8ubFelqgPQoizQm0exg5bQxf9sLqYsCUrqBHZx4xf28GmIBg+t+ap 1JPmeBltUoiouy1U866I3dbT388h0a5iyzio82fEHL8DjJMyZNNLpyz2VPkzckdvwW+T wxWtZw+cSYVbqc2sKPn96AOMf0i+SXF470LV8HxIa21gEi3atiVcEg+ihB6xT5IGaJZt jZ7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728157625; x=1728762425; 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=uWbe6sy8YDQU8OuL8fDc3zUrDVgXUCz7bTnLrmpVA0c=; b=LNRt3H9PvttWAziXp02dzqOVLyN8R1fmWjiDJVF1rafIzretAGeP7iE5qw8DBE3rAz 9Fu3dE2/+xQiW6zwWpiAoPxJy8IUkc6phVGkeiiko2Bzy7UmUELH5gaQpnYUAlpx2SAv Dggn1BstQgr+Et3OuzAs2lprXKPlIx/jgQMIZzz/vvystb+Fz+Xxatubm3pEcIihZVxi ijcKejiz5x+A1mDvjOjZWP55io84jqaRCTI9ah8ebkiYpP5PyWpa/23I1m65FzM4bG6K oX0CLkXA43NueEcBN6XdAC5A1ZdaMrtCjh9rdlihRzZ5H/nYfn6JDyGkxGvRLwnZqdIC Vvkw== X-Forwarded-Encrypted: i=1; AJvYcCUg8/6Bnz51uy8g7J7tIcJEstW7oBRimgJJmU9mlBkzBk/tb/FgY/z+yjug5w3N4dyuTSQHfJmTuecl@nongnu.org, AJvYcCV4ndNss7rP94KnQ7KWp+32pEvVC+GsPog438EUy4Sq4krjZwpzVzPVq+/AofyE+6T/5djbKbVP03k=@nongnu.org X-Gm-Message-State: AOJu0YxurlrtV/IkFJX1oCpEkFisydt6/b+TJoLxx+KIhSgnIBN/vx2S zAfYMYmoUiIMjV7MkMRbMKsX/aNpFa5x2TfFavTlwokUu94o62hgYbxhAQ== X-Google-Smtp-Source: AGHT+IG5g/rsq9seolLBlh/Iqe5qaVV5+tjlHe8Xnxx7UcmMrtqBcKJyRcVGC6FR0cLODd8FhnXWgA== X-Received: by 2002:a05:600c:4e86:b0:42f:5ca3:d784 with SMTP id 5b1f17b1804b1-42f85aae76dmr59578575e9.14.1728157624561; Sat, 05 Oct 2024 12:47:04 -0700 (PDT) Received: from archlinux.. (pd95ed790.dip0.t-ipconnect.de. [217.94.215.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42f86a0afc1sm47506775e9.1.2024.10.05.12.47.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 12:47:04 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Daniel Henrique Barboza , Nicholas Piggin , Bin Meng , Corey Minyard , Bernhard Beschow , qemu-ppc@nongnu.org, Alex Williamson , Hanna Reitz , Jason Wang , qemu-block@nongnu.org, Kevin Wolf , =?utf-8?q?Philippe_Ma?= =?utf-8?q?thieu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_?= =?utf-8?q?Goater?= Subject: [PATCH v2 08/23] hw/ppc/ppce500_ccsr: Log access to unimplemented registers Date: Sat, 5 Oct 2024 21:45:48 +0200 Message-ID: <20241005194603.23139-9-shentey@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241005194603.23139-1-shentey@gmail.com> References: <20241005194603.23139-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=shentey@gmail.com; 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The CCSR space is just a container which is meant to be covered by platform device memory regions. However, QEMU only implements a subset of these devices. Add some logging to see which devices a guest attempts to access. Signed-off-by: Bernhard Beschow --- hw/ppc/ppce500_ccsr.c | 32 +++++++++++++++++++++++++++++++- hw/ppc/trace-events | 3 +++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/hw/ppc/ppce500_ccsr.c b/hw/ppc/ppce500_ccsr.c index 5d0e1e0e89..6659560674 100644 --- a/hw/ppc/ppce500_ccsr.c +++ b/hw/ppc/ppce500_ccsr.c @@ -13,12 +13,42 @@ #include "qemu/osdep.h" #include "ppce500_ccsr.h" +#include "qemu/log.h" +#include "trace.h" + +static uint64_t ppce500_ccsr_io_read(void *opaque, hwaddr addr, unsigned size) +{ + uint64_t value = 0; + + trace_ppce500_ccsr_io_read(addr, value, size); + qemu_log_mask(LOG_UNIMP, + "%s: unimplemented [0x%" HWADDR_PRIx "] -> 0\n", + __func__, addr); + + return value; +} + +static void ppce500_ccsr_io_write(void *opaque, hwaddr addr, uint64_t value, + unsigned size) +{ + trace_ppce500_ccsr_io_write(addr, value, size); + qemu_log_mask(LOG_UNIMP, + "%s: unimplemented [0x%" HWADDR_PRIx "] <- 0x%" PRIx32 "\n", + __func__, addr, (uint32_t)value); +} + +static const MemoryRegionOps ppce500_ccsr_ops = { + .read = ppce500_ccsr_io_read, + .write = ppce500_ccsr_io_write, + .endianness = DEVICE_NATIVE_ENDIAN, +}; static void ppce500_ccsr_init(Object *obj) { PPCE500CCSRState *s = CCSR(obj); - memory_region_init(&s->ccsr_space, obj, "e500-ccsr", MPC85XX_CCSRBAR_SIZE); + memory_region_init_io(&s->ccsr_space, obj, &ppce500_ccsr_ops, obj, + "e500-ccsr", MPC85XX_CCSRBAR_SIZE); sysbus_init_mmio(SYS_BUS_DEVICE(s), &s->ccsr_space); } diff --git a/hw/ppc/trace-events b/hw/ppc/trace-events index 1f125ce841..ca4c231c9f 100644 --- a/hw/ppc/trace-events +++ b/hw/ppc/trace-events @@ -143,6 +143,9 @@ ppc_irq_cpu(const char *action) "%s" ppc_dcr_read(uint32_t addr, uint32_t val) "DRCN[0x%x] -> 0x%x" ppc_dcr_write(uint32_t addr, uint32_t val) "DRCN[0x%x] <- 0x%x" +ppce500_ccsr_io_read(uint32_t index, uint32_t val, uint8_t size) "[0x%" PRIx32 "] -> 0x%08x (size: 0x%" PRIu8 ")" +ppce500_ccsr_io_write(uint32_t index, uint32_t val, uint8_t size) "[0x%" PRIx32 "] <- 0x%08x (size: 0x%" PRIu8 ")" + # prep_systemio.c prep_systemio_read(uint32_t addr, uint32_t val) "read addr=0x%x val=0x%x" prep_systemio_write(uint32_t addr, uint32_t val) "write addr=0x%x val=0x%x" From patchwork Sat Oct 5 19:45:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 1993125 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=hB7qymWJ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XLbZp6s3Bz1xtV for ; Sun, 6 Oct 2024 06:49:06 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxAkO-0005S2-CY; Sat, 05 Oct 2024 15:47:24 -0400 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 1sxAkC-0005Nh-59; Sat, 05 Oct 2024 15:47:14 -0400 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 1sxAk8-0007fG-U3; Sat, 05 Oct 2024 15:47:11 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-42cd74c0d16so31425425e9.1; Sat, 05 Oct 2024 12:47:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728157626; x=1728762426; 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=w+XxmN8aD/MZ6DGzlhF4E6QfY0KHf9UNl0Gr9lvIaYE=; b=hB7qymWJDBYO9eR7JvhaZ681VDYse6aU+va8/2Hs7HPsTEPCJ8O5EBfSj9ITwaf7zq 5xlXeyzvNao2oNL43LUsG4sVFZJgMv7OSvCM1xosgzNLAVXMPwwZtsvvRPpX4ODia1F6 TfhzPz6YpURLcgZD0QBImTEF8hYyc9T3tF+/y74re0I+KOr5OnDKS8FPuvFq2PZLcvEc Djy90lFOOjFnv1niIWFZaQeHaPSpiCAeeME1D0q8m1qOsDAlNFU1MkgP+W64bgKHDxgY zoKx9aTKVYN9PZtfcgxSw5JaqEaV7TiMcX8p4bWzY84MXkgoa34rx1GADhoZzBOfzzF/ SZww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728157626; x=1728762426; 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=w+XxmN8aD/MZ6DGzlhF4E6QfY0KHf9UNl0Gr9lvIaYE=; b=cLiWdqzJ+bX/vAmcGPcHIaJ7RRRkTwQIEiuNR4nm60CVJcWGwRl+aiTD+pBSYvQRVz ew1gsYnz3Cs8pMCRNt9ALPceO7t34i7PqSYWOsmoOM2BTumsSr1oEgstiFZtWBsAFT4/ Ovuz51XAPp1N48vxYvMPBaCn/dMdcQZRnCwnK+VE0CP7ZN8d693WMSlTQJKuuUlytSjj 2q0E2n3z7z/3KgPnl1Pkxk5ce18koXwJk4NbqvqRnAdiSDoIRyvoHS0T66YJ1N1IcgIy NUFpBhM721A5iNatg1AAJRpaYdaBVDz95h07W0y3NpXZ1SJSq3Q+swShkrDVCwfHJtx7 k50g== X-Forwarded-Encrypted: i=1; AJvYcCVOlFjla8vdGh53AgbilTfcECYzKZZTsO47AyphYJMfLEpCvDXJHBqKFjQLQMy9FBys65hBZsZ+y4d/@nongnu.org, AJvYcCWm3V3wXjkQQkAUtB2WCOErqPcfLPPwQr3fEWAbgqfW46ystMAWQSv28ECycTYUBN0t7QNI5E/AiO8=@nongnu.org X-Gm-Message-State: AOJu0YyaY084xNv6y5ru7njuHPO/emI1ytbNUxVtP4BPjjnZcuox5Ydz 8EqXVo0rADveFKSXJ64/Ul5l88lF/pY7Mhz+nHxylr0nohY7NnTOGwQcbg== X-Google-Smtp-Source: AGHT+IF6LakbRBuk2PKoeaM+x98od3+6dNX5dPx9nGmSnBzmoj/+W8+58VaL74PBpL0eWovVGY0sTA== X-Received: by 2002:a05:600c:3c83:b0:42c:b037:5fce with SMTP id 5b1f17b1804b1-42f85a6c5d5mr52557465e9.3.1728157625983; Sat, 05 Oct 2024 12:47:05 -0700 (PDT) Received: from archlinux.. (pd95ed790.dip0.t-ipconnect.de. [217.94.215.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42f86a0afc1sm47506775e9.1.2024.10.05.12.47.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 12:47:05 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Daniel Henrique Barboza , Nicholas Piggin , Bin Meng , Corey Minyard , Bernhard Beschow , qemu-ppc@nongnu.org, Alex Williamson , Hanna Reitz , Jason Wang , qemu-block@nongnu.org, Kevin Wolf , =?utf-8?q?Philippe_Ma?= =?utf-8?q?thieu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_?= =?utf-8?q?Goater?= Subject: [PATCH v2 09/23] hw/ppc/mpc8544_guts: Populate POR PLL ratio status register Date: Sat, 5 Oct 2024 21:45:49 +0200 Message-ID: <20241005194603.23139-10-shentey@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241005194603.23139-1-shentey@gmail.com> References: <20241005194603.23139-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=shentey@gmail.com; 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Populate this read-only register with some arbitrary values which avoids U-Boot's get_clocks() to hang(). Signed-off-by: Bernhard Beschow Reviewed-by: BALATON Zoltan --- hw/ppc/mpc8544_guts.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hw/ppc/mpc8544_guts.c b/hw/ppc/mpc8544_guts.c index e3540b0281..c02b34ccde 100644 --- a/hw/ppc/mpc8544_guts.c +++ b/hw/ppc/mpc8544_guts.c @@ -29,6 +29,12 @@ #define MPC8544_GUTS_RSTCR_RESET 0x02 #define MPC8544_GUTS_ADDR_PORPLLSR 0x00 +REG32(GUTS_PORPLLSR, 0x00) + FIELD(GUTS_PORPLLSR, E500_1_RATIO, 24, 6) + FIELD(GUTS_PORPLLSR, E500_0_RATIO, 16, 6) + FIELD(GUTS_PORPLLSR, DDR_RATIO, 9, 5) + FIELD(GUTS_PORPLLSR, PLAT_RATIO, 1, 5) + #define MPC8544_GUTS_ADDR_PORBMSR 0x04 #define MPC8544_GUTS_ADDR_PORIMPSCR 0x08 #define MPC8544_GUTS_ADDR_PORDEVSR 0x0C @@ -75,6 +81,12 @@ static uint64_t mpc8544_guts_read(void *opaque, hwaddr addr, addr &= MPC8544_GUTS_MMIO_SIZE - 1; switch (addr) { + case MPC8544_GUTS_ADDR_PORPLLSR: + value = FIELD_DP32(value, GUTS_PORPLLSR, E500_1_RATIO, 6); /* 3:1 */ + value = FIELD_DP32(value, GUTS_PORPLLSR, E500_0_RATIO, 6); /* 3:1 */ + value = FIELD_DP32(value, GUTS_PORPLLSR, DDR_RATIO, 12); /* 12:1 */ + value = FIELD_DP32(value, GUTS_PORPLLSR, PLAT_RATIO, 6); /* 6:1 */ + break; case MPC8544_GUTS_ADDR_PVR: value = env->spr[SPR_PVR]; break; From patchwork Sat Oct 5 19:45:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 1993137 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=m7g43lRQ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XLbbr4W5Rz1xtV for ; Sun, 6 Oct 2024 06:50:00 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxAkI-0005Ok-Gu; Sat, 05 Oct 2024 15:47:19 -0400 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 1sxAkD-0005Nl-Sw; Sat, 05 Oct 2024 15:47:14 -0400 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 1sxAkB-0007fb-6E; Sat, 05 Oct 2024 15:47:13 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-42cc8782869so31362605e9.2; Sat, 05 Oct 2024 12:47:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728157628; x=1728762428; 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=kmPlGvENuR506VnaTPZdPC+ldftCElBorI3DqzYxhaE=; b=m7g43lRQcH4BNfZMMx9JcdxBuq0bDoObF5ozfqg2rbsTJ5jUwtF7CEGqpLykTk4d8H DqbvVFMzZjrOjxDfKCmS1aarlAGG9/+KU9eNujRMFlxMjkTrhXQoFnhMdVa/YPfsbLRu KC0BQgRGsU/AnjdnJwx27smDLOiCQKXteuVdJmacQEpuRBBxnrcxgZaZDAWKupT8i82x DHWYCjStxLfyzz1obSdxn5D7mG1qRD7TVvkW7u9WUDrdBGl8jV263EvimUSTEKAnZYTp P1qEVSkOmuXIwjuuaXjPZ11Fr+NHulG3fLAyFSgsp9oHyXNyx0zpnAhoF6SY7wShSl/H sHRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728157628; x=1728762428; 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=kmPlGvENuR506VnaTPZdPC+ldftCElBorI3DqzYxhaE=; b=bb0E3z5/1hEebiQnOAVN4uQ3+XZqlzviG18568qa8EI7vhBPDO2ehQYojp5SK8DJkv UnfDH/I7g9cYVvXyIyLYX5YZgp9TBRIZdeZbSepvte3+HebroJwt+XGxrbw4RLlnEOmx aXJNCyIzyLh8ov4aQOZaOSdSsLFaHAzPvwbtcsNKKHwGvgwoNwxc1SVnfJm6aFtb3xRU DZMeP6QASUp2ra2FrceEdktvqIVhyrp9UrwWeS4/2H2xTyw+Lw0eD7HlzXBW7ruv03FZ +ytdmq/ihoxroTP3jmxKrs6dqWjSmI7v7KYXw1UDyKqtNLh0I0+rl2i7hlUKI2IkSRss t4eQ== X-Forwarded-Encrypted: i=1; AJvYcCUNGR7xRfdev4jpLr5S9IA36BDQa8l3RsTnT8HxwzDeUQNlAvZkcQsoJR1otx/rNPOBMKSZoBF5Uh4=@nongnu.org, AJvYcCW7ucrVBe0Gh/8dz887XKiGVRI1ZvIYFLx8jMAwhbc0luYP4yVHAM81zLP4yZNaO3wCwkgWE++r5URa@nongnu.org X-Gm-Message-State: AOJu0YzMabCmkh3ataHG9CKdlqxb9s/qxPi+YGLueFK/TZzD9qiTc6HQ ktKwZ7jDdW09iouv7TRjkTBAn0eSAZQwskCoEQ/6OG6Wsa4/jdbwY9a4Ew== X-Google-Smtp-Source: AGHT+IHCsiwuPA/bhLZdggdOI4/TTDTLJzSH3fEg5GRZT8UWre2zyV9P0+AYxzv9bouG3BcBq/RJRQ== X-Received: by 2002:a05:600c:5105:b0:42c:b22e:fc2e with SMTP id 5b1f17b1804b1-42f85ab6657mr44233995e9.15.1728157627484; Sat, 05 Oct 2024 12:47:07 -0700 (PDT) Received: from archlinux.. (pd95ed790.dip0.t-ipconnect.de. [217.94.215.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42f86a0afc1sm47506775e9.1.2024.10.05.12.47.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 12:47:07 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Daniel Henrique Barboza , Nicholas Piggin , Bin Meng , Corey Minyard , Bernhard Beschow , qemu-ppc@nongnu.org, Alex Williamson , Hanna Reitz , Jason Wang , qemu-block@nongnu.org, Kevin Wolf , =?utf-8?q?Philippe_Ma?= =?utf-8?q?thieu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_?= =?utf-8?q?Goater?= Subject: [PATCH v2 10/23] hw/i2c/mpc_i2c: Convert DPRINTF to trace events for register access Date: Sat, 5 Oct 2024 21:45:50 +0200 Message-ID: <20241005194603.23139-11-shentey@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241005194603.23139-1-shentey@gmail.com> References: <20241005194603.23139-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=shentey@gmail.com; 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Reviewed-by: Cédric Le Goater Signed-off-by: Bernhard Beschow --- hw/i2c/mpc_i2c.c | 9 +++++---- hw/i2c/trace-events | 5 +++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/hw/i2c/mpc_i2c.c b/hw/i2c/mpc_i2c.c index 2467d1a9aa..3d79c15653 100644 --- a/hw/i2c/mpc_i2c.c +++ b/hw/i2c/mpc_i2c.c @@ -24,6 +24,7 @@ #include "hw/sysbus.h" #include "migration/vmstate.h" #include "qom/object.h" +#include "trace.h" /* #define DEBUG_I2C */ @@ -224,8 +225,8 @@ static uint64_t mpc_i2c_read(void *opaque, hwaddr addr, unsigned size) break; } - DPRINTF("%s: addr " HWADDR_FMT_plx " %02" PRIx32 "\n", __func__, - addr, value); + trace_mpc_i2c_read(addr, value); + return (uint64_t)value; } @@ -234,8 +235,8 @@ static void mpc_i2c_write(void *opaque, hwaddr addr, { MPCI2CState *s = opaque; - DPRINTF("%s: addr " HWADDR_FMT_plx " val %08" PRIx64 "\n", __func__, - addr, value); + trace_mpc_i2c_write(addr, value); + switch (addr) { case MPC_I2C_ADR: s->adr = value & CADR_MASK; diff --git a/hw/i2c/trace-events b/hw/i2c/trace-events index 6900e06eda..f708a7ace1 100644 --- a/hw/i2c/trace-events +++ b/hw/i2c/trace-events @@ -35,6 +35,11 @@ aspeed_i2c_bus_write(uint32_t busid, uint64_t offset, unsigned size, uint64_t va aspeed_i2c_bus_send(const char *mode, int i, int count, uint8_t byte) "%s send %d/%d 0x%02x" aspeed_i2c_bus_recv(const char *mode, int i, int count, uint8_t byte) "%s recv %d/%d 0x%02x" +# mpc_i2c.c + +mpc_i2c_read(uint64_t addr, uint32_t value) "[0x%" PRIx64 "] -> 0x%02" PRIx32 +mpc_i2c_write(uint64_t addr, uint32_t value) "[0x%" PRIx64 "] <- 0x%02" PRIx32 + # npcm7xx_smbus.c npcm7xx_smbus_read(const char *id, uint64_t offset, uint64_t value, unsigned size) "%s offset: 0x%04" PRIx64 " value: 0x%02" PRIx64 " size: %u" From patchwork Sat Oct 5 19:45:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 1993121 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=JizyVPHX; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XLbZb4HM7z1xtV for ; Sun, 6 Oct 2024 06:48:55 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxAkP-0005TV-Ku; Sat, 05 Oct 2024 15:47:26 -0400 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 1sxAkE-0005O7-Hu; Sat, 05 Oct 2024 15:47:15 -0400 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 1sxAkC-0007fr-GL; Sat, 05 Oct 2024 15:47:14 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-42cb1e623d1so31529625e9.0; Sat, 05 Oct 2024 12:47:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728157629; x=1728762429; 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=Qh7tx41xIteOcANyWopZzt4/cC1snPfQD4qcl5bcIW8=; b=JizyVPHXJ8gfwrx0ppujRkwojUdBfXY9ICsITIWEs+/4/W6j90OmsloonvgAqfOxNz hDplGd/NksBsuxbU7UdRqr9GHceF2oQdsCKRtCRnwIPb5x0TxjlE3lfSBAc7xBqrwJxD XHfRcn4df+BYgrua8Mv85xGeGe2cEutvf4/ZbOW0VpOz7pha0HgBbUpYcNyEK7jyeCol XiYi3dlobOUY6FcoXknkVWBNrwKCo4al45/Wl/8PLxWryUmdGpobk5WYWbAFFbs8L3cv u98QI3CoD1pdZl28egtAUybd1+8p0XVtR3SfUmpdf0bdmWz10PeJ+ZBdBM+cOHeNKCo+ 4+JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728157629; x=1728762429; 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=Qh7tx41xIteOcANyWopZzt4/cC1snPfQD4qcl5bcIW8=; b=qgyFcA0FKnlkPKOjZ9raZ4ZST/69OO/YgGpTK9bzuVaVNwKWc6dwJZNpbIiBMTxz0J 8BdkZ9jDKTZ85+HG5oLOcpi2xgE9Dc1OgePD86Q8FGriMATR4fCn5xoAIk0HnS8u87rD Hd3AjBMsb4uV6rODNJGMpS6/Qf7MYSGqJStsagTenVoq1S4Pkm7bcl7aVUJDP3LVPGc/ sjNDSL66mBFxz28CpkY3Tsj3XjkL0/c97Leg64HRsna85pbZc4+JQpVtpVX+Fuxi1u3V E60rutksMMUM5YAE/QR49GsoRpwNKlT9wjuNRpb17svnpgw1f5I0eCCwuVisJ6M+AWQj laCQ== X-Forwarded-Encrypted: i=1; AJvYcCUb3Qjz+Tm69Gjo5FmgdCsMVKU/8RFDp+6J9FrNbmNoRC/Ns6z+PsHhgtXKNHF2/zTKCwNq15LWTnfD@nongnu.org, AJvYcCWKxjBYupjMywDbz04ut8lhvqWUXlKMukjlEkvMDNtH5F6hBpmmFR+EW++O5LHXPk/PiKL8YbEVjdI=@nongnu.org X-Gm-Message-State: AOJu0YyCYSrdy4PrrUGs/9aMnU7c9cDoBmAfWtTWjdOT+7Pn/l7/u03E vZGJyQGl5jSxAgX2277lTqb3HcOCP/Bj90GUD6A8RS0I+pYeiAfw7PJyyw== X-Google-Smtp-Source: AGHT+IGoOikjyZCfqd9MKVTNZdx0xQAGHh5DrtmXeoQjDG5qgsCI8Y8L0BBW+aqYvNZZf/70UbBTZQ== X-Received: by 2002:a05:600c:5246:b0:42f:4f6:f8bc with SMTP id 5b1f17b1804b1-42f85aa6a64mr57467415e9.9.1728157628878; Sat, 05 Oct 2024 12:47:08 -0700 (PDT) Received: from archlinux.. (pd95ed790.dip0.t-ipconnect.de. [217.94.215.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42f86a0afc1sm47506775e9.1.2024.10.05.12.47.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 12:47:08 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Daniel Henrique Barboza , Nicholas Piggin , Bin Meng , Corey Minyard , Bernhard Beschow , qemu-ppc@nongnu.org, Alex Williamson , Hanna Reitz , Jason Wang , qemu-block@nongnu.org, Kevin Wolf , =?utf-8?q?Philippe_Ma?= =?utf-8?q?thieu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_?= =?utf-8?q?Goater?= Subject: [PATCH v2 11/23] hw/i2c/mpc_i2c: Prefer DEFINE_TYPES() macro Date: Sat, 5 Oct 2024 21:45:51 +0200 Message-ID: <20241005194603.23139-12-shentey@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241005194603.23139-1-shentey@gmail.com> References: <20241005194603.23139-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=shentey@gmail.com; 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Reviewed-by: Cédric Le Goater Signed-off-by: Bernhard Beschow --- hw/i2c/mpc_i2c.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/hw/i2c/mpc_i2c.c b/hw/i2c/mpc_i2c.c index 3d79c15653..16f4309ea9 100644 --- a/hw/i2c/mpc_i2c.c +++ b/hw/i2c/mpc_i2c.c @@ -20,7 +20,6 @@ #include "qemu/osdep.h" #include "hw/i2c/i2c.h" #include "hw/irq.h" -#include "qemu/module.h" #include "hw/sysbus.h" #include "migration/vmstate.h" #include "qom/object.h" @@ -345,16 +344,13 @@ static void mpc_i2c_class_init(ObjectClass *klass, void *data) dc->desc = "MPC I2C Controller"; } -static const TypeInfo mpc_i2c_type_info = { - .name = TYPE_MPC_I2C, - .parent = TYPE_SYS_BUS_DEVICE, - .instance_size = sizeof(MPCI2CState), - .class_init = mpc_i2c_class_init, +static const TypeInfo types[] = { + { + .name = TYPE_MPC_I2C, + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(MPCI2CState), + .class_init = mpc_i2c_class_init, + }, }; -static void mpc_i2c_register_types(void) -{ - type_register_static(&mpc_i2c_type_info); -} - -type_init(mpc_i2c_register_types) +DEFINE_TYPES(types) From patchwork Sat Oct 5 19:45:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 1993154 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=d3anrNlW; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XLbdV6B8Kz1xtN for ; Sun, 6 Oct 2024 06:51:26 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxAkR-0005X1-8W; Sat, 05 Oct 2024 15:47:27 -0400 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 1sxAkF-0005OM-3y; Sat, 05 Oct 2024 15:47:15 -0400 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 1sxAkC-0007gC-Ok; Sat, 05 Oct 2024 15:47:14 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-37cc60c9838so1773140f8f.1; Sat, 05 Oct 2024 12:47:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728157630; x=1728762430; 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=tV4roYq++fPVNjDJH3OXVG1IWov9RJmtNt7xuyalb90=; b=d3anrNlWdkZMbAMfHr6mF3Gax9uwN9VxWlv+n+twd4LUuj8cdL4zvI9s/As9lKr4Ci 0GefztIBJCF/8VIaXKruE6VZThCC+gLTl4reWpX+kOVQlh2KtDWD9U5Y9uYJ74xbpIrY dHV1xRntfxYENgEH1YJ8NsFhYbe7ApaHWxfypP5aPng3Q/m2Ac7UC9mXqwNfwvC7dTHk UCaCMwEXciAcxMND1WXj9lrdUNtn4iU9PYyNyB2kQnB0ARM6xGCsLuBy+lCg/yGW3z7q HpT/jcZ/hSMqxVphGn+gX9s4gYebr2BWz15NX1JGwb49/ABOUeD52AjPBL+p+EtBbMVR QIKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728157630; x=1728762430; 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=tV4roYq++fPVNjDJH3OXVG1IWov9RJmtNt7xuyalb90=; b=qexbedC6AMghb1hZ43s8axDbW+cC8b3dQeg2PMdT/Oyz1ll/W4tl54TjQDrrFpTxiP pi4eF3VXyg1XK9cXIELz0wmhBl5n3oovsoQOkreiIm1zwVb8O1M5bkzxzrWRV9wvYWgm 5by6xs/aG0h+ItQSgTDWke21HyKxuaS2DkfaFuJdgbwN/LEr4FnXkgVAAvs1lr6EIGZl /lRgALBCddAUaqi7atQcTQUowUqb/ALnFKTSIBZ5Tp7aXzG1Y7vWTIeYXbqeFodCqXj/ 3KVNej2N4hNvxeflvHJUkCrogqv+BOvdrV+d0dtON5pV6ltwgDMuv8YCDzs0ZTln9S4s +xWA== X-Forwarded-Encrypted: i=1; AJvYcCUwWq4y41u+9XVtOy+oKQS0po88/N9O1TQ2kebzTS4wvFWDw4CVnMKJD42r8gtK4bx1oiixK2L0nmgw@nongnu.org, AJvYcCVk4t8MflFGHnVK68UJPetqwlCyk8BVaOEn8kTAR4vwZcxZN+FcBP6aiBfC39/wwYSC0B4lYkKodJA=@nongnu.org X-Gm-Message-State: AOJu0YxGgAqZ/B+zZ4X87YhQvbrbtcff02y8YJKoYoANMdSXrDaF0Z59 9erxRQV9b81gXDFv16sOZSc3u6wB7lQFb3oyeswar4JNiOkx5a8CFTOJCA== X-Google-Smtp-Source: AGHT+IFIgwdq4hJJ6vgrn3ijzy2QYQI2gqfswWOBo3bVMtrVrKm1+RYkBMbeY6Tns6dc8nT+gzQU2Q== X-Received: by 2002:adf:ee49:0:b0:374:b9ca:f1e8 with SMTP id ffacd0b85a97d-37d04a577f7mr6777001f8f.20.1728157630235; Sat, 05 Oct 2024 12:47:10 -0700 (PDT) Received: from archlinux.. (pd95ed790.dip0.t-ipconnect.de. [217.94.215.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42f86a0afc1sm47506775e9.1.2024.10.05.12.47.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 12:47:09 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Daniel Henrique Barboza , Nicholas Piggin , Bin Meng , Corey Minyard , Bernhard Beschow , qemu-ppc@nongnu.org, Alex Williamson , Hanna Reitz , Jason Wang , qemu-block@nongnu.org, Kevin Wolf , =?utf-8?q?Philippe_Ma?= =?utf-8?q?thieu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_?= =?utf-8?q?Goater?= , BALATON Zoltan Subject: [PATCH v2 12/23] hw/pci-host/ppce500: Reuse TYPE_PPC_E500_PCI_BRIDGE define Date: Sat, 5 Oct 2024 21:45:52 +0200 Message-ID: <20241005194603.23139-13-shentey@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241005194603.23139-1-shentey@gmail.com> References: <20241005194603.23139-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=shentey@gmail.com; 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Prefer a macro rather than a string literal when instantiaging device models. Reviewed-by: BALATON Zoltan Signed-off-by: Bernhard Beschow --- hw/pci-host/ppce500.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c index 97e5d47cec..d7ff2ba778 100644 --- a/hw/pci-host/ppce500.c +++ b/hw/pci-host/ppce500.c @@ -475,7 +475,7 @@ static void e500_pcihost_realize(DeviceState *dev, Error **errp) address_space_init(&s->bm_as, &s->bm, "pci-bm"); pci_setup_iommu(b, &ppce500_iommu_ops, s); - pci_create_simple(b, 0, "e500-host-bridge"); + pci_create_simple(b, 0, TYPE_PPC_E500_PCI_BRIDGE); memory_region_init(&s->container, OBJECT(h), "pci-container", PCIE500_ALL_SIZE); memory_region_init_io(&h->conf_mem, OBJECT(h), &pci_host_conf_be_ops, h, From patchwork Sat Oct 5 19:45:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 1993111 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=NfA3ItMR; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XLbYd4rNdz1xtV for ; Sun, 6 Oct 2024 06:48:05 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxAkU-0005Zz-0N; Sat, 05 Oct 2024 15:47:30 -0400 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 1sxAkG-0005Ol-Cs; Sat, 05 Oct 2024 15:47:18 -0400 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 1sxAkE-0007gs-Tj; Sat, 05 Oct 2024 15:47:16 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-42cb60aff1eso30988975e9.0; Sat, 05 Oct 2024 12:47:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728157632; x=1728762432; 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=rIGcIV5oEe21ffMfXv8dxIlxwIuJMnLBjp2bLHMXYyE=; b=NfA3ItMRdKacBQGo7lUp+OU1NoQkH4pWzoJa33yLMzTnh6ZsWqM3LEKTmFI7wG6zGm v0B16dkBgAU4jD0GD4MhKRLHVpIr987orQGgJ07yVDn93ZI9r1tKFzdlkHHO0brsFCHr AgVaMHwGdWBKQrKAwIuP5a21a5q6UtXLXASMwdCr3njhQprs0jcurMFpOd0QB12kNTRS iUNKG600V/U0hVyiYt9NqobwTQNRV9IdgTE197gi13ny+Vyt0FLyKQH4TrOZ2UCHQLn3 Uacn3oc/LD8i/G5440C3kf3g8TZEz04mw2ySMLCFt4dk5WrUzTCVgHufLMv0meXtWMNP 0KPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728157632; x=1728762432; 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=rIGcIV5oEe21ffMfXv8dxIlxwIuJMnLBjp2bLHMXYyE=; b=fAhdX6DkXvu64QPYsGj/WbwpOsNYWgCJ2O8lz0qgHArpj1I7khjFSGcDoYaoUF0H+o 6dBduQjopFhZnXLD5nvXHtlBcTN0K7cl3XaJvdWJqvD+AMA58zA+GTa9kEXHBRLFD4TA pN1+q3V4HiT9jZTxs1FqZPEsp5zTYhSqx3nYaWzPjif5AgkNrlRs3JrbpmBw2fTQp0AO HnTu3n2RiUDYgaBQsCn+VXpKg+JvAJKHfq+ZjCb8CRmBCRFrkJ3GKW783TMwEu2xaX2K sim2uiouv1xKo9gsaFsGqOJmIZrGtW5umnumJLetXjaxN9U9AGdfY1gQd2uoP5ULbNdH KVow== X-Forwarded-Encrypted: i=1; AJvYcCU693SOcoc2NcJ9NNqhjuu61eav68u52a/aZup9k7ewSQW9qElm8iEUn687z3GoAwBw5u+GGeJ1RdTy@nongnu.org, AJvYcCWRsxPK6fDuQuj4zDR3VtSzbhkClaIm6sq2LQQFz5cn34NNo2wqPYHbDLjEeHOlROaVrZi8cVQ0kQg=@nongnu.org X-Gm-Message-State: AOJu0YyZQ7h5ztpXuTXcjMfqQG6i8e3zxjPAFcpYVtNSGEyfuRedPbGS sj8HssjXiPVuuTBvfkRENBHE955hEEaVY7++1uyTCacjJB6U5HsR/rv5cw== X-Google-Smtp-Source: AGHT+IFBb4h3bokBRGeh62r3lJN2PulGsDWevBVTB/zYylw5emGjhGnCRMYB1CELyd6DR+2zRo5v5w== X-Received: by 2002:a05:600c:1906:b0:42c:c4c8:7090 with SMTP id 5b1f17b1804b1-42f85aa7b0emr56531595e9.9.1728157631770; Sat, 05 Oct 2024 12:47:11 -0700 (PDT) Received: from archlinux.. (pd95ed790.dip0.t-ipconnect.de. [217.94.215.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42f86a0afc1sm47506775e9.1.2024.10.05.12.47.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 12:47:11 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Daniel Henrique Barboza , Nicholas Piggin , Bin Meng , Corey Minyard , Bernhard Beschow , qemu-ppc@nongnu.org, Alex Williamson , Hanna Reitz , Jason Wang , qemu-block@nongnu.org, Kevin Wolf , =?utf-8?q?Philippe_Ma?= =?utf-8?q?thieu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_?= =?utf-8?q?Goater?= Subject: [PATCH v2 13/23] hw/pci-host/ppce500: Prefer DEFINE_TYPES() macro Date: Sat, 5 Oct 2024 21:45:53 +0200 Message-ID: <20241005194603.23139-14-shentey@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241005194603.23139-1-shentey@gmail.com> References: <20241005194603.23139-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=shentey@gmail.com; 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Reviewed-by: Cédric Le Goater Signed-off-by: Bernhard Beschow --- hw/pci-host/ppce500.c | 42 ++++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c index d7ff2ba778..1ce79ea20c 100644 --- a/hw/pci-host/ppce500.c +++ b/hw/pci-host/ppce500.c @@ -21,7 +21,6 @@ #include "hw/pci/pci_device.h" #include "hw/pci/pci_host.h" #include "qemu/bswap.h" -#include "qemu/module.h" #include "hw/pci-host/ppce500.h" #include "qom/object.h" @@ -508,17 +507,6 @@ static void e500_host_bridge_class_init(ObjectClass *klass, void *data) dc->user_creatable = false; } -static const TypeInfo e500_host_bridge_info = { - .name = TYPE_PPC_E500_PCI_BRIDGE, - .parent = TYPE_PCI_DEVICE, - .instance_size = sizeof(PPCE500PCIBridgeState), - .class_init = e500_host_bridge_class_init, - .interfaces = (InterfaceInfo[]) { - { INTERFACE_CONVENTIONAL_PCI_DEVICE }, - { }, - }, -}; - static Property pcihost_properties[] = { DEFINE_PROP_UINT32("first_slot", PPCE500PCIState, first_slot, 0x11), DEFINE_PROP_UINT32("first_pin_irq", PPCE500PCIState, first_pin_irq, 0x1), @@ -535,17 +523,23 @@ static void e500_pcihost_class_init(ObjectClass *klass, void *data) dc->vmsd = &vmstate_ppce500_pci; } -static const TypeInfo e500_pcihost_info = { - .name = TYPE_PPC_E500_PCI_HOST_BRIDGE, - .parent = TYPE_PCI_HOST_BRIDGE, - .instance_size = sizeof(PPCE500PCIState), - .class_init = e500_pcihost_class_init, +static const TypeInfo types[] = { + { + .name = TYPE_PPC_E500_PCI_BRIDGE, + .parent = TYPE_PCI_DEVICE, + .instance_size = sizeof(PPCE500PCIBridgeState), + .class_init = e500_host_bridge_class_init, + .interfaces = (InterfaceInfo[]) { + { INTERFACE_CONVENTIONAL_PCI_DEVICE }, + { }, + }, + }, + { + .name = TYPE_PPC_E500_PCI_HOST_BRIDGE, + .parent = TYPE_PCI_HOST_BRIDGE, + .instance_size = sizeof(PPCE500PCIState), + .class_init = e500_pcihost_class_init, + }, }; -static void e500_pci_register_types(void) -{ - type_register_static(&e500_pcihost_info); - type_register_static(&e500_host_bridge_info); -} - -type_init(e500_pci_register_types) +DEFINE_TYPES(types) From patchwork Sat Oct 5 19:45:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 1993145 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=fgZh89fb; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XLbd53sdnz1xvB for ; Sun, 6 Oct 2024 06:51:05 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxAkd-0005q6-Dh; Sat, 05 Oct 2024 15:47:39 -0400 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 1sxAkI-0005Os-34; Sat, 05 Oct 2024 15:47:18 -0400 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 1sxAkG-0007hb-ND; Sat, 05 Oct 2024 15:47:17 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-42cbbb1727eso31679955e9.2; Sat, 05 Oct 2024 12:47:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728157633; x=1728762433; 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=T//dp0abStXeq6JWPfINCQ4KAUheGtCEJkAqcnHC/p4=; b=fgZh89fbPjL7LAL/+MgBM0pS+1bsjAoiRc1HZVLNw7VXmuMhe/lSBbL+KxtHqVD1+j uIuwCFY/OLM9CTyvZtEEgE+K/XwOjRvydkuzaS2cIelpn/5i4ItLLccDtYVlphbjYHks 5T+7bko8fwqcHYlgk7gOxelSJUIjN+vhYR6yWWTXgtDz9ZBe9n/vq8+VKT48aV0NTI7U C3ROs6fZGoa8BlStLMDxWsD3hhcYPdbFabm+PsIP7RBDENXq6S+7QYD1RAK0AZIP2Smt otb2Xp9NwpZTjFe1JN2/S50S6+9tNEtXXEmu4EHqHvp6OtA8iHhU7Gq6jl3cNJr8V+Gn xC9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728157633; x=1728762433; 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=T//dp0abStXeq6JWPfINCQ4KAUheGtCEJkAqcnHC/p4=; b=Kp4BQjLdhA0AVkzDSEQivnZeOW7iYXEV/oVrSsrI6fcufLR3A1/9lC/Vsdrzl4Z8qb OFmDb8t8BBBLUnTI/w5WUf3boTfTibIMCKm/PzS+k1oDPwr3jitYO0qKBLn4dUwW82BS 7TQUT4lJcPXPid0JkG94IeRVwaXuOpe7MFwJbaW9Enb8mTB47bZx261l8d1sTjvH47xe 7GEH/4XeKaFAgGY8z06xmPG5IxyJXoA7jtXkPl1YZmfJBMWFFM29pd6Wp6uS/TA07lsq Lw2MdLcgSOm01sncjCZfk4MwUVX5LUijCMaLDW/135AHsOXIFa8FwwHUOA0A5RVXo/CL LL9g== X-Forwarded-Encrypted: i=1; AJvYcCUE5uB2OqAYcA9gkApUdATjwkKOTOpch1JkOVILS8w/Jo6npvqvVpQysSUHVG+g8jkUhrAtDgbmRW4=@nongnu.org, AJvYcCVH9oblm+nGKqRjGP+MPOIfdAWTd6pgsYo+ZbFVWPGabWVfWEqlW78t4jVd228XdEESU+iTn/y3MUzl@nongnu.org X-Gm-Message-State: AOJu0Yweg565sQUGgU+iEJ+UM8Z74rK6+ERyYVnGjfK7l/gmUhN5a8cA uEGcYxZ9cv6ByoVeUWR785arNCOYISyFKJKWrDctA4CO03RQ5oAgtKH8aQ== X-Google-Smtp-Source: AGHT+IFv1FTU/3RqXKFQJGTMKuhsRJh0dALKvfSuzjEHKsGsNKSRsRZm37e8NFBfX5uMgYiQ3196tQ== X-Received: by 2002:a05:600c:44d6:b0:42c:c401:6d86 with SMTP id 5b1f17b1804b1-42f85aea06fmr47916805e9.27.1728157633228; Sat, 05 Oct 2024 12:47:13 -0700 (PDT) Received: from archlinux.. (pd95ed790.dip0.t-ipconnect.de. [217.94.215.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42f86a0afc1sm47506775e9.1.2024.10.05.12.47.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 12:47:12 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Daniel Henrique Barboza , Nicholas Piggin , Bin Meng , Corey Minyard , Bernhard Beschow , qemu-ppc@nongnu.org, Alex Williamson , Hanna Reitz , Jason Wang , qemu-block@nongnu.org, Kevin Wolf , =?utf-8?q?Philippe_Ma?= =?utf-8?q?thieu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_?= =?utf-8?q?Goater?= Subject: [PATCH v2 14/23] hw/gpio/mpc8xxx: Prefer DEFINE_TYPES() macro Date: Sat, 5 Oct 2024 21:45:54 +0200 Message-ID: <20241005194603.23139-15-shentey@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241005194603.23139-1-shentey@gmail.com> References: <20241005194603.23139-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=shentey@gmail.com; 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Reviewed-by: Cédric Le Goater Signed-off-by: Bernhard Beschow --- hw/gpio/mpc8xxx.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/hw/gpio/mpc8xxx.c b/hw/gpio/mpc8xxx.c index 63b7a5c881..de183c3be5 100644 --- a/hw/gpio/mpc8xxx.c +++ b/hw/gpio/mpc8xxx.c @@ -23,7 +23,6 @@ #include "hw/irq.h" #include "hw/sysbus.h" #include "migration/vmstate.h" -#include "qemu/module.h" #include "qom/object.h" #define TYPE_MPC8XXX_GPIO "mpc8xxx_gpio" @@ -208,17 +207,14 @@ static void mpc8xxx_gpio_class_init(ObjectClass *klass, void *data) device_class_set_legacy_reset(dc, mpc8xxx_gpio_reset); } -static const TypeInfo mpc8xxx_gpio_info = { - .name = TYPE_MPC8XXX_GPIO, - .parent = TYPE_SYS_BUS_DEVICE, - .instance_size = sizeof(MPC8XXXGPIOState), - .instance_init = mpc8xxx_gpio_initfn, - .class_init = mpc8xxx_gpio_class_init, +static const TypeInfo types[] = { + { + .name = TYPE_MPC8XXX_GPIO, + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(MPC8XXXGPIOState), + .instance_init = mpc8xxx_gpio_initfn, + .class_init = mpc8xxx_gpio_class_init, + }, }; -static void mpc8xxx_gpio_register_types(void) -{ - type_register_static(&mpc8xxx_gpio_info); -} - -type_init(mpc8xxx_gpio_register_types) +DEFINE_TYPES(types) From patchwork Sat Oct 5 19:45:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 1993141 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=dTAncQbp; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XLbcv2qNGz1xvB for ; Sun, 6 Oct 2024 06:50:55 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxAkY-0005dz-LN; Sat, 05 Oct 2024 15:47:34 -0400 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 1sxAkK-0005Pt-5W; Sat, 05 Oct 2024 15:47:20 -0400 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 1sxAkH-0007ht-D5; Sat, 05 Oct 2024 15:47:18 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-42cb806623eso27841045e9.2; Sat, 05 Oct 2024 12:47:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728157635; x=1728762435; 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=jlo3i+gTLj++N5p9flHBUDt4I/6LJsfJbAWD74BnZ64=; b=dTAncQbpZVJkxcqAWnq7QiWjyT2sCc1akVlGL7sLycn1Tfm06I4Ess2IpSelom9CIg Ae7o11RuizftlteC26DIHZg2LuoCQJuOYlpTPh2TlP9sVZ31xI/B3Tabg9WQpdbA+J80 xWktwF3/eg8V4GRLd7BjRZ/IKccc/fTF9B7wFRmD3ZLvZ0oYhJQdPkk12tqFhfFksMqM SLzHDV2qOVwPmtBHLXvehnGyipB1v2+nQygQSTS1qzh5ipdtd3+63b7NKMH01Fz+2iQq Hxkk0pHC7nzeqdntSM1sTqdtIR7N6XdXWHMz0wWRRg/hqsIZA3MIA8FD7BP1Z9AKE3KV k7kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728157635; x=1728762435; 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=jlo3i+gTLj++N5p9flHBUDt4I/6LJsfJbAWD74BnZ64=; b=HWrzyUaZUVZObdcIgoRAfnZIzQl1xuYmO6RYjej/rLcHscuboEi1DegFpY6BDHrwo0 kU6PkMAHJQYr7YzONOIwVW2OxZ7ErIto67vGvFXhVEfyLU/Sh4prKOHIzbQdWllocuvI Gqlx10gFY1nhWxIAes2rzNAOZ7DWrNc2MHk9hST4xqRUnVECRDaCcMjgoWKw9jBs7JY9 oouGzM6zEM1W28jnwpxlQMQaZbnbBeGKU16XpKMgTloYi4AFv72Q/oPB2qvW3lbiuFWw jmXPQj1wQ58DzKo211+i0Ac1fpVI+425yEcY8smnaPaxDpC9rFWFsk/fku1fkrNIxfZ/ h60Q== X-Forwarded-Encrypted: i=1; AJvYcCUzzNmsW33LhK8jN4ds9nqaMj6T1tt2gu0Z5lirzYlCyFCizfxf05BE4qtvlyFkMNY3OrjR3Dd7HWsT@nongnu.org, AJvYcCXISR7g75PZCmnkp7v3eyo7742lTRKEeXV/laI84T8Xl6+SXgCh+Rwv0kov+rsKeRqualu/Bo5sgg4=@nongnu.org X-Gm-Message-State: AOJu0YwU7A/cKNwgVQEk/CKq65izPCEu8IH4E7lfAJXdzi+6Yva9mcqw 1VFq+9le3EVRU9kS2JXqdh1zxvdn9tV1JEsHpNY6oszeCUFX81EjOCf44g== X-Google-Smtp-Source: AGHT+IHI83yUKp89dT6LP0Dpvj6BdGTmrYklOh6AFId/2wx3C2RRwGEyaz7y93Su55OMCZa8oq198Q== X-Received: by 2002:a05:600c:19c6:b0:42f:8515:e47d with SMTP id 5b1f17b1804b1-42f85ab68femr52037945e9.11.1728157634972; Sat, 05 Oct 2024 12:47:14 -0700 (PDT) Received: from archlinux.. (pd95ed790.dip0.t-ipconnect.de. [217.94.215.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42f86a0afc1sm47506775e9.1.2024.10.05.12.47.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 12:47:13 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Daniel Henrique Barboza , Nicholas Piggin , Bin Meng , Corey Minyard , Bernhard Beschow , qemu-ppc@nongnu.org, Alex Williamson , Hanna Reitz , Jason Wang , qemu-block@nongnu.org, Kevin Wolf , =?utf-8?q?Philippe_Ma?= =?utf-8?q?thieu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_?= =?utf-8?q?Goater?= Subject: [PATCH v2 15/23] hw/ppc/mpc8544_guts: Prefer DEFINE_TYPES() macro Date: Sat, 5 Oct 2024 21:45:55 +0200 Message-ID: <20241005194603.23139-16-shentey@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241005194603.23139-1-shentey@gmail.com> References: <20241005194603.23139-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=shentey@gmail.com; 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Reviewed-by: Cédric Le Goater Signed-off-by: Bernhard Beschow --- hw/ppc/mpc8544_guts.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/hw/ppc/mpc8544_guts.c b/hw/ppc/mpc8544_guts.c index c02b34ccde..cf2317b3ab 100644 --- a/hw/ppc/mpc8544_guts.c +++ b/hw/ppc/mpc8544_guts.c @@ -18,7 +18,6 @@ */ #include "qemu/osdep.h" -#include "qemu/module.h" #include "qemu/log.h" #include "sysemu/runstate.h" #include "cpu.h" @@ -141,16 +140,13 @@ static void mpc8544_guts_initfn(Object *obj) sysbus_init_mmio(d, &s->iomem); } -static const TypeInfo mpc8544_guts_info = { - .name = TYPE_MPC8544_GUTS, - .parent = TYPE_SYS_BUS_DEVICE, - .instance_size = sizeof(GutsState), - .instance_init = mpc8544_guts_initfn, +static const TypeInfo types[] = { + { + .name = TYPE_MPC8544_GUTS, + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(GutsState), + .instance_init = mpc8544_guts_initfn, + }, }; -static void mpc8544_guts_register_types(void) -{ - type_register_static(&mpc8544_guts_info); -} - -type_init(mpc8544_guts_register_types) +DEFINE_TYPES(types) From patchwork Sat Oct 5 19:45:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 1993147 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=Exw1eBrJ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XLbdM3WPcz1xtN for ; Sun, 6 Oct 2024 06:51:16 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxAkY-0005dl-Dm; Sat, 05 Oct 2024 15:47:34 -0400 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 1sxAkM-0005Qd-E2; Sat, 05 Oct 2024 15:47:23 -0400 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 1sxAkK-0007iH-Hk; Sat, 05 Oct 2024 15:47:21 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-42cbe624c59so26468425e9.3; Sat, 05 Oct 2024 12:47:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728157636; x=1728762436; 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=s4Dr3HPw/83bA9AUPIBC22MfX6IPsg4vrM+FUTIQ5rI=; b=Exw1eBrJN0+7Rr/IKH48aABy4nAJMWL/6dImiCzKiLvlTAFx2BzvvurfFt5T7900Bl 6JZjlCSUm9v8850MEInEuF01uwGpPl7NSXU2cpx/qki/p2/x2EQ3umLdosHeUk2OSRLi 4A1LEGz7eWT0PcCBMziqpH+BuKTsD4CyiqW0FOSu4Afs23XZCF1y6yXkBpmDKLTJ+ppZ IX3VpDjaYMPEMBsjOIC3r17bk4TEPEcQMid6nn5CmBuMqo9Ds5UNSifWD5w91bILLvko skJn5DkkaOAVorhwXjMOpIUloE2ElfpRkp6qGFkG93+8O+MqP+l/McKvf6kUx9ciFHkJ diYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728157636; x=1728762436; 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=s4Dr3HPw/83bA9AUPIBC22MfX6IPsg4vrM+FUTIQ5rI=; b=RmsMGE3rP3ATCT9XxcsOZJIkf2BHDhG0a/c466GJ1sZBf1djR75uk0W72Ps8uY+0jx snn6kmbgaVnipUflMSojYxWxd91C+zIdB5UzDRs+dIPYEhkanjNPiECAyXAPxH7boD8u 9g/AmHoCCW6x9CoEJCkPX3eHytRezYn+CBizDtTJBBvdoj5zZDt1pjXIrCWpzsfRphp5 NOCxWQTcB0qyM/1sMhQp+MAOtqTLeGAj7ywl56Crn2bqZks0VlynINyJZ8sqz/38Mxg5 Nhi0tWRhRRyd5anUGnvC/LGlB+I2mkK8Y9WuAZ3zIK+o4SXW4r7CP30W4qiPFY70XCpq QTvQ== X-Forwarded-Encrypted: i=1; AJvYcCUXoK+G8HDh7idYZ2rhQlmk009N0GUyEKr6WzQ17d4uxf16JiHCued4pX1FoPPsa3hF6vYkXRaHuej3@nongnu.org, AJvYcCWpsEc4kB0BsExGOPkoL2x4SZpFZVg12UwXRWal3kfNYcFFbcvRZyZ8mBCcvUg+35X9+TabwOnuatg=@nongnu.org X-Gm-Message-State: AOJu0YzIIb4ODYwbL0f640gN+J3bXiCY/e/i61B8y+5nE6qWvUYAEpFF fCV4Y4Pr61IQGR2shk9jfkCVvUNN9lpl1jjoaTSVeJOkFLMW6PxQWrfPWw== X-Google-Smtp-Source: AGHT+IFcVi6kDEKnnDjOSoLT+ADqx3S6vwTaBNiNx3jh5Ly22w9hiSZWpb9yBnT2+4djhzhhsGt3Rw== X-Received: by 2002:a05:600c:1ca5:b0:42c:cd88:d0f7 with SMTP id 5b1f17b1804b1-42f85ab4830mr48144685e9.10.1728157636126; Sat, 05 Oct 2024 12:47:16 -0700 (PDT) Received: from archlinux.. (pd95ed790.dip0.t-ipconnect.de. [217.94.215.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42f86a0afc1sm47506775e9.1.2024.10.05.12.47.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 12:47:15 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Daniel Henrique Barboza , Nicholas Piggin , Bin Meng , Corey Minyard , Bernhard Beschow , qemu-ppc@nongnu.org, Alex Williamson , Hanna Reitz , Jason Wang , qemu-block@nongnu.org, Kevin Wolf , =?utf-8?q?Philippe_Ma?= =?utf-8?q?thieu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_?= =?utf-8?q?Goater?= Subject: [PATCH v2 16/23] hw/net/fsl_etsec/etsec: Prefer DEFINE_TYPES() macro Date: Sat, 5 Oct 2024 21:45:56 +0200 Message-ID: <20241005194603.23139-17-shentey@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241005194603.23139-1-shentey@gmail.com> References: <20241005194603.23139-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=shentey@gmail.com; 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Reviewed-by: Cédric Le Goater Signed-off-by: Bernhard Beschow --- hw/net/fsl_etsec/etsec.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/hw/net/fsl_etsec/etsec.c b/hw/net/fsl_etsec/etsec.c index 3fdd16ef2e..9bd886b996 100644 --- a/hw/net/fsl_etsec/etsec.c +++ b/hw/net/fsl_etsec/etsec.c @@ -36,7 +36,6 @@ #include "registers.h" #include "qapi/error.h" #include "qemu/log.h" -#include "qemu/module.h" /* #define HEX_DUMP */ /* #define DEBUG_REGISTER */ @@ -431,17 +430,14 @@ static void etsec_class_init(ObjectClass *klass, void *data) dc->user_creatable = true; } -static const TypeInfo etsec_info = { - .name = TYPE_ETSEC_COMMON, - .parent = TYPE_SYS_BUS_DEVICE, - .instance_size = sizeof(eTSEC), - .class_init = etsec_class_init, - .instance_init = etsec_instance_init, +static const TypeInfo types[] = { + { + .name = TYPE_ETSEC_COMMON, + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(eTSEC), + .class_init = etsec_class_init, + .instance_init = etsec_instance_init, + }, }; -static void etsec_register_types(void) -{ - type_register_static(&etsec_info); -} - -type_init(etsec_register_types) +DEFINE_TYPES(types) From patchwork Sat Oct 5 19:45:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 1993153 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=lIM8LTln; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XLbdT2Khrz1xvB for ; Sun, 6 Oct 2024 06:51:25 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxAkX-0005d0-PO; Sat, 05 Oct 2024 15:47:33 -0400 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 1sxAkM-0005QC-0m; Sat, 05 Oct 2024 15:47:22 -0400 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 1sxAkK-0007iV-HA; Sat, 05 Oct 2024 15:47:21 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-42cb806623eso27841155e9.2; Sat, 05 Oct 2024 12:47:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728157637; x=1728762437; 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=W4BSHyKm9Xr2ijuyVGhrvTe55yx+XDCqJUFhxaQuRKY=; b=lIM8LTln5vsOQJN0sss0inhkPKbboHCmuZvt8GdBcvR9KeVhvTsksbPnELIFY/G7D7 3HEKzXx/cF4iCAPxZzYlxgpd4QNRQaJjvkqSQGx32gBj5awDkfNe9k5uzE03M/rqqU9x lbfjr3mAfRyMH0g8i9rEJ1MNV1hvN+XtoQUNF+LULUv73ZkqZPC9F3IOO4znUUDYDhEq fudISN4ZujpQGwr/Agpw9ywx2hopJs9XnsKjxoH+8z3OvH8WPX0J9iXcWdJisfGNPTvN TT/N4Ge/0ZxbAkbPw7h/WrGDUWCmkijZ4aJXjI9CVmbwZ5IYtIrP3oKPW3Zmi26WkWT2 9dLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728157637; x=1728762437; 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=W4BSHyKm9Xr2ijuyVGhrvTe55yx+XDCqJUFhxaQuRKY=; b=eaJQ+LLJT3DlorfI832BLHj2+lnq3qHlXug0/SnwexXnFQcpznxt3EMhiYSf1JStm5 9HWRoH6/nyhBPqIRjQuz7QRV2EC/sVkZ/nqaWK4wCnHTYikd+hsVguo04TMNqaA2r2/N 3Ly0nX+pROnITxy+rUy7G1P4mG9dXXn9cZsPn0GfQHClqAblLSwKP2FfC6H1UZfNi2hy OrYgnqxKzDGjG+/uSVtHO/uLlDOIBYIN7D899ogxvHIY1d55ytrNArktJA00phlHyMXK N9HxtNN9Oan4Uz8i2WKgX+fZJ8NfqP/CiE7w6JvfRoLmz/hqgs9uUlWn04lP3TDZK2zt g5QQ== X-Forwarded-Encrypted: i=1; AJvYcCXYog8svZ2aPLaT6Ma8HazZVD/c/+PBh1Pw4bB03kBfXbJzqLv/5UhFZ7Of2F9HtF3WdIpmJGbP7Hm6@nongnu.org, AJvYcCXu4HWoiE8PNYgfgdE2ygmGpQkqqkAjZJJTVBZ7SRmzFMhcFRqCEo9Eh3CfRbTE1LSVwhnnAJdsAeY=@nongnu.org X-Gm-Message-State: AOJu0YzAsBidOALgz9bhVnVaFycdS9ewRlvJrG15yC6FsgxNoLhsiJ7F WX1p/xPrdcaz3lrQIzo3H85Jr/bhuTDEB+yQZWN5Y1vM9hZcQ9TcYVLr7Q== X-Google-Smtp-Source: AGHT+IF1mjHSp8+0m2jIfj3eYndG0IwLwGp3jZHLGJqgg5zGZaAk0mo+5Do+aBeHRP7BEEuskubToA== X-Received: by 2002:a05:600c:190b:b0:42c:be90:fa2f with SMTP id 5b1f17b1804b1-42f85af4582mr49749195e9.25.1728157636972; Sat, 05 Oct 2024 12:47:16 -0700 (PDT) Received: from archlinux.. (pd95ed790.dip0.t-ipconnect.de. [217.94.215.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42f86a0afc1sm47506775e9.1.2024.10.05.12.47.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 12:47:16 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Daniel Henrique Barboza , Nicholas Piggin , Bin Meng , Corey Minyard , Bernhard Beschow , qemu-ppc@nongnu.org, Alex Williamson , Hanna Reitz , Jason Wang , qemu-block@nongnu.org, Kevin Wolf , =?utf-8?q?Philippe_Ma?= =?utf-8?q?thieu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_?= =?utf-8?q?Goater?= Subject: [PATCH v2 17/23] hw/intc: Guard openpic_kvm.c by dedicated OPENPIC_KVM Kconfig switch Date: Sat, 5 Oct 2024 21:45:57 +0200 Message-ID: <20241005194603.23139-18-shentey@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241005194603.23139-1-shentey@gmail.com> References: <20241005194603.23139-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=shentey@gmail.com; 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Allows to clearly mark code sections relying on this device type. Reviewed-by: Cédric Le Goater Signed-off-by: Bernhard Beschow --- hw/ppc/e500.c | 2 +- hw/intc/Kconfig | 4 ++++ hw/intc/meson.build | 3 +-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index 74836ebb64..566c3b6f8e 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -828,7 +828,7 @@ static DeviceState *ppce500_init_mpic_qemu(PPCE500MachineState *pms, static DeviceState *ppce500_init_mpic_kvm(const PPCE500MachineClass *pmc, Error **errp) { -#ifdef CONFIG_KVM +#ifdef CONFIG_OPENPIC_KVM DeviceState *dev; CPUState *cs; diff --git a/hw/intc/Kconfig b/hw/intc/Kconfig index dd405bdb5d..a3df98ae59 100644 --- a/hw/intc/Kconfig +++ b/hw/intc/Kconfig @@ -16,6 +16,10 @@ config OPENPIC bool select MSI_NONBROKEN +config OPENPIC_KVM + bool + depends on OPENPIC && KVM + config APIC bool select MSI_NONBROKEN diff --git a/hw/intc/meson.build b/hw/intc/meson.build index 6bfdc4eb33..b9de6bf5c6 100644 --- a/hw/intc/meson.build +++ b/hw/intc/meson.build @@ -48,8 +48,7 @@ specific_ss.add(when: 'CONFIG_IOAPIC', if_true: files('ioapic.c')) specific_ss.add(when: 'CONFIG_LOONGSON_LIOINTC', if_true: files('loongson_liointc.c')) specific_ss.add(when: 'CONFIG_MIPS_CPS', if_true: files('mips_gic.c')) specific_ss.add(when: 'CONFIG_OMPIC', if_true: files('ompic.c')) -specific_ss.add(when: ['CONFIG_KVM', 'CONFIG_OPENPIC'], - if_true: files('openpic_kvm.c')) +specific_ss.add(when: 'CONFIG_OPENPIC_KVM', if_true: files('openpic_kvm.c')) specific_ss.add(when: 'CONFIG_POWERNV', if_true: files('xics_pnv.c', 'pnv_xive.c', 'pnv_xive2.c')) specific_ss.add(when: 'CONFIG_PPC_UIC', if_true: files('ppc-uic.c')) specific_ss.add(when: 'CONFIG_RX_ICU', if_true: files('rx_icu.c')) From patchwork Sat Oct 5 19:45:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 1993143 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=ifeYQPtJ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XLbcx5mZdz1xtN for ; Sun, 6 Oct 2024 06:50:57 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxAkU-0005aU-Kr; Sat, 05 Oct 2024 15:47:30 -0400 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 1sxAkO-0005Qv-17; Sat, 05 Oct 2024 15:47:24 -0400 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 1sxAkL-0007io-Fx; Sat, 05 Oct 2024 15:47:23 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-42f6bec84b5so31427405e9.1; Sat, 05 Oct 2024 12:47:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728157639; x=1728762439; 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=evt0YZ7xXYDWP6QHRFCyD0Jf+AgpLDKyhozVkVjfLSU=; b=ifeYQPtJBm9O07TLm2z0E8oWZe6o+1Ev3sE145oCQbhMd9T02yf8IHK+hwRAjucOxX EoU1xJwbkvK1IzqmxUkzhQLu+TjrbiAB2FnuKF0kxd20cNMXW/REA4RztZNINosXyI3F O2n1gBksuLPQ7aX7TrrNcTAtWMX/rRr05wsbKFvoXcPhtVUC9wRamTWWt2ENbgPqySzN avBFf2Eg7pCuoqH2lLMVU/3bENevmEjde6Q0wCBkSbzp//aaZTGKFfeCCcy6KXfFmb9t S/HPvuA3b6n7bQpDy18VPMPGIIrZF3TP02siIk4x4C6nH1Rc9uBrFfg62H4KT4zlCukP ZQCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728157639; x=1728762439; 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=evt0YZ7xXYDWP6QHRFCyD0Jf+AgpLDKyhozVkVjfLSU=; b=W0PSEV7aED05rEINZnmNWgUWMnFYeTg1ZWDMAdwM0HAIy5ph0tXXBA+00sqq8LuK7U rfX7/5LAfHDg0iTlaIGFExFwDKWfQMmv+MZQ84+NgsPgSM2BNd+TUADaAV+M96yCbxQ5 iNpluA2DeKniyPdADFC+JLzmHsUhxwSS6ncOPtvVygQ8BYPcT8hL3pYd3m17UdzHkIXK jstR25HWJ0K5llCcvIvsZekTycG6tVZsLGuNQ462qxoO+TRzO52u+3rGqeWiDrenDcow E64SU6s6TipHO5JR9PWL8JIEkSrNTbQOp4qwbRYJCA8l6QfTjbFgoTBoE2y11RqGLQSr aHsA== X-Forwarded-Encrypted: i=1; AJvYcCVPiYlhAvN2geL8joN+mbJ3AgtNmiTXDxPTG18Qb38czSvBn2+gF3IVwdvBV110675xHQrON1fbEwg=@nongnu.org, AJvYcCWZNjWiu4V7qu9lSOmspuH++audxzVUDYm9u5zwzZv6T9SPO1UbE1Ey+jIUSCjjMt1wm7usPfxHDHIT@nongnu.org X-Gm-Message-State: AOJu0Yzn6q8afKjrid2j9yma4kcxXhwDch4R01KAphkDv14YhsGuyAm7 SxfuuvVOgDu0om5sfJBjIrEXMj/tB0Z8PkhvhcJNc/mbKTagYWOyT6n5Eg== X-Google-Smtp-Source: AGHT+IGP1MEtOCWvVqMRVVuGcqk0jRG07ZsEoxD7mwiHZr6jR3AEMDhv8PSmSTtQBq7tsdb/kNaebA== X-Received: by 2002:a05:600c:511d:b0:42c:e0da:f13e with SMTP id 5b1f17b1804b1-42f85ab7b98mr50429575e9.18.1728157638561; Sat, 05 Oct 2024 12:47:18 -0700 (PDT) Received: from archlinux.. (pd95ed790.dip0.t-ipconnect.de. [217.94.215.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42f86a0afc1sm47506775e9.1.2024.10.05.12.47.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 12:47:17 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Daniel Henrique Barboza , Nicholas Piggin , Bin Meng , Corey Minyard , Bernhard Beschow , qemu-ppc@nongnu.org, Alex Williamson , Hanna Reitz , Jason Wang , qemu-block@nongnu.org, Kevin Wolf , =?utf-8?q?Philippe_Ma?= =?utf-8?q?thieu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_?= =?utf-8?q?Goater?= Subject: [PATCH v2 18/23] hw/sd/sdhci: Prefer DEFINE_TYPES() macro Date: Sat, 5 Oct 2024 21:45:58 +0200 Message-ID: <20241005194603.23139-19-shentey@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241005194603.23139-1-shentey@gmail.com> References: <20241005194603.23139-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=shentey@gmail.com; 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Reviewed-by: Cédric Le Goater Signed-off-by: Bernhard Beschow --- hw/sd/sdhci.c | 62 +++++++++++++++++++++------------------------------ 1 file changed, 26 insertions(+), 36 deletions(-) diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index ed01499391..aa89513796 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -37,7 +37,6 @@ #include "migration/vmstate.h" #include "sdhci-internal.h" #include "qemu/log.h" -#include "qemu/module.h" #include "trace.h" #include "qom/object.h" @@ -1598,15 +1597,6 @@ static void sdhci_sysbus_class_init(ObjectClass *klass, void *data) sdhci_common_class_init(klass, data); } -static const TypeInfo sdhci_sysbus_info = { - .name = TYPE_SYSBUS_SDHCI, - .parent = TYPE_SYS_BUS_DEVICE, - .instance_size = sizeof(SDHCIState), - .instance_init = sdhci_sysbus_init, - .instance_finalize = sdhci_sysbus_finalize, - .class_init = sdhci_sysbus_class_init, -}; - /* --- qdev bus master --- */ static void sdhci_bus_class_init(ObjectClass *klass, void *data) @@ -1617,13 +1607,6 @@ static void sdhci_bus_class_init(ObjectClass *klass, void *data) sbc->set_readonly = sdhci_set_readonly; } -static const TypeInfo sdhci_bus_info = { - .name = TYPE_SDHCI_BUS, - .parent = TYPE_SD_BUS, - .instance_size = sizeof(SDBus), - .class_init = sdhci_bus_class_init, -}; - /* --- qdev i.MX eSDHC --- */ #define USDHC_MIX_CTRL 0x48 @@ -1882,12 +1865,6 @@ static void imx_usdhc_init(Object *obj) s->quirks = SDHCI_QUIRK_NO_BUSY_IRQ; } -static const TypeInfo imx_usdhc_info = { - .name = TYPE_IMX_USDHC, - .parent = TYPE_SYSBUS_SDHCI, - .instance_init = imx_usdhc_init, -}; - /* --- qdev Samsung s3c --- */ #define S3C_SDHCI_CONTROL2 0x80 @@ -1946,18 +1923,31 @@ static void sdhci_s3c_init(Object *obj) s->io_ops = &sdhci_s3c_mmio_ops; } -static const TypeInfo sdhci_s3c_info = { - .name = TYPE_S3C_SDHCI , - .parent = TYPE_SYSBUS_SDHCI, - .instance_init = sdhci_s3c_init, +static const TypeInfo types[] = { + { + .name = TYPE_SDHCI_BUS, + .parent = TYPE_SD_BUS, + .instance_size = sizeof(SDBus), + .class_init = sdhci_bus_class_init, + }, + { + .name = TYPE_SYSBUS_SDHCI, + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(SDHCIState), + .instance_init = sdhci_sysbus_init, + .instance_finalize = sdhci_sysbus_finalize, + .class_init = sdhci_sysbus_class_init, + }, + { + .name = TYPE_IMX_USDHC, + .parent = TYPE_SYSBUS_SDHCI, + .instance_init = imx_usdhc_init, + }, + { + .name = TYPE_S3C_SDHCI, + .parent = TYPE_SYSBUS_SDHCI, + .instance_init = sdhci_s3c_init, + }, }; -static void sdhci_register_types(void) -{ - type_register_static(&sdhci_sysbus_info); - type_register_static(&sdhci_bus_info); - type_register_static(&imx_usdhc_info); - type_register_static(&sdhci_s3c_info); -} - -type_init(sdhci_register_types) +DEFINE_TYPES(types) From patchwork Sat Oct 5 19:45:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 1993144 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=nebnATgh; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XLbd4712pz1xtN for ; Sun, 6 Oct 2024 06:51:04 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxAke-0005tq-EL; Sat, 05 Oct 2024 15:47:40 -0400 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 1sxAkP-0005TU-Ad; Sat, 05 Oct 2024 15:47:25 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sxAkM-0007j7-JE; Sat, 05 Oct 2024 15:47:24 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-42ca4e0299eso27396115e9.2; Sat, 05 Oct 2024 12:47:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728157640; x=1728762440; 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=CKFL05mVsE9TRhWdfuyf1kRZkYUXZq0RfSCcqjBQa4k=; b=nebnATghl1DTPw7S5oyQn+yEwESsLre/my9AtJvBRFzFP58us4aie4yH02OvQWto8v vil7LIZEhfqy7o9kA4bsUoYnNkrXUbyl4hkSFjCzDHgw+hEO75Xa52Mm02bejWw0oYj3 syh/DmZ3cah84ZNJMOtPQcNpVeVjzrQ1abfroJq1IOWQ0QVPqbsEn99664YaEJv0nA2D O08gBAMVxmGNMjX0lCdHSzoTVGIi8PVsHjnPe7vv1AVX5SgMO3GuJt5Jf/Ex22CGu9+N AjwGKugC4Sl9eGVWazeNkMYEZtzmINT46if6iUzJ8YJlrebAbE/M6NlDPsFI0QCjjoMg t/fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728157640; x=1728762440; 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=CKFL05mVsE9TRhWdfuyf1kRZkYUXZq0RfSCcqjBQa4k=; b=n9gBTE2B9Id7AMFrCqH/VhZpuICUcGNRSs/raQOVtVyauOXwLstNeJzHi633lzil2m Nbjy658RXyfLqHd9GK6dnC+aka/joAlbm7VhW/MzQ049n54ZnjLL0rX1fgmrNz8/Z2NL RYJWxDoTuLhK8AmTr9Ogc3UAZeAG0gUJOflq+Q4R2Qr/c5speTJNB/Rq1ujB3t+BRm3M 195Ti7m3M6UV+JEs6Y5mvu4oloTPXHt5hay7m/rZYKRC3ql9q5ihR+eiEMlBtox56Hrk w7rKqKNO6j4oRTzEkPgRt/kn9A0hgicp4WTvs7ZkYav7HzrAZ64+ZXRuCxfCYPsBW0rP LMqQ== X-Forwarded-Encrypted: i=1; AJvYcCUVVTo0+XBsIEvRF3GsmCf/7MvFTEPL4S2FkEJa/RVH8xrr7hcqMpjqJUJO3kgorx2dZBR/nmKTcQM=@nongnu.org, AJvYcCVMZIvEfISBA/pM8Z9kOUMPHcWuugziPxvzgpUpQ8xQwz+Y0/eTljeVr7To3jVk+EkfCGO4oSjWo0kH@nongnu.org X-Gm-Message-State: AOJu0Yw3mqG7ZxGH4pWE2WgsyKvnihSYTrCRGtVKi8LJpWvhjRhFltRE syjZYEA8U+PPPZcC52c+sjFWp/D8UiS+SRh7rRmlJQZori3LwJweH/5qVA== X-Google-Smtp-Source: AGHT+IHsgaMAY7vSWtHDEY69fl6DIDRDyFARZGHhJSUs6+iDEydrOPhJRASlVxOX/dJeSQnu3KjKGg== X-Received: by 2002:a05:600c:6c11:b0:42f:7c9e:1f96 with SMTP id 5b1f17b1804b1-42f85b64a22mr51595905e9.1.1728157640104; Sat, 05 Oct 2024 12:47:20 -0700 (PDT) Received: from archlinux.. (pd95ed790.dip0.t-ipconnect.de. [217.94.215.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42f86a0afc1sm47506775e9.1.2024.10.05.12.47.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 12:47:19 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Daniel Henrique Barboza , Nicholas Piggin , Bin Meng , Corey Minyard , Bernhard Beschow , qemu-ppc@nongnu.org, Alex Williamson , Hanna Reitz , Jason Wang , qemu-block@nongnu.org, Kevin Wolf , =?utf-8?q?Philippe_Ma?= =?utf-8?q?thieu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_?= =?utf-8?q?Goater?= Subject: [PATCH v2 19/23] hw/block/pflash_cfi01: Prefer DEFINE_TYPES() macro Date: Sat, 5 Oct 2024 21:45:59 +0200 Message-ID: <20241005194603.23139-20-shentey@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241005194603.23139-1-shentey@gmail.com> References: <20241005194603.23139-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=shentey@gmail.com; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Reviewed-by: Cédric Le Goater Signed-off-by: Bernhard Beschow Reviewed-by: Kevin Wolf --- hw/block/pflash_cfi01.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/hw/block/pflash_cfi01.c b/hw/block/pflash_cfi01.c index 7b6ec64442..cf11dada29 100644 --- a/hw/block/pflash_cfi01.c +++ b/hw/block/pflash_cfi01.c @@ -47,7 +47,6 @@ #include "qemu/bitops.h" #include "qemu/host-utils.h" #include "qemu/log.h" -#include "qemu/module.h" #include "qemu/option.h" #include "hw/sysbus.h" #include "migration/vmstate.h" @@ -947,20 +946,16 @@ static void pflash_cfi01_class_init(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); } - -static const TypeInfo pflash_cfi01_info = { - .name = TYPE_PFLASH_CFI01, - .parent = TYPE_SYS_BUS_DEVICE, - .instance_size = sizeof(PFlashCFI01), - .class_init = pflash_cfi01_class_init, +static const TypeInfo types[] = { + { + .name = TYPE_PFLASH_CFI01, + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(PFlashCFI01), + .class_init = pflash_cfi01_class_init, + }, }; -static void pflash_cfi01_register_types(void) -{ - type_register_static(&pflash_cfi01_info); -} - -type_init(pflash_cfi01_register_types) +DEFINE_TYPES(types) PFlashCFI01 *pflash_cfi01_register(hwaddr base, const char *name, From patchwork Sat Oct 5 19:46:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 1993140 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=hSozv1UU; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XLbct6ZZ1z1xtN for ; Sun, 6 Oct 2024 06:50:54 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxAkb-0005iY-HL; Sat, 05 Oct 2024 15:47:37 -0400 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 1sxAkP-0005UT-Uv; Sat, 05 Oct 2024 15:47:26 -0400 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 1sxAkO-0007jc-Gz; Sat, 05 Oct 2024 15:47:25 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-42e82f7f36aso26638925e9.0; Sat, 05 Oct 2024 12:47:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728157642; x=1728762442; 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=gqpqyzefSA/fNNCTFuL3jxhMZZmJ96+lu7QCsbLGY8c=; b=hSozv1UUClqNPFGotkWwaBlqaptK7AQKD1bmc5DL6WeuG2wqGx9u0nR0gMNedAacm/ 7iKLHPwmh28Osz/+BT3xoCF1h37fFRHcvXO4CA77TrPx/SyjtNYxJLKHKLxOOIkWYP8t OgnWFEIb2pe4xAc5l/rG4FJLU9NmXZg5FA5CUr2vDi1V7I8D2qWoR/LIsAzbzZiXF9+o u4/rDrPB986Imxybvc01/UxQ7EE3NsmED1uPy4pMIlDyP4QIE255mIo/UVSzGe/Qclx/ J0vSPQFV+zAjgZmwWvZsl7Z0zaP8AnpFnReWFId7S4NzcF+n539aYOxLHfW9QA/Efj42 xlLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728157642; x=1728762442; 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=gqpqyzefSA/fNNCTFuL3jxhMZZmJ96+lu7QCsbLGY8c=; b=mI5zxca+m9Nv9QeeufF66UzQ7QPzpSlVpEGZznWHClyN2iewRCdtCKLDiMs3TJ/nVG UrXVLoDtmcM4wFhNGXw5rxAomaM7XeG2HgFiMJwbheunGU8p4U2C1PqmC9FqIN7tocnx 0qx3AukboXaOuR+hXL37dpQcsCj/SFJ4W/+yeSP/6DnYdNNZcOwR7QEC7x1CC74GdFlb c/ThauHn0PXz23sdkrR4XLUoco2GIwGsXPmUYY8v+PU0iQuWjLtPVTOcHUWbIDHBgmgr IZbQFsECua8hD6LjeXzcXCok87veKwHbwBzM/w29pcU0vFXvGvsxdqibCxHj7b6bCw5Y R5zQ== X-Forwarded-Encrypted: i=1; AJvYcCUSQ4shcgORvISc5zsjY2GhfdF4RvV9mtYeKOz7V8qyZH12z+4en26ygBTYrwX46CSq+06yXbLqMI53@nongnu.org, AJvYcCUnWQNuF17pnShl9/i9RgKqjxgVYm+MilDWaiUqL9iKNXWk3wE2WPDTThc5/BvJEP0TFhW0nVB+GXo=@nongnu.org X-Gm-Message-State: AOJu0YyryDTVRpV5BlWOvnQ1Ixn8ddv9cQqV9l6tteiWTOEhGxh9gRAK IkaOFov7guM775H31LCv4wUS8C6UUhHcHWdQj9wrWHq/WBui52bZbt+G+A== X-Google-Smtp-Source: AGHT+IFpW+Dqh/CnTv/uS1K3nRQWU7jcXq/wSLu+3iDbUJ2V0Xog/ca4uj17M4W2jcWRJXOcOATOEw== X-Received: by 2002:a05:600c:6054:b0:42f:8ac6:5198 with SMTP id 5b1f17b1804b1-42f8ac655damr20482115e9.18.1728157641715; Sat, 05 Oct 2024 12:47:21 -0700 (PDT) Received: from archlinux.. (pd95ed790.dip0.t-ipconnect.de. [217.94.215.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42f86a0afc1sm47506775e9.1.2024.10.05.12.47.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 12:47:21 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Daniel Henrique Barboza , Nicholas Piggin , Bin Meng , Corey Minyard , Bernhard Beschow , qemu-ppc@nongnu.org, Alex Williamson , Hanna Reitz , Jason Wang , qemu-block@nongnu.org, Kevin Wolf , =?utf-8?q?Philippe_Ma?= =?utf-8?q?thieu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_?= =?utf-8?q?Goater?= Subject: [PATCH v2 20/23] hw/i2c/smbus_eeprom: Prefer DEFINE_TYPES() macro Date: Sat, 5 Oct 2024 21:46:00 +0200 Message-ID: <20241005194603.23139-21-shentey@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241005194603.23139-1-shentey@gmail.com> References: <20241005194603.23139-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=shentey@gmail.com; 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Reviewed-by: Cédric Le Goater Signed-off-by: Bernhard Beschow --- hw/i2c/smbus_eeprom.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/hw/i2c/smbus_eeprom.c b/hw/i2c/smbus_eeprom.c index 9e62c27a1a..1d4d9704bf 100644 --- a/hw/i2c/smbus_eeprom.c +++ b/hw/i2c/smbus_eeprom.c @@ -151,19 +151,16 @@ static void smbus_eeprom_class_initfn(ObjectClass *klass, void *data) dc->user_creatable = false; } -static const TypeInfo smbus_eeprom_info = { - .name = TYPE_SMBUS_EEPROM, - .parent = TYPE_SMBUS_DEVICE, - .instance_size = sizeof(SMBusEEPROMDevice), - .class_init = smbus_eeprom_class_initfn, +static const TypeInfo types[] = { + { + .name = TYPE_SMBUS_EEPROM, + .parent = TYPE_SMBUS_DEVICE, + .instance_size = sizeof(SMBusEEPROMDevice), + .class_init = smbus_eeprom_class_initfn, + }, }; -static void smbus_eeprom_register_types(void) -{ - type_register_static(&smbus_eeprom_info); -} - -type_init(smbus_eeprom_register_types) +DEFINE_TYPES(types) void smbus_eeprom_init_one(I2CBus *smbus, uint8_t address, uint8_t *eeprom_buf) { From patchwork Sat Oct 5 19:46:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 1993131 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=SePOd9rN; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XLbb00D7Kz1xtV for ; Sun, 6 Oct 2024 06:49:16 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxAkW-0005b5-AD; Sat, 05 Oct 2024 15:47:32 -0400 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 1sxAkR-0005Xe-C3; Sat, 05 Oct 2024 15:47:27 -0400 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 1sxAkP-0007k5-RQ; Sat, 05 Oct 2024 15:47:27 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-42f56ad2afaso41163205e9.1; Sat, 05 Oct 2024 12:47:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728157643; x=1728762443; 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=Cl3/ACOFe6sZ551UWvYmqWR5h6YnAmWXApza4E1vkv4=; b=SePOd9rNYXOeJBFprIZXA3ApD0X1yz/INPt/u57hsFVg90gxDojKjsmbkQ2PhadkaE YN1Bspm2IemDLpri88SpkVnm5vEbdGpMFfXzdaShgnbgz+ObR/ZcMYvlhtjWucArfcHZ mDIyQODEx6dY+qBXY5C4UPiv/CUgObzc+ildUNPq+DPtwAF7YWg5Edh/I5WHZpTl1yf8 8CXcOMjv5rbwbhH97np7jl1LGmU5AzDgTr748MLfM8Cigs5uTqmByiIh+/lH7E5kRf4A iD1oG51QgrkQDS05OFwHx10uHwNQygkRaHQyrbV0THd6nyWGOI8pcrvItHQq5/a5XQsJ T0EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728157643; x=1728762443; 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=Cl3/ACOFe6sZ551UWvYmqWR5h6YnAmWXApza4E1vkv4=; b=HJd8TG/sFNHM8dMBP/7ZTc9j+A8P5XPzNncBm2rQJrnMJOKD90Qn+EeEoEyJVwwPVF ZOcMJKkuRsV4rqDftu66TPZcAYQJOzhIZuWzj8sXzHrlAZgJsXFwHz3tALwNRZPGvGeE 4aJibMQ/HfKcbA4iRBEpGkpUQEfUh20sNzrOaSk7a1R2aao8gtdhmb06f9jVRu1+lahX CGC+I/wmoXkvh4W3C29omBg3vL3yz4S/1q2KrTj0PPb4UwNs1xH4ki4TW93mmW3575wV v8fxprB9hmNOvBLTQaMBsXwwK+maIvhdedEhw9puA5jRk535XEHQYnUSO24FDM4rFC+R i55A== X-Forwarded-Encrypted: i=1; AJvYcCUWOxFwbMiYtSmimmy1c9/WmLSX40Y8AwVHfsNZJGVRuzybuv6MqHceWQXQsLs7AAhoHuAnu3ytGsIG@nongnu.org, AJvYcCX1g6YMdlgOaV6G235xx7gwFBRdbO2tyCcs8C64tAlzzJ3PlP8t0ii7SVOCdN4Eq1jcrfJ5pa14u+E=@nongnu.org X-Gm-Message-State: AOJu0YzhsAwVqlzGQyDVEg/U8GNs+unmC37QgZ2cUC3jBtxYtUm5IDKF bkQKtU/GkqBaXxPmO1AY0NyJ56WfqibtM7kc5DEE/LUOBAvQVvmzmQNrRw== X-Google-Smtp-Source: AGHT+IGZ67Jr/eSNElQpJKULOfk8K3CCWn8qnoAvzNqTAsK2SvigepyhfbgKtyPCAZOHIw3NwV3FHg== X-Received: by 2002:a05:600c:4fd6:b0:42c:aeaa:6b0d with SMTP id 5b1f17b1804b1-42f85aa957fmr77854055e9.9.1728157643206; Sat, 05 Oct 2024 12:47:23 -0700 (PDT) Received: from archlinux.. (pd95ed790.dip0.t-ipconnect.de. [217.94.215.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42f86a0afc1sm47506775e9.1.2024.10.05.12.47.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 12:47:22 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Daniel Henrique Barboza , Nicholas Piggin , Bin Meng , Corey Minyard , Bernhard Beschow , qemu-ppc@nongnu.org, Alex Williamson , Hanna Reitz , Jason Wang , qemu-block@nongnu.org, Kevin Wolf , =?utf-8?q?Philippe_Ma?= =?utf-8?q?thieu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_?= =?utf-8?q?Goater?= Subject: [PATCH v2 21/23] hw/rtc/ds1338: Prefer DEFINE_TYPES() macro Date: Sat, 5 Oct 2024 21:46:01 +0200 Message-ID: <20241005194603.23139-22-shentey@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241005194603.23139-1-shentey@gmail.com> References: <20241005194603.23139-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=shentey@gmail.com; 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Bernhard Beschow --- hw/rtc/ds1338.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/hw/rtc/ds1338.c b/hw/rtc/ds1338.c index a5fe221418..6de13caf99 100644 --- a/hw/rtc/ds1338.c +++ b/hw/rtc/ds1338.c @@ -14,7 +14,6 @@ #include "hw/i2c/i2c.h" #include "migration/vmstate.h" #include "qemu/bcd.h" -#include "qemu/module.h" #include "qom/object.h" #include "sysemu/rtc.h" @@ -227,16 +226,13 @@ static void ds1338_class_init(ObjectClass *klass, void *data) dc->vmsd = &vmstate_ds1338; } -static const TypeInfo ds1338_info = { - .name = TYPE_DS1338, - .parent = TYPE_I2C_SLAVE, - .instance_size = sizeof(DS1338State), - .class_init = ds1338_class_init, +static const TypeInfo types[] = { + { + .name = TYPE_DS1338, + .parent = TYPE_I2C_SLAVE, + .instance_size = sizeof(DS1338State), + .class_init = ds1338_class_init, + }, }; -static void ds1338_register_types(void) -{ - type_register_static(&ds1338_info); -} - -type_init(ds1338_register_types) +DEFINE_TYPES(types) From patchwork Sat Oct 5 19:46:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 1993138 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=GUV/+oky; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XLbcf6619z1xtN for ; Sun, 6 Oct 2024 06:50:42 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxAkb-0005iw-Jw; Sat, 05 Oct 2024 15:47:37 -0400 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 1sxAkT-0005aC-MT; Sat, 05 Oct 2024 15:47:29 -0400 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 1sxAkR-0007ka-F1; Sat, 05 Oct 2024 15:47:28 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-42cb6f3a5bcso41078795e9.2; Sat, 05 Oct 2024 12:47:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728157645; x=1728762445; 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+ds0AjfWm1BLDzVoFKcfUneoqAfmU7A0JJkdajhZMM=; b=GUV/+oky+zFP1wJGx4G7S8LMTGR1CAoEI9Bd/e6vROmfAoB/k9xQ+4acIgiUjxJGn6 dPOyTZl2SAZFhYaPFlDbEt4VKAuae8reyun+AkyBG8P+x0+ehDiUOzTngSi8/S/4C5od /ZGIzg0khsKfR01egx8N5pxVcRQ84ipsPfSInkArf+/O+NQaQ/g/RKXKhMIH51HMrc2o ygEJvTNzRTT1PCmWsEXiUV4gca8j8x8Ub4A8qdDfmW5/pBkG26sFSq0HS0ZsiwUDWbb2 reU0fOoX3XJPSWVaPaUub4WJ16ob+5ze9n/5sA5SQiIAeV0ASpcUCBPYcW+KcYH3Nwoo fJSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728157645; x=1728762445; 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+ds0AjfWm1BLDzVoFKcfUneoqAfmU7A0JJkdajhZMM=; b=wOwEOu7LMVWcTkNdb7OkijcoNXUnvsa5bv5mUj/daXTpevtP7+Bnol0Sv0zC5/DzSZ AT8k+lvHibHfxLwKKhNCF1syT6ya1pBpSLEdeHD4/jcAxkGIlBKHMqEwwUzNdW/dR6tb 2SceZwbdKjRuE5Tp6ct68Q52vPyFknnyLR+IsEKUfwDmuTzyVeAdhs06nsJSzI04wdGF Gp68ImpbneRPx10elbbDeGgaMXmUPUOiZ1ubZcsBsmQjd1W7WEmyUCndhbgJBPZpLVYt RWXlspms2ohZoFG88oRZFxUhz2PQEjlz1bNNdlC/3CZU57TmVbSrFsWv9SsvY5iRLPjj 0k6A== X-Forwarded-Encrypted: i=1; AJvYcCUcE4zh72FlS4rj11NzDH+R55ZgYYVnBfjBikvFDVYVn+XvbpFzg3pijJwr23EcEbQRn8MSmOgbvEmv@nongnu.org, AJvYcCVjQ/PUh97E9ApAc28/fT+IEyU/ky975nUuQZ4Qyy3jCvyCC5XanqUd9mw7fsWoADIxoB8m9vmxHN0=@nongnu.org X-Gm-Message-State: AOJu0YzbUSxIkiW8hFJ2MINwwmKGb2gO2hZyaNyJwH7C64FD/Vu/N4kv 7d9VEssSAgNEUacJgAI/xKXtdb5VHtASUUpTTu8bYA11jVhVNzaIYVzlBA== X-Google-Smtp-Source: AGHT+IHQTEdgyboeDMKJIvP6gZk+8jyoasEg7+flxtNb8L+/Ps8gusx8Q8mWQoK0bMuu0rOSaIi2Uw== X-Received: by 2002:a05:600c:3c9c:b0:42c:bae0:f05f with SMTP id 5b1f17b1804b1-42f85aa98ddmr67367565e9.13.1728157644510; Sat, 05 Oct 2024 12:47:24 -0700 (PDT) Received: from archlinux.. (pd95ed790.dip0.t-ipconnect.de. [217.94.215.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42f86a0afc1sm47506775e9.1.2024.10.05.12.47.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 12:47:23 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Daniel Henrique Barboza , Nicholas Piggin , Bin Meng , Corey Minyard , Bernhard Beschow , qemu-ppc@nongnu.org, Alex Williamson , Hanna Reitz , Jason Wang , qemu-block@nongnu.org, Kevin Wolf , =?utf-8?q?Philippe_Ma?= =?utf-8?q?thieu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_?= =?utf-8?q?Goater?= Subject: [PATCH v2 22/23] hw/usb/hcd-ehci-sysbus: Prefer DEFINE_TYPES() macro Date: Sat, 5 Oct 2024 21:46:02 +0200 Message-ID: <20241005194603.23139-23-shentey@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241005194603.23139-1-shentey@gmail.com> References: <20241005194603.23139-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=shentey@gmail.com; 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Reviewed-by: Cédric Le Goater Signed-off-by: Bernhard Beschow --- hw/usb/hcd-ehci-sysbus.c | 118 +++++++++++++++++---------------------- 1 file changed, 50 insertions(+), 68 deletions(-) diff --git a/hw/usb/hcd-ehci-sysbus.c b/hw/usb/hcd-ehci-sysbus.c index 2b1652f7a8..87a3bebe3e 100644 --- a/hw/usb/hcd-ehci-sysbus.c +++ b/hw/usb/hcd-ehci-sysbus.c @@ -19,7 +19,6 @@ #include "hw/qdev-properties.h" #include "hw/usb/hcd-ehci.h" #include "migration/vmstate.h" -#include "qemu/module.h" static const VMStateDescription vmstate_ehci_sysbus = { .name = "ehci-sysbus", @@ -97,17 +96,6 @@ static void ehci_sysbus_class_init(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_USB, dc->categories); } -static const TypeInfo ehci_type_info = { - .name = TYPE_SYS_BUS_EHCI, - .parent = TYPE_SYS_BUS_DEVICE, - .instance_size = sizeof(EHCISysBusState), - .instance_init = ehci_sysbus_init, - .instance_finalize = ehci_sysbus_finalize, - .abstract = true, - .class_init = ehci_sysbus_class_init, - .class_size = sizeof(SysBusEHCIClass), -}; - static void ehci_platform_class_init(ObjectClass *oc, void *data) { SysBusEHCIClass *sec = SYS_BUS_EHCI_CLASS(oc); @@ -118,12 +106,6 @@ static void ehci_platform_class_init(ObjectClass *oc, void *data) set_bit(DEVICE_CATEGORY_USB, dc->categories); } -static const TypeInfo ehci_platform_type_info = { - .name = TYPE_PLATFORM_EHCI, - .parent = TYPE_SYS_BUS_EHCI, - .class_init = ehci_platform_class_init, -}; - static void ehci_exynos4210_class_init(ObjectClass *oc, void *data) { SysBusEHCIClass *sec = SYS_BUS_EHCI_CLASS(oc); @@ -134,12 +116,6 @@ static void ehci_exynos4210_class_init(ObjectClass *oc, void *data) set_bit(DEVICE_CATEGORY_USB, dc->categories); } -static const TypeInfo ehci_exynos4210_type_info = { - .name = TYPE_EXYNOS4210_EHCI, - .parent = TYPE_SYS_BUS_EHCI, - .class_init = ehci_exynos4210_class_init, -}; - static void ehci_aw_h3_class_init(ObjectClass *oc, void *data) { SysBusEHCIClass *sec = SYS_BUS_EHCI_CLASS(oc); @@ -150,12 +126,6 @@ static void ehci_aw_h3_class_init(ObjectClass *oc, void *data) set_bit(DEVICE_CATEGORY_USB, dc->categories); } -static const TypeInfo ehci_aw_h3_type_info = { - .name = TYPE_AW_H3_EHCI, - .parent = TYPE_SYS_BUS_EHCI, - .class_init = ehci_aw_h3_class_init, -}; - static void ehci_npcm7xx_class_init(ObjectClass *oc, void *data) { SysBusEHCIClass *sec = SYS_BUS_EHCI_CLASS(oc); @@ -168,12 +138,6 @@ static void ehci_npcm7xx_class_init(ObjectClass *oc, void *data) set_bit(DEVICE_CATEGORY_USB, dc->categories); } -static const TypeInfo ehci_npcm7xx_type_info = { - .name = TYPE_NPCM7XX_EHCI, - .parent = TYPE_SYS_BUS_EHCI, - .class_init = ehci_npcm7xx_class_init, -}; - static void ehci_tegra2_class_init(ObjectClass *oc, void *data) { SysBusEHCIClass *sec = SYS_BUS_EHCI_CLASS(oc); @@ -184,12 +148,6 @@ static void ehci_tegra2_class_init(ObjectClass *oc, void *data) set_bit(DEVICE_CATEGORY_USB, dc->categories); } -static const TypeInfo ehci_tegra2_type_info = { - .name = TYPE_TEGRA2_EHCI, - .parent = TYPE_SYS_BUS_EHCI, - .class_init = ehci_tegra2_class_init, -}; - static void ehci_ppc4xx_init(Object *o) { EHCISysBusState *s = SYS_BUS_EHCI(o); @@ -207,13 +165,6 @@ static void ehci_ppc4xx_class_init(ObjectClass *oc, void *data) set_bit(DEVICE_CATEGORY_USB, dc->categories); } -static const TypeInfo ehci_ppc4xx_type_info = { - .name = TYPE_PPC4xx_EHCI, - .parent = TYPE_SYS_BUS_EHCI, - .class_init = ehci_ppc4xx_class_init, - .instance_init = ehci_ppc4xx_init, -}; - /* * Faraday FUSBH200 USB 2.0 EHCI */ @@ -282,24 +233,55 @@ static void fusbh200_ehci_class_init(ObjectClass *oc, void *data) set_bit(DEVICE_CATEGORY_USB, dc->categories); } -static const TypeInfo ehci_fusbh200_type_info = { - .name = TYPE_FUSBH200_EHCI, - .parent = TYPE_SYS_BUS_EHCI, - .instance_size = sizeof(FUSBH200EHCIState), - .instance_init = fusbh200_ehci_init, - .class_init = fusbh200_ehci_class_init, +static const TypeInfo types[] = { + { + .name = TYPE_SYS_BUS_EHCI, + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(EHCISysBusState), + .instance_init = ehci_sysbus_init, + .instance_finalize = ehci_sysbus_finalize, + .abstract = true, + .class_init = ehci_sysbus_class_init, + .class_size = sizeof(SysBusEHCIClass), + }, + { + .name = TYPE_PLATFORM_EHCI, + .parent = TYPE_SYS_BUS_EHCI, + .class_init = ehci_platform_class_init, + }, + { + .name = TYPE_EXYNOS4210_EHCI, + .parent = TYPE_SYS_BUS_EHCI, + .class_init = ehci_exynos4210_class_init, + }, + { + .name = TYPE_AW_H3_EHCI, + .parent = TYPE_SYS_BUS_EHCI, + .class_init = ehci_aw_h3_class_init, + }, + { + .name = TYPE_NPCM7XX_EHCI, + .parent = TYPE_SYS_BUS_EHCI, + .class_init = ehci_npcm7xx_class_init, + }, + { + .name = TYPE_TEGRA2_EHCI, + .parent = TYPE_SYS_BUS_EHCI, + .class_init = ehci_tegra2_class_init, + }, + { + .name = TYPE_PPC4xx_EHCI, + .parent = TYPE_SYS_BUS_EHCI, + .class_init = ehci_ppc4xx_class_init, + .instance_init = ehci_ppc4xx_init, + }, + { + .name = TYPE_FUSBH200_EHCI, + .parent = TYPE_SYS_BUS_EHCI, + .instance_size = sizeof(FUSBH200EHCIState), + .instance_init = fusbh200_ehci_init, + .class_init = fusbh200_ehci_class_init, + }, }; -static void ehci_sysbus_register_types(void) -{ - type_register_static(&ehci_type_info); - type_register_static(&ehci_platform_type_info); - type_register_static(&ehci_exynos4210_type_info); - type_register_static(&ehci_aw_h3_type_info); - type_register_static(&ehci_npcm7xx_type_info); - type_register_static(&ehci_tegra2_type_info); - type_register_static(&ehci_ppc4xx_type_info); - type_register_static(&ehci_fusbh200_type_info); -} - -type_init(ehci_sysbus_register_types) +DEFINE_TYPES(types) From patchwork Sat Oct 5 19:46:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 1993123 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=Zl1RXNV4; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XLbZh1dl8z1xvB for ; Sun, 6 Oct 2024 06:49:00 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxAkb-0005hw-3K; Sat, 05 Oct 2024 15:47:37 -0400 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 1sxAkU-0005aa-Q9; Sat, 05 Oct 2024 15:47:30 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sxAkS-0007lO-Un; Sat, 05 Oct 2024 15:47:30 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-42f56ad2afaso41164245e9.1; Sat, 05 Oct 2024 12:47:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728157647; x=1728762447; 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=S/Zjzyk/99b3FvfdDneqC7YDOwNG7GIYmd9kWNwTs+4=; b=Zl1RXNV4KdeRmI0JC3MeR2wuL8c/pyXU5D1mNQ+kuYYcD8905P+lmgKqO64MwGR88z 5gnPTXsh/pRTGyFH57FcisHN2ChLnzlw9Y4aGsNQX9EXHVL8RwDIlgH6u8PV62R/7hnF c9wRDQGuHfHmODlia8AhWpDSwELFKhLCpUbc5LCGg3CH/pnp6RBLPMmkY/KdFy4uaIhN MTrOqysrl7K4+Q6sDgdiCbUTfNjBfQROF3xNBbJw97tMZlfpXi97VBcQ+b5zMi/WdY68 DvSnb8K+3rj4KfcWZ6LI1XLsohWNTnOyz+xCmlKBzog6QeABPkSAXHzDnO4aXNCihEUN 8Xgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728157647; x=1728762447; 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=S/Zjzyk/99b3FvfdDneqC7YDOwNG7GIYmd9kWNwTs+4=; b=BP6/6qmpVta/fNaqxRf0PDmj8pW+Mt5qJGgPI0dRui0l5KsBl5gKwTzZwjZi9zrFPO BE3N2hl5ibj94ZvBAkf6K2QPvZ46lrsN/0PKfcaAEOMPGTEfVKxPQ2shqMmrXpFFSTqe FGygslcn6X/j4alGN3OO12e31r8Kv7y9nyg9HIgVRTBNe4hIfE4Be9Zucrs0oDdNYTFm fzGyIutFgi0S1+xItpKBKAq2Hye/Bx8OjE8FgLXWpx722O1/p4Q3LOHJAv1CV6fuz3JJ KHGUihAB1BjCtQratNDGCWMQ7gyrzk8fokZ790SPPT08BYutgFxqt6J8oUlFRdELL9rO MSdA== X-Forwarded-Encrypted: i=1; AJvYcCWIJLIzvA99IYgFGn58z32iMKKtvOoGx8QihRR4f+qFpb7MNT0tiv3JQfN3rsRIprSahXbpDyM8Zfk=@nongnu.org, AJvYcCX4f2KdvaUL3srMNq23N3Oi/WQme+05iqrX0xyG7ma+KI0vvjLCtf+ec5tjAt4GM9Nzh57KTpHxKdSz@nongnu.org X-Gm-Message-State: AOJu0Yz5pL7fy6cOUT0B0BniZMydkXxHnIV7IIwkoyO1eDsVyTFyNaI8 FUEhpMDgJ9QBw4aig1/Q7uwS31Z96iPo/3vsOJtPYwxEYJpoeAGGPhQVHw== X-Google-Smtp-Source: AGHT+IFR52qnljiwTpPc9b0iVdklJYtViYGVQ/Wypl3QpXr3NIblivFNbEpIj5l3AfHiFNrrfb/0ww== X-Received: by 2002:a05:600c:3c9c:b0:42c:bae0:f05f with SMTP id 5b1f17b1804b1-42f85aa98ddmr67367915e9.13.1728157646492; Sat, 05 Oct 2024 12:47:26 -0700 (PDT) Received: from archlinux.. (pd95ed790.dip0.t-ipconnect.de. [217.94.215.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42f86a0afc1sm47506775e9.1.2024.10.05.12.47.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 12:47:26 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Daniel Henrique Barboza , Nicholas Piggin , Bin Meng , Corey Minyard , Bernhard Beschow , qemu-ppc@nongnu.org, Alex Williamson , Hanna Reitz , Jason Wang , qemu-block@nongnu.org, Kevin Wolf , =?utf-8?q?Philippe_Ma?= =?utf-8?q?thieu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_?= =?utf-8?q?Goater?= Subject: [PATCH v2 23/23] hw/vfio/platform: Let vfio_start_eventfd_injection() take VFIOPlatformDevice pointer Date: Sat, 5 Oct 2024 21:46:03 +0200 Message-ID: <20241005194603.23139-24-shentey@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241005194603.23139-1-shentey@gmail.com> References: <20241005194603.23139-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=shentey@gmail.com; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Avoids one downcast, making the code more type-safe. Reviewed-by: Cédric Le Goater Signed-off-by: Bernhard Beschow --- hw/vfio/platform.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index a85c199c76..77bbfbf62c 100644 --- a/hw/vfio/platform.c +++ b/hw/vfio/platform.c @@ -318,13 +318,12 @@ static void vfio_platform_eoi(VFIODevice *vbasedev) /** * vfio_start_eventfd_injection - starts the virtual IRQ injection using * user-side handled eventfds - * @sbdev: the sysbus device handle + * @vdev: the VFIO platform device handle * @irq: the qemu irq handle */ -static void vfio_start_eventfd_injection(SysBusDevice *sbdev, qemu_irq irq) +static void vfio_start_eventfd_injection(VFIOPlatformDevice *vdev, qemu_irq irq) { - VFIOPlatformDevice *vdev = VFIO_PLATFORM_DEVICE(sbdev); VFIOINTp *intp; QLIST_FOREACH(intp, &vdev->intp_list, next) { @@ -417,7 +416,7 @@ fail_vfio: kvm_irqchip_remove_irqfd_notifier(kvm_state, intp->interrupt, irq); abort(); fail_irqfd: - vfio_start_eventfd_injection(sbdev, irq); + vfio_start_eventfd_injection(vdev, irq); return; }