From nobody Sat Apr 5 05:36:00 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1737828855; cv=none; d=zohomail.com; s=zohoarc; b=dtc8Td6+Tdvk0zLqp5PoG4zhL/cHa+AhkBwgj/9oYKGoUj3x+cqwH7ycBxXqR4b79S+1O9/9SyQVGat7v6nh+iOooI4fy664hon5xrkhT+BSHNw1is7Gpl/aho5Twn7/XuKkLq2uCWhOnQpuS+D0u1CyAkMlfTIVSrGPYiysa08= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1737828855; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/se+ZOUWHI4guWWCfgPKU8ovKC99g/6LRZidVGKe1oI=; b=iNMBUNa9tHp30k0DQ34hCVnQWi9eF4DLWFV+9y9M/37RYXw20bmyjCQKS8km3aPIGOi8kVqiXDqI8wSCQxw/dEIRaFg8wgJzPc2rE8GAivkeqahq+VoAdS4pyKUTLRU1i0aVsILDRf8urSRYczkFuK32LPV86l5qv7XvtW+iEj4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1737828855298181.51267846289272; Sat, 25 Jan 2025 10:14:15 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.877006.1287210 (Exim 4.92) (envelope-from ) id 1tbkfJ-0004p0-2T; Sat, 25 Jan 2025 18:13:53 +0000 Received: by outflank-mailman (output) from mailman id 877006.1287210; Sat, 25 Jan 2025 18:13:53 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tbkfI-0004ot-W5; Sat, 25 Jan 2025 18:13:52 +0000 Received: by outflank-mailman (input) for mailman id 877006; Sat, 25 Jan 2025 18:13:52 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tbkfI-0004aj-70 for xen-devel@lists.xenproject.org; Sat, 25 Jan 2025 18:13:52 +0000 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [2a00:1450:4864:20::336]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 213dc56b-db48-11ef-a0e5-8be0dac302b0; Sat, 25 Jan 2025 19:13:51 +0100 (CET) Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-4361f664af5so35550265e9.1 for ; Sat, 25 Jan 2025 10:13:51 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a1c4e49sm6227077f8f.98.2025.01.25.10.13.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 10:13:50 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 213dc56b-db48-11ef-a0e5-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737828831; x=1738433631; darn=lists.xenproject.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=/se+ZOUWHI4guWWCfgPKU8ovKC99g/6LRZidVGKe1oI=; b=LRHBJHLWm7gqxXEu8WXxnmKG3n89uc5bSbcx1rG8HfUc6m/wy+Ft0El7SI79t44d8F ufbHGqNRJpjbXQknnJxdIcVYRhT9A0C6Xv2fiC008I883D6kU/C1QphM2p3Nheq+37qv 6si0JLjwGaMxvkn3uLNFL89V5Hhu0GOPOiVfnSZmnBpnEhQo9DvsVRAPac6hcR2q0ffV KDtl+j6SdFlUo+Poims3zileJZz+qEJ0sRlM+lssJGPydgMyEmWYh52DxN5XaNkPCqu9 d7erUjS01Q7oHKvM/pw6UAp953sIESOQrgZFLu6C7Eb5AVlV4Bz/xQVCUtLs2xqgOKnZ Moyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737828831; x=1738433631; 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=/se+ZOUWHI4guWWCfgPKU8ovKC99g/6LRZidVGKe1oI=; b=w5LUVltpk88pQrnwXjgZGp7K0QLrpPMuHNvXGvU7vV30YGUA/gkw0Puikji9Uu33Hq TOUOtZDldtvOEWG/sDkQvYZYyWlt4D1N4yndZT8y2rbW6hO1udNHZ7VJYfAj9Llv3P9I 2H4FhRaiVZmJaE2dZWHVffiAJcEDC4mtV6FRYNAC41bsvcZ4BY1l3bYVAT4g4z0dTKI4 TpHA59DebJKHNGj5UMKevlsBqDNVHOFgqVJ540fD14gBBTYbOPg/tMQwMLRTFtWSq0Bx RczUubyl5vxyRvRbdDnR1lImSR3E4qMNDg1dugDC2zjHLKXsZIXq5koo7exf2qW/f5VF wUSg== X-Forwarded-Encrypted: i=1; AJvYcCWeVBHglOY2vDriEwI6HPThPBPPUmd23oDTJDwjMiSypEnl4nUN7O0puTImnBy1lA4iPRvUgmVHo+4=@lists.xenproject.org X-Gm-Message-State: AOJu0YyQnDdqUCilr8H2rkEXjNtCQkra4ZE9zZ4vLSDBhppD0Bb9TKW3 JTjtvHlkU5Zl/JLEfQ60TZyWbBk14c6NEw9kVVsvWNMVkbbIs0Ta8euzYrIRc0w= X-Gm-Gg: ASbGncuDfjvoKXWCnCyMTXso0CLiZ2ryRZb3UHVxug2IRLAytSaSB0lxL5+3dB8vBOl dQKKlN4N1EdIFaOtAbOUcZL/a2NKukatDKVKJblVPcrkRrcMRD2z40wt8q7C4GuNlM8GSmN64x3 31vWZ4dePZXdZs4KTlQt+ZiWebVy8ekwxlxEidljJYosTHfsKAiO+sno+qWZmhS+flPdRtlgJh/ 7BzLkFNlycCqyr2nKOgRDhIu0jV0ip8+k/wSU7pKdSq5qYGiOkDwfYpC5eUzf/RnQcQH0MyemsY tcSwKUkaQ1wo8giigsDYgDp3OXRCbDCFLtLAkrKFD3LwTpQmbcoEvEWyOaIw X-Google-Smtp-Source: AGHT+IGP2iaXKLI15CkhKDP5NBlnFOMSHwCbGSNXKLvJxawalslRdLF5wYi0CoJhDHevjTYCGWh83g== X-Received: by 2002:a05:600c:3d86:b0:434:f9e1:5cf8 with SMTP id 5b1f17b1804b1-4389143c306mr335517805e9.31.1737828830945; Sat, 25 Jan 2025 10:13:50 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Yi Liu , Markus Armbruster , Eduardo Habkost , Anthony PERARD , Gustavo Romero , Jason Wang , qemu-ppc@nongnu.org, "Michael S. Tsirkin" , Paolo Bonzini , Alexander Graf , Richard Henderson , Stefan Berger , Bernhard Beschow , Stefano Stabellini , Gerd Hoffmann , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Marcel Apfelbaum , Alex Williamson , Paul Durrant , =?UTF-8?q?Cl=C3=A9ment=20Mathieu--Drif?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 1/9] hw/sysbus: Use sizeof(BusState) in main_system_bus_create() Date: Sat, 25 Jan 2025 19:13:35 +0100 Message-ID: <20250125181343.59151-2-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125181343.59151-1-philmd@linaro.org> References: <20250125181343.59151-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1737828856815019000 Rather than using the obscure system_bus_info.instance_size, directly use sizeof(BusState). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alexander Graf Reviewed-by: Cl=C3=A9ment Mathieu--Drif Reviewed-by: Richard Henderson --- hw/core/sysbus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c index 9355849ff0a..f713bbfe04f 100644 --- a/hw/core/sysbus.c +++ b/hw/core/sysbus.c @@ -323,8 +323,8 @@ static void main_system_bus_create(void) * assign main_system_bus before qbus_init() * in order to make "if (bus !=3D sysbus_get_default())" work */ - main_system_bus =3D g_malloc0(system_bus_info.instance_size); - qbus_init(main_system_bus, system_bus_info.instance_size, + main_system_bus =3D g_new0(BusState, 1); + qbus_init(main_system_bus, sizeof(BusState), TYPE_SYSTEM_BUS, NULL, "main-system-bus"); OBJECT(main_system_bus)->free =3D g_free; } --=20 2.47.1 From nobody Sat Apr 5 05:36:00 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1737828860; cv=none; d=zohomail.com; s=zohoarc; b=fE6HPHWZ73c4zjpClJcZ8LHnhYM0BAo4u2/DadEw63nD38f07bLfuYi3c3SSiIeWSPjIUZivWJVAFIJ9N3+Jty4c6mGDX0veNT/oxOAmbiQ9hiAIfv61vTrKg+JRPcwd0Xg1BsTEJTSgDyE+EgiAISqPIv9a4kHF+1V7W1T/9TA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1737828860; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+D9ecSNssEoyInsTWPhPYbcbkHeV5ELbKuxuFIHXnAU=; b=El1Ly+PCuRlRSnlPqZstKfYsG501e6roJThT06DrMW5V373JKfolCtLdzIY8et2LYaMqhBBUNcOlFH38C0E2PJGDya5gpRR5n7qye9soXIAvfjOXTw3f7pxMaEYDpI59CBAibc2LsFtS86/lDu8ckcYFmFEVxHBy8ebQW55FWgE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1737828860520222.14787187103434; Sat, 25 Jan 2025 10:14:20 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.877008.1287220 (Exim 4.92) (envelope-from ) id 1tbkfR-00058H-9L; Sat, 25 Jan 2025 18:14:01 +0000 Received: by outflank-mailman (output) from mailman id 877008.1287220; Sat, 25 Jan 2025 18:14:01 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tbkfR-00058A-6Q; Sat, 25 Jan 2025 18:14:01 +0000 Received: by outflank-mailman (input) for mailman id 877008; Sat, 25 Jan 2025 18:14:00 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tbkfQ-000565-47 for xen-devel@lists.xenproject.org; Sat, 25 Jan 2025 18:14:00 +0000 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [2a00:1450:4864:20::32f]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 247d6791-db48-11ef-99a4-01e77a169b0f; Sat, 25 Jan 2025 19:13:57 +0100 (CET) Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4361c705434so22039945e9.3 for ; Sat, 25 Jan 2025 10:13:57 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd4c75c0sm68201815e9.31.2025.01.25.10.13.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 10:13:55 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 247d6791-db48-11ef-99a4-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737828836; x=1738433636; darn=lists.xenproject.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=+D9ecSNssEoyInsTWPhPYbcbkHeV5ELbKuxuFIHXnAU=; b=N7dRkc6p0L9U/te9/9bQ7dDkBTWvo2AePP0WNz86xrDKWDkyunA50kwama/VhS4KkM u9WtPAyGqenbpHdjXvnlBnVtApy0uj52w5ADLHweKFC0GEOx73qNLhDOYmnJquFloZZT 0cEHqAKgG1se7H9cKre4cfNvYhR/gqs7Jve88fUaXmMiNogaYOP2MV0wipdj0/cDQGSP 1HMeU009HUK+aLfLLk+KM+vhQgsBt9d03JgQ+ENpi8c24gO+fgo0su3Zr8hd54vBW4Pv bH3rjtASmfcb6JBfB//sxw5LxW/2OxQVcfYgNh55bW/cka3jKZ2TwGDkJi9D3yQzaFZY m0Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737828836; x=1738433636; 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=+D9ecSNssEoyInsTWPhPYbcbkHeV5ELbKuxuFIHXnAU=; b=oPCf0BwFQWGunizws6vrDn9aainlr4T4VSyA4/TT2mgbvtVPwHhNR5HvOkl83FlK5u k19vX4rOFB5pcB5VNVGqwZtO2aevkOz81EGCmbvg0XWf6ZxeWqQkM/HcY3r2OIMO6TPn eyEGd9/D1hzvZZfr4Rz5w0P2nHvgoRXcxSOX1d/YeW6Xj/C5RI4uJRJPPGkfgedyZ/4g sdn99oFoBr1A5nOAUbO5FzKwBAdE3fhEnuku5sPfIdGwBHYhNvaFj9AljYhALXFzUilq pqkmbiCQRWwLn8/HfL6kH0LmvKt4orbAwYx9wuwh6hKeRWw0mNzUpButWxHk/gJDmqJj 8MEA== X-Forwarded-Encrypted: i=1; AJvYcCXSxE/Mz8yNvwXdbi2ldxhPQu9oOOwFm/SEnhHUTrycrOACRpt1Z/jvuax0sJZmllVFQ+SL4zCOYaA=@lists.xenproject.org X-Gm-Message-State: AOJu0YzLjl/b5jn3dcS1y/Xy+u/veYSdOazzIeqAXOV6bI9IHVZ9pN9G HRJfV6oScHb5ep8DPopsIHlA6ulZJcLy9uc+Idp11Sgu+PPXLGj+jzJJQ9wpna8= X-Gm-Gg: ASbGncswr2Mx1QAltd1rhMTqQv0oYuR+XlqUxw0jOcHtK8TPJmRTLIACY7CPciJtuui ETbsrWoneKVVzQ4hoiSFGbib+EYOGMK2tzqceIT6sx+Jd+Cc7sfEx9taONS7sysKEA8+exgiwV+ L0HBMnWZzxLF64Sqfay3UpPaB2NgR4QQ4z73hen587qMCaoJXGlJ0YJxNR9sxHgiMMRTheYHjX3 hni7oXSmJ5BMpmnsRl67VwdWxAW/ENlG7U/ZhQShDDopZq61/j0RWI7n8XweJFopvzOA+TrGhHR bAgfFXjQP8eDvDaepsfRx9Rq/ns8fxSaOdDCPTUTGhMzLfdZjXvDSUGVHp1o X-Google-Smtp-Source: AGHT+IH3gG9oDbH+Yt++6e9axdywvxazaykwi7sr/Zo0cY2/uHyHOw51lxlnycmePra8xEH0EQ/Sbw== X-Received: by 2002:a05:600c:3b94:b0:434:9934:575 with SMTP id 5b1f17b1804b1-438913e02f8mr395787785e9.16.1737828836350; Sat, 25 Jan 2025 10:13:56 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Yi Liu , Markus Armbruster , Eduardo Habkost , Anthony PERARD , Gustavo Romero , Jason Wang , qemu-ppc@nongnu.org, "Michael S. Tsirkin" , Paolo Bonzini , Alexander Graf , Richard Henderson , Stefan Berger , Bernhard Beschow , Stefano Stabellini , Gerd Hoffmann , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Marcel Apfelbaum , Alex Williamson , Paul Durrant , =?UTF-8?q?Cl=C3=A9ment=20Mathieu--Drif?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 2/9] hw/sysbus: Declare QOM types using DEFINE_TYPES() macro Date: Sat, 25 Jan 2025 19:13:36 +0100 Message-ID: <20250125181343.59151-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125181343.59151-1-philmd@linaro.org> References: <20250125181343.59151-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1737828860818019000 When multiple QOM types are registered in the same file, it is simpler to use the the DEFINE_TYPES() macro. In particular because type array declared with such macro are easier to review. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alexander Graf Reviewed-by: Bernhard Beschow Reviewed-by: Cl=C3=A9ment Mathieu--Drif Reviewed-by: Richard Henderson --- hw/core/sysbus.c | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c index f713bbfe04f..306f98406c0 100644 --- a/hw/core/sysbus.c +++ b/hw/core/sysbus.c @@ -80,13 +80,6 @@ static void system_bus_class_init(ObjectClass *klass, vo= id *data) k->get_fw_dev_path =3D sysbus_get_fw_dev_path; } =20 -static const TypeInfo system_bus_info =3D { - .name =3D TYPE_SYSTEM_BUS, - .parent =3D TYPE_BUS, - .instance_size =3D sizeof(BusState), - .class_init =3D system_bus_class_init, -}; - /* Check whether an IRQ source exists */ bool sysbus_has_irq(SysBusDevice *dev, int n) { @@ -306,15 +299,6 @@ static void sysbus_device_class_init(ObjectClass *klas= s, void *data) k->user_creatable =3D false; } =20 -static const TypeInfo sysbus_device_type_info =3D { - .name =3D TYPE_SYS_BUS_DEVICE, - .parent =3D TYPE_DEVICE, - .instance_size =3D sizeof(SysBusDevice), - .abstract =3D true, - .class_size =3D sizeof(SysBusDeviceClass), - .class_init =3D sysbus_device_class_init, -}; - static BusState *main_system_bus; =20 static void main_system_bus_create(void) @@ -337,10 +321,21 @@ BusState *sysbus_get_default(void) return main_system_bus; } =20 -static void sysbus_register_types(void) -{ - type_register_static(&system_bus_info); - type_register_static(&sysbus_device_type_info); -} +static const TypeInfo sysbus_types[] =3D { + { + .name =3D TYPE_SYSTEM_BUS, + .parent =3D TYPE_BUS, + .instance_size =3D sizeof(BusState), + .class_init =3D system_bus_class_init, + }, + { + .name =3D TYPE_SYS_BUS_DEVICE, + .parent =3D TYPE_DEVICE, + .instance_size =3D sizeof(SysBusDevice), + .abstract =3D true, + .class_size =3D sizeof(SysBusDeviceClass), + .class_init =3D sysbus_device_class_init, + }, +}; =20 -type_init(sysbus_register_types) +DEFINE_TYPES(sysbus_types) --=20 2.47.1 From nobody Sat Apr 5 05:36:00 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1737828861; cv=none; d=zohomail.com; s=zohoarc; b=nviKWuXMVRPUkB6f3xUtRa+R6TQK+U6XKKDENwxWTqatq9sISmE/oy4GOK3CEEBRCxg7g+KQbUt8/PLhgsSsghqlRU3C5ibFY4HguiKm/moM/y6HXw0e1l+n3boRB9nYGNAX5tKferPQKhwvur12yEviYAosFG48MmaiUThnzcA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1737828861; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=60AuA1WDx9vhZn9WTP7sL5YOcyHTmPSWNTPXV1fPX/g=; b=VNVNOwZqOIwdx8HxVwXvxBPZx8W1bQdONFcTUeHltnyRQQ/4GgkX3VCroK9qF/Qm9D0Mvnq7UuSuM3ZnoHB3bZcHW2okLnI9eGOOrasqMoaieeBkOLbsmRWW52LtgTYIMv/xm+sYK4i/1h/6PW8JcWhIxmYkjP6LtKQdOFaMgtA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1737828861709543.0134936292746; Sat, 25 Jan 2025 10:14:21 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.877009.1287230 (Exim 4.92) (envelope-from ) id 1tbkfU-0005R9-Ko; Sat, 25 Jan 2025 18:14:04 +0000 Received: by outflank-mailman (output) from mailman id 877009.1287230; Sat, 25 Jan 2025 18:14:04 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tbkfU-0005QM-HR; Sat, 25 Jan 2025 18:14:04 +0000 Received: by outflank-mailman (input) for mailman id 877009; Sat, 25 Jan 2025 18:14:03 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tbkfT-000565-R0 for xen-devel@lists.xenproject.org; Sat, 25 Jan 2025 18:14:03 +0000 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [2a00:1450:4864:20::430]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 27a761a7-db48-11ef-99a4-01e77a169b0f; Sat, 25 Jan 2025 19:14:02 +0100 (CET) Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-385ef8b64b3so2698316f8f.0 for ; Sat, 25 Jan 2025 10:14:02 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a17d865sm6249213f8f.38.2025.01.25.10.14.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 10:14:01 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 27a761a7-db48-11ef-99a4-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737828842; x=1738433642; darn=lists.xenproject.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=60AuA1WDx9vhZn9WTP7sL5YOcyHTmPSWNTPXV1fPX/g=; b=IFlm2xVQAoQfvtsA1V7yF+n0t4VdAbrIGxxDsUiOutAcB2a3fkoTR3/WbpNST1hPEd TYwZybs9iRmfjhmz6C1PGkSJ3gXQGct1y2xMS4u7nWnYRHGb0cgiR0ufF8xtxNSAEKBb yCTahB+URGpRTBcAd7XKPBmJ2Z9M0jpQt1PoOCDA9m60ECHEeyeHQuDYZGOXkcAYpgtK YdDxCarS07jWcGnWUUOqyliOISqDNFDfuqkGRfeLrlXn49DU0I0nTRN3LfdMKMdjaj/C xjqFMrRd2x3XcVhqWBxT8b3+03sNUStBhMQ+YbDnHWwKD7Gn28ACAKlIe1kNVCemx7UK fZpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737828842; x=1738433642; 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=60AuA1WDx9vhZn9WTP7sL5YOcyHTmPSWNTPXV1fPX/g=; b=W1yZX1ad7GKeDOq5rgSUBKvB7XXpm848/u9g3jzwSU/dJSxS2XV9XrLWKxJv0008lo dyexG4OzbSi75Zaf9Qjet1JVNoAQBSmqLzK00/Bx5wZTEYTqL+gPtCXGAbUMMv3C9yI3 Mrp6fGHZ9ZNGaLipxhqLcqctpNCuiQzVnx9U2zniYq1MwIeE43EB8iHfW6lqzIh1yr6c RN21q0imF4E51J7lxwwozm8V4DiUMM/9G0rrdHcyDQL5xKZHnRc0YveKPptOXNoMbI1w bW/z0+aG6/G76nK74LMgn9uaTtyvaTuqvyILQg/2/61wwlUEkIgLrRSn/fNhSa0IKNuN envg== X-Forwarded-Encrypted: i=1; AJvYcCUIdznIETPgwkhaAtsNyU4HV20D4VlGAXPSUnMx1AApuBYCgNGlDdhdGMpJ0FrM0MYh6STKYb9Q0vo=@lists.xenproject.org X-Gm-Message-State: AOJu0YxcThVnL+YTwdUM/BAnXlFSAq8r7auXsYqZ0Rn6u9Ix6w2Mcv7Y 40jsE0pL6PuxNt7XqnmsBLkGSBd30rNdcqyeZJ6omach0U/XJkoMqMwrzeMdtW0= X-Gm-Gg: ASbGnct70fWQrkdtZb8AVj7QVxogs/OSrLgcmeXzS9ShD1MZ71XF3KffTt56WhgzNca cI+DTfUjrKEwGmV9vIn7GnVw97C8SxiJYrqsWKvnjY2CVpf2zvm+NV8c3dvlSmvjPky4S0vtIAT igW9dWRCMRNb2egQlCWJJ+hY1lRA3C7m+AV2tZArhhB3ZvBHP7uun2H4B1nyCnbmLdn6qN0F3Ey fp1wWtmqsg6wX4uVxXBIRtQOq74Z4rhw+UZTJ4ZKXv40ywKI1iGb/KiB6592PL3vxCrH+cgCxsW 4h/g43hnW0aFNB+e7s/IGOComZK3mAgDTD2vEEqk83OpnAtTNcmOeQCyhUSg X-Google-Smtp-Source: AGHT+IFmsyFMtRiyUoQTMlDTj6UgcQ0Wyp8q7Re0IHss6ougDQh97Nwe8Gj2HZEyku0oDKVtn8rFyg== X-Received: by 2002:a05:6000:2c5:b0:37d:4647:154e with SMTP id ffacd0b85a97d-38bf5655bd3mr29759427f8f.9.1737828841654; Sat, 25 Jan 2025 10:14:01 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Yi Liu , Markus Armbruster , Eduardo Habkost , Anthony PERARD , Gustavo Romero , Jason Wang , qemu-ppc@nongnu.org, "Michael S. Tsirkin" , Paolo Bonzini , Alexander Graf , Richard Henderson , Stefan Berger , Bernhard Beschow , Stefano Stabellini , Gerd Hoffmann , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Marcel Apfelbaum , Alex Williamson , Paul Durrant , =?UTF-8?q?Cl=C3=A9ment=20Mathieu--Drif?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 3/9] hw/sysbus: Introduce TYPE_DYNAMIC_SYS_BUS_DEVICE Date: Sat, 25 Jan 2025 19:13:37 +0100 Message-ID: <20250125181343.59151-4-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125181343.59151-1-philmd@linaro.org> References: <20250125181343.59151-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1737828862806019000 Some TYPE_SYS_BUS_DEVICEs can be optionally dynamically plugged on the TYPE_PLATFORM_BUS_DEVICE. Rather than sometimes noting that with comment around the 'user_creatable =3D true' line in each DeviceRealize handler, introduce an abstract TYPE_DYNAMIC_SYS_BUS_DEVICE class. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alexander Graf Reviewed-by: Cl=C3=A9ment Mathieu--Drif Reviewed-by: Richard Henderson --- include/hw/sysbus.h | 2 ++ hw/core/sysbus.c | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/include/hw/sysbus.h b/include/hw/sysbus.h index c9b1e0e90e3..81bbda10d37 100644 --- a/include/hw/sysbus.h +++ b/include/hw/sysbus.h @@ -19,6 +19,8 @@ DECLARE_INSTANCE_CHECKER(BusState, SYSTEM_BUS, OBJECT_DECLARE_TYPE(SysBusDevice, SysBusDeviceClass, SYS_BUS_DEVICE) =20 +#define TYPE_DYNAMIC_SYS_BUS_DEVICE "dynamic-sysbus-device" + /** * SysBusDeviceClass: * diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c index 306f98406c0..e8d03fd28d9 100644 --- a/hw/core/sysbus.c +++ b/hw/core/sysbus.c @@ -321,6 +321,14 @@ BusState *sysbus_get_default(void) return main_system_bus; } =20 +static void dynamic_sysbus_device_class_init(ObjectClass *klass, void *dat= a) +{ + DeviceClass *k =3D DEVICE_CLASS(klass); + + k->user_creatable =3D true; + k->hotpluggable =3D false; +} + static const TypeInfo sysbus_types[] =3D { { .name =3D TYPE_SYSTEM_BUS, @@ -336,6 +344,12 @@ static const TypeInfo sysbus_types[] =3D { .class_size =3D sizeof(SysBusDeviceClass), .class_init =3D sysbus_device_class_init, }, + { + .name =3D TYPE_DYNAMIC_SYS_BUS_DEVICE, + .parent =3D TYPE_SYS_BUS_DEVICE, + .class_init =3D dynamic_sysbus_device_class_init, + .abstract =3D true, + } }; =20 DEFINE_TYPES(sysbus_types) --=20 2.47.1 From nobody Sat Apr 5 05:36:00 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1737828867; cv=none; d=zohomail.com; s=zohoarc; b=YkyPoJk776Pyc9qT/EvpLMr9Zm9jJJ9cUA4peLT+jDd/+LSksdS4qxgEW347QZ1lGnfEnGlGkljLCzAYH+BldtfXq5ybg7Saursix5hT/jpcW6ajX9RfrL4DdQ/HorWwEOoeZQkiyZlQe/bDEfa7AOEN+uJnSiKzsQjcjswC6rc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1737828867; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=dyOkRsNGVEWSIU/g0zj3C7+UfvVjzQgLwIYDoErjrzY=; b=isBXHUIcc5gQMyeibUi5mvBEPvufvUkm5TaXIUNat5myPUDx+5A48Hl4YO+XEnJT36rWtK2Rgq/yR12SD/WuolYql9yOpQzj8DkjBBVWZNc4bEAw+Ji6Yjo34A6eefTtsZebZsrllOPDkmccSFk9YKgxEn50DnjN7Qsihnb5rL4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1737828867053110.75060934560042; Sat, 25 Jan 2025 10:14:27 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.877012.1287240 (Exim 4.92) (envelope-from ) id 1tbkfa-0005ri-TD; Sat, 25 Jan 2025 18:14:10 +0000 Received: by outflank-mailman (output) from mailman id 877012.1287240; Sat, 25 Jan 2025 18:14:10 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tbkfa-0005rb-Pt; Sat, 25 Jan 2025 18:14:10 +0000 Received: by outflank-mailman (input) for mailman id 877012; Sat, 25 Jan 2025 18:14:08 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tbkfY-000565-Th for xen-devel@lists.xenproject.org; Sat, 25 Jan 2025 18:14:08 +0000 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [2a00:1450:4864:20::335]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 2abdfab3-db48-11ef-99a4-01e77a169b0f; Sat, 25 Jan 2025 19:14:07 +0100 (CET) Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-43622267b2eso32316685e9.0 for ; Sat, 25 Jan 2025 10:14:07 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd4857c3sm68307685e9.10.2025.01.25.10.14.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 10:14:06 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 2abdfab3-db48-11ef-99a4-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737828847; x=1738433647; darn=lists.xenproject.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=dyOkRsNGVEWSIU/g0zj3C7+UfvVjzQgLwIYDoErjrzY=; b=E3O265wl8yaUU469AX64Lx2fHgrT11jgPvGuwnNbs2wApqv2zuUVgkd+ZrCcHWzbM9 nuyw1pl9S3/SGydU1n4FEQkHTZsiIn2G47jTsnv1ckFrstQHyVBvQMz97zeIBRnDcGGv fBNp9dx2OkOGMJej9nItABW5MVvQJ4hy1DsdkT6Lr+NUi5/PNLq7lrg4GvgL4o3gqqql yz6Fec8OtOElEzfzMHdqt3qWT9vYR4bAlQOWnV/ZZhiqOw09spIhL8HtdlwISu32SCXG 3VERGi0PMk8dIp/1dB5kCAZWYUeMeeMRw2WSpnmoXsj7PST+0dz58etulVZHCfR+5T7G jMHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737828847; x=1738433647; 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=dyOkRsNGVEWSIU/g0zj3C7+UfvVjzQgLwIYDoErjrzY=; b=h4LxTu31Svs5wse0ClHatCNPvzJjf2/ylBctYZwijYPYY3si4YYbL/PtW30ZRntQ9W ZZAPR2QDHL/usRKB26UlzJ6r14gjghKAhe51BERYPhsdvpIb3Lra7T11YZ2A7tanyDjo wII+1DHMGwmmmK2bDtmKU/FC9j3hZF+9NRFf15b+5Kq4TpdRlPglJUp/plkDoDL3HJwM VSP2dvvSSDE8UamZsgltB9AKm3XWtZgU+cLR8gBXihaFzn1Y4/q0J+mrSOsNxv+q5ojt /T1m7XZtkYmJN8gVPPNn11bH2uyLUMncQlo1FgbF6A5CxUEYCV5J1pmfva4E0QpReDhy LqOA== X-Forwarded-Encrypted: i=1; AJvYcCWvH5oNEE6kesSQPUmc8gwMEAsOb0ByRbnRM4+OGHF4Q70glcTw4AkGFi0QuMbHa+2Ayl7JMF1jo68=@lists.xenproject.org X-Gm-Message-State: AOJu0YyHTLGjFrv+XELr7wZKoXqGUOHp68I0a5rBIKnvEHoHYGhUyCEU +Nt45C0J8dhzBteka9c/cZgoD2qNleD/7bai5ht/UCD44QyGjxsmkrV2QAnzYOk= X-Gm-Gg: ASbGncueZI9WCvpTZEWH6bRl7tPNeZ9YERv2TxwhJXJb5ljXkSZhViWAa5EdlLcDbbi X2A9rDoFdiXBNHg6XyCiWCU320hrUi4C18xlogxUB1py73TC4n77dZr//2SjFG1DT5+ecbUWNlR X7dZ4wbPapr0wqnJm7U6aMuO2CHeXMqYgK0JP2wizTYrPljzCUdAdWVfEyMN5JpmtppfKqO6YFC /qn4rEc5bTkv4LNnZveFzogViDkkPzJ07cR408jjI92vSRsS/ODiyGJojh4aFdKyC60985/21i3 M4Y6/uybwhirkxOTK5jMURmdG3vwxFv8rIMdqb5vW0Q4KuytN2ysErF+xaWm X-Google-Smtp-Source: AGHT+IEr2qoA1rRQRSxzBRg9AaVRyh1DsB0c2e066JVheh7W35FZo8o118MnJ47nSIRaQRkoz3MpFg== X-Received: by 2002:a05:600c:468d:b0:436:4708:9fb6 with SMTP id 5b1f17b1804b1-43891437546mr293523335e9.20.1737828846888; Sat, 25 Jan 2025 10:14:06 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Yi Liu , Markus Armbruster , Eduardo Habkost , Anthony PERARD , Gustavo Romero , Jason Wang , qemu-ppc@nongnu.org, "Michael S. Tsirkin" , Paolo Bonzini , Alexander Graf , Richard Henderson , Stefan Berger , Bernhard Beschow , Stefano Stabellini , Gerd Hoffmann , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Marcel Apfelbaum , Alex Williamson , Paul Durrant , =?UTF-8?q?Cl=C3=A9ment=20Mathieu--Drif?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 4/9] hw/vfio: Have VFIO_PLATFORM devices inherit from DYNAMIC_SYS_BUS_DEVICE Date: Sat, 25 Jan 2025 19:13:38 +0100 Message-ID: <20250125181343.59151-5-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125181343.59151-1-philmd@linaro.org> References: <20250125181343.59151-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1737828868913019000 Do not explain why VFIO_PLATFORM devices are user_creatable, have them inherit TYPE_DYNAMIC_SYS_BUS_DEVICE, to explicit they can optionally be plugged on TYPE_PLATFORM_BUS_DEVICE. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alexander Graf Reviewed-by: Richard Henderson --- hw/vfio/amd-xgbe.c | 2 -- hw/vfio/calxeda-xgmac.c | 2 -- hw/vfio/platform.c | 4 +--- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/hw/vfio/amd-xgbe.c b/hw/vfio/amd-xgbe.c index 96bd608b8dd..aaa96903db0 100644 --- a/hw/vfio/amd-xgbe.c +++ b/hw/vfio/amd-xgbe.c @@ -41,8 +41,6 @@ static void vfio_amd_xgbe_class_init(ObjectClass *klass, = void *data) &vcxc->parent_realize); dc->desc =3D "VFIO AMD XGBE"; dc->vmsd =3D &vfio_platform_amd_xgbe_vmstate; - /* Supported by TYPE_VIRT_MACHINE */ - dc->user_creatable =3D true; } =20 static const TypeInfo vfio_amd_xgbe_dev_info =3D { diff --git a/hw/vfio/calxeda-xgmac.c b/hw/vfio/calxeda-xgmac.c index 87c382e7361..b016d42b496 100644 --- a/hw/vfio/calxeda-xgmac.c +++ b/hw/vfio/calxeda-xgmac.c @@ -41,8 +41,6 @@ static void vfio_calxeda_xgmac_class_init(ObjectClass *kl= ass, void *data) &vcxc->parent_realize); dc->desc =3D "VFIO Calxeda XGMAC"; dc->vmsd =3D &vfio_platform_calxeda_xgmac_vmstate; - /* Supported by TYPE_VIRT_MACHINE */ - dc->user_creatable =3D true; } =20 static const TypeInfo vfio_calxeda_xgmac_dev_info =3D { diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index 1070a2113a1..f491f4dc954 100644 --- a/hw/vfio/platform.c +++ b/hw/vfio/platform.c @@ -672,13 +672,11 @@ static void vfio_platform_class_init(ObjectClass *kla= ss, void *data) dc->desc =3D "VFIO-based platform device assignment"; sbc->connect_irq_notifier =3D vfio_start_irqfd_injection; set_bit(DEVICE_CATEGORY_MISC, dc->categories); - /* Supported by TYPE_VIRT_MACHINE */ - dc->user_creatable =3D true; } =20 static const TypeInfo vfio_platform_dev_info =3D { .name =3D TYPE_VFIO_PLATFORM, - .parent =3D TYPE_SYS_BUS_DEVICE, + .parent =3D TYPE_DYNAMIC_SYS_BUS_DEVICE, .instance_size =3D sizeof(VFIOPlatformDevice), .instance_init =3D vfio_platform_instance_init, .class_init =3D vfio_platform_class_init, --=20 2.47.1 From nobody Sat Apr 5 05:36:00 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1737828870; cv=none; d=zohomail.com; s=zohoarc; b=SaRhG6bVPriQYfp4+a1+7vUKEKudZ7DPUku8awybjF+oiuM6bB86I8d8Vau+azITtHUktCU0oazGUn2yHenOfy/4cs07JWqyWjwyXboemOjDuB/jHRPn0V+HHV1/mp3leGKG0aGEfxdGWnWUEbPNplqS9NLWRYqsY4NOGBEvvgA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1737828870; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=oekQdNljsXmvRCfjRcF/YH736cTnRtLa3bqMS7/4HKc=; b=IwbOiT6LUdZfPxeJXP8NxxQHUCmlPuCW4epPkD+79l+DE5Js5Ton6BsUDvIbjn0hrhBoeP+20x1mLnqPvLfz6c4TJY0ZSDDkqs4/PgFwxvDF6vNJpbzuJJGVm1m/QeP7KXNdkuhsrh5O02u4kVL+zQgaqH+8m5s2GT1USuwDhaw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1737828870148110.15100827994547; Sat, 25 Jan 2025 10:14:30 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.877020.1287250 (Exim 4.92) (envelope-from ) id 1tbkfg-0006Lw-56; Sat, 25 Jan 2025 18:14:16 +0000 Received: by outflank-mailman (output) from mailman id 877020.1287250; Sat, 25 Jan 2025 18:14:16 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tbkfg-0006Lp-1N; Sat, 25 Jan 2025 18:14:16 +0000 Received: by outflank-mailman (input) for mailman id 877020; Sat, 25 Jan 2025 18:14:14 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tbkfe-000565-7O for xen-devel@lists.xenproject.org; Sat, 25 Jan 2025 18:14:14 +0000 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [2a00:1450:4864:20::32f]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 2dee327a-db48-11ef-99a4-01e77a169b0f; Sat, 25 Jan 2025 19:14:12 +0100 (CET) Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-435f8f29f8aso22054715e9.2 for ; Sat, 25 Jan 2025 10:14:12 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd4900e2sm68626685e9.24.2025.01.25.10.14.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 10:14:11 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 2dee327a-db48-11ef-99a4-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737828852; x=1738433652; darn=lists.xenproject.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=oekQdNljsXmvRCfjRcF/YH736cTnRtLa3bqMS7/4HKc=; b=kRDrcwQdbzmSmB8bU63/J64wP26Ii1A8PtSXws8H9JIo5A+Y/78FjH9j+JubgXPtNs zR2HMWsUiWelfOg37tSwpTq1+NmkRHE2Aa4vZrhBv7+oIPdV+DjIgHDdz5f13ON2Ivby Iu7zN8+pMKkB7UBBf8rTdahQgG4NSHzJPMBQ8Uj4RUBWnD0D559g6/8XJ8BnzwnN9VVr BrXkH650taRllw+oCNYcB93pAlkPwXKdLU7xWTlRhDcZwgLLxj3TjCMzau937b34elur 6Ny1EzninbzZfj2tody8Fcsaa7dqjhiRO+H5y1tNnW7ToJfTpg6nsyvodLWaXVQNi8tF tpXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737828852; x=1738433652; 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=oekQdNljsXmvRCfjRcF/YH736cTnRtLa3bqMS7/4HKc=; b=LWHgB5FrKztcwFEC7YVq+W4cIHTAmU6yRvouu/bfPHvIaM9H4TxBtdNlDY+mU31D7Z 81VhmErx7lwuGEVHi/7AzKZetG2bkfgThbPZv5c1Qwrid7KaHxk1vA503Fp2yUPKoQpH TJKN2lJl1pvSZxJdrWmiRpEenJF3I2P8gZZxWoDpSWF1PWWBz+PmSZh70zutB/od7FVL 2KHRsDvZJDTqNvnfSILVe7lG2q8qdOneH5RRS9CYsA4y3hrjg2xCGOFlW3UAY7qx4FUp SPr891So26CSsz4g6pYnEhOv5dSHad+DTmT/0AEUMiZ73VO4/3wJt2Vo7FDvSNYcvQhz ifLA== X-Forwarded-Encrypted: i=1; AJvYcCW45ZiWpwA3Tj2jdEks8XMIJbwnX81e8Wb1U7d5qdx8IjxgkzRJyJO7lAvDVtNlPeCASu2FwAqF2X4=@lists.xenproject.org X-Gm-Message-State: AOJu0Yw7yW/+0k9MTBUBgEdDwWNKiPjDig1PsfcOt49jKm9kCHzkETiq Bvt4HtN73NCgwfko0+Q07R16h/p6jxxCJbWks+UhFk8kfOJjuWykouy1IXUGLNk= X-Gm-Gg: ASbGncvVBzSDtkpzCtFxJ9Xc1DTYSXuolO0XGx5Oaa2cKzRugPjQVxsr9DhdXxEbtn5 d6e/l61r9HwJJMdPXGdmcZSkAtO/0s19GaudPXR4Vpni/m5s9SYhtafplmUGmXZDySkzJPjgEQW M+0EqZpkE6Hn8ji9xGL5Jh2ez3MHFt9KcTluwFEDI80KW5fhPedNYHE0aifqFBxWwBbV/EiT64S QhOhNVA1xqd5drkbFy53Nwj8EMqGUXenZwbFdtGn9SaB1ohTGBZQY2Tr6S4SKsPhWXpCiUKSij9 TkZnkAlJr1aEqcJ98CQ990/jJAUdq9F7IW01epA/7VqHooTLVK3M+7PIzeau X-Google-Smtp-Source: AGHT+IFcf5NC5w3OdMEeSdE+fJzRv8eMmKrsAaFn1q2W0Qs4+hxyDFiFEoLFYJSBxaKkISXGUJ3R0Q== X-Received: by 2002:a05:600c:1f19:b0:434:a1d3:a30f with SMTP id 5b1f17b1804b1-438b9cc072emr109914115e9.6.1737828852191; Sat, 25 Jan 2025 10:14:12 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Yi Liu , Markus Armbruster , Eduardo Habkost , Anthony PERARD , Gustavo Romero , Jason Wang , qemu-ppc@nongnu.org, "Michael S. Tsirkin" , Paolo Bonzini , Alexander Graf , Richard Henderson , Stefan Berger , Bernhard Beschow , Stefano Stabellini , Gerd Hoffmann , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Marcel Apfelbaum , Alex Williamson , Paul Durrant , =?UTF-8?q?Cl=C3=A9ment=20Mathieu--Drif?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 5/9] hw/display: Have RAMFB device inherit from DYNAMIC_SYS_BUS_DEVICE Date: Sat, 25 Jan 2025 19:13:39 +0100 Message-ID: <20250125181343.59151-6-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125181343.59151-1-philmd@linaro.org> References: <20250125181343.59151-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1737828870807019000 Because the RAM FB device can be optionally plugged on the TYPE_PLATFORM_BUS_DEVICE, have it inherit TYPE_DYNAMIC_SYS_BUS_DEVICE. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alexander Graf Reviewed-by: Cl=C3=A9ment Mathieu--Drif Reviewed-by: Richard Henderson --- hw/display/ramfb-standalone.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/display/ramfb-standalone.c b/hw/display/ramfb-standalone.c index 6c35028965d..1be106b57f2 100644 --- a/hw/display/ramfb-standalone.c +++ b/hw/display/ramfb-standalone.c @@ -72,13 +72,12 @@ static void ramfb_class_initfn(ObjectClass *klass, void= *data) dc->vmsd =3D &ramfb_dev_vmstate; dc->realize =3D ramfb_realizefn; dc->desc =3D "ram framebuffer standalone device"; - dc->user_creatable =3D true; device_class_set_props(dc, ramfb_properties); } =20 static const TypeInfo ramfb_info =3D { .name =3D TYPE_RAMFB_DEVICE, - .parent =3D TYPE_SYS_BUS_DEVICE, + .parent =3D TYPE_DYNAMIC_SYS_BUS_DEVICE, .instance_size =3D sizeof(RAMFBStandaloneState), .class_init =3D ramfb_class_initfn, }; --=20 2.47.1 From nobody Sat Apr 5 05:36:00 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1737828876; cv=none; d=zohomail.com; s=zohoarc; b=nvYzwK/Sn+0Lhj5vaaokbeVXjBW3/kSWy42FF7xwdzej8y7lZf6hwpe/PlzFAlZBNABYo8DuN8V/Y691NPywfFouW7cy7qo8aWYEYa/+VjliVUsCdHnno3ig9qjxVBkzu0gU8g8+1GpsrFEpkw/ZDBuu/+7JwjXqRS4max/r3OA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1737828876; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=w1nS9BzjJB0tn/0Fa9F2b1T3lbd2oKgl5iwd0JMSerQ=; b=BVtVwj2bKbuf2zSN9psIoxZIixjWk1o5SghzSW1oG8Um22QDoaw5OK1bbvitaqzWF/Crf//+/d/fV76WFLLRCImjtpIruIFdwnTTBoTs9NZ7xJdXyBzstv7D6S9utWqW0QDGkbxgJGPpFygyD+Pw+x6NdIUhW7Khv76hCS/LUF0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1737828876830649.6161975542185; Sat, 25 Jan 2025 10:14:36 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.877028.1287260 (Exim 4.92) (envelope-from ) id 1tbkfk-0006kx-Ds; Sat, 25 Jan 2025 18:14:20 +0000 Received: by outflank-mailman (output) from mailman id 877028.1287260; Sat, 25 Jan 2025 18:14:20 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tbkfk-0006ko-9d; Sat, 25 Jan 2025 18:14:20 +0000 Received: by outflank-mailman (input) for mailman id 877028; Sat, 25 Jan 2025 18:14:19 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tbkfj-000565-OA for xen-devel@lists.xenproject.org; Sat, 25 Jan 2025 18:14:19 +0000 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [2a00:1450:4864:20::32c]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 310dec10-db48-11ef-99a4-01e77a169b0f; Sat, 25 Jan 2025 19:14:18 +0100 (CET) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-43621d27adeso20827385e9.2 for ; Sat, 25 Jan 2025 10:14:18 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd54c066sm67839795e9.29.2025.01.25.10.14.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 10:14:17 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 310dec10-db48-11ef-99a4-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737828857; x=1738433657; darn=lists.xenproject.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=w1nS9BzjJB0tn/0Fa9F2b1T3lbd2oKgl5iwd0JMSerQ=; b=eFBesdrMiTebZm1ezPYRTAvmBhUY8ufXa/xDBnjmUG+JoObKcl5SVBTtErKJ6Q5OZd NKGc7poeu4rMJZYvL8b9ZACIV/3jYYv4DNcXxlbTjg8bc8XPE6gIunmzXmetxMIxin1c P/gUe/7om8FeRyQ/uJV05QG+27iaZCWqSOztVXUFrvMVsQpYMTb2T0YogbLL/n8FUbef YEPOD71TZ4TyFgRVcg7LS8e8coqPPFoc8l7fi62dhwRLswqE12kUWhh+DkkRWdgESv2a ZxslaYQqLy4aNcvb0z/t7vaib6/loY40lhhfhf88MFcjhDDK/eOM3RetiBMfkZtut4na 8WVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737828857; x=1738433657; 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=w1nS9BzjJB0tn/0Fa9F2b1T3lbd2oKgl5iwd0JMSerQ=; b=nzR1nYkO0O5SN9fnno2gLb/ASD4Br/YOcBXpOz+Adki+lJiiOQ+okjdTF84S8xKb/X ouckhldsy/W3+Zbp7eIPKQMqj8OUqFX6Q/dUNMteB//synICe3wQ5WOstyFoAIRTnv3i D/Ke08WSShT6JP9ZbPOmtpapD4+ISTGHXDHllAZ1PgvopB40Xy2g6s0cAjjSdwxCLI62 MfjHYhg4/H4H5tumrIs30QecZGkK5vVhmVjwwkFKDMIsYg8ibyDKv/24GgIqb+qvhIJz 5g/7cQmRiMpvSPoWFfTYtjBoPkqFQaDdM4KTbtNcx7XDgxHwOE8jbqQHxQ+RsOzFliT+ eqUw== X-Forwarded-Encrypted: i=1; AJvYcCWWgYJjpyk+aRgpdi1x4VB6xsGZgxIg4HY8adbX84KhjQBWeof2GzfbatHzac9Uu8bZcNzfReTpGTs=@lists.xenproject.org X-Gm-Message-State: AOJu0YztDwgM9J/NJHY4gzonZej7jMEUG8NxNuWcqIqoh9BC0OtmhClC 3noXXPXuD8giH6AzzLn+zSxGdDJuKM9ESZdTUTeetho00IK6U2cq0m6sRgCwV9Q= X-Gm-Gg: ASbGncs58a7Og6w6sxS8HupobpRQUF3PzFdwcpC9Aep1uEAW4mtBHMMqLZFdYEl/8es JOcKbLGOvZD/l62m+AYDOjZJAElqb+Sk4erUhaPM1pgPzQmPAAq+kjPUFvyA6HykrEgjmT3e9+G S24+1fiSHqa6lGyMwbf1xARLS9Lwcgwkxc25lLyUIblzDPapZbfvcjAyYnEIeTe0KnqFYqCPkMS VO+DjvKJN6C00t5yyEGDf74Fo1YG2ps7v0pyjelDtBREDv5EU9RHfYT0F4W3VmpXtixFxGMGq+d jQfGVU0trR4857vR9lnx66a/dG8iex8/7dKYRw/RpI4s4lQvFGaJr9ecMc26 X-Google-Smtp-Source: AGHT+IE5XUCSuHVVDMagGbiF8o/U1zOarBMIVGYFxMB07VQ6SArrPMMpgZuB4UE+b0bVMHzNNBLvMA== X-Received: by 2002:a7b:cc8f:0:b0:438:a214:52f4 with SMTP id 5b1f17b1804b1-438a2145332mr233337725e9.25.1737828857490; Sat, 25 Jan 2025 10:14:17 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Yi Liu , Markus Armbruster , Eduardo Habkost , Anthony PERARD , Gustavo Romero , Jason Wang , qemu-ppc@nongnu.org, "Michael S. Tsirkin" , Paolo Bonzini , Alexander Graf , Richard Henderson , Stefan Berger , Bernhard Beschow , Stefano Stabellini , Gerd Hoffmann , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Marcel Apfelbaum , Alex Williamson , Paul Durrant , =?UTF-8?q?Cl=C3=A9ment=20Mathieu--Drif?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 6/9] hw/i386: Have X86_IOMMU devices inherit from DYNAMIC_SYS_BUS_DEVICE Date: Sat, 25 Jan 2025 19:13:40 +0100 Message-ID: <20250125181343.59151-7-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125181343.59151-1-philmd@linaro.org> References: <20250125181343.59151-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1737828878832019000 Do not explain why _X86_IOMMU devices are user_creatable, have them inherit TYPE_DYNAMIC_SYS_BUS_DEVICE, to explicit they can optionally be plugged on TYPE_PLATFORM_BUS_DEVICE. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alexander Graf Reviewed-by: Cl=C3=A9ment Mathieu--Drif Reviewed-by: Richard Henderson --- hw/i386/amd_iommu.c | 2 -- hw/i386/intel_iommu.c | 2 -- hw/i386/x86-iommu.c | 2 +- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c index 6b13ce894b1..e8e084c7cf8 100644 --- a/hw/i386/amd_iommu.c +++ b/hw/i386/amd_iommu.c @@ -1687,8 +1687,6 @@ static void amdvi_sysbus_class_init(ObjectClass *klas= s, void *data) dc->hotpluggable =3D false; dc_class->realize =3D amdvi_sysbus_realize; dc_class->int_remap =3D amdvi_int_remap; - /* Supported by the pc-q35-* machine types */ - dc->user_creatable =3D true; set_bit(DEVICE_CATEGORY_MISC, dc->categories); dc->desc =3D "AMD IOMMU (AMD-Vi) DMA Remapping device"; device_class_set_props(dc, amdvi_properties); diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index f366c223d0e..7fde0603bfe 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -4871,8 +4871,6 @@ static void vtd_class_init(ObjectClass *klass, void *= data) dc->hotpluggable =3D false; x86_class->realize =3D vtd_realize; x86_class->int_remap =3D vtd_int_remap; - /* Supported by the pc-q35-* machine types */ - dc->user_creatable =3D true; set_bit(DEVICE_CATEGORY_MISC, dc->categories); dc->desc =3D "Intel IOMMU (VT-d) DMA Remapping device"; } diff --git a/hw/i386/x86-iommu.c b/hw/i386/x86-iommu.c index fed34b2fcfa..5cdd165af0d 100644 --- a/hw/i386/x86-iommu.c +++ b/hw/i386/x86-iommu.c @@ -146,7 +146,7 @@ bool x86_iommu_ir_supported(X86IOMMUState *s) =20 static const TypeInfo x86_iommu_info =3D { .name =3D TYPE_X86_IOMMU_DEVICE, - .parent =3D TYPE_SYS_BUS_DEVICE, + .parent =3D TYPE_DYNAMIC_SYS_BUS_DEVICE, .instance_size =3D sizeof(X86IOMMUState), .class_init =3D x86_iommu_class_init, .class_size =3D sizeof(X86IOMMUClass), --=20 2.47.1 From nobody Sat Apr 5 05:36:00 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1737828878; cv=none; d=zohomail.com; s=zohoarc; b=YtZjtncxEcSWb8W7/tD89lMePBjRcgwVZo1mjaG6OZBeipvWuZNgn8+E8K2o0gj5mjNsxB0qB81ou77UaOw3ix80OL/97xwhr+DllfekN3arerp1iAmEGUAj79H3g7f4jBH3YFjd/+/50WTxV3o6IC0YpaTJ6fqg78YaXRa3G6s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1737828878; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=J6WqpNLLgPHFQ99I41LLhDNBlDQghx4mWgl59MS9KjI=; b=ZGRUmKZ8MMtfMDAC2irp4phDHrJaeHK49K9gYpB3Xkr3sTTcuW1uCAqq3LOFqIRWbI139zITZnOWHNEkG+fBdYorpQgBH0O979VPiLNX0XiqAGaB8IUxwJzCZzRZGkvsu4vjgcuvsuhgip918DYnQ4rLqjdzl7pHlRlH3AzbvD8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 17378288789621014.989757609263; Sat, 25 Jan 2025 10:14:38 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.877038.1287270 (Exim 4.92) (envelope-from ) id 1tbkfr-0007NG-OA; Sat, 25 Jan 2025 18:14:27 +0000 Received: by outflank-mailman (output) from mailman id 877038.1287270; Sat, 25 Jan 2025 18:14:27 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tbkfr-0007Mw-JU; Sat, 25 Jan 2025 18:14:27 +0000 Received: by outflank-mailman (input) for mailman id 877038; Sat, 25 Jan 2025 18:14:26 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tbkfq-0004aj-8j for xen-devel@lists.xenproject.org; Sat, 25 Jan 2025 18:14:26 +0000 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [2a00:1450:4864:20::330]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 3583c3d5-db48-11ef-a0e5-8be0dac302b0; Sat, 25 Jan 2025 19:14:25 +0100 (CET) Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-4361815b96cso20866275e9.1 for ; Sat, 25 Jan 2025 10:14:25 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd4d29cesm69824895e9.35.2025.01.25.10.14.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 10:14:23 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 3583c3d5-db48-11ef-a0e5-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737828865; x=1738433665; darn=lists.xenproject.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=J6WqpNLLgPHFQ99I41LLhDNBlDQghx4mWgl59MS9KjI=; b=PAiFrCXOUDqU7nzb8Yrw2aUD8pdEjbr5FIK8KmdIyHq59pvaV4KI5FpJ1ZL0dxv2BU LpBsvBlcdsjr98+ZExv+tiR0TlXPijW4kk7l8wQMVXNudH3elPXK+sqoKmZlF57SHrJ5 DPCXnvVr915yY9mSP0DCQaI+xzgdDARW4Q8VrjTwImcK0OmG9LoGnjMXQbye/Pm/MXKz G2dujPk2KmeZ6VFLKcS31ZsxUpuNGbepj+219vUShp03j3IABQWJ7qhJrqd0mW9NreNB Ul9RRjXZHy+CBRv61p5ZqgNZ8Yk5mFSA0v+JUWODjkznr2oQUSe6VLWk7s4e6gZ1wgQd EfYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737828865; x=1738433665; 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=J6WqpNLLgPHFQ99I41LLhDNBlDQghx4mWgl59MS9KjI=; b=jnpcUvy8pzPJU+0yoInxRioXg4QGKDNnpnfRghSICSNGEm0BoL8nAb+3HpqLsnYKrv mtJc5niI1lXE2Ug41ZsUCvBUv1ci/Po3ZwccrOxmi7kq/8pjzt3yqVBivr6WucWuOeQN ddProj+5MoMGxX/ANq6TbcF9KTu1Qgj6X8OP5YmNIxtimgqJPq+cfpc+aG8V4xJybgpY S3o0M8GjKS3cVnOPEvIyh1EA6yM3+YNbOhOjCfBcmjzlYXutQBV9vuDEjbuW87b7FduN 2IjxyW0D1gHvC8pJi8zg8uIIlzKvlf9sG4AMfCU2Q6Vir6f3ktoTOZc0alOzZN4d4peR j3+g== X-Forwarded-Encrypted: i=1; AJvYcCW85B297nJktt6g6FDN/rAqH2MG+fxpp1po/QVvevQ7f+Uupj+5zv1vue6oTUdbpYbHJgsFe8bIia4=@lists.xenproject.org X-Gm-Message-State: AOJu0YwREfUbzw2qWbaVu8JCaaxKrspal/lY7atts09m9aR7PJKWWd/L HMKW94F6z35DzUdJtN4IPhAbmVWQVPaInmZraqWPQ8EWGBy6iR2B8ulP47UV3yg= X-Gm-Gg: ASbGncu8TsudT+gwo4irg0DrYW4NndNa7fANyZZjVpEBKPylGWT0zyVgffMnE3ub3Re eY0Wva02BEAIxFHWQwZv4vo1GV1YqFX7Tv07svmroFgmHP4wOk/A2G8WWvfIPFF1CeadlmCM3Qs 9LIFIYTwm03aX7VmlVOIqbDBiJwnKcZ08kKfAhEaVpFdv+FfM9nHdiSoDVu1bRtvcmTR56WX+mm r8N8RXasJOM5NyrCJyOT4OvLIuebqSflZ/3ZYM6pDtCRPR3yYs/byoW87IRyNEpEjo2peCtP+tU 3TLzjMjbniXdD9xzMbCdtwlb4dclGN/OJoJQma3WM8Fwnl1xfbzFaO6kJoWS X-Google-Smtp-Source: AGHT+IHtukcUsuBgToag1rm73vPOv6PLwBxDIv19SmO8jk0VeznszQ2sl5L6woNkrDfICXUGMJC2jg== X-Received: by 2002:a05:600c:1f86:b0:436:faeb:2a1b with SMTP id 5b1f17b1804b1-438913db2cfmr312879235e9.13.1737828864896; Sat, 25 Jan 2025 10:14:24 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Yi Liu , Markus Armbruster , Eduardo Habkost , Anthony PERARD , Gustavo Romero , Jason Wang , qemu-ppc@nongnu.org, "Michael S. Tsirkin" , Paolo Bonzini , Alexander Graf , Richard Henderson , Stefan Berger , Bernhard Beschow , Stefano Stabellini , Gerd Hoffmann , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Marcel Apfelbaum , Alex Williamson , Paul Durrant , =?UTF-8?q?Cl=C3=A9ment=20Mathieu--Drif?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 7/9] hw/net: Have eTSEC device inherit from DYNAMIC_SYS_BUS_DEVICE Date: Sat, 25 Jan 2025 19:13:41 +0100 Message-ID: <20250125181343.59151-8-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125181343.59151-1-philmd@linaro.org> References: <20250125181343.59151-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1737828880843019000 Because the network eTSEC device can be optionally plugged on the TYPE_PLATFORM_BUS_DEVICE, have it inherit TYPE_DYNAMIC_SYS_BUS_DEVICE. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Bernhard Beschow Reviewed-by: Alexander Graf Reviewed-by: Cl=C3=A9ment Mathieu--Drif Reviewed-by: Richard Henderson Tested-by: Bernhard Beschow --- hw/net/fsl_etsec/etsec.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/net/fsl_etsec/etsec.c b/hw/net/fsl_etsec/etsec.c index 781b9003954..3ce4fa2662d 100644 --- a/hw/net/fsl_etsec/etsec.c +++ b/hw/net/fsl_etsec/etsec.c @@ -425,14 +425,12 @@ static void etsec_class_init(ObjectClass *klass, void= *data) dc->realize =3D etsec_realize; device_class_set_legacy_reset(dc, etsec_reset); device_class_set_props(dc, etsec_properties); - /* Supported by ppce500 machine */ - dc->user_creatable =3D true; } =20 static const TypeInfo etsec_types[] =3D { { .name =3D TYPE_ETSEC_COMMON, - .parent =3D TYPE_SYS_BUS_DEVICE, + .parent =3D TYPE_DYNAMIC_SYS_BUS_DEVICE, .instance_size =3D sizeof(eTSEC), .class_init =3D etsec_class_init, .instance_init =3D etsec_instance_init, --=20 2.47.1 From nobody Sat Apr 5 05:36:00 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1737828989; cv=none; d=zohomail.com; s=zohoarc; b=h5PAsSfaArq7RTy8+fSmScgc/QGKvNYzsNmOa1G3o1X/aR8oWB5yIg9PBVEEUVOnIMo0To7qY0CzP6GhPozsK84SYfatHyLjs85mC5LRqpOqg/Wwye3ahZlBolOWSy8Z9CERWXkXMkaadzDinjzfoJar9bdevw6je0er2RJrNGg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1737828989; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=OjNRCKPy/l7f95vUUTcVvrIiqVVOepFXrbHeokjkTeQ=; b=JSuRSMOe/x9gwH3j3peHIQmVg2S6L50y5Q86kteznv2XgbliEU+fAFdFKGUofT634tiBMv//+PdN3Gmbc12iyOWp6FRoXsYfsE1jRu0a/u8Eg07UU7CXooPpjeizN+W5Iwgekl3W44z73dZ4PZjIAGprOq+zDSTXBaTQix5XorY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1737828989019190.08370592009283; Sat, 25 Jan 2025 10:16:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbkg0-0008Qy-22; Sat, 25 Jan 2025 13:14:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tbkfx-0008Oz-ER for qemu-devel@nongnu.org; Sat, 25 Jan 2025 13:14:33 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbkfv-0004I9-VD for qemu-devel@nongnu.org; Sat, 25 Jan 2025 13:14:33 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-43625c4a50dso20247365e9.0 for ; Sat, 25 Jan 2025 10:14:31 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a176434sm6225313f8f.13.2025.01.25.10.14.28 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 10:14:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737828870; x=1738433670; 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=OjNRCKPy/l7f95vUUTcVvrIiqVVOepFXrbHeokjkTeQ=; b=QEeGtKyTyaRXQyqMFPgl+hD7/VA2rBivdSHvJDNPW6gkOiJnBdoo7UvHJU6itwATKe pdPeP7vO47T7GSQZZjADcoHBGw20bmHfUxqf7pPgLs4rkS/RCK8b/TzGSiHA5muk8uDK R2YPCP3OXHO+hf1dNeygV1esnp/f273QLcMOWMz1TJ5KIfKMRWZWGc8DDjdO2csmcc5h GkIxlu+YgP2eeyQEWtuTbmCJqHeV3TLM7HHsRH2AVIhN4bYBDVwtJgAx2TiugvaILHnd 6UOLIfsS2inftG/DwMW5mR9p9PI717T6dcJMyitmwJjsowEq/Jr5tGJvTmIUaqnakYjD IBew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737828870; x=1738433670; 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=OjNRCKPy/l7f95vUUTcVvrIiqVVOepFXrbHeokjkTeQ=; b=Z/ajJpte4xYBOYwzpzynMFHfLD+1FhxdWBF41ExxBpInkcslBESfyBCZct8xgP0Yme eXcV+Y05sPza+TdVj+00cv0O74ZDBBkqcEDFUCIW7Ku4qnJmUdX7KLRkXLgG39CSL+02 99Nlbe8MDXd8F/8Ia1oeyez6KGignLCXT8/Dj80oaNNOJnVdWaSP2oko8kt6RY3hoIqe qKmecJApu55V8v0G+A4+3+/FaTBSB4ejnOr+9ewNIw7IJlmvOr/7vw5HfPJMYLifiKPw deeLZC46ow3h3Ib1YtJIACWfBnkcYwtW1KyYRXUmyAmno0vS7btqtpBCh+EeFaJCAcuJ +GJw== X-Gm-Message-State: AOJu0YzsjVFuCAQy9VnjZ9JRukGmK8oV4PPO8Y5AoKKFStt7Lx1jSY+g HKBZsGocmvmxtTZVEAJRaq9yaPza2oJoGzsSfyDDVTqJR9FzSFCf4ho3dgEi9JJxIsHl4sx6HlG wvNI= X-Gm-Gg: ASbGncuFkhOfLOBdAKlcFgXyHbZAx50gEVeP1Bol9lXcELpR/UnpV5E3G9FgI676clX KPi7ZyEr7ZBF/Xj4ukihAEUrHAUgIegQfEgpheoIMAl6m/PoutIL6t/uhYfHKM2H3eCpiRyRHyj UkW5PcGC3r6HcwupuqRZ1+o4NLjYKOk9Rrb9sN91KimnSUSBRi7+mvYrKZcUkGgfvxpyDuF6jAg iAay2r/jqyPf77b9iJ5/RMfiM1bP1LW8w1GzB4ui8j5CwlqJtUChVwVncYe0tsXuGhPqKUcwxsq 380A2pKJmB9Ul6lWjY5RQNPBytqSd15nrYCKHtc7Ki7i/cPHEkXhbIVJavmL X-Google-Smtp-Source: AGHT+IGsW1rE0tr04FeKYA2KGXlK/mvTNA5dlL64lnJuwONXDJIce4w6YtcdzlGTbIKmz0lEq52uwg== X-Received: by 2002:a5d:4d83:0:b0:385:f195:2a8 with SMTP id ffacd0b85a97d-38bf566cd2emr22422454f8f.30.1737828870120; Sat, 25 Jan 2025 10:14:30 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Yi Liu , Markus Armbruster , Eduardo Habkost , Anthony PERARD , Gustavo Romero , Jason Wang , qemu-ppc@nongnu.org, "Michael S. Tsirkin" , Paolo Bonzini , Alexander Graf , Richard Henderson , Stefan Berger , Bernhard Beschow , Stefano Stabellini , Gerd Hoffmann , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Marcel Apfelbaum , Alex Williamson , Paul Durrant , =?UTF-8?q?Cl=C3=A9ment=20Mathieu--Drif?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 8/9] hw/tpm: Have TPM TIS sysbus device inherit from DYNAMIC_SYS_BUS_DEVICE Date: Sat, 25 Jan 2025 19:13:42 +0100 Message-ID: <20250125181343.59151-9-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125181343.59151-1-philmd@linaro.org> References: <20250125181343.59151-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1737828993230019000 Because the TPM TIS sysbus device can be optionally plugged on the TYPE_PLATFORM_BUS_DEVICE, have it inherit TYPE_DYNAMIC_SYS_BUS_DEVICE. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alexander Graf Reviewed-by: Cl=C3=A9ment Mathieu--Drif Reviewed-by: Richard Henderson Reviewed-by: Stefan Berger --- hw/tpm/tpm_tis_sysbus.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/tpm/tpm_tis_sysbus.c b/hw/tpm/tpm_tis_sysbus.c index ee0bfe9538e..4f187690a28 100644 --- a/hw/tpm/tpm_tis_sysbus.c +++ b/hw/tpm/tpm_tis_sysbus.c @@ -133,7 +133,6 @@ static void tpm_tis_sysbus_class_init(ObjectClass *klas= s, void *data) dc->vmsd =3D &vmstate_tpm_tis_sysbus; tc->model =3D TPM_MODEL_TPM_TIS; dc->realize =3D tpm_tis_sysbus_realizefn; - dc->user_creatable =3D true; device_class_set_legacy_reset(dc, tpm_tis_sysbus_reset); tc->request_completed =3D tpm_tis_sysbus_request_completed; tc->get_version =3D tpm_tis_sysbus_get_tpm_version; @@ -142,7 +141,7 @@ static void tpm_tis_sysbus_class_init(ObjectClass *klas= s, void *data) =20 static const TypeInfo tpm_tis_sysbus_info =3D { .name =3D TYPE_TPM_TIS_SYSBUS, - .parent =3D TYPE_SYS_BUS_DEVICE, + .parent =3D TYPE_DYNAMIC_SYS_BUS_DEVICE, .instance_size =3D sizeof(TPMStateSysBus), .instance_init =3D tpm_tis_sysbus_initfn, .class_init =3D tpm_tis_sysbus_class_init, --=20 2.47.1 From nobody Sat Apr 5 05:36:00 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1737829004; cv=none; d=zohomail.com; s=zohoarc; b=bBYKycjMWT0GGDk2ai/pgx4JkbAbam88wPpsw12LE0UawWUPD+wPx2SxxFHrSycWsUGW8BjAq+X2RW0PdITpnejTmZcKKOsPu/iDiI/xueFJmI81lcqgggGEEFnbAuDa8lUbbfM5VfvAWw/N1048bWtaIPJaOcPkEMpYgiz+kq8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1737829004; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=bl6x3NGb6owz3SHDZJmiiZ4r1za5TcxmylUs2G0w4SA=; b=S2lVyQRnauftZV4byITLXJBFCkY8Ov1JGZ0nvbAjo1UnqAl9uaIdaOYzkquRLZ7pKC90yLWpipHDx08YbIoaHslbg2vwRoeuQogpL2KZGiMPsNKenGp3hSflX/7Z07QCH3njXda+6HCDQer1tQWp8xghQAuA+L8tjEFsFBfAcQk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 173782900480749.60352331766023; Sat, 25 Jan 2025 10:16:44 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbkgK-0000HJ-3j; Sat, 25 Jan 2025 13:14:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tbkg6-00006c-CG for qemu-devel@nongnu.org; Sat, 25 Jan 2025 13:14:46 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbkg1-0004Ip-DI for qemu-devel@nongnu.org; Sat, 25 Jan 2025 13:14:41 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4364a37a1d7so32105095e9.3 for ; Sat, 25 Jan 2025 10:14:37 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a176490sm6041968f8f.1.2025.01.25.10.14.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 10:14:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737828875; x=1738433675; 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=bl6x3NGb6owz3SHDZJmiiZ4r1za5TcxmylUs2G0w4SA=; b=ro4U20GmmVU2Vhqa43lZgUYnhXDQKpJxZ3nleuqP3lU6Aeh8c0AwatB1U9GEcH9NEC mswFz4j7kDRcVZxXDsTKl7qrjDkieop17+COSuDMIgTT7dO18zcz8hyUDLhPvvz1VPc9 raJX59mPtz2IsNjX4+pBABhfbANLPOQwrVBrd2x6B59/UYMdzw3g06Z6lLteVGiK/+HQ BlNIPnpJbfg2vhHVERz7tu5zH+at0eer76PqDQv9f3dVTO5I13l6kNLRpsMAEoUT0fPo yaJKwFRwUC3a5NqbRT0dA0IRg74YTG2JM0Xmfbe2SJ1BtH2d3n1BzCHNWkV4fy0zsS8n y6bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737828875; x=1738433675; 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=bl6x3NGb6owz3SHDZJmiiZ4r1za5TcxmylUs2G0w4SA=; b=kaL3SqoCnM+oiiXIVya3v5CGpQ8eoHc/1W67ShyOwx5t7xhPMgmdzL9Bwtgdwn61Gf RPihHQIVqA6GeV1mHTkDWxIgsLg6bhnjgneEf4wb37sW/Kz1l7wnkfuQUvrsKtNIUxWT r4rfWFTiHywmLMbXl2OKZivBKYFnC+AcmsEcVjPR3oge/FviS+GWOwcuT1gfO5SxhIs0 KKYVUajoTlUIXZCYDzIkdskQuorMV5Mmf6FsrgVSmgvOTRufKOv5UxcDBXnl6Moy3rPQ whpPMLjTnPWV1w86F5k33jiiKJWarGKsGwdLMZBcuKo5T20wi7j26TLQMY6ySTaMEX+x dXCg== X-Gm-Message-State: AOJu0Yz7bDND23DkFeM1ahbQxV/RyZNK5ptvokkjVu7LGA+iCHJJOPqM Sy/03infS9ZiI0IgnpRjIlNAfiIFUS4qcC0NilQQiybJERzM9gH5W+h2pDRXlbEpyrGzD6i7FWz US7w= X-Gm-Gg: ASbGncuYzY4u4JyCt2kR4ulqtWKoPVPmTL7SI1N3DTeDK6yx7oaJPeNvt+BesUFiV9N M+LPHgimKG5JhiVIj+WS9tga9A32NC7Xy3ctFm+aLtvhgOgpqwtjmIrFnIjDXLe377qgLIprAwl PZLxu71kqaYZgIvrtdUJEGyXplUYft/A7pN7idwuP945y0v4m1mS9E72htKqX8L6/qqJTfeQTLF EYU0CZi9HqbENmH+6C4nf3Sm6U+hHHqDVM5eCb2OhntOhujvrjIP6TXnCv/JpJVi3ddl0AE/7xM ZksjyJE/ZuPLiqeP4Ro0MOMERizYbfU62DcU2/mp3HxlYL2tmZdDGWzuJXnm X-Google-Smtp-Source: AGHT+IH6Im9WAFP62p+c65YcO9soXGrjbd4TGzQetbCmkepXX8mf8yxKvYvU59Qz1V1TA9WTvs42GQ== X-Received: by 2002:adf:f504:0:b0:385:ecdf:a30a with SMTP id ffacd0b85a97d-38bf57ab510mr28008868f8f.33.1737828875399; Sat, 25 Jan 2025 10:14:35 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Yi Liu , Markus Armbruster , Eduardo Habkost , Anthony PERARD , Gustavo Romero , Jason Wang , qemu-ppc@nongnu.org, "Michael S. Tsirkin" , Paolo Bonzini , Alexander Graf , Richard Henderson , Stefan Berger , Bernhard Beschow , Stefano Stabellini , Gerd Hoffmann , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Marcel Apfelbaum , Alex Williamson , Paul Durrant , =?UTF-8?q?Cl=C3=A9ment=20Mathieu--Drif?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 9/9] hw/xen: Have legacy Xen backend inherit from DYNAMIC_SYS_BUS_DEVICE Date: Sat, 25 Jan 2025 19:13:43 +0100 Message-ID: <20250125181343.59151-10-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125181343.59151-1-philmd@linaro.org> References: <20250125181343.59151-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1737829005456019000 Because the legacy Xen backend devices can optionally be plugged on the TYPE_PLATFORM_BUS_DEVICE, have it inherit TYPE_DYNAMIC_SYS_BUS_DEVICE. Remove the implicit TYPE_XENSYSDEV instance_size. Untested, but I'm surprised the legacy devices work because they had a broken instance size (QDev instead of Sysbus...), so accesses of XenLegacyDevice fields were overwritting sysbus ones. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Bernhard Beschow Reviewed-by: Alexander Graf Reviewed-by: Bernhard Beschow Tested-by: Bernhard Beschow --- include/hw/xen/xen_pvdev.h | 3 ++- hw/xen/xen-legacy-backend.c | 7 ++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h index 0c984440476..48950dc2b57 100644 --- a/include/hw/xen/xen_pvdev.h +++ b/include/hw/xen/xen_pvdev.h @@ -32,7 +32,8 @@ struct XenDevOps { }; =20 struct XenLegacyDevice { - DeviceState qdev; + SysBusDevice parent_obj; + const char *type; int dom; int dev; diff --git a/hw/xen/xen-legacy-backend.c b/hw/xen/xen-legacy-backend.c index 118c571b3a7..4d079e35d83 100644 --- a/hw/xen/xen-legacy-backend.c +++ b/hw/xen/xen-legacy-backend.c @@ -640,16 +640,14 @@ static void xendev_class_init(ObjectClass *klass, voi= d *data) DeviceClass *dc =3D DEVICE_CLASS(klass); =20 set_bit(DEVICE_CATEGORY_MISC, dc->categories); - /* xen-backend devices can be plugged/unplugged dynamically */ - dc->user_creatable =3D true; dc->bus_type =3D TYPE_XENSYSBUS; } =20 static const TypeInfo xendev_type_info =3D { .name =3D TYPE_XENBACKEND, - .parent =3D TYPE_DEVICE, + .parent =3D TYPE_DYNAMIC_SYS_BUS_DEVICE, .class_init =3D xendev_class_init, - .instance_size =3D sizeof(struct XenLegacyDevice), + .instance_size =3D sizeof(XenLegacyDevice), }; =20 static void xen_sysbus_class_init(ObjectClass *klass, void *data) @@ -672,7 +670,6 @@ static const TypeInfo xensysbus_info =3D { static const TypeInfo xensysdev_info =3D { .name =3D TYPE_XENSYSDEV, .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_size =3D sizeof(SysBusDevice), }; =20 static void xenbe_register_types(void) --=20 2.47.1