From patchwork Mon Sep 23 09:29:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13809437 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6F922CF9C5B for ; Mon, 23 Sep 2024 09:34:50 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssfPQ-0001hp-1m; Mon, 23 Sep 2024 05:31: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 1ssfPN-0001ZQ-TE; Mon, 23 Sep 2024 05:31:05 -0400 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ssfPM-0006wb-1B; Mon, 23 Sep 2024 05:31:05 -0400 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a8d446adf6eso647969666b.2; Mon, 23 Sep 2024 02:31:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727083860; x=1727688660; 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=UacqFQWwY/RdMUHAYDpVrliqhGJbLEk5GcxMrcdJHGk=; b=NyjLwOdZpoSoH2To2GYNTAPfWGYdFRZjZzXMTYgirwxTP2v/Qe3UrckNGRElJX2j+o CYzAolwhD8XezeAtgtEktOf2JrRZbKSIaTYIyPan9Fgoxqm96TG/79cbOlTzxvTpP35E 86QEtCZQU9eRma5Un9tB7jVnJ8jHiTA4GggtSHmSMOq8NmF+IMRdNbUVtftadBMFi1eE RNglb2mtFa/Tx4rzoNgG6bRRNaShe+ib5kFsJz0W/9scXztf2jtk/b8H0xGH5MDqu4mR Kajr5UmOEakeQopfOKvSr/fNegFhvR+b/UtO5p+/WBaKVlmGf0b80SDJQrnLlM3Opxw6 wKNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727083860; x=1727688660; 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=UacqFQWwY/RdMUHAYDpVrliqhGJbLEk5GcxMrcdJHGk=; b=ZOacUta6jL06Pz8Tbj1cIMTlCV5oqghNcfWTqaL0AjIyO1ysLylK4OauG3r5PY9/N7 OzfD1NLshzBvug/zrBxjEDdq3kEJgsE5Z5sSH9EJUnHvZT/qZ+JdroxbejCjED+9zPwx A/whvEZEPMWM/Zn3pFg4+aHthOtSkObpb5OjgfS43ccwBKeX4Y/SEeDU0rewUWJuBfkQ Od4XqInE8zZebMu1vrai048HdWO2i3f5h5Yemjbmp5YjsC7MU4sEfXW3LMh2f3YoQXsM ses3kZECJboQstjtyO7EOGJz7W/VudmxWd71QvDt5opHUGeNFTZWBXow5ebMcoJZuGxP hsTQ== X-Forwarded-Encrypted: i=1; AJvYcCVT2mapbusWfUldAYmODVYASdHAqOvfJjdTzTFXMvDALb5TXzlFWqu0AYzXFEorxwbw8HMdGep1So48@nongnu.org, AJvYcCVo2Wgmj5MSN7i2lICE9QcKQ/SpF7TLPKy9foAXi9rHGxS2TiLsDkXQ1SoOwJ8dMUQXujzZcDVAni8=@nongnu.org X-Gm-Message-State: AOJu0Yyvlciovs4us9xpK4yFUKqiC5JbdmmbqQ4byJOe2dQ7xBU6jyNH T60OgUJ5unNx2FHbFfsLzeyP9ePtazje/4utNt6hlUesSZXzDqHAB1IXmA== X-Google-Smtp-Source: AGHT+IGNRJb28XANS441MzHqrZmf6zgrrGW6A35kGGoV2FP+oJji9k/8fcBegCp2m1HTQS03XKjsKg== X-Received: by 2002:a17:907:7da5:b0:a8a:8dd1:b2d1 with SMTP id a640c23a62f3a-a90d5109321mr1065095566b.55.1727083860425; Mon, 23 Sep 2024 02:31:00 -0700 (PDT) Received: from archlinux.. (90-181-218-29.rco.o2.cz. [90.181.218.29]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a90612b3f6fsm1188747166b.107.2024.09.23.02.30.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 02:30:59 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Hanna Reitz , qemu-ppc@nongnu.org, Kevin Wolf , Corey Minyard , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Alex Williamson , Jason Wang , Daniel Henrique Barboza , qemu-block@nongnu.org, Nicholas Piggin , Bin Meng , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Bernhard Beschow Subject: [PATCH 01/23] hw/ppc/e500: Do not leak struct boot_info Date: Mon, 23 Sep 2024 11:29:54 +0200 Message-ID: <20240923093016.66437-2-shentey@gmail.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20240923093016.66437-1-shentey@gmail.com> References: <20240923093016.66437-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=shentey@gmail.com; helo=mail-ej1-x630.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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. Signed-off-by: Bernhard Beschow --- hw/ppc/e500.h | 8 ++++++++ hw/ppc/e500.c | 17 ++++------------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/hw/ppc/e500.h b/hw/ppc/e500.h index 8c09ef92e4..557ce6ad93 100644 --- a/hw/ppc/e500.h +++ b/hw/ppc/e500.h @@ -5,10 +5,18 @@ #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; + boot_info boot_info; + /* points to instance of TYPE_PLATFORM_BUS_DEVICE if * board supports dynamic sysbus devices */ 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 Mon Sep 23 09:29:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13809433 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 64C7CCF9C6F for ; Mon, 23 Sep 2024 09:33:32 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssfPR-0001o7-MY; Mon, 23 Sep 2024 05:31:09 -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 1ssfPP-0001eR-5Y; Mon, 23 Sep 2024 05:31:07 -0400 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ssfPN-0006wj-Cq; Mon, 23 Sep 2024 05:31:06 -0400 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-a7aa086b077so540730966b.0; Mon, 23 Sep 2024 02:31:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727083863; x=1727688663; 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=MGd/V7b3/Zz9r6wp7tpzWusPdgXCdziXM20jKtJvMrg=; b=PRbDOIaaVuJWoU7MTE8lFolwD/FpXSz/bwsBM2iR868OQ3SpTkDaUQDfp4/cT5n1y3 TsjoGgeOqUhUoD2E8PYMXcRXluEmuJhc7pop0NAHOr1vF4Qe8wxD+KAB1ed2lW5BrLPL gL+AzwYxSME24tMl5qt5aConABzVEsbZc8DVBKFh4xANW5d8Nyg4cmkhBxjchGCAs79i bPmaDLdqRpPJ53EwdwYL9NiUDbB4R67BtRgVTlRfHzNcU9GL6vNqP5seUMnNiriE/mDp bFSB2loGR5t0r5LH3JRtK5LzIDRD6bNzS7vjhcXHTn9Hk7FSzXU7L/M8r0h+8HgSF2pH 9PCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727083863; x=1727688663; 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=MGd/V7b3/Zz9r6wp7tpzWusPdgXCdziXM20jKtJvMrg=; b=gJSQcvEVXcjvhkMCWe8CVnV6zJT5LbjBUNpTKFZSppkSTbAOcs/Pt9VcW4oHX8hniY FT/UGMXqt78PsXA+P7L3UoIlt9yV9BnG0Y5hswqyjRwETOmqXhwYCndskwm2rJLcfUQc 27gtfmfvt+/P8xAhg8lcrotlKsUbcDVqPKj/zJ/fv9sr+nOU2MnKkOJu1C/OXPO5Popf BTys8Is/gKR9dQeQ6h5d8nkJ/cah2yCPfZDWibezLnLEKFzyZODBFGtaI9nJyqppurd7 +GpuCx+sY6t0w/yA6+MJXEpDcLn1eftow98tnFCK7qDf9awpeY1Cxp7FtpdjMq7Wi93L 6dpw== X-Forwarded-Encrypted: i=1; AJvYcCU0wzWY4UYB6Ikt//oNFvTr3PRYnhYASf9nLCSy7Y9uOt+nUkwRaQO97LzGlaHqnFg56HRDpIkEs3w=@nongnu.org, AJvYcCWHpUYeSPKe7fQj523c6Sj+kzRfhmTEmhc89IymlkkcmUL/ORdQn8LHqU85+KPsSwqtpzonWf9LVJ/r@nongnu.org X-Gm-Message-State: AOJu0Yytnm2MFxGPGhCyCukEq4WUuu9Ub2bDxCPOVwYTWqp6rNKZZqhb HLaLCIHUe517GmOEGgYN0JN5HmYA8frYxcEMEqHRNOfngQrrdV5cExbs8A== X-Google-Smtp-Source: AGHT+IFZV6X+LEmYS9LvHtJMLinZpKZu/as0ldzmato/mZN18YzhQpOjheM4uufr+/O8oqcvM2o5vA== X-Received: by 2002:a17:907:9708:b0:a83:8591:7505 with SMTP id a640c23a62f3a-a90d5167dc8mr1306071866b.59.1727083862426; Mon, 23 Sep 2024 02:31:02 -0700 (PDT) Received: from archlinux.. (90-181-218-29.rco.o2.cz. [90.181.218.29]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a90612b3f6fsm1188747166b.107.2024.09.23.02.31.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 02:31:01 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Hanna Reitz , qemu-ppc@nongnu.org, Kevin Wolf , Corey Minyard , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Alex Williamson , Jason Wang , Daniel Henrique Barboza , qemu-block@nongnu.org, Nicholas Piggin , Bin Meng , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Bernhard Beschow Subject: [PATCH 02/23] hw/ppc/e500: Reduce scope of env pointer Date: Mon, 23 Sep 2024 11:29:55 +0200 Message-ID: <20240923093016.66437-3-shentey@gmail.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20240923093016.66437-1-shentey@gmail.com> References: <20240923093016.66437-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::631; envelope-from=shentey@gmail.com; helo=mail-ej1-x631.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org The env pointer isn't used outside the for loop, so move it inside. After that, the firstenv pointer is never read, so remove it. 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 Mon Sep 23 09:29:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13809426 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0DBF8CF9C5B for ; Mon, 23 Sep 2024 09:32:50 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssfPT-0001vH-Kk; Mon, 23 Sep 2024 05:31:11 -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 1ssfPR-0001lk-1a; Mon, 23 Sep 2024 05:31:09 -0400 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ssfPP-0006x3-9k; Mon, 23 Sep 2024 05:31:08 -0400 Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-5c42e7adbe0so4713528a12.2; Mon, 23 Sep 2024 02:31:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727083864; x=1727688664; 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=y0cE0YFArCBzwLd1JwfRPTOm56ohUC4IOprmiVi2Nc4=; b=U2WSo1sxiQv21OI3Q6KNyACnRavsyRE0I6hRsb4Uxo8b/xw2gO+1sMi0N/16wwD9y8 E6EWhClx0apUIV4S2iznNbdzSQVQLG04ZEdADyDdksEt3/Swey7F7I9BUQJfn/Qc+TMY 6zZecRltV5xqYAFXGdc59oHGmny8TNBRiUkL5drlHJ182jJUEqcqlJbfA+SGuqwB473q dBzlUDssSTeD5N2M8Cpp6m2Qfpoi4/r6y3spfZVqeYrYg5Uvl4r2BR/Xs9uUOCnKbmxN mqBN3bEzZBtzSKTwl7up+R1gwzrMdH3RvKqOiiaAOJa7k0gpHf9Sc/41hwj0PAhc5uXf fwGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727083864; x=1727688664; 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=y0cE0YFArCBzwLd1JwfRPTOm56ohUC4IOprmiVi2Nc4=; b=FeT9Z3ckgUk01n1UmeoYWL4RfzlvKkXlSSMyvd1M1LcAi92Hc7T/g4QbDWlTgK92IX Xl2oLYBEpY6cUMhMDDIoPsJ8MkTXRY2OpXcetBJiBKTFiCFi43SyJXTHXDiP1PgeTRe3 KiJDAH2Y2XtniESxhYELmbauZjKAC1sqds0Dh72dEKt98NDMW2cHF5iqvbmYLFiHBi/7 eI1OigK8UVO7lr5vhCw27Y6A1XsekmfckGxmjscQU6aUWi5Cik17iC2ie+hDHRsyyV06 sa77Hv4kelCYKnNL8bXx30tBJrisGXM+/XQAe4fvyO7xsGMUoUSoiEbHH0K1sdfCYSpp tWNA== X-Forwarded-Encrypted: i=1; AJvYcCVsyTK+8VsLqp7yFUqucg7WG2SGy1FZ9hP0mfASDBkm84EodT4F/lq+gKYNrpVULJ6eeuFvHA0bOnSF@nongnu.org, AJvYcCX75EM6pM+VOkGE8l7qQfZBKZMqPw/YmtjAKNKayVXJ3/ZZ+7JssX7eGOr4Frx/AnilnvpErLYGCVs=@nongnu.org X-Gm-Message-State: AOJu0Yy3a5nIlxpeNoMt3y9OLXiwm8WOGBTFwsS2gLEHEAbN+IqISnsm GyYAlpirpOIbFH0HZc1QHQEbyOSx7TSoK+ew0fnj7FuTT6NpEvN5f3k1Vg== X-Google-Smtp-Source: AGHT+IGHMW9H011FvW9gPouGu3vNVkb9qXZqbDxVmp6W7xZBs3Z9KnuendsEMBoJjyT630FEivBQsw== X-Received: by 2002:a17:907:25c2:b0:a8a:780f:4faf with SMTP id a640c23a62f3a-a90d5925392mr946568966b.47.1727083863792; Mon, 23 Sep 2024 02:31:03 -0700 (PDT) Received: from archlinux.. (90-181-218-29.rco.o2.cz. [90.181.218.29]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a90612b3f6fsm1188747166b.107.2024.09.23.02.31.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 02:31:03 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Hanna Reitz , qemu-ppc@nongnu.org, Kevin Wolf , Corey Minyard , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Alex Williamson , Jason Wang , Daniel Henrique Barboza , qemu-block@nongnu.org, Nicholas Piggin , Bin Meng , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Bernhard Beschow Subject: [PATCH 03/23] hw/ppc/e500: Prefer QOM cast Date: Mon, 23 Sep 2024 11:29:56 +0200 Message-ID: <20240923093016.66437-4-shentey@gmail.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20240923093016.66437-1-shentey@gmail.com> References: <20240923093016.66437-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::529; envelope-from=shentey@gmail.com; helo=mail-ed1-x529.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Bernhard Beschow Reviewed-by: BALATON Zoltan --- 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 Mon Sep 23 09:29:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13809428 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 37020CF9C71 for ; Mon, 23 Sep 2024 09:33:05 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssfPV-00025Z-Uk; Mon, 23 Sep 2024 05:31:13 -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 1ssfPT-0001tT-01; Mon, 23 Sep 2024 05:31:11 -0400 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ssfPR-0006xQ-F5; Mon, 23 Sep 2024 05:31:10 -0400 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-a8d13b83511so502550966b.2; Mon, 23 Sep 2024 02:31:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727083866; x=1727688666; 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=wIcGbmtd7uHKf6ZYKTXQmr65WTCHDsrdSE+qbZuFBjw=; b=Hs7sL7T074QKfuAcE8oIi58WQCANh1GPJdpKcOQFZouIWJwpbMeNbti8cy1CYMKlxR cHUdUCYcm68a2yUAkAvjPbGCUxFU6+Ia0xJlVXsqWUfspWM0uPthyVrBaL1q2+dR9/2t T/gn0i6g6V8HSmF0MHWAjuCt6iUWsv8eDFB7KTvAwpk/DzLyVVXugqtWW8hEDyvJdobg YXGwXTs66n4yHQX3tZHevY+3i6QIZJ4T8zydw5raZd2ugB+8Mm/4h3rFB98N1qv3+U0t tdlNxuPxIn292yeQhP/i9C2dyKUdQ0a+91tr2bjNpe3zEnY8FATUHYq+koUGTLHHu220 gczw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727083866; x=1727688666; 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=wIcGbmtd7uHKf6ZYKTXQmr65WTCHDsrdSE+qbZuFBjw=; b=gom+9xeptDQCjikyBBtxXw9ciytcZw0Nrm74FURZ8OPwOEpq4e/1CVIMcdNttCWOKa p5k/vE48z36ySWyIDoHIuQP6IHOPsxQvOdf98/Bws2hcRb8P9lKxRzNv7eGSX/Pth1CD 8Lc93Sa79L/bX7c/ngU3h/RW/MjIvjMOPa5Nktm4AN5M8bbNymjlPok5Jx5jJSCchWnu Lsiln68/l/VzI/7sjCtbRUgg7NBfByqnOPrYntuJ+nfxRrFl/TpnM9JeZ7NOEWo+hkYi 6oxhWlWZcNrDR2q4f9m49InUwElWPFRThRMiBmf2ZJvjwpwBcD7qrgR8fouewPns7s4r J+LQ== X-Forwarded-Encrypted: i=1; AJvYcCURx5eUpJBgO0tCI3TwC1Ckt9plKCwRjWA8uebkPyx4hzAq/cwHehkNGB+hw5E+CgykmSsMd1mJpUQ=@nongnu.org, AJvYcCXeDe1ZGzCeW2ZbKbK7e2NojaafhOWV4BUQl9ch0frKOneW7oXWmEgKo+hzY00/Spr4VCGtzh1Blw0g@nongnu.org X-Gm-Message-State: AOJu0YyfdtInBDAMtCA14InainBI5qIcA3Vx1U5wS3flzqUPSrjfIamg zPtRwkvjSRd6Qc8xPFiZySHpd6H3nLzvxwtP+M+d7TfvWMDYu2hpNpS4zA== X-Google-Smtp-Source: AGHT+IF/pl/EoqM31sD4DdIC4SGsQT23Gm2p4puQIXkv2O1256sSVS/pMpvPk6LxXZHDUa2tjaknFw== X-Received: by 2002:a17:907:98a:b0:a8d:5d28:8e07 with SMTP id a640c23a62f3a-a90d59292f6mr1148839466b.42.1727083866119; Mon, 23 Sep 2024 02:31:06 -0700 (PDT) Received: from archlinux.. (90-181-218-29.rco.o2.cz. [90.181.218.29]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a90612b3f6fsm1188747166b.107.2024.09.23.02.31.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 02:31:04 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Hanna Reitz , qemu-ppc@nongnu.org, Kevin Wolf , Corey Minyard , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Alex Williamson , Jason Wang , Daniel Henrique Barboza , qemu-block@nongnu.org, Nicholas Piggin , Bin Meng , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Bernhard Beschow Subject: [PATCH 04/23] hw/ppc/e500: Remove unused "irqs" parameter Date: Mon, 23 Sep 2024 11:29:57 +0200 Message-ID: <20240923093016.66437-5-shentey@gmail.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20240923093016.66437-1-shentey@gmail.com> References: <20240923093016.66437-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62e; envelope-from=shentey@gmail.com; helo=mail-ej1-x62e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Bernhard Beschow Reviewed-by: BALATON Zoltan --- 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 Mon Sep 23 09:29: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: 13809431 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C1D52CF9C5B for ; Mon, 23 Sep 2024 09:33:26 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssfPY-0002Dv-2i; Mon, 23 Sep 2024 05:31:16 -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 1ssfPV-00025j-US; Mon, 23 Sep 2024 05:31:13 -0400 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ssfPT-0006xg-9y; Mon, 23 Sep 2024 05:31:12 -0400 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a8d2b24b7a8so940166866b.1; Mon, 23 Sep 2024 02:31:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727083868; x=1727688668; 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=w4QKCLTnYRmG6RbJry6AnrnojW0x9+VCIRXbxcRAKqY=; b=DHaLVgxo6VVLPM5cUV/BFL+h+bmrCxlWzDEJIEDvNeNGztLnwTe3OPvOjDXvkewEXH STdpYuhBWNDKT81u/xOFUbF3LiuEjeL+S7w9zL+g6fQu9LXPPZvcSvDy+l2Q8bTka/xn d5So9e5ZTFTNaMaWrsVuwI+eSKsI37oF3lAdgTkb0ac7aAR6nXIU2dyXYqJFpO/vn8j2 iXGMVlhBE/sufw52RZVSee9NbKuwEwBmPxLTQnqdEju6KEXgWU94xv8Z82i6evheOpbT XlygGBO0M/DEkiYKWrpYqEM3Wh0DpwNZot2eeCNeiAH/frUTdvR230jhkrTFaI9Ae743 7Mag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727083868; x=1727688668; 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=w4QKCLTnYRmG6RbJry6AnrnojW0x9+VCIRXbxcRAKqY=; b=K0wD7zbc49WYyJXLv+hP7QB4/Zk8Zf5As7j4URU/IET8rEowNIywkO6wSXQglSZJjG f0fRuadVCybs0N7PTQ/9dXCKPU+0C2AEijE9KjcSvc2FVx3XVYeLMH2GJJVsRVijWXAt WtfH8Z1BUwWMKoFXoMx3qO6/vfOQZWFkR2g1U1sDV0EPAXywQ1kph1p4G3/GpGGtc6ml ZIDI0LMx/BNl3RZxNxu6Owq8paCX6QxFCCYkNOlyin+git7ya9hmy6UoZ9hMoCyPaQMa UYYNRTx9gXk5VqilaZiT0fzyUh+C3ODUx85+KwH0AMCRHtrnpI++Yn9AVpGfrrv6ogL9 9vMA== X-Forwarded-Encrypted: i=1; AJvYcCUacCS3oRPF07xKBd1HRFhSclBHF7LF55jOASskpiInuQ5ia4xs26S89GyQwDtPeJ/t7Jq7uJ3hoCJY@nongnu.org, AJvYcCWiJ1+XNF8f896sujxWHilT8dW7hj0SUm4nvvNo9cTvLJuHf8bRv2Y1SZROTN25PG68Um+BzUB9kgU=@nongnu.org X-Gm-Message-State: AOJu0YzNcHqRdY9nbP4ytIqiS55jQXCBWB2XN6wUSRECh1Lez5wBPkPu A5J33B6a4wGCzxizxVI5gFx39ehVo5TTJdnA468AK3voWu3IQHW3G8sb9w== X-Google-Smtp-Source: AGHT+IGPr5k4lTfDwH8Hzdc+kNUjPn/92EN4rGVwxClEJG/iwvJPVOVc1ujyM8Ee/YYCEoDnxYji9Q== X-Received: by 2002:a17:907:a0e:b0:a90:3494:2aa9 with SMTP id a640c23a62f3a-a90c1c363c1mr1628386966b.2.1727083868126; Mon, 23 Sep 2024 02:31:08 -0700 (PDT) Received: from archlinux.. (90-181-218-29.rco.o2.cz. [90.181.218.29]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a90612b3f6fsm1188747166b.107.2024.09.23.02.31.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 02:31:07 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Hanna Reitz , qemu-ppc@nongnu.org, Kevin Wolf , Corey Minyard , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Alex Williamson , Jason Wang , Daniel Henrique Barboza , qemu-block@nongnu.org, Nicholas Piggin , Bin Meng , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Bernhard Beschow Subject: [PATCH 05/23] hw/ppc/e500: Add missing device tree properties to i2c controller node Date: Mon, 23 Sep 2024 11:29:58 +0200 Message-ID: <20240923093016.66437-6-shentey@gmail.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20240923093016.66437-1-shentey@gmail.com> References: <20240923093016.66437-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=shentey@gmail.com; helo=mail-ej1-x633.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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. Signed-off-by: Bernhard Beschow Reviewed-by: Cédric Le Goater --- 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 Mon Sep 23 09:29:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13809438 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AB1EFCF9C6F for ; Mon, 23 Sep 2024 09:34:52 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssfPZ-0002JQ-DR; Mon, 23 Sep 2024 05:31:17 -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 1ssfPY-0002FI-CU; Mon, 23 Sep 2024 05:31:16 -0400 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ssfPV-0006xs-PZ; Mon, 23 Sep 2024 05:31:16 -0400 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-a8d51a7d6f5so614214066b.2; Mon, 23 Sep 2024 02:31:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727083870; x=1727688670; 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=QwsoQdUrJVWYxvUgDYuKBFMf0v5P53ou5sqi+kSdVbs=; b=eRPu9/NLDZyWvWoorAOmXVrUIXZU8URNj0I7sZKCbAa3S56vG1DtUppbqf+K2/FTAY yPdHFfas9qNdutyDogRV8IA7Mja8J6bzQYt8v7WNourd4yRJnUQKHgAi6YC7gz7ITrm0 5TsYvuODR7di1ooLx2kSQlclmOuCCool0mbjbCLGOfSixSbd9CZujtERXfzg05Kcaz38 ZsGihV5NblB6wmQx4arDwdaqsTmK5dQO5nq+wd3Pp/khDuy2CbeeMw4E80YjdyeufB2i IPXBxuyB0QH9sXni1NtLB+LPlPM7xHhtqDTUx8Ky5n9pzsBQ+5KCTchLmcQK/msV33ws fwcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727083870; x=1727688670; 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=QwsoQdUrJVWYxvUgDYuKBFMf0v5P53ou5sqi+kSdVbs=; b=RuRqpKxR9ahJjq9gt/xn9B8XvsUDpmyrg+Jajj2+/ZS9LQ3RxOQzdFjpNnfothhs1x DxRF073zPsoGjmytnz6U9txMsH6OlCu9tD4+pmZpFSUVFbYsrCk6K6UDns0ATQgk2yHu mQIa5qk6uIJhbWJOfg2t3fVjdYennOX2Q5/HDPMIP9JHLI6ceJ50+SqJFGBQeqeDSGi8 c+NYtRg3REDn3OCSKMYPs90PPShEAgpZV8n4aiDIMtuCdElOnU9LL4zPGpGWVFUDWWlm +tf1BzRR4+btUtIffBmHSbea5SLKiGexuRzMHgzbWr47+OUVtVDPichGJaPKOBinN5x6 1qdQ== X-Forwarded-Encrypted: i=1; AJvYcCUQD2LZ/SQ6v3VAZaw+LYkmpnNmc3dQqKBXeV3ILoNoGKH0oqV2Ej4YQDLdykCaeX8RV3Qw9Nh/SIQ=@nongnu.org, AJvYcCURCnFKgQI+9Etfd8AwFTIyTJYW0ohYicAU0aZRy7OjxCjhymztVCV5iK1oKLiQC0FePOgXItvyQNuK@nongnu.org X-Gm-Message-State: AOJu0YxjDCECXVfQ+0jXKpXZPMh3NyPyIhDsM4WF8Hn4O9Y8At7xoaHr X9QlWYw6gNZ/WAsk6b/eF+x9/zqBl1pF5fAkevqCwl2hrDLoFSGGwnXlIg== X-Google-Smtp-Source: AGHT+IFkEwvgPFvsRjXEL7W5AqBarn2pB08glC2ZukVll0DZqIc/t2lr7n2Yg4Rw34hRsJ767JDAaw== X-Received: by 2002:a17:907:7d87:b0:a7a:b561:3575 with SMTP id a640c23a62f3a-a90d5168094mr1093817466b.56.1727083870015; Mon, 23 Sep 2024 02:31:10 -0700 (PDT) Received: from archlinux.. (90-181-218-29.rco.o2.cz. [90.181.218.29]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a90612b3f6fsm1188747166b.107.2024.09.23.02.31.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 02:31:08 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Hanna Reitz , qemu-ppc@nongnu.org, Kevin Wolf , Corey Minyard , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Alex Williamson , Jason Wang , Daniel Henrique Barboza , qemu-block@nongnu.org, Nicholas Piggin , Bin Meng , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Bernhard Beschow Subject: [PATCH 06/23] hw/ppc/e500: Use SysBusDevice API to access TYPE_CCSR's internal resources Date: Mon, 23 Sep 2024 11:29:59 +0200 Message-ID: <20240923093016.66437-7-shentey@gmail.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20240923093016.66437-1-shentey@gmail.com> References: <20240923093016.66437-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::632; envelope-from=shentey@gmail.com; helo=mail-ej1-x632.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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. Signed-off-by: Bernhard Beschow Reviewed-by: BALATON Zoltan --- 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 Mon Sep 23 09:30:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13809441 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 04C62CF9C5B for ; Mon, 23 Sep 2024 09:35:08 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssfPi-0002sz-Nd; Mon, 23 Sep 2024 05:31: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 1ssfPZ-0002LO-Qt; Mon, 23 Sep 2024 05:31:17 -0400 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ssfPX-0006y9-L2; Mon, 23 Sep 2024 05:31:17 -0400 Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-5356aa9a0afso6216749e87.2; Mon, 23 Sep 2024 02:31:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727083872; x=1727688672; 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=8dnNWB1tKdPz2ILQ+8Fnny+ubgZlPn6x4nw7p7w7r+Y=; b=MVNp+fP7kfwziKFeXvoohG1nLxUlpLh3jTDtcfcIJunZ4lJ7BhYl1DB9w2bKvuVdqy j4+fUprMaUNnLsgO8ZikJytoQeNFDIjEose1Vwl9UZkEQLE2HV4nAa0Y3/5cZrnIrILC pwaRSig800lmDrTqfuTIx+Q2M3vXXYmw/m44VZlZTY8rsXqB2KxbLYHf3RHYVdm1lfPq 2gP2dc5JKlPj5nPp31TXvKBqKJd7ZwBxs5V1PkKihwF9V4f9NOIKh8dY8lsLd5nwzL2I aC+L7gYgNB5R3vPyklqGFNKl07ayPwffmQKNuTvTmofs7gAYlGMQpAhXM25u3KLLuS4F mF/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727083872; x=1727688672; 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=8dnNWB1tKdPz2ILQ+8Fnny+ubgZlPn6x4nw7p7w7r+Y=; b=H6rorrKGFdOl2FoDqXhGVPj1B1+50fAYCfFWh/wzgM6TT8xoAFwRWgjw/Yo0fPcHmA YX3MlzsBZUCFF+NKTxohdVOZFD4H5prULfXL+8e55zK7Yfuwr0ymja3lFnW+N6UlzB+Y lOXbqW2HjzfhEr+xxRe0c5NKIQBqn/1n1l6a7FXAmWqSDh6pMhUvDp3RTZCQ8ta4VEOU X2msqTIgOrqz1XZkUTjhcKDjroqyu3uB0q9tG8ed93R2/J1OzYSJcM4U1Qrw9CyktouH we2PZnlEphMcrNJYFlBruqTx/AmQEjQtTB8VnKTKCUSxI07KewQMhLDSDX69+tk8Iz+b ZxUw== X-Forwarded-Encrypted: i=1; AJvYcCUtjblENNODsRKVrvo+ImqX9Tnsfbtr3U3cHOs8q1geopdUK4ju5gLgyFmaUt/0lT+btYt3LTFrvuVa@nongnu.org, AJvYcCVzHxojqMuX/nk/FTYC7+fRw4j8FF4+jnSxoHthziGnOJsSI0CVGqvgt2tQ7/xte37uPDI15ApC4tA=@nongnu.org X-Gm-Message-State: AOJu0YzaSDvLeMmWbrauIl4SmDUGuD5QpbAzcwx8CBfoUjMMHE8KKaR4 USeg9cMk0tGv9UvCVnXGqi5zX5uTcDRKZA2UrpJMRfuSZE3RqXgZ74begA== X-Google-Smtp-Source: AGHT+IHcv1XM/XdU/R0ABNQsgcs+p8SK6GKNTprFTr8urPgVkse5sGszB6o2CksHWFgjIx8imMOsww== X-Received: by 2002:ac2:4c4d:0:b0:533:45c9:67fe with SMTP id 2adb3069b0e04-536ac32ef59mr6896874e87.48.1727083871927; Mon, 23 Sep 2024 02:31:11 -0700 (PDT) Received: from archlinux.. (90-181-218-29.rco.o2.cz. [90.181.218.29]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a90612b3f6fsm1188747166b.107.2024.09.23.02.31.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 02:31:11 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Hanna Reitz , qemu-ppc@nongnu.org, Kevin Wolf , Corey Minyard , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Alex Williamson , Jason Wang , Daniel Henrique Barboza , qemu-block@nongnu.org, Nicholas Piggin , Bin Meng , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Bernhard Beschow Subject: [PATCH 07/23] hw/ppc/e500: Extract ppce500_ccsr.c Date: Mon, 23 Sep 2024 11:30:00 +0200 Message-ID: <20240923093016.66437-8-shentey@gmail.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20240923093016.66437-1-shentey@gmail.com> References: <20240923093016.66437-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12e; envelope-from=shentey@gmail.com; helo=mail-lf1-x12e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org The device model already has a header file. Also extract its implementation into an accompanying source file like other e500 devices. This commit is also a preparation for the next commit. Signed-off-by: Bernhard Beschow --- MAINTAINERS | 2 +- hw/ppc/e500-ccsr.h | 2 ++ hw/ppc/e500.c | 17 ----------------- hw/ppc/ppce500_ccsr.c | 38 ++++++++++++++++++++++++++++++++++++++ hw/ppc/meson.build | 1 + 5 files changed, 42 insertions(+), 18 deletions(-) create mode 100644 hw/ppc/ppce500_ccsr.c diff --git a/MAINTAINERS b/MAINTAINERS index ffacd60f40..b7c8b7ae72 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1433,7 +1433,7 @@ e500 L: qemu-ppc@nongnu.org S: Orphan F: hw/ppc/e500* -F: hw/ppc/ppce500_spin.c +F: hw/ppc/ppce500_*.c 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/e500-ccsr.h index 249c17be3b..3ab7e72568 100644 --- a/hw/ppc/e500-ccsr.h +++ b/hw/ppc/e500-ccsr.h @@ -4,6 +4,8 @@ #include "hw/sysbus.h" #include "qom/object.h" +#define MPC8544_CCSRBAR_SIZE 0x00100000ULL + struct PPCE500CCSRState { /*< private >*/ SysBusDevice parent; diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index 2225533e33..4ee4304a8a 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -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 @@ -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..191a9ceec3 --- /dev/null +++ b/hw/ppc/ppce500_ccsr.c @@ -0,0 +1,38 @@ +/* + * QEMU PowerPC E500 embedded processors CCSR space emulation + * + * Copyright (C) 2009 Freescale Semiconductor, Inc. All rights reserved. + * + * Author: Yu Liu, + * + * This file is derived from hw/ppc440_bamboo.c, + * the copyright for that material belongs to the original owners. + * + * 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 "e500-ccsr.h" + +static void e500_ccsr_init(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 types[] = { + { + .name = TYPE_CCSR, + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(PPCE500CCSRState), + .instance_init = e500_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 Mon Sep 23 09:30: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: 13809424 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 75646CF9C71 for ; Mon, 23 Sep 2024 09:32:37 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssfPk-00033Z-TB; Mon, 23 Sep 2024 05:31:28 -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 1ssfPb-0002SK-KS; Mon, 23 Sep 2024 05:31:25 -0400 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ssfPZ-0006yM-08; Mon, 23 Sep 2024 05:31:19 -0400 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5c24ebaa427so7802029a12.1; Mon, 23 Sep 2024 02:31:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727083874; x=1727688674; 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=RERJXKUszJ43EeqHg4WLrmh2/0JVzvko+c62JLfBV1k=; b=jnFHJLfiDwp4x4MQcNW3CDYzSNxrYteg/ksCFdOsL4kWZBwbZ1yttbHYRliJNkTAvR JoVHsG8k3l4FJ7UsCNWwGsBjy48hF6rpMI2PQWbwbPI6JMH0z5NjeLPKhRsHJqlozPs3 EBc/AskRt9j2vkd2NGB5iQmDqURtpdBmX6MuENdvPnH2EQ3BqF/IV4JyB8XQ1Ea4dGV0 eIHsQa4uT+q1lAA6Ww2ZFENtvS59WMLSyAYROdq5RQwKIRdU7AYUsEieaYs1wRosj3K7 zduNui3vgTNqXr2RNp4uCl05B2Mb+6OILDGmFX7iWTn2rWkU8MJXG0eIPQnNMSPeWGtT SoUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727083874; x=1727688674; 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=RERJXKUszJ43EeqHg4WLrmh2/0JVzvko+c62JLfBV1k=; b=p8D1fF9vTxZxXFnFHf5lrQZBwS7stvVenzwSuoSYfrfOtExDhCU3VW8h4Eou3C8e4G LS5aNOL0M2oHwKmkEC9t6TQlAW+lEwRv/dG+VcLBzCLyxzMBkpYm+m/zwSUAnYWTecnT mw6XO5NjBy2eXdoOndtW90crB1fcO+Fa7Tgcr4/+6yfxNN5h/0noXClnKNtTtFWdSfc5 9y7pMJztCEh6Z6QI/Z9xe7IVEZ9WrVOUYMkPMQgNZZTAaWEMSPJZdvumfeoQabSrSlIW SqBmxF0WWlBfunzf9l9ndnrCmSXa2PEvLL8bFcvmYFRMwzFRmbw1cg0jM7wpboLWb5Et 2t8Q== X-Forwarded-Encrypted: i=1; AJvYcCVqRVFDaBIs8VCYvC0S3H4ckaTmDpcWQ6Dcr5IwpNhGC/b3ea0taru2WHXX5hq32+CBLDJIs4OWQJ8=@nongnu.org, AJvYcCXuYFthgVsrR9JOZlasA+jIY3XUO6Sscq2FzOGnpaqa2Bx2awhrGWqpiodRUEHqbbYnbcR9tFychOMz@nongnu.org X-Gm-Message-State: AOJu0Yy7167X8zmyy3RCWf7UETM0M6Shu/PCiDkCfhaxGJ4QRyWCdf+3 oe+1RhQmC2MVr2LY7Jy6faJxrPBNaTCXYh9PDvsFaaDx6imYtG5ipaCBhA== X-Google-Smtp-Source: AGHT+IFvV8tT709ubtZE3OCMj4d/1/E7HCpx7Ggm+UbJBUd/nhLzPNWdSF3QOsvTqsugtHHOvBT3/w== X-Received: by 2002:a17:907:9408:b0:a8d:498f:640 with SMTP id a640c23a62f3a-a90c1d6ec4dmr1533310766b.21.1727083873500; Mon, 23 Sep 2024 02:31:13 -0700 (PDT) Received: from archlinux.. (90-181-218-29.rco.o2.cz. [90.181.218.29]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a90612b3f6fsm1188747166b.107.2024.09.23.02.31.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 02:31:12 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Hanna Reitz , qemu-ppc@nongnu.org, Kevin Wolf , Corey Minyard , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Alex Williamson , Jason Wang , Daniel Henrique Barboza , qemu-block@nongnu.org, Nicholas Piggin , Bin Meng , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Bernhard Beschow Subject: [PATCH 08/23] hw/ppc/ppce500_ccsr: Log access to unimplemented registers Date: Mon, 23 Sep 2024 11:30:01 +0200 Message-ID: <20240923093016.66437-9-shentey@gmail.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20240923093016.66437-1-shentey@gmail.com> References: <20240923093016.66437-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=shentey@gmail.com; helo=mail-ed1-x533.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org The 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 | 33 +++++++++++++++++++++++++++++++-- hw/ppc/trace-events | 3 +++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/hw/ppc/ppce500_ccsr.c b/hw/ppc/ppce500_ccsr.c index 191a9ceec3..28942b2348 100644 --- a/hw/ppc/ppce500_ccsr.c +++ b/hw/ppc/ppce500_ccsr.c @@ -15,14 +15,43 @@ */ #include "qemu/osdep.h" +#include "qemu/log.h" #include "e500-ccsr.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 e500_ccsr_init(Object *obj) { PPCE500CCSRState *ccsr = CCSR(obj); - memory_region_init(&ccsr->ccsr_space, obj, "e500-ccsr", - MPC8544_CCSRBAR_SIZE); + memory_region_init_io(&ccsr->ccsr_space, obj, &ppce500_ccsr_ops, obj, + "e500-ccsr", MPC8544_CCSRBAR_SIZE); sysbus_init_mmio(SYS_BUS_DEVICE(ccsr), &ccsr->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 Mon Sep 23 09:30:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13809440 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 13C26CF9C71 for ; Mon, 23 Sep 2024 09:35:03 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssfPm-0003Bq-Tt; Mon, 23 Sep 2024 05:31: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 1ssfPd-0002as-W1; Mon, 23 Sep 2024 05:31:25 -0400 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ssfPa-0006yl-VC; Mon, 23 Sep 2024 05:31:20 -0400 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-a8d24f98215so558177066b.1; Mon, 23 Sep 2024 02:31:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727083875; x=1727688675; 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=K6CZQD1xJ4Za1UOZKzua0E5ijXIgQYfhe3Y1vJtCOdo=; b=CM+3vsSazaMGn3z6d6FG3nEQEzZv6kPaR/5sxZs/M3wp9iwkz8xidfTxYqKZFUMQd9 COIQmmq6O1djNBPTO1XC7eg/VKC/0d2yZwWPcXnxWj4ly5wUW+7Tieh/JzecetwqiUJ+ d/GEHsBacMOrqkRk0ksvtqtmObEHESV/Y5nqrGpSDgGq5gbZN/+Fg+kCqMsWVfmuBkRk m2G3oTmoGgE9+C7Op6sR/+r9rEl7RygFKfXLryclfhNyg0+feqSVfelcaAiaCUzhSl0L rcxEGF8sZTAH1BVeJkf1OQj7D7CdnPQCJ+u0OqssYxmQ9yja7kLU92rBB5ndRxipAnHp +gLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727083875; x=1727688675; 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=K6CZQD1xJ4Za1UOZKzua0E5ijXIgQYfhe3Y1vJtCOdo=; b=YHiRSCd+7d+kjao1Mr7n4VXqpp9Dm/Z2dd3sqFXFsjCRfzmlxPbgNILpzwPhtXNo/j BJY4KMQuozNzqF27WUR3I3Hs3yso9sgZWF+lDOHC2Z88FrQQacXipaiAufZ7BsEwk7r/ HsaCBiWikdVLS1Bg65pjO1bFIJn7Io0d6lbo7lWn/bHOIaBzvu5tVsZGCAl4DlNY3hv/ RuLMMTt8Lhe42J+EqGoPCNVQX97FbibraS75TgzeZCgyyLhqr0yONsd9RUfjhidumyWq yc/kjDUGiNzQNO94Gp0UJrhzpdfCUcy9ozcQDBjUh4qf4K/pTdyOTc3Gg8OKZLvFY79G Eg/Q== X-Forwarded-Encrypted: i=1; AJvYcCV934OXNruIixzdHDhGKTqNYPp9ShY3qIXqJIkpS5QT/vn67g1SRVL93KzH45p/YqHbmRYzf2GqGKw=@nongnu.org, AJvYcCWRp/C9NGL6nzyEYXGqMrXvJgz0x85JI238OQ3GQgGBkfUvagNm44Cpz0Phz+LXyvIQV8HRYm2uO8pH@nongnu.org X-Gm-Message-State: AOJu0Yx6fzsskuOCAF5wkV35ZVUgc7LInndWTvrjS7Y+Dpn0azZflC8V K5c8FTBcklHbK3Cg0LTawlU1fNOgFgDUoK+qGNuEtNRZFXxwyxxYUl9ZnA== X-Google-Smtp-Source: AGHT+IEwJQIEHhCll5yjtbAaJ8IDBYP3vjsdaQHZgaoq4obMSCgozPrBBVQgRoQONBW/Xw0hlKXfJA== X-Received: by 2002:a17:906:d262:b0:a86:851e:3a2b with SMTP id a640c23a62f3a-a90d4ffc82dmr1075343066b.29.1727083875320; Mon, 23 Sep 2024 02:31:15 -0700 (PDT) Received: from archlinux.. (90-181-218-29.rco.o2.cz. [90.181.218.29]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a90612b3f6fsm1188747166b.107.2024.09.23.02.31.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 02:31:14 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Hanna Reitz , qemu-ppc@nongnu.org, Kevin Wolf , Corey Minyard , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Alex Williamson , Jason Wang , Daniel Henrique Barboza , qemu-block@nongnu.org, Nicholas Piggin , Bin Meng , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Bernhard Beschow Subject: [PATCH 09/23] hw/ppc/mpc8544_guts: Populate POR PLL ratio status register Date: Mon, 23 Sep 2024 11:30:02 +0200 Message-ID: <20240923093016.66437-10-shentey@gmail.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20240923093016.66437-1-shentey@gmail.com> References: <20240923093016.66437-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62f; envelope-from=shentey@gmail.com; helo=mail-ej1-x62f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Populate this read-only register with some arbitrary values which avoids U-Boot's get_clocks() to hang(). Signed-off-by: Bernhard Beschow --- 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..6688fd44c3 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, 16, 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, 3); /* 3:2 */ + value = FIELD_DP32(value, GUTS_PORPLLSR, E500_0_RATIO, 3); /* 3:2 */ + value = FIELD_DP32(value, GUTS_PORPLLSR, DDR_RATIO, 6); /* 6:1 */ + value = FIELD_DP32(value, GUTS_PORPLLSR, PLAT_RATIO, 4); /* 4:1 */ + break; case MPC8544_GUTS_ADDR_PVR: value = env->spr[SPR_PVR]; break; From patchwork Mon Sep 23 09:30: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: 13809422 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C821DCF9C72 for ; Mon, 23 Sep 2024 09:32:29 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssfPl-00037h-Ti; Mon, 23 Sep 2024 05:31:29 -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 1ssfPg-0002lu-Ti; Mon, 23 Sep 2024 05:31:25 -0400 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ssfPc-0006z3-Dn; Mon, 23 Sep 2024 05:31:22 -0400 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-a8d64b27c45so766462866b.3; Mon, 23 Sep 2024 02:31:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727083877; x=1727688677; 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=Gk0TI6PhzPVX9iexQrZ/MM+nIP2rF3HI992oH7AdJ4I=; b=ETqgGm81KZtoYruwD95OXByzSBBliL2PqzOpLoUAGLpenfEO2ihQVxFzk0Ln/hePyR Z0cxx8Blcka21YTQjQQJh+HOl+P//eEOGCqHewNphHS9WJhQXiCkKzo1sH0jOYzUYT2O pJxtH5OgqS7u4JjGMeYmeJjxVCW1xPWy1hwVS8g/mhkob2p4yJ2Stqq2y0/5b5sPF5aB 0/ao+KgLRMvwYAEWUyTyBMjucKeFglQ2UCSAL+F0zPYtnA1XXPK+EKiJ2jfSf3GJLppS t3LjQMo5GRnlxhkzhX//B+uFO2mn8eK9teNK4xOMjkwPDtrzsQvbdEj53lbV4w0oXemY Oxlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727083877; x=1727688677; 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=Gk0TI6PhzPVX9iexQrZ/MM+nIP2rF3HI992oH7AdJ4I=; b=oqKVBWqzgM8VpGlZQ+vuShalMCvoE4D1cgT/DMBz9u+D6tIpopFBJpXcfwv64nOx5b 9DxrilE8fYCNxOfHTm8Qo+gFTfi96fo9lFdeS/NBN/nlJf2Tyl8s5OW+J8P6e6ww4DmM 19hwXXUZPiJ4K2iTy8X7OtxWIEaNoYwejuS1wIeRHZJDNtRldOOR4rt4DCC4Yg16t5lr 5wmGkiSVuI9svGqpOccCc0Bi0C5yj+ET4Um/SKf8LZQu+IIjCnRHh6QK6JLhev0XX7Fy AJRDuqRRAQB3m1fs3O/vUbkQGSZWg7hUhFi+20HYH3IsP8XG0wSxDqMy5vpVEDE1v6H/ gVRw== X-Forwarded-Encrypted: i=1; AJvYcCWuddZY8NIUan//EeKJ37ENar9K94NhorIWclHdlHVp7nFeNOt93Z8Hlr3dZIfziLBWV7KCShkqt2K0@nongnu.org, AJvYcCX5iQCPakbWA27mRv+N4tSF6z4fC5mnL8+zMGxtWKoLfRIMwudRB0qtwtRcOYsnhtpNeRjwV432zdA=@nongnu.org X-Gm-Message-State: AOJu0YzWw3+q2G48PWnKT03OYX96hTL+CMcK4FzRNMDHBOH+Agd1z4dj jPyHoYdODrXl1CZyHjwVZ8NY7lGhq2FUAHwWH8eiNljryC4jLZrEiDiADA== X-Google-Smtp-Source: AGHT+IG92EfphYA6j4+HK3yEweb6tY+YoKcMJvzq5HMag6Rs4+rgGUCH1A9CByPd72K2RFeKFLI9dg== X-Received: by 2002:a17:907:e655:b0:a8d:5472:b56c with SMTP id a640c23a62f3a-a90d4ffdc5dmr1030574266b.22.1727083877205; Mon, 23 Sep 2024 02:31:17 -0700 (PDT) Received: from archlinux.. (90-181-218-29.rco.o2.cz. [90.181.218.29]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a90612b3f6fsm1188747166b.107.2024.09.23.02.31.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 02:31:16 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Hanna Reitz , qemu-ppc@nongnu.org, Kevin Wolf , Corey Minyard , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Alex Williamson , Jason Wang , Daniel Henrique Barboza , qemu-block@nongnu.org, Nicholas Piggin , Bin Meng , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Bernhard Beschow Subject: [PATCH 10/23] hw/i2c/mpc_i2c: Convert DPRINTF to trace events for register access Date: Mon, 23 Sep 2024 11:30:03 +0200 Message-ID: <20240923093016.66437-11-shentey@gmail.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20240923093016.66437-1-shentey@gmail.com> References: <20240923093016.66437-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::634; envelope-from=shentey@gmail.com; helo=mail-ej1-x634.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Bernhard Beschow Reviewed-by: Cédric Le Goater --- 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 Mon Sep 23 09:30:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13809436 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 00B7DCF9C6F for ; Mon, 23 Sep 2024 09:34:35 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssfPl-00034g-2R; Mon, 23 Sep 2024 05:31:29 -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 1ssfPh-0002nd-DI; Mon, 23 Sep 2024 05:31:25 -0400 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ssfPe-0006zO-Db; Mon, 23 Sep 2024 05:31:25 -0400 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-a8d2b24b7a8so940199466b.1; Mon, 23 Sep 2024 02:31:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727083879; x=1727688679; 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=srRYZRMsYEk3Ixto2iPTmfOmvfPdHaxOey2BOrigk8E=; b=jc2YfGU0STqyciFqtbl0q31rJmkn3WpChis0gfnTMQdO4858G/Xzp2/DF3gFL576ex kMJCCtAne5dkEea2Wy1PLAqb81uIqWlZB6AT/2RIssmAnqC7v9E4o7b6xN9waX9q8oE4 miffKv4eVeitBq0agMod7rywjSvn7esJDg9jZxyAmB3UYwfjwttA5c8UhKgmSemcbEI7 Qbz8PSzJH49aUiLaPLsk+uSDNoozn4HL4S77reoRSI3ZJ81vjaPsHb4DkAHUFiMoSrVE xwrg0JLM4W3KWFlGLRxd0c+8mH4atMQGQQfHRoVIiIeOX0aMLDnDjUSBDDURXIZ+jJ1j cUCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727083879; x=1727688679; 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=srRYZRMsYEk3Ixto2iPTmfOmvfPdHaxOey2BOrigk8E=; b=aBKcQL0xGmuvQ1LIUI//J2CLDd3h53nsqoReSDR4EoEEmeisgt/xqH0G6To/Z9kNxN 0AuU9KpVhkhqUvZYGLGg0RufvC5dBv4wqp3gezpXXwqrud+tPd/UOsUDT6PUjyW37MRf XBT8ym5+VozBDRvmitiGeoV/1T2eHOBSAA91o6/czOLAMARZIa4ORAHM2yWKmOVnLqkI DsLbKb1sBEMKp5kqg9hWSBu6Xr7+Qfkz84gTSotpHZn8Uy8R0FpuSOX9A9btyfk4BzBA XzcP8GyusAJBkwHn15E9nzucjVy3RnnK4wrCBrdao1nhKEPuwxwTPU0uQyvW3CAapGAe hlXw== X-Forwarded-Encrypted: i=1; AJvYcCVnfj/wZT/1+Crdtjy3oj7zmWvN2QdF9sDdo3emja5hToGN/vCMPPyLdc27lGx6nYPiJIHNtMrLjdU=@nongnu.org, AJvYcCXGH1kmcrkVk+eDY3SXdve7M87H4KgmkIhzaJ0VgI8r1RA4nB1WAzKqSmh8Lp3187hQfegAmMu2UEbG@nongnu.org X-Gm-Message-State: AOJu0Yzj7+Ne/Uu5EoPLhOTljELhPM+Wg99f678/Egzvy9j8SbQpUryl KqmNV5picyf9LZbLBKSEc5A0L7+QiY9CSTWFU3Dgm7/ETv5hgweoQS1Ijw== X-Google-Smtp-Source: AGHT+IGfeWFYVL1ZnurH8y2RgNyV0q51OrlWBMpDvZNfEhv7B0BE07Vg/HsuHiEsPEHr4fiPnh61GQ== X-Received: by 2002:a17:907:7254:b0:a7c:d284:4f1d with SMTP id a640c23a62f3a-a90d3644733mr1149971966b.28.1727083879191; Mon, 23 Sep 2024 02:31:19 -0700 (PDT) Received: from archlinux.. (90-181-218-29.rco.o2.cz. [90.181.218.29]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a90612b3f6fsm1188747166b.107.2024.09.23.02.31.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 02:31:17 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Hanna Reitz , qemu-ppc@nongnu.org, Kevin Wolf , Corey Minyard , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Alex Williamson , Jason Wang , Daniel Henrique Barboza , qemu-block@nongnu.org, Nicholas Piggin , Bin Meng , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Bernhard Beschow Subject: [PATCH 11/23] hw/i2c/mpc_i2c: Prefer DEFINE_TYPES() macro Date: Mon, 23 Sep 2024 11:30:04 +0200 Message-ID: <20240923093016.66437-12-shentey@gmail.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20240923093016.66437-1-shentey@gmail.com> References: <20240923093016.66437-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::632; envelope-from=shentey@gmail.com; helo=mail-ej1-x632.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Bernhard Beschow Reviewed-by: Cédric Le Goater --- 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 Mon Sep 23 09:30:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13809421 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8519BCF9C6F for ; Mon, 23 Sep 2024 09:32:27 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssfPp-0003LG-1M; Mon, 23 Sep 2024 05:31: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 1ssfPi-0002qH-3b; Mon, 23 Sep 2024 05:31:26 -0400 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ssfPg-0006za-Jx; Mon, 23 Sep 2024 05:31:25 -0400 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-a83562f9be9so468925266b.0; Mon, 23 Sep 2024 02:31:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727083881; x=1727688681; 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=OUh+oh7tSH9I4rc1ZsB6pfl2pyJWratf071Tqy+tkcU=; b=U+oPZC+hysKG6aM191gij5dmDFhms3o2ff3YiZ0ce7Sd2KOu1NQ+Z71Lb9aKE+4N9R 9z/2UT3enCcrRRl5fg/d66XbMuy3wCkEg1FsFrMhL1mqtpkB8xP29OSHoqypKdewDvxC JrRxYNHg/Us+ODVxarOEQKrLNv/lm3JEHxAXMuIjLZQMi+ubRKRpNd11NPreCbe5T1Li YpUHfj+GWQk3CYl4BbbTH13eC2zZYWJgybiwBy17JH7w/dJII/pQTRn4uSSZvg3N5k4J AIQfZ0mi2432k/5Vf5d/NJpWvgvsvDvpQplOeJTC88yijbeU8mxk9aaNvc1tj7C9cKgg PeKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727083881; x=1727688681; 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=OUh+oh7tSH9I4rc1ZsB6pfl2pyJWratf071Tqy+tkcU=; b=UH8wmIgaZOfS57N4SIWlIfpBn2/ZSD26ugsbyyfNSmkroLYqmacGQpmZQjoORjalJt yPpfPadAeOkPc0NnfH+sXBdNxVrsTHnAN5n8xX0EFl+z6ydhyKKhM1YlxKgBiFz7NBkR g/5r8WQFSLt+koHbtONx1CQ2Q5Rf6GcvIJigwhy+/9/43dn2iCKZYQ6sizhz3j1V+Ojl sO1OzqIuMaf0gxk0ZfyLx8oVylfHC8gu+QhGbHvt8W0Xz5n68peUR6X2NDvm1mmj4cWy B7YDht06coh8wQrgG9rrK+qKgQBEw8N/kFm8dnpdyAmAg84+j88RPh9LiQ0v5JAFHIoi B/HQ== X-Forwarded-Encrypted: i=1; AJvYcCV3x1d2JoBw6qwGqvLjyUJqcFFCe+O2MNstP6c6ZvSJOslODXP9DXMz0DQAPsgevYBE6A6zI6Q3v8k=@nongnu.org, AJvYcCXlSnthZfqBUShHlk29/28ouxjhsengkA+EJF+17QRqRXbiMOZngFqGMTzTh2Zaqkn0ZfNuqe2YRkOh@nongnu.org X-Gm-Message-State: AOJu0Yw/NFhZVbU7ZTtlugPTcd+UYU3971ogzZKHVvZR7qDeWrdnSLD/ 5ALr3Ljb9+GLjc6r2Uz3Zmt4hdH/T9XcvUvT8UMp6V/t+5nKFnv0r+eVYg== X-Google-Smtp-Source: AGHT+IGhZPbR4sS92Yd3klCUpgb6yNV+VJtM3enhxhrJr4m2BQw7iB/OEqxNo6fgEFeILE3Fo616ig== X-Received: by 2002:a17:906:730c:b0:a8d:55ce:fb86 with SMTP id a640c23a62f3a-a90d5122bd7mr1185738166b.57.1727083881148; Mon, 23 Sep 2024 02:31:21 -0700 (PDT) Received: from archlinux.. (90-181-218-29.rco.o2.cz. [90.181.218.29]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a90612b3f6fsm1188747166b.107.2024.09.23.02.31.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 02:31:20 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Hanna Reitz , qemu-ppc@nongnu.org, Kevin Wolf , Corey Minyard , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Alex Williamson , Jason Wang , Daniel Henrique Barboza , qemu-block@nongnu.org, Nicholas Piggin , Bin Meng , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Bernhard Beschow Subject: [PATCH 12/23] hw/pci-host/ppce500: Reuse TYPE_PPC_E500_PCI_BRIDGE define Date: Mon, 23 Sep 2024 11:30:05 +0200 Message-ID: <20240923093016.66437-13-shentey@gmail.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20240923093016.66437-1-shentey@gmail.com> References: <20240923093016.66437-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::634; envelope-from=shentey@gmail.com; helo=mail-ej1-x634.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Prefer a macro rather than a string literal when instantiaging device models. Signed-off-by: Bernhard Beschow Reviewed-by: BALATON Zoltan --- 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 Mon Sep 23 09:30:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13809443 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C69A1CF9C6F for ; Mon, 23 Sep 2024 09:35:21 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssfPm-00039I-BV; Mon, 23 Sep 2024 05:31: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 1ssfPj-0002yf-N3; Mon, 23 Sep 2024 05:31:27 -0400 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ssfPh-0006zl-Si; Mon, 23 Sep 2024 05:31:27 -0400 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-a8d24f98215so558192966b.1; Mon, 23 Sep 2024 02:31:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727083882; x=1727688682; 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=mHGjpUSmV1BY/gesAqJRCAT6c0HlF78YEs0jV0SsyRc=; b=RezEmTP+0B9V9xAQlssH/HvqrlhtUVxB5C3jyeQwA+rWKt8Qw6Drf5kChjwSXQ6N3G 0txnLf3P0eb7xMAdmxx2+6SckolIP6N3tSWUFuoGbwgy/xdWS2cXQuFtXEvfD9nmiVnE oZbP04aF4YBNda7X2FZr7F4mf1Zeiu6dQA7uMqKtvEeUu3nwgeZTiHW6iAntaNv110HU TlVsq5fRQjzRI06KdZcYTgHGJsneLuHK77UreWLRCdc+w+Jnzx+U8xULR7gMuitJlzJC bCuVlHMYH17h8FFcNbVi2JIxZ+kINP2H+KMa0LRHdGog5HFgeb7h6RJG8e1EoxgwUKcc epPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727083882; x=1727688682; 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=mHGjpUSmV1BY/gesAqJRCAT6c0HlF78YEs0jV0SsyRc=; b=rVg3ZMq0fYmn40JJ+MKLumcfvw4gc8Idee9gbaRbJURfP/lEOtzdT2iGtyABW7AqK/ i7AVK8iBN4SjKuU6Z7fo3wd/+bWuqMbw+C0sd2jppq31HRua1d+ZfjURDvDOwjRhYHhc ohx4b/D2w7FMBPJXZTunzCDneIKSFPrjyVCx8ZVaZ6SWOheL6r6dxNWTggCB+4BPjnaZ EaigOHKbzw9Md5kPtYRQg0OPAXMRWJR2UtHPgJDkpuWTqw69j/5zYH8nWLN8ISm0Bclm w3qoeK7M0T+4MciT3BqEAiQmdPHsejf9KDaAnyUYbNwRx/pzfq6Sd1BifLyMBzWkAsE6 d4wg== X-Forwarded-Encrypted: i=1; AJvYcCVrZhP0StLAXq9PjRTZVRnnD8+F4bPjz66U15j4oM2YWqj5jNGdfvTCAgAQalqcRcnDcgQnVyKxvsU=@nongnu.org, AJvYcCXTjghBkQC7b8qmGgYzX1dAxGIEPRBdlpBYSON/eAM6sUdVnQpKI8e9svSRMneTcnsyQazB+odtyxrw@nongnu.org X-Gm-Message-State: AOJu0YxrddgaffZDTHBRik9BTdYsX5dizhzuS+HOy+1JA6CeolP5GXaO GZcL/6PR6gB7k07JuAmPKZlLRgNKNYEymJ/Vfh57AgRc5gRWha3ut7hFmA== X-Google-Smtp-Source: AGHT+IE9itsyK/LlKe4r9Sa82Dr7vX3q9d1qBslDtDQJTMKiRyiljh/d26vV1d5PbCDgs7EEI/Z2ag== X-Received: by 2002:a17:907:d2db:b0:a8d:f04:b19b with SMTP id a640c23a62f3a-a90d4fbcfd5mr1101262466b.2.1727083882399; Mon, 23 Sep 2024 02:31:22 -0700 (PDT) Received: from archlinux.. (90-181-218-29.rco.o2.cz. [90.181.218.29]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a90612b3f6fsm1188747166b.107.2024.09.23.02.31.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 02:31:21 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Hanna Reitz , qemu-ppc@nongnu.org, Kevin Wolf , Corey Minyard , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Alex Williamson , Jason Wang , Daniel Henrique Barboza , qemu-block@nongnu.org, Nicholas Piggin , Bin Meng , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Bernhard Beschow Subject: [PATCH 13/23] hw/pci-host/ppce500: Prefer DEFINE_TYPES() macro Date: Mon, 23 Sep 2024 11:30:06 +0200 Message-ID: <20240923093016.66437-14-shentey@gmail.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20240923093016.66437-1-shentey@gmail.com> References: <20240923093016.66437-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62e; envelope-from=shentey@gmail.com; helo=mail-ej1-x62e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Bernhard Beschow Reviewed-by: Cédric Le Goater --- 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 Mon Sep 23 09:30:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13809442 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9DC26CF9C6F for ; Mon, 23 Sep 2024 09:35:18 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssfPm-0003Bw-Un; Mon, 23 Sep 2024 05:31: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 1ssfPl-00034k-1k; Mon, 23 Sep 2024 05:31:29 -0400 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ssfPj-00070D-8m; Mon, 23 Sep 2024 05:31:28 -0400 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a8d100e9ce0so504498866b.2; Mon, 23 Sep 2024 02:31:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727083884; x=1727688684; 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=FkfWI02D70VtzWbR0yhpKcWeB0nhAn0RHoWdU2Bvhx8=; b=Z0aEFxLluermHTNH9TbKDeQjZMrIDk4GIoCo4GU+VmKgx+RqV1fX7nFtT/Ov3tky2V imosaai1ExCm5PUqakwXXT2LPLjB2WB9NkHqKi8QIRCohbr1VGzo3fFc+rHHk62YiN0M Fgv0LP8B2qrghHC8JPJNCE24GQon4+Uo+n2jjQHKqfhCANpCKZi2qwUwlCe19sRWcdmJ yNQNZ36Y9X5pREmdRuV/jKyeBh8g6E/AiuT6yaPoNEcrvIjSycOYYT0IGQDMqd27y2Cd PPRFkSWPzeh/UZZNiNgVE8AH+ykkm1gDmWEUwZolx1scNp/ovtxdD7AGpDrZcXg0R78J NMFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727083884; x=1727688684; 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=FkfWI02D70VtzWbR0yhpKcWeB0nhAn0RHoWdU2Bvhx8=; b=J85MbTf1Do24GvXNKs8vxvVzam1oMioO/eY8AKGrt3ctxvyvcUJP0xVcDvNrL+ffBa weSVPi9JsddJ+6Wicig6nTl7vYpe2LLETMu96p6A1t2RPivHtUspGUjopBJOh6eNb4+g 51dDPCu4J+CpychfLceT6d0jyAx9o6iRZGfsaGZtl3iXtbrCUKuphsCYc2I4hPXi8Nui EEyuCFNOF7qR82ifrlYgfEgnoVd2YGPpCZtSTrFEPMTQZqGVuFT1kgc/kpo029OTVHZ3 JqSYJjmue4bdXoSDTFhe6Ocir7E3goMnLGV46A9eya7GVVGxU8SuEuXEZVidg1InkCLV R1bg== X-Forwarded-Encrypted: i=1; AJvYcCUhVejjQy2g+HWUg/wdulwkPe5czkdKEgdiQm2Dl10Lv+9GVPFAsllS1ZLteGzapPTkMyyGsNLoXOzb@nongnu.org, AJvYcCVI0CLD69P6hVmiVa4Ip5nV9SXkfeerxMxwKwjEJbw9XLCzF/INEwFOQYZ3se0M8z4EB//RFtDxzPs=@nongnu.org X-Gm-Message-State: AOJu0YwC88DqiYQb56BOj4zq7NHU2p0xkZt50SbOceaJGfUZuqaqeFAX gF21hGiq8IJ+EP6SU2A+BbjPx6ZCw+h4HBSkyMWJ4GosuUIRfHLxTsRKBg== X-Google-Smtp-Source: AGHT+IFh8CFek9hxkLL6felu5Vk0iaQ0t1buQG+uvDFXzx6tJpapcMekUUu6CXC49EH5lOCdZ4cPCQ== X-Received: by 2002:a17:906:c155:b0:a8d:6712:2ddd with SMTP id a640c23a62f3a-a90d549c063mr1162954866b.2.1727083884281; Mon, 23 Sep 2024 02:31:24 -0700 (PDT) Received: from archlinux.. (90-181-218-29.rco.o2.cz. [90.181.218.29]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a90612b3f6fsm1188747166b.107.2024.09.23.02.31.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 02:31:23 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Hanna Reitz , qemu-ppc@nongnu.org, Kevin Wolf , Corey Minyard , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Alex Williamson , Jason Wang , Daniel Henrique Barboza , qemu-block@nongnu.org, Nicholas Piggin , Bin Meng , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Bernhard Beschow Subject: [PATCH 14/23] hw/gpio/mpc8xxx: Prefer DEFINE_TYPES() macro Date: Mon, 23 Sep 2024 11:30:07 +0200 Message-ID: <20240923093016.66437-15-shentey@gmail.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20240923093016.66437-1-shentey@gmail.com> References: <20240923093016.66437-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=shentey@gmail.com; helo=mail-ej1-x636.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Bernhard Beschow Reviewed-by: Cédric Le Goater --- 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 Mon Sep 23 09:30:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13809432 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F109DCF9C71 for ; Mon, 23 Sep 2024 09:33:26 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssfPv-0003nb-JW; Mon, 23 Sep 2024 05:31: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 1ssfPm-00038k-2v; Mon, 23 Sep 2024 05:31:30 -0400 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ssfPk-00070l-Gd; Mon, 23 Sep 2024 05:31:29 -0400 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a8d4979b843so515733366b.3; Mon, 23 Sep 2024 02:31:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727083886; x=1727688686; 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=zl1UfkNK4uOLHCCNuOFOWU9ZrQRdFQX35RLscGjdLrg=; b=ZI6DeI83QKfJ4XJyOPtFx6yd82FRXvckX31wtc9R1JN5ZWc22mNR1PQS+Ds14Ltn63 jRYyDbfxxPRaHLXIGoudNMa8vtxWVpmj9ccUKc8zxV03mwu2Jab55LF9ExIO2I07LOr7 24q25ryAOmaQb44s/PhkMGLU/yYyxbbMEbnSGJj9gxozLKT0zS8QIqoiULW+TFqJWPXe Yt0UsjqoO2jQD49/Usd1MUTHiRjOFdkEJe+D6v5tN7IkJaLTc5/J3Sbs+QNIpVFBJdJc I35ElocJkkNnmlQu0QdRPYXfsarurLqdrtlnyagUIVUYGsSOnfip40EKMeLEqBRDNkHR 0S1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727083886; x=1727688686; 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=zl1UfkNK4uOLHCCNuOFOWU9ZrQRdFQX35RLscGjdLrg=; b=pFS+sXWsfEV8jODDdpazqEZriP+xK3E5leOLGxn6vkm+RpUARlncutOXaKtugk6Z+M JaUQApxo6CoX3JWrlvN0u0ZI2eWFtdjOP53lQ0hZSrHCzumqpVd6HUsogqnWf4Qy0QAq f8Xd4w8qHm4bPbZFX+gh5W2AkQ4f5wAUF7kK7xymDapXHFZ5fYFBovEKRziaPUHPCFee PCWwNUl2zUXK0WJTZ5Kx+0w4AlHzcG+1eGb7YdiU2IWoNS4OhsGcL03tEr19nUc5w3uD GzcsPeOEJKd+rU4tljKM7q9RrihsE8Z5O4Fw9ZkSXeN3YtcsXUGd5Eu8/BxIxSyrlpdV DC+Q== X-Forwarded-Encrypted: i=1; AJvYcCVpfj2jCN4ygkE0Bed0+qvecp6kefa7Xol3obw3BHfLeAoIiFkAlKdhs8br8Ez4fMgjn3Rn8LP9+ME=@nongnu.org, AJvYcCXg51gwYCMSFyabTyvUY77WtL2tjqOEEc5wHlkm1LXJDIu1U7omlUq11pWUpGoRJWGl3NmOeWXYr8gj@nongnu.org X-Gm-Message-State: AOJu0YyknBVhsY/iNMz3K4XviiXWBNrTO7zV0HHDmVzHPTGmCpP1NCun Fs/f7C6NVjYEqTFtaCaxKF1dYpq8yGRZbtjaJCIOqWpYr4eAtOtwbu6nZQ== X-Google-Smtp-Source: AGHT+IEKW+H3JsoS1O6yo6rqI9yZQ5idQ/Pyi1NG+Wti/sIMHZ50/3bbzras5gWuWJo45UTyamhbSQ== X-Received: by 2002:a17:907:e603:b0:a90:344a:7db6 with SMTP id a640c23a62f3a-a90d583ba97mr1079142466b.62.1727083885793; Mon, 23 Sep 2024 02:31:25 -0700 (PDT) Received: from archlinux.. (90-181-218-29.rco.o2.cz. [90.181.218.29]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a90612b3f6fsm1188747166b.107.2024.09.23.02.31.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 02:31:25 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Hanna Reitz , qemu-ppc@nongnu.org, Kevin Wolf , Corey Minyard , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Alex Williamson , Jason Wang , Daniel Henrique Barboza , qemu-block@nongnu.org, Nicholas Piggin , Bin Meng , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Bernhard Beschow Subject: [PATCH 15/23] hw/ppc/mpc8544_guts: Prefer DEFINE_TYPES() macro Date: Mon, 23 Sep 2024 11:30:08 +0200 Message-ID: <20240923093016.66437-16-shentey@gmail.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20240923093016.66437-1-shentey@gmail.com> References: <20240923093016.66437-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=shentey@gmail.com; helo=mail-ej1-x633.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Bernhard Beschow Reviewed-by: Cédric Le Goater --- 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 6688fd44c3..cbb1e3adda 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 Mon Sep 23 09:30:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13809423 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5C017CF9C5B for ; Mon, 23 Sep 2024 09:32:37 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssfPq-0003Rz-Os; Mon, 23 Sep 2024 05:31: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 1ssfPn-0003Eo-Da; Mon, 23 Sep 2024 05:31:31 -0400 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ssfPl-000710-RF; Mon, 23 Sep 2024 05:31:31 -0400 Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-a7a843bef98so554382366b.2; Mon, 23 Sep 2024 02:31:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727083887; x=1727688687; 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=vTAYFcyEYOewFDEdRGbYScC4E5SZ9wSdgr4ijamJJiA=; b=PLQ00/hKHClPGaUAWOkwfju8iYzqyLRmN2deK3KaScJfD/l+yO51C8RnO6AFBWnonk Aw9E7/otsr1AgKPToUjDY3dExtPGM9FQ5NuplW2GUUo5pJdmTLcfymvp+E5eitWJ/J3x F0G6hktYBQ9aVighKq/bay172H/rsDLxyfeXr+kvC1GBYXmaEGyca87oUBPs+ciQPoD/ /8OBLdE24xGqeZthdp9dC720VaxiLGiThuB78VDsQnhGyPHsFlcM+nhfHRLYhntLJO3x t/oW3mCl2+lza+dVE95SVyi404sihN5PE4n4jWQmVCYBFnv0d2R7dDYjyFaU3BZQmIRn QP6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727083887; x=1727688687; 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=vTAYFcyEYOewFDEdRGbYScC4E5SZ9wSdgr4ijamJJiA=; b=CB97WnazrMfu5BK/6J3z440QJwhdLioeJJ8Xmjtre78/efdEiPyWpDDbFQYMHDRt+A 2d2fIyTRPV6/nxNppf+SzzE2dwASzX369N1RtANtxSyPgiWc7FDqhbCrY6To+KVHnRkK fRLErew2R1PknEOEWRytEyhfw2yIJ+oHsDGZvL6RbEU4JaoNb8sTyB3O5FN/Mw8kMtCg eP8CpjG/E9ExWxT44PuYuxMmu4oDjZYnqW+XK3uljXRcVUqH3hrOxXgRjwDy/0mQEY47 nSict8mKaL+nOlnk5A4fFkrNV7+fADTKXlHMUq8vfp8sjFC5q9e79X/mzrBR0qRnLZ50 5yfw== X-Forwarded-Encrypted: i=1; AJvYcCUWb8OlSvFhKIG9Q3hw9BLoOzsuprEEyerbSJJm4UIaQFfD9rO6kaylAoEjL4IS4n961utuimR405ed@nongnu.org, AJvYcCXjE0lvwM1ZU6OIecR96YVb+PJDzTHtmwVvsrgpssGU1ZNU09CiaGN1zM/YJsGV0znXRqeBPiGBXpk=@nongnu.org X-Gm-Message-State: AOJu0YwxT22xCV1arOWqIT1BpMHfg6yeN7Ktw6z/gEN7yv1otjwdoqBH LHwMmGiiC2hJ5LSGV71gVnqQoZWTFmK4Swd/a58HdnSt32KdlZooqLqSfg== X-Google-Smtp-Source: AGHT+IH7kOrGrs11twdPlGMngsYp2+d8ZkGLvegXkfNGuiCd4ENUXx5IN9HSNg7mJ0Qd0ZRKninr8g== X-Received: by 2002:a17:906:d25b:b0:a86:f960:411d with SMTP id a640c23a62f3a-a90d4fdf842mr1140067166b.2.1727083887158; Mon, 23 Sep 2024 02:31:27 -0700 (PDT) Received: from archlinux.. (90-181-218-29.rco.o2.cz. [90.181.218.29]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a90612b3f6fsm1188747166b.107.2024.09.23.02.31.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 02:31:26 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Hanna Reitz , qemu-ppc@nongnu.org, Kevin Wolf , Corey Minyard , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Alex Williamson , Jason Wang , Daniel Henrique Barboza , qemu-block@nongnu.org, Nicholas Piggin , Bin Meng , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Bernhard Beschow Subject: [PATCH 16/23] hw/net/fsl_etsec/etsec: Prefer DEFINE_TYPES() macro Date: Mon, 23 Sep 2024 11:30:09 +0200 Message-ID: <20240923093016.66437-17-shentey@gmail.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20240923093016.66437-1-shentey@gmail.com> References: <20240923093016.66437-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=shentey@gmail.com; helo=mail-ej1-x62b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Bernhard Beschow Reviewed-by: Cédric Le Goater --- 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 Mon Sep 23 09:30:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13809427 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 21203CF9C6F for ; Mon, 23 Sep 2024 09:33:05 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssfPs-0003Wk-3n; Mon, 23 Sep 2024 05:31:36 -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 1ssfPp-0003Pw-Vt; Mon, 23 Sep 2024 05:31:34 -0400 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ssfPo-00071H-8Z; Mon, 23 Sep 2024 05:31:33 -0400 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-a8d2b24b7a8so940227366b.1; Mon, 23 Sep 2024 02:31:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727083888; x=1727688688; 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=N6N1zWPO8DnSJg1Q/8i6UHf3EekeeyOAcUgqB8xGeAc=; b=icgvvAMd72sAmyGs1SlwBR/nBdkThAGhBpapsgSnMvepseDYIu1Eb932rCOr/5eOGv 9b+hW68Gj9c0pqYx6O1K/lyZCcs+U8qvLKrzlRBLIyUJ9yWhj/ernKEiVd2icguS1Tmv eIvnzHYaG7ALQaz69s4eMddykYxrwmFOLD0ontFhlQi1y/5HEF8TEYNbpd04rfcQut3c y8GE2UkUyF0qiytjq4iY36hvMCDauTNjq+nGJOb4rbC3uKhJBo6Mz/q2byYrunRDkhvM lTxyXKi2WPsL3rHYPOzvnb5PUxqSrmSFl3EpsCWcrK0IeunYBQbh6qTnZybiivbmH9Ak 60mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727083888; x=1727688688; 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=N6N1zWPO8DnSJg1Q/8i6UHf3EekeeyOAcUgqB8xGeAc=; b=MXAy+Nap37XHhzM/RqyCMx2Lk4I4mCUQlvVyLVWZsWLZncTd0zcNcRsZgG3QE05CIa MT6M3hA4ygv7JZRIg7urMEkTr8dSUI8aJZ09/CGNQtsBv+kxaItuEpvL8h6GI9WaykVO nWENVY4JhEX0BZ5OI3Vtv5mqJvwdVkR5tJXbpmID4PMXvwan8GaQDrdNwILL1vYZ8SR0 CuWM1XkFn1GXFE9ZFoHgwUrQKR8NK7xGn+PmRzuXQI/DMdKGy8HROOqoq8om2lc0HtrS cuc9mK0LKXj3+MW72X1TjiqK7HwT9KrbrbEck1XFNHU2zSr7JXhsa6USzTe8rlttAn9h RxOg== X-Forwarded-Encrypted: i=1; AJvYcCUG59p9Yg6uiJoPVDEeRWItRVi2VwvmDyvAPmJlA6EAhLzrM+ZXE23TOA9UknFgZHDs5KXN0v53LhM=@nongnu.org, AJvYcCWbzpKrJgO8OVOApfJ9Qqil908HwwrClUiwEfs8wf3Q4e0BR1c63Ph5XnBiR7xd6VTrdUKbVOOnDYcE@nongnu.org X-Gm-Message-State: AOJu0YwFC8y3YHBP3R7qUtS0fNsa3HDUxhVsmxx2zfJujknW6A48FrkU x0sHVxLQEB5eci/D/osYcmwIUvWvwNmsgVF+/TU/Zz8v2t3HhyVmctq9gw== X-Google-Smtp-Source: AGHT+IEzfruuAabaD+oBvcCRqz8chteMFhJRScR73hbZjHbHlB2rxyLnv/Ws0MbJsapmh7VM5amC6Q== X-Received: by 2002:a17:907:2da5:b0:a8d:6dab:b8ee with SMTP id a640c23a62f3a-a90d362ce84mr1207410366b.23.1727083888464; Mon, 23 Sep 2024 02:31:28 -0700 (PDT) Received: from archlinux.. (90-181-218-29.rco.o2.cz. [90.181.218.29]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a90612b3f6fsm1188747166b.107.2024.09.23.02.31.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 02:31:27 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Hanna Reitz , qemu-ppc@nongnu.org, Kevin Wolf , Corey Minyard , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Alex Williamson , Jason Wang , Daniel Henrique Barboza , qemu-block@nongnu.org, Nicholas Piggin , Bin Meng , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Bernhard Beschow Subject: [PATCH 17/23] hw/intc: Guard openpic_kvm.c by dedicated OPENPIC_KVM Kconfig switch Date: Mon, 23 Sep 2024 11:30:10 +0200 Message-ID: <20240923093016.66437-18-shentey@gmail.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20240923093016.66437-1-shentey@gmail.com> References: <20240923093016.66437-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62f; envelope-from=shentey@gmail.com; helo=mail-ej1-x62f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Allows to clearly mark code sections relying on this device type. Signed-off-by: Bernhard Beschow Reviewed-by: Cédric Le Goater --- 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 4ee4304a8a..149e608324 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 Mon Sep 23 09:30:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13809439 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 00B73CF9C5B for ; Mon, 23 Sep 2024 09:35:02 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssfPt-0003eA-Dp; Mon, 23 Sep 2024 05:31: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 1ssfPr-0003V6-B7; Mon, 23 Sep 2024 05:31:35 -0400 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ssfPp-00071i-C8; Mon, 23 Sep 2024 05:31:34 -0400 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-a8b155b5e9eso610137966b.1; Mon, 23 Sep 2024 02:31:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727083890; x=1727688690; 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=ZEqt+B/rZIxMfU9E+WiGg5KsOPuW4FR5+eD/WT3GDlU=; b=HEQKLQUIJgQnCWo6SPZYMhEIPM1W5wvYb8q9/RL2ADJPbKQMkorGzNzcDpWKRAXVBq ZmWoBx0bFf0rgUc+1YPNtGlKs6dT01HhfF0X7CiwRxlMEyT1wIDBjA2do4ye5HqzjHwk 7UUptFgjV4uLrRRJL7hARl0Nc69x1WZDCkGWcw7yChYwACVL8cLAUrk5mn136mAabfE8 oKxrj2EPKz7TCt732m8957vabuwhxE7ED6didRJZO/tn/pY/Ys0XJlfx9EEaYw8kIJ6b MT/5DN6o2upd8HXjlsfD/GxOHnnsps1Ii9N7hqZcSYlY8+fdkmX8l72ga+kKB/33QU5T uiAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727083890; x=1727688690; 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=ZEqt+B/rZIxMfU9E+WiGg5KsOPuW4FR5+eD/WT3GDlU=; b=iAnMo5XM5TUaa0GNSPSka8Fx+URqxbhUXoV/zONV0NJY5yQuhz3ZP+PmI+ccsF6RWL oQyGNf3NR0Bt0t0COsGnA+jD++U+4Kt+PDS1wCgWBfks+txxeN0bUnWyraohVRU4USoB 7sjkJc71ozKfQKXOy+XN67Vvej2+jBAa9zRxPbmsiA5BEE0M9FF1BiKe2A0JWae4IQgp Z6K+5Oe2mk8T2n7uVJm/bKDRYXDmLI8G3qJmk5/KRh1HlCOqp/hXMR05CtM9iDuypLMi 2df3HWZaK0R7lFFpsJA9bW+PCXtJjjZPjYyXiSCphyOs4dm70D0tRLndvookvzgbRMg4 GkgQ== X-Forwarded-Encrypted: i=1; AJvYcCUVEZmNjqvEK9pjpmDZ7HvDiuKRP+wop+nMKh/tdYNdNe28LekVqT26XB7IH/FtcXzP02a1shGHJKbJ@nongnu.org, AJvYcCX9B2vAESRmRrSasllVIbEsDRyhGJRKW0Ip5O4gNrvOdazto9tiW8lIlGI8gPgrW5o+mpFmYqWEwCg=@nongnu.org X-Gm-Message-State: AOJu0Yxnss38cNF3HfBdOchfc8v5oifks8Mcz9QT1eFh0wHdxjHzwu9I dDv1pEKXcdqxz5ejFTPoaJOmhMsVIm64nrIn0YTd+ltOtC/WrC7yiThKAQ== X-Google-Smtp-Source: AGHT+IGPs86AeQbW3UBi24h3sOmCWRRsJfhjcOsSwwgsnpFlauMcEEzR1MYD2C8rEAjfyxYwJIFCpA== X-Received: by 2002:a17:907:d3e1:b0:a8a:71d5:1094 with SMTP id a640c23a62f3a-a90d50eec25mr1022663666b.46.1727083890042; Mon, 23 Sep 2024 02:31:30 -0700 (PDT) Received: from archlinux.. (90-181-218-29.rco.o2.cz. [90.181.218.29]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a90612b3f6fsm1188747166b.107.2024.09.23.02.31.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 02:31:29 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Hanna Reitz , qemu-ppc@nongnu.org, Kevin Wolf , Corey Minyard , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Alex Williamson , Jason Wang , Daniel Henrique Barboza , qemu-block@nongnu.org, Nicholas Piggin , Bin Meng , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Bernhard Beschow Subject: [PATCH 18/23] hw/sd/sdhci: Prefer DEFINE_TYPES() macro Date: Mon, 23 Sep 2024 11:30:11 +0200 Message-ID: <20240923093016.66437-19-shentey@gmail.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20240923093016.66437-1-shentey@gmail.com> References: <20240923093016.66437-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62a; envelope-from=shentey@gmail.com; helo=mail-ej1-x62a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Bernhard Beschow Reviewed-by: Cédric Le Goater --- 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 87122e4245..3ed2d8658a 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 Mon Sep 23 09:30:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13809429 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CB63ECF9C6F for ; Mon, 23 Sep 2024 09:33:13 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssfPv-0003oA-O1; Mon, 23 Sep 2024 05:31: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 1ssfPt-0003eG-DZ; Mon, 23 Sep 2024 05:31:37 -0400 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ssfPr-00071q-PI; Mon, 23 Sep 2024 05:31:37 -0400 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-a8d56155f51so496305366b.2; Mon, 23 Sep 2024 02:31:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727083892; x=1727688692; 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=xjFxdBHFisGMgmJV+yxy4OCzd9gwLLwjEyXicrgoEOs=; b=LS1GK+bRTaKOMqhMIw53/20qK4hnig4f7NGKvnVxID2YkufRd/73L9UaAGu2Jm9M+Z YJdQguWca+64qYfiolAc2V7VqHrEONCEYp6c8vG0pLZChoC1tfX+EAHXLMbO3ZG1Fxxz INF3FlQMngRmHCAx/CetSWHy3arsm4THUDFSLA2u7AWgMNRJTa2JWk5JfKAE8ZINZsIF GfInWbplTH1AOzGroI5GzYvrlsAeKeRb7ZlDZA/IZdEFHKIec7B3I+v8KPE4iM7PyJBf SYCY5hR/q2b52yiueZuWSgOUSNy/M5UYuix4s3EVoAqj9ZGgNY6M55cLXbPUw7MbVoLw Y0NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727083892; x=1727688692; 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=xjFxdBHFisGMgmJV+yxy4OCzd9gwLLwjEyXicrgoEOs=; b=qQOgpqJxAokCQC6HLW6Ia0wVhMLUean5fJQVbpiTG+qytBpppjELy41Jtm6vDpDrhj q/dmdaJ96W+D/dxvef1l30F41GZ9Gm8c4Jpk1Z3Lw6z0r45d4MxHZtBoaYxDsqzo1ABM t0wToucXyloQRYp9VX83dz69g6oJK6hIocwbIcEjuIFQHtcCNYgR65YbfVqWLGi1eabY odF4eAlxD4PlXUePE/ojgkVHxvH2pgZCRZdxH+f2zhnoG/4TVtgx/kVSzxRAaaqQ2zj7 JtPtN0o3ymjf9Sqj+64kz6wV0NgrAjgpnmrn3VSEh+wekLy8v1P2lkQUDo2X6YeSWG4S c1Og== X-Forwarded-Encrypted: i=1; AJvYcCUbkpcYtJrPV2Idh0JAkpVtvDsItd9zdWabOrMrEZM5UG8t2/UqSD4rTku9d/WUUG4LiKYugPh3WHk=@nongnu.org, AJvYcCVbvmr9frZz9/Of2aWFC92qCS/Eb3NKWUyZUrgX3r1kKvfF0/K7yWf7sfPIAjmrciK6bSmPB7aQu4l2@nongnu.org X-Gm-Message-State: AOJu0YxBG63W9iEFgcI2cFBoRH1qHkkPxvOKnRJZ7B8dyZqMdWE+Krfn f1Axcec6QGSKo14dmavljQV7z6VFTgFaPwwTe3KcMGOdnWc4JfI43ry0Xg== X-Google-Smtp-Source: AGHT+IHgNIv65lwph6phtyyhYNvgu3BbDU7C3wE3C8+IvpPtkEKiPaPFW+Dm3TLnNwK18hUSoHQpyg== X-Received: by 2002:a17:907:2684:b0:a86:8917:fcd6 with SMTP id a640c23a62f3a-a90d512f9a6mr1064726866b.60.1727083892232; Mon, 23 Sep 2024 02:31:32 -0700 (PDT) Received: from archlinux.. (90-181-218-29.rco.o2.cz. [90.181.218.29]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a90612b3f6fsm1188747166b.107.2024.09.23.02.31.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 02:31:31 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Hanna Reitz , qemu-ppc@nongnu.org, Kevin Wolf , Corey Minyard , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Alex Williamson , Jason Wang , Daniel Henrique Barboza , qemu-block@nongnu.org, Nicholas Piggin , Bin Meng , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Bernhard Beschow Subject: [PATCH 19/23] hw/block/pflash_cfi01: Prefer DEFINE_TYPES() macro Date: Mon, 23 Sep 2024 11:30:12 +0200 Message-ID: <20240923093016.66437-20-shentey@gmail.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20240923093016.66437-1-shentey@gmail.com> References: <20240923093016.66437-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::632; envelope-from=shentey@gmail.com; helo=mail-ej1-x632.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Bernhard Beschow Reviewed-by: Cédric Le Goater --- 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 Mon Sep 23 09:30:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13809434 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6CD43CF9C5B for ; Mon, 23 Sep 2024 09:34:24 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssfPy-000442-Vn; Mon, 23 Sep 2024 05:31:43 -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 1ssfPx-0003uR-56; Mon, 23 Sep 2024 05:31:41 -0400 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ssfPv-000724-M6; Mon, 23 Sep 2024 05:31:40 -0400 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a8d64b27c45so766521666b.3; Mon, 23 Sep 2024 02:31:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727083893; x=1727688693; 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=aOzD6ssHRYbkBf57nSepsx+Z8u/2fDdX3pi3JzLzT/I=; b=ZXEcUDOwqEVhtfU+C7i2nf5J/TGDI4ttCtnJAK3AtluK9IeGt1UX+eaFFWFq29PRGY NfDkvMseHbs/HNOTQLuiLka0swhe4W046xNVCm+0eC+LEv+d8gcfOtYwFMMn36JSHD4G 12ZOSdoo97iTwg5g0LDNLf6pBquF9AGTG2bWRzi3G+uCj3bFNTdZf3MwlT7uOBNj2KoL mwnYqnpx9rGFCwf76RlnqJpZMACTv3hRatReA+ZRd+noLqLvPy3xDzIrci8S0JpcgERH XiAskIG7SH5vjrOoiNfPghYWMckV1NZyozldocobPiRu5aTsCaDGAoGKBHJdxBpmuz9o SoQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727083893; x=1727688693; 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=aOzD6ssHRYbkBf57nSepsx+Z8u/2fDdX3pi3JzLzT/I=; b=T6/nRdxfCKQLq1YN1/V29VKS/rABZCaDlUQv+QENCME3Ctmn0EYC3z+C9PcapdIBBj lv2fxqu1C7+e9cmrjGO1GE8p4GuJoNvMfjKDbx2jB+r8nzUoojLZXzNupdxWk4cm3YoN qkZknUIYmW/H9a8kIXs3jxsH8O1zYJmF8rlRZdgo/2oYh9juwvTMbH9Po0wIQgOkjo8k IohuYpC5/iW6snjI9Jf8rYHusJTgLFxjWKhVR9QcBojeoX3spfGwOEqg+YCktQ6Ugqm8 DGS0WqoSuZ0YE6YkqrByfa/LD7WDoqOgvea0DMOnWEs5r0O43DRaKHlQiKyd13aiRO1O t57w== X-Forwarded-Encrypted: i=1; AJvYcCVeR//EtxPnX7YdF0Yrrk9HWQ+s7g74wCl58mb13EmUQNysbG2XfC3SZ/sHc8oQ334SQA1I5N3KK+Y=@nongnu.org, AJvYcCX5f3ZwAd4sr8iT6z4AgBwuzCzDGMD8rHE6JmM2i4SzLYJQzgK9XqOLKlLQuKqlN3DPqlWmBVCacIvP@nongnu.org X-Gm-Message-State: AOJu0YzbbEYxsjp/qBDm+UJjjiFNIooeM+BynwEVxZF5szfHI1MSS/Ap wtVq3R2T4m3T6uAT9BOzNxPntVIBAIvAiCPh4eadkq2LgzBf/u8iWUsAQg== X-Google-Smtp-Source: AGHT+IHMnDUojEx5KTsGqZ/MIAt5QRpQ9BKEWydVapkuMT0BgZXw4V5k0QrZhao7n3vFI2nx1cBMMw== X-Received: by 2002:a17:906:d25b:b0:a86:f960:411d with SMTP id a640c23a62f3a-a90d4fdf842mr1140091666b.2.1727083893465; Mon, 23 Sep 2024 02:31:33 -0700 (PDT) Received: from archlinux.. (90-181-218-29.rco.o2.cz. [90.181.218.29]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a90612b3f6fsm1188747166b.107.2024.09.23.02.31.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 02:31:33 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Hanna Reitz , qemu-ppc@nongnu.org, Kevin Wolf , Corey Minyard , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Alex Williamson , Jason Wang , Daniel Henrique Barboza , qemu-block@nongnu.org, Nicholas Piggin , Bin Meng , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Bernhard Beschow Subject: [PATCH 20/23] hw/i2c/smbus_eeprom: Prefer DEFINE_TYPES() macro Date: Mon, 23 Sep 2024 11:30:13 +0200 Message-ID: <20240923093016.66437-21-shentey@gmail.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20240923093016.66437-1-shentey@gmail.com> References: <20240923093016.66437-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=shentey@gmail.com; helo=mail-ej1-x633.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Bernhard Beschow Reviewed-by: Cédric Le Goater --- 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 Mon Sep 23 09:30:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13809430 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4AC1FCF9C6F for ; Mon, 23 Sep 2024 09:33:20 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssfQD-0004xw-Ea; Mon, 23 Sep 2024 05:31:57 -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 1ssfPy-0003u0-0a; Mon, 23 Sep 2024 05:31:42 -0400 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ssfPv-00072J-GQ; Mon, 23 Sep 2024 05:31:40 -0400 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a8d43657255so661922666b.0; Mon, 23 Sep 2024 02:31:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727083895; x=1727688695; 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=M9bzZ/GFOvwUoR1zPglVl2k74UkcypgW81AHz/hJj94=; b=YhpoN0gpgd04lWaJCP03YjJUjm0acLgrUfcfj8ZVSg9YLclSFiEwAM4cpcFwSdUgtF pTKPl3DmnXN94f7KBCIQ7xdhjTbD0zJQyYZDZV4Knyfz4N109SujFjyisLVtxViSXcgd hhb19ngo93FuTykH6g3XfPibeY8medFQDnErBwp1afVF+btNcQ9VZUSg8ui9CjJGjpCj hrnEp9qFjNnPhdALIw2g3gJP7tT5lQzPmMaupU3CDnA4jqzvmWU7iL5R/28yOPISBIvK Md2wAxC36dFGc62pqwPjscmBzSuxph4kqGpAmuajzjsGZDQkK9KzBh4OdKirbc3mLA7w y3Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727083895; x=1727688695; 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=M9bzZ/GFOvwUoR1zPglVl2k74UkcypgW81AHz/hJj94=; b=PvNfMiBYMiHx/zJN+K+63DBMdNbwPULptCwL/Xk1truVguErYKe3XRA2KM148XkwCe /GS8errOhrSjJ8Ci177PJB2IPcVkE8Tu5thhpBvpA+rtIKs/zRJ4zrxPF5lSAahdV+iV 3zPW/+Sq6hp3ZfH35lXoHs3o9h4g6DmLAtEwixcbAtMgcyteyp5kYq5YlNbTCDyc+OI1 beXNE+GI1ami2f1VAhi4asMV/VXLRnp1Ne9Xn1+8DbH/uCl4rGyiAcbt9i4EoRP3Gikx SFjBFzvsdp1XE7uhuuP+OHfzarWzpu4w2J+uOs76HpOTO1Gl9z4ajLkpwINzJtisTqpH AXJQ== X-Forwarded-Encrypted: i=1; AJvYcCULcOnd/hXa8QvJwKbCyIewAMYFPBSCRpXfstBHxDXwSJFgMP8QWsjLHpI3ciCj/ZSbBCiDLZd/KY8=@nongnu.org, AJvYcCUkV3ztk4eB5MkL6dLkkKO+n9/uY+rqBObspaB9uNcmaqqzhnK89++Dq2jb0VM0ekafalqR9nv22iJW@nongnu.org X-Gm-Message-State: AOJu0YwuzTx9prqLhrsz6rR+VKiF4WzV0StYb91C1yTkFzQLMFIgJcVx bSybKK9KzwxrqPAX7pXaUUimWdBQfwGT/6XOqK1QJJcUAlWy9e6kiD2oyg== X-Google-Smtp-Source: AGHT+IElN7sgu8F6nrOsHxOV3IX+3sDJSzhAOAJB09zFAe31ce4ait1ch6jgYpJyOrr3muBTSzdnag== X-Received: by 2002:a17:907:3f25:b0:a8a:ead3:8515 with SMTP id a640c23a62f3a-a90d514a83fmr1115869666b.65.1727083895462; Mon, 23 Sep 2024 02:31:35 -0700 (PDT) Received: from archlinux.. (90-181-218-29.rco.o2.cz. [90.181.218.29]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a90612b3f6fsm1188747166b.107.2024.09.23.02.31.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 02:31:34 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Hanna Reitz , qemu-ppc@nongnu.org, Kevin Wolf , Corey Minyard , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Alex Williamson , Jason Wang , Daniel Henrique Barboza , qemu-block@nongnu.org, Nicholas Piggin , Bin Meng , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Bernhard Beschow Subject: [PATCH 21/23] hw/rtc/ds1338: Prefer DEFINE_TYPES() macro Date: Mon, 23 Sep 2024 11:30:14 +0200 Message-ID: <20240923093016.66437-22-shentey@gmail.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20240923093016.66437-1-shentey@gmail.com> References: <20240923093016.66437-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=shentey@gmail.com; helo=mail-ej1-x630.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org --- 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 Mon Sep 23 09:30:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13809425 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5B47ECF9C5B for ; Mon, 23 Sep 2024 09:32:45 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssfQL-0005pO-Io; Mon, 23 Sep 2024 05:32:05 -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 1ssfPy-00042u-LM; Mon, 23 Sep 2024 05:31:42 -0400 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ssfPw-00072Z-F2; Mon, 23 Sep 2024 05:31:42 -0400 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a9018103214so599346466b.3; Mon, 23 Sep 2024 02:31:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727083897; x=1727688697; 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=30eSo8wCFe2NZUhIuWQhfIj7OMLCKiEi3QH07KcC8x4=; b=i/TFk/XowvGZ/frzUMxod7uB6tbasZRpJw+80z8wr/rGP+k6A5b3IAuK/vgW+vOj8O CV2Nd8B72JSOJmuvupvg7eKTgavUmY1ImpzrL0540p517JOrg8G++sNPJP6Z7GIRTG0z pVRhotYZsnfsbNdeNIWKO+QZ+tW5RdWcIwkjbIb8ZmUov9EG4L/aEVLUPAle/ZAAVscU lsaJMrFUw+1NT9QQlEuAJuJZVoGgjQQ9k2SPv5SUFnQ+Qa47DuRubdJeUsbWlcFdz0M8 Z1P7sYKdfUp5WoB7iaj5KrUtpv+MJdEuNirRAw/cYV17fb6VmsQ5CVRh6nAlVT3u6u8M 5CEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727083897; x=1727688697; 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=30eSo8wCFe2NZUhIuWQhfIj7OMLCKiEi3QH07KcC8x4=; b=w1/n5j2cXRtUhRXwBYAPTHqLqBAoJuHZ7Elo3/H4Nu91W7z2SvCwKWTBhJMCbGbCJT Q102dkSdly7uFR/s1O3AXSn5eEAoPgfZJTvRHfsTmhV3K4oNXFlSbSwZaS4URTIUZe86 DA8VWJn5TWJZJOr+slMpwX0UC2G0GG93Imx1lBce/VA01HdGkwrbji1Ily3xoYQsIfnt wJ5WCZP0EY9RN0Ze6RlZORlCeyIn7gjCOC2B9TXJd43jyvuxhgffc29+uM7i2BeBzhlA NadczrkguOWK28Byl7GD0UEFWTt7o/5iIghxcZnZZBpBhHc+4Di8D7iSbXC/0GOXPoyK flsQ== X-Forwarded-Encrypted: i=1; AJvYcCV3868bDJJXHK5Guf1h5YO47t4DHfRAkNNHyZoaPIMAh3C3nAXPrmjRFZ5YzLlQcMiQ0cw9/ofQtCA=@nongnu.org, AJvYcCX7ZKsAvSXX+yeUDKt+micY4stGnT9FCGdAGytvwGzmYpXeBgPGlIKXniRTBmLcGkbXSvfTi9Obg6HG@nongnu.org X-Gm-Message-State: AOJu0YzGv/B9G//3PCUGrs9vyb42pLtDTTuwRFt8BIwSyaHfqGPRYCor ItGMjKEGg9QrCYjdUFGsXE83iZOgx25ZF/8wQ+SIP5AxKnF5d/VKKMv/ug== X-Google-Smtp-Source: AGHT+IH5LZepyt+o7dPH941kY+02WS75I1ORGhmukoVSfVBAFZh6YGn5Gsyx2vJZv3ycCXenhdkJnA== X-Received: by 2002:a17:907:1b23:b0:a86:88f7:679c with SMTP id a640c23a62f3a-a90d592576fmr1244998366b.41.1727083897230; Mon, 23 Sep 2024 02:31:37 -0700 (PDT) Received: from archlinux.. (90-181-218-29.rco.o2.cz. [90.181.218.29]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a90612b3f6fsm1188747166b.107.2024.09.23.02.31.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 02:31:36 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Hanna Reitz , qemu-ppc@nongnu.org, Kevin Wolf , Corey Minyard , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Alex Williamson , Jason Wang , Daniel Henrique Barboza , qemu-block@nongnu.org, Nicholas Piggin , Bin Meng , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Bernhard Beschow Subject: [PATCH 22/23] hw/usb/hcd-ehci-sysbus: Prefer DEFINE_TYPES() macro Date: Mon, 23 Sep 2024 11:30:15 +0200 Message-ID: <20240923093016.66437-23-shentey@gmail.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20240923093016.66437-1-shentey@gmail.com> References: <20240923093016.66437-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=shentey@gmail.com; helo=mail-ej1-x636.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Bernhard Beschow Reviewed-by: Cédric Le Goater --- 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 Mon Sep 23 09:30:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13809435 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 63A97CF9C6F for ; Mon, 23 Sep 2024 09:34:24 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssfQD-0004z8-Qh; Mon, 23 Sep 2024 05:31: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 1ssfPz-000485-Hg; Mon, 23 Sep 2024 05:31:43 -0400 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ssfPx-00072s-Tq; Mon, 23 Sep 2024 05:31:43 -0400 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-a8d56155f51so496320166b.2; Mon, 23 Sep 2024 02:31:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727083899; x=1727688699; 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=QazYJuwkb+nuQnDTinA3pE/6s10IXt5ACq+vDFbVeD4=; b=d7ImnK2lECBrjc0jm6ETz+EX2x/rMCjVk94APZwPut4Wfz1an10+r6nj9whvqzWO2A kZIx2ysQ5f9VQF+MkUS9L4vUT+VIhKPxLMQN2sC/DAH64q067pO6W3mW9w8cGsOUNioU 7E4bD+mInsX8HBR/AJxP1GAlz6DCFayFZONN9wfQJnFV9KlhonM042h7SXKo+MyIe1uJ bF3Fpe2VU2dLXbdl2RCZNxS4Fzp3iS5WeZHSq7DgWbWhyumbvPSugs4wDR+RAsdw1cVB O9S7NIEgslD4qVGmmiFn3leLJzeczFaU7Ar+n8vEbeLZ22GQjjDJdsMahwGEZpbKRG9n giHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727083899; x=1727688699; 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=QazYJuwkb+nuQnDTinA3pE/6s10IXt5ACq+vDFbVeD4=; b=fFGechHVNJWwonhVHZhSyypVNW/QaVTqQ4i2sQsvQv9HJadUa1ChvnxgIDR42RUuhA FZHskGAR4eFVGdrRetJelheSoHUhpUdo2ML5Q2nKUpcS3HLs41gdxcMn1YZTqaxhGPnQ ayyfn2QXORflf7pzuUSt7e5b0SPhAzRVnYVQt+xz0He4QFab7zBwIVJfwew60ulNjt1e Q2Fv1OJbTH7XtWmEeDo7iVye5sep1yGtuTO++002yZcnfqZmghb7fVuyxV/37zOj4qwS TWB5vHZMd+Oeqee6WTeb6MuK7h9JiS2orjUd4lAtsG+tMmie4pb1GmbgjHNFQcrQ3xHO 0JGg== X-Forwarded-Encrypted: i=1; AJvYcCWHuIi7P+0XOG4bvzx2M/0V4NBgus+c9I1JYxa6hGEGJPhHRWKqHmZH6uyu2fgitrJ7tWyNLNuGOLM=@nongnu.org, AJvYcCXFXEAxSDjau9dYK68gjVQBXWR1HngMzxDK+Y9sgQ50NVqe/a0rLc7JIdyx973A/D0sVaqBbAIZoYSW@nongnu.org X-Gm-Message-State: AOJu0YzLT6hk795g7fzlCT0NwYpGEICzQk6yTdygpQQu/tHuvG/vkPyq T71CEOrkfmH1B0FW3dQNr9GAFzOuKNwSjhUPn0TMRnnclrAqpKwPF9wL4A== X-Google-Smtp-Source: AGHT+IHiW18NJQyxd924KS3hFzgS8ngM98lDZCBq7qV+osEvw/ye+oDjvWfs/Sl7gbTW4ln8yMTUzg== X-Received: by 2002:a17:907:f704:b0:a86:80ef:4fe5 with SMTP id a640c23a62f3a-a90d50ee84bmr1037087466b.47.1727083899120; Mon, 23 Sep 2024 02:31:39 -0700 (PDT) Received: from archlinux.. (90-181-218-29.rco.o2.cz. [90.181.218.29]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a90612b3f6fsm1188747166b.107.2024.09.23.02.31.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 02:31:38 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Hanna Reitz , qemu-ppc@nongnu.org, Kevin Wolf , Corey Minyard , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Alex Williamson , Jason Wang , Daniel Henrique Barboza , qemu-block@nongnu.org, Nicholas Piggin , Bin Meng , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Bernhard Beschow Subject: [PATCH 23/23] hw/vfio/platform: Let vfio_start_eventfd_injection() take VFIOPlatformDevice pointer Date: Mon, 23 Sep 2024 11:30:16 +0200 Message-ID: <20240923093016.66437-24-shentey@gmail.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20240923093016.66437-1-shentey@gmail.com> References: <20240923093016.66437-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62a; envelope-from=shentey@gmail.com; helo=mail-ej1-x62a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Avoids one downcast, making the code more type-safe. Signed-off-by: Bernhard Beschow Reviewed-by: Cédric Le Goater --- 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; }