From nobody Mon Nov 23 04:18:41 2026 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1793218674; cv=none; d=zohomail.com; s=zohoarc; b=n1oK7eZihZBL/yzxaFDtEBqhkZNg15HPbYvPSK7AWF5bddnyvI2nPmL34ByNPncyATRpbi7Fvs7DzPGAaubsXIO9qp++VwWqIwZNEecFwxsUlEg1U7TB4/V+hF5RHraHQA+/kUu6LYSHj05pSPvRf7I65a+i7wKw5OXvikHEnkE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793218674; h=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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=cWoyICeXIEDcF+ntNhHWZ5R9npUPu6GPUvFCsQk32MY=; b=FpscFOH19BXcz3CTDEystfqcWKfd7jw68G9Bs1+2QI+yuLQZXmzFOyvggFmKMC+LOWJVpnCSLc7u/cJx+7duRY4y2zVCfTaj7WzXEWhMM4h4fRxmO4m/axQmFLlUDwv+IJYSVJOuyZDSBnTBdkXgo8A0dmxxR9WywCaZfYea+yo= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793218674893449.91465461176006; Wed, 28 Oct 2026 13:17:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMA4K-0004xz-N6; Wed, 28 Oct 2026 16:16:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMA4I-0004wa-Ry for qemu-devel@nongnu.org; Wed, 28 Oct 2026 16:16:18 -0400 Received: from mail-dy1-x1332.google.com ([2607:f8b0:4864:20::1332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xMA4H-0002Cd-AM for qemu-devel@nongnu.org; Wed, 28 Oct 2026 16:16:18 -0400 Received: by mail-dy1-x1332.google.com with SMTP id 5a478bee46e88-3535a54bed9so2028564eec.1 for ; Wed, 28 Oct 2026 13:16:16 -0700 (PDT) Received: from DESKTOP-Q716RM7 ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id 5a478bee46e88-36a23951e00sm12016896eec.20.2026.10.28.13.16.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2026 13:16:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793218576; x=1793823376; 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:content-type; bh=cWoyICeXIEDcF+ntNhHWZ5R9npUPu6GPUvFCsQk32MY=; b=nzfGdFj0vJIWSJvBIPhLSlTeBUhNFF7qz5xNDRrDzqAdvPSTRagPsONybug+PW5r0g tfeLIzUmqcRtqgbSzRwegr/EQCP69k3YmD3Fy+ABD4WXxTw9+ngFldiAw1IlmpSYNfyO yIMh6h5nslMQuo4VES2xMsw9w+aVoQ/j5Ax19k5euGwK2k0AnXWXAo+ciTnBB9dWqzNr YeNuEQEWGkZPiW7W1NCv3qlEezpo6zsNyxLZtzsa9b50t3wjDT7Aztkv9ZQAENlLBfhQ /mJWqGjlvU+c9tN3NOvIFqwEqVc+byljC8ok4L+ysEqIp7PqVUnEvqErKGAbeBk4QYL2 D3FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793218576; x=1793823376; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=cWoyICeXIEDcF+ntNhHWZ5R9npUPu6GPUvFCsQk32MY=; b=dni60uT+BBhAJMomqV+T6Sofo+bb730/BuLgyWWQP7z6XT/3GXRmRc6LQjw0DFqD/N qZkGAltUks3PTyBRgC7GVyLkx6kJ03WO5rucdoZqlSOt88rTzKzk9MCT4B0NtYC3q2Hl mHYshx6AkiY+/KVV88X9FU+fOsQAF4Q93qiDxIq4dClPo/p7AX4DP6FbyC8RTPwDW5rv hVMg2G91t0Dq7iSQnk5Lj9UhmLqu+RKZDRAZJmWMhfoTaCZutOydkglauXvAyQkoUGWL MCU1q/Wgl/9r1kH8zj67SOH74d/LBLb5v864765ifSoUz+L56DcBcEvUIuEEdofp2bpH EONg== X-Gm-Message-State: AFq9FYI6VWC/1LP6K2fH45Eq8Z7hS/TgoGLUmrm7wvNzW5uO1+BYU4YT nF3Ja0tCdQLtnU9fqoaMHU62ElcVcckoHWexhw40WvN/t08/pd4IGj5+72mX+Ba6 X-Gm-Gg: AYBFou1YrZW8bYYCBGZG83boUGCk1YL7SlXrGsLUKFcZIhz9KVqF55Wrbkc5uKvRGyN ulP2WAyZMFtHyG+AJ80FU2rtbGS4IhfPAuSWrsh3FZYLkKjnICPoTpbod2pPLsYaSioqg8MebBj wfAR7jAeHkkwq6iwGWXuElPKwTAPkCxphRCiH4OWMrpHso36yUrGejnd4l/g2pFgvVMNLGH3ftN 9WHvtsuJZTbpwxroymTz8KNollcSzpY/30RgwQ0OVks3uZefhxYiZK++by9CyKGlM2G1unYjcKT CVikv9D8j01Td7T2uihtuIKN052eo4OQw1Ofn0zQ+nUH9Z1y4wRT0eXJVkK/Rh2DExfRde4A1RP 2SlA+/kYor46sx0JLqsKqowT8ahGzlwbXWufYcB6BvTQ/aOuK0jJTIvp9XsZRBAeWUJzeOVUE+o ASyoSwKTFVY5/LgIUOO36PWbObUciumyBNzUZgZfXMvgrC0k3Y8yT3Q3p0NRO3pIWCG/05e2Dxs NjJKgO9+H7R4XNqS2TXBopMNccmvsUMbqd1fJoeag8gAZ17saTHuu9cDRSaAAM4ORB+4JOjYHgQ k8xqKqFo+/WpCpCieXwhhADiAEAqW7dkhpumrb9oWQdLD+N2 X-Received: by 2002:a05:693c:20c8:20b0:369:ef63:ea90 with SMTP id 5a478bee46e88-36a203fe357mr4711973eec.28.1793218575593; Wed, 28 Oct 2026 13:16:15 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , David Hildenbrand , qemu-s390x@nongnu.org, Jiaxun Yang , Peter Maydell , Pierrick Bouvier , Eric Farman , Song Gao <17746591750@163.com>, Max Filippov , Cornelia Huck , Fam Zheng , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Matthew Rosato , Philippe Mathieu-Daude , qemu-arm@nongnu.org, "Edgar E. Iglesias" , Paolo Bonzini Subject: [PATCH 01/12] target-info: add target_loongarch() Date: Thu, 29 Oct 2026 04:15:45 +0800 Message-ID: <20261028201557.2688-2-luoyonggang@gmail.com> X-Mailer: git-send-email 2.55.0.windows.3 In-Reply-To: <20261028201557.2688-1-luoyonggang@gmail.com> References: <20261028201557.2688-1-luoyonggang@gmail.com> MIME-Version: 1.0 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=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1332; envelope-from=luoyonggang@gmail.com; helo=mail-dy1-x1332.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=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: qemu development 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 @gmail.com) X-ZM-MESSAGEID: 1793218677841154100 Content-Type: text/plain; charset="utf-8" Report whether the selected target architecture is LoongArch. Signed-off-by: Yonggang Luo Reviewed-by: Pierrick Bouvier --- include/qemu/target-info.h | 7 +++++++ target-info.c | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/include/qemu/target-info.h b/include/qemu/target-info.h index 2cd4cc5671b..6c4e2809ad3 100644 --- a/include/qemu/target-info.h +++ b/include/qemu/target-info.h @@ -92,6 +92,13 @@ bool target_hexagon(void); */ bool target_or1k(void); =20 +/** + * target_loongarch: + * + * Returns whether the target architecture is LoongArch. + */ +bool target_loongarch(void); + /** * target_base_ppc: * diff --git a/target-info.c b/target-info.c index e67d7bed520..b6d9cd8d97c 100644 --- a/target-info.c +++ b/target-info.c @@ -84,6 +84,11 @@ bool target_or1k(void) return target_arch() =3D=3D SYS_EMU_TARGET_OR1K; } =20 +bool target_loongarch(void) +{ + return target_arch() =3D=3D SYS_EMU_TARGET_LOONGARCH64; +} + bool target_base_ppc(void) { switch (target_arch()) { --=20 2.55.0.windows.3 From nobody Mon Nov 23 04:18:41 2026 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1793218747; cv=none; d=zohomail.com; s=zohoarc; b=G+gMj2mfT2WSuY+a4IAjwP2b4D/zGaEIpaqNCEW4hYzt0zVEoCjTX+cWi76k2Oabv6p08um/eIqfZ+y6/NVVYzmlqnFeufEwQHwcpeOs1t0vWO3uFc9tBQ7zHFzTfMgNQz3X08xLT3dS1QdCnpx86MJeRMd9IFcnzBwHUu/+mQ8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793218747; h=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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=jxKoLwAp1Bl4rnQorq+3BYZr6+qu/Ilca8ukToeEfCc=; b=FO6s47MURlVT/RbihWgroOsebBzNldwLDmkQaRqFJAhnp03v/TdxPQo74Eh4lZzpOeFTAL1sy68rTmvCWpGiMy1GjZ+NNhThaIcn/1jkQd+idG82ImMj1a88n9bv7xdh1bnV2DJdjzv1YwIgm93qhbBGYZ7wgBfXNs5LIqdBZsU= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793218747900222.1537624790135; Wed, 28 Oct 2026 13:19:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMA4i-00056A-EM; Wed, 28 Oct 2026 16:16:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMA4S-0004zS-SC for qemu-devel@nongnu.org; Wed, 28 Oct 2026 16:16:30 -0400 Received: from mail-dy1-x1334.google.com ([2607:f8b0:4864:20::1334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xMA4N-0002Df-8D for qemu-devel@nongnu.org; Wed, 28 Oct 2026 16:16:27 -0400 Received: by mail-dy1-x1334.google.com with SMTP id 5a478bee46e88-3282db206d3so1381309eec.0 for ; Wed, 28 Oct 2026 13:16:22 -0700 (PDT) Received: from DESKTOP-Q716RM7 ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id 5a478bee46e88-36a23951e00sm12016896eec.20.2026.10.28.13.16.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2026 13:16:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793218582; x=1793823382; 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:content-type; bh=jxKoLwAp1Bl4rnQorq+3BYZr6+qu/Ilca8ukToeEfCc=; b=J24gzf9GCPCBsf3Up97UU6TVUtkCbOHXcIBQf/koc5cJtB1KEmbHtkrolGqmTt6Nwl rMp1LwKrl/U08E/gpepKIERJxI6qB0AYsVOJsCGl2LAbVX+qUZIMThzmKIZ/Qj9qitZn Yv7H4aLfxvla7BQtAmyY93lplAR2HPDSTqFJibM+lIbObrMxZFocP5zjXNswB8yTldXX TIayzJhto7Vj3o+/h5FJfH2y28Qi9ANDZ3nQAj5GVJJy23xOtiLonhklzk/Bv0rc9b4T HfX2z6IP+PArBcTc0Qmbp1FUygqHMTiSFTcrtfavRjiIfdavkKlZNbh1ZQMdxfnUR4Qs HUmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793218582; x=1793823382; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=jxKoLwAp1Bl4rnQorq+3BYZr6+qu/Ilca8ukToeEfCc=; b=GltM6JXSiFuruVibt9dU7w5PkfiVqdHCM8klnoKeTj5FQCKW38Uzrc2edNIXZhLwmf S6reeAvvzAOy9FxQ/GjsDCxVBBacVFTLQLtm2KfBVuLvad5vSiHpzMEGZtELrouVbalf oZ5FDZhO9CUJQtTKQRSbYKfsPdVue74AXhyU4pVZIqRGULESJRw4qvAl4o4V41Xsn2pT 7z7o2TWfyVAYhyI8fwL1jQBqsAmHwG4uWruypbJnNUnr7RD900GJCOFQMar0WopWEY9X GXHUuxrQEvhILODWf0dqUbHm3k7PanbPt7NptpwphoJneGXEo1NXpjbZBQ4fsO2lbkbt Ipkw== X-Gm-Message-State: AFq9FYIL0MKPQi9MaWoDRHA+fBlSB3b6rAjUmQxdByhRolLdj72s/zoD Drv3Xfc7301ljO+GSvZMb3a3TuDRXIaKgZrjGWnZAFs1MrqDphGoYFl6E2it0WTq X-Gm-Gg: AYBFou13ayQeeF1b71EzvvsIbK9CB+yD4uDW2269qQizwzFVTGR+uki3fMGdJ4+ec7D c0bayI7EDgMxQaj1wz8PVcQhuEx3S2s3Xgknl1j+EFYRywUX1fkANT+uXr9wGAxTTD/q2WgjPZP AVMxeHaJo5JMCRCArIvuQ9YHKCW01qkPwnQHnUabXp9t42JXdpm0kg+F5OoB0ZCZ89jHzBMbESE zz1zNFjWrsHBrtQW6dpoYlFmUrDexBrMuRSFkYl/x5BHJl+fW0OJliyl1e60rBzO30mLXl1AqmD ZdmhO2Xo0zyC0gNYA0QcStoIbe4NPUn9BDoH28FbTTl/nXNp4K6r0KoJCQcOKMcDGfQywWQmVU5 SMFeqj/0duF8hRUHqpMAMqLfjZ7AWPQsdg87Xtt+VezYQd+DxQx6g3sntqA6BIsA/swWT93pbou UnY1FPUezICAZCSETLHCGTEJhfzNFzKiDL0eVe4GNEFZKa2cdepHefuo2ScSB6V//iaLEQaT3c7 iULDh2NsplnyxLtzAe16luR2+jm7oekYLyhympj7ed/Ag3/n7CaZeWX8KsVOeZzDM6Vs98t/csb Nfo4N5D80VzLTdwI8xQ3gRLJ39k0IryspYeJD/WC9LbJ47L3cGuLcMzqagdX4shCvl8PIw== X-Received: by 2002:a05:7301:78d:b0:36a:1d6f:917c with SMTP id 5a478bee46e88-36a203ff237mr4351578eec.22.1793218581543; Wed, 28 Oct 2026 13:16:21 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , David Hildenbrand , qemu-s390x@nongnu.org, Jiaxun Yang , Peter Maydell , Pierrick Bouvier , Eric Farman , Song Gao <17746591750@163.com>, Max Filippov , Cornelia Huck , Fam Zheng , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Matthew Rosato , Philippe Mathieu-Daude , qemu-arm@nongnu.org, "Edgar E. Iglesias" , Paolo Bonzini Subject: [PATCH 02/12] hw/loongarch/virt: select virt machine types with is_available Date: Thu, 29 Oct 2026 04:15:46 +0800 Message-ID: <20261028201557.2688-3-luoyonggang@gmail.com> X-Mailer: git-send-email 2.55.0.windows.3 In-Reply-To: <20261028201557.2688-1-luoyonggang@gmail.com> References: <20261028201557.2688-1-luoyonggang@gmail.com> MIME-Version: 1.0 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=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1334; envelope-from=luoyonggang@gmail.com; helo=mail-dy1-x1334.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=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: qemu development 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 @gmail.com) X-ZM-MESSAGEID: 1793218750080158500 Content-Type: text/plain; charset="utf-8" LoongArch virt machines use the same QOM names as virt machines on other targets. Register them only when the selected target is LoongArch, via target_loongarch(). Signed-off-by: Yonggang Luo Reviewed-by: Pierrick Bouvier --- hw/loongarch/virt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 9c5371af9de..3f1b82f25ef 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -11,6 +11,7 @@ #include "qapi/error.h" #include "exec/target_page.h" #include "hw/core/boards.h" +#include "qemu/target-info.h" #include "hw/char/serial-mm.h" #include "system/kvm.h" #include "system/tcg.h" @@ -1553,6 +1554,7 @@ static void virt_class_init(ObjectClass *oc, const vo= id *data) .name =3D MACHINE_VER_TYPE_NAME("virt", __VA_ARGS__), \ .parent =3D TYPE_LOONGARCH_VIRT_MACHINE, \ .class_init =3D MACHINE_VER_SYM(class_init, virt, __VA_ARGS__), \ + .is_available =3D target_loongarch, \ }; \ static void MACHINE_VER_SYM(register, virt, __VA_ARGS__)(void) \ { \ @@ -1587,6 +1589,7 @@ static const TypeInfo virt_machine_info =3D { .class_init =3D virt_class_init, .instance_init =3D virt_initfn, .instance_finalize =3D virt_instance_finalize, + .is_available =3D target_loongarch, .interfaces =3D (InterfaceInfo[]) { { TYPE_HOTPLUG_HANDLER }, { } --=20 2.55.0.windows.3 From nobody Mon Nov 23 04:18:41 2026 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1793218753; cv=none; d=zohomail.com; s=zohoarc; b=naCEJlKZXIk0hjClx0wQe6Xzmj9zJQvdqdfbq9UQaBonz0nnSOmuqWNYuX/G7dFkH9WXwRXn3yDQcRrlRzHRdc3SDxf34U2qCKpzlGxdwxD0rDnLlQ0tbh4kMRkbcixJMsPJnZeMNmRGMDFilRuRY96s9FAR7noJs49IWtLbTlE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793218753; h=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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1Kd/JJ+ki+GBlJjMkI5tJ6UFoV7UjonthLRTOxTkDpk=; b=h60i+1pRQuRuifkkgRKpGa2ovwfBR97DXI+ycfaIl8X8Wj5UGrF+hYdO9zdUvu8xi7gm1fqsKBkvILB3U+G4Rs/9cNBwB0JCjJa+DSNJled+JiES14LC+/mMWaaSgHo6WULy0p8kxLCRQks91mn0BTjEw1eJdcQrgOzOHtQ1ol8= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17932187534021023.9175393712803; Wed, 28 Oct 2026 13:19:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMA4i-000561-AP; Wed, 28 Oct 2026 16:16:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMA4W-0004zn-L7 for qemu-devel@nongnu.org; Wed, 28 Oct 2026 16:16:34 -0400 Received: from mail-dy1-x132e.google.com ([2607:f8b0:4864:20::132e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xMA4U-0002EK-Mx for qemu-devel@nongnu.org; Wed, 28 Oct 2026 16:16:32 -0400 Received: by mail-dy1-x132e.google.com with SMTP id 5a478bee46e88-3514b90bb89so2664337eec.1 for ; Wed, 28 Oct 2026 13:16:28 -0700 (PDT) Received: from DESKTOP-Q716RM7 ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id 5a478bee46e88-36a23951e00sm12016896eec.20.2026.10.28.13.16.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2026 13:16:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793218588; x=1793823388; 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:content-type; bh=1Kd/JJ+ki+GBlJjMkI5tJ6UFoV7UjonthLRTOxTkDpk=; b=DQyrLS293RsXpHhnQuyPIh6C/0j6sFzjVsCLCGVi/Hf3ggWDAxRZeX2ABKOY0ntizj +BddzRs1Z5/6/yU6+pZBRAUDoQPTiM+mxr7O7egW7+n3YRSFVikT03GI/hekz+RY2SiP 0Pchrzi00AK52Ko9e2KCtClkPAAddGHN+JoQ5usEjRZEmR7e2OUnWAGfEv9XD9mRa9B2 M8GFESgvGGNtMGAWiK6tczCneRO+9vkQNr0GTZVqrh5JDSJmG3XhMhOJZmoyM9hoEk2z rRtZbv4GLTmGENObTraOJixjwpRGHwfQ3M0hkC+8MDtMq1t5d5EMRXxRad+/BQbRIY2I o3ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793218588; x=1793823388; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=1Kd/JJ+ki+GBlJjMkI5tJ6UFoV7UjonthLRTOxTkDpk=; b=1jI1Mq6oj+/Y4B6KIUvbwhfYWaJ26IRIhhDat4Q7S5A7EMkRYyU+TRSj9BycTYDe/Y BBuq7bQ9u9lmpf10fUYEgH/3KsOanSG6pzyIOG60v1QuXWhp8+O16vH8kvcwfX9lkgVv GYaQ35Gf2v9YUvedj71jGZv/43PxuZMkBcEyXCFizHLMhqvhR2U/09jg8wNA1twtGxHk jhGZW0SLm3gACNzA2o1oFzWExkJzjoC460TrPgzQwgLTHqMfpcgovX00dAXeMCD7XiVU EBrjkYZGiLJE32Kll8gAvZRiD+QjkMuIET7paJlShDL1lE16dnHq1mnM+5bjqufUaZLF gVMw== X-Gm-Message-State: AFq9FYLBTtXG14r2iL0pJnHkROtxmU7jRqxlgarc2S92FOvHPqAxfHtb g9SYrEu082RAjSxzi5Oyn/QUJBv+IpzcDLJYsUG88F6O5ZWW/nUI+3mbvhkgM/C6 X-Gm-Gg: AYBFou0RlqpbrhF6HZop6VcLKCqcuJcp5V/g7lGWdwMMj8lc0igQDNS1lL+1ZRsomC9 mPJoEsDS0OGgaZbXJU0YScxp9N4QOEp2ks7zOKhgdiocp+edgiVmPdRUVfxGEw7PMTAe3pi+Yzq fIqGOKgZSsKxc8d/GrgtNTE5grncxuJBT896QKLFwrF4jcxPnyxfaFAxtdwPJsrMYCY3VHc0G+n AhMFcmWoXcsyWyqjhZOfGePyBHG0I+B8jkxOzSGWRUiNEqojiv18AjSIofi0fX8EQDnfeJ4v3At N83qwmFNRiPYiQkA+hezoBLzBpFqJIX+M8LetjhzCp+qZIiIwTNGyebqUFumEGCPJWyM8duluCU Nb7t9+NYAIlx5e5IVIJGqfTT83kiRYNYqRLNSekjtaEnjTQwKgslZWBmnVU6Q+VxsFhoOmbalqm Thd35nGwaGCVWgVV2f27FHiiT1cGjmCjPaw3ruw9EDG+OKVHOIhtXs+8fzZwac4THHgRlXXo7d5 EGEZ1nDq62cWU/vq9IwShnqfFgYuXz3yhXcHt/DFIR96jkSY9SoeMdHeHcng+WMKHgmnICuXmdY DBeN3d0foHPaDEhljz93aV6yY+DUjS7Bxb13uwcpkSgcrGyn X-Received: by 2002:a05:7300:c88:b0:36a:1044:e805 with SMTP id 5a478bee46e88-36a2008a23dmr6939278eec.23.1793218587575; Wed, 28 Oct 2026 13:16:27 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , David Hildenbrand , qemu-s390x@nongnu.org, Jiaxun Yang , Peter Maydell , Pierrick Bouvier , Eric Farman , Song Gao <17746591750@163.com>, Max Filippov , Cornelia Huck , Fam Zheng , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Matthew Rosato , Philippe Mathieu-Daude , qemu-arm@nongnu.org, "Edgar E. Iglesias" , Paolo Bonzini Subject: [PATCH 03/12] target-info: add target_xtensa() Date: Thu, 29 Oct 2026 04:15:47 +0800 Message-ID: <20261028201557.2688-4-luoyonggang@gmail.com> X-Mailer: git-send-email 2.55.0.windows.3 In-Reply-To: <20261028201557.2688-1-luoyonggang@gmail.com> References: <20261028201557.2688-1-luoyonggang@gmail.com> MIME-Version: 1.0 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=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::132e; envelope-from=luoyonggang@gmail.com; helo=mail-dy1-x132e.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=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: qemu development 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 @gmail.com) X-ZM-MESSAGEID: 1793218754055158500 Content-Type: text/plain; charset="utf-8" Report whether the selected target architecture is Xtensa. Signed-off-by: Yonggang Luo Reviewed-by: Pierrick Bouvier --- include/qemu/target-info.h | 7 +++++++ target-info.c | 11 +++++++++++ 2 files changed, 18 insertions(+) diff --git a/include/qemu/target-info.h b/include/qemu/target-info.h index 6c4e2809ad3..1d6c6f4472c 100644 --- a/include/qemu/target-info.h +++ b/include/qemu/target-info.h @@ -99,6 +99,13 @@ bool target_or1k(void); */ bool target_loongarch(void); =20 +/** + * target_xtensa: + * + * Returns whether the target architecture is Xtensa. + */ +bool target_xtensa(void); + /** * target_base_ppc: * diff --git a/target-info.c b/target-info.c index b6d9cd8d97c..07dc88fd366 100644 --- a/target-info.c +++ b/target-info.c @@ -89,6 +89,17 @@ bool target_loongarch(void) return target_arch() =3D=3D SYS_EMU_TARGET_LOONGARCH64; } =20 +bool target_xtensa(void) +{ + switch (target_arch()) { + case SYS_EMU_TARGET_XTENSA: + case SYS_EMU_TARGET_XTENSAEB: + return true; + default: + return false; + } +} + bool target_base_ppc(void) { switch (target_arch()) { --=20 2.55.0.windows.3 From nobody Mon Nov 23 04:18:41 2026 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1793218751; cv=none; d=zohomail.com; s=zohoarc; b=gdU++1/f1ey1sDEPrnzDlAOHFfAycO85+z6JT/1psc8ey+rCqHec6C8lJ7Cen5YdI9fPWwmb8NMU0rf1wZlmZwpNw1mjaFs7smeFMgj7C23MHbZVYEmBArYywH1ziVj/Zx2w1L8RKmn+nnUkMEupIkm8QUlw7ixFzsFDTW9/rGA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793218751; h=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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=NuBToxGTKV+VzeXb2lZn4OChHw2LGBi0yxV28yWFalg=; b=m52M4bXC4PwRPgIHieqxf4/e4fl6n2s1U98mEXlQdlVvREmedfrUON2FP4MOLu918JOTfcukkbvE6hKy7Hm7uwLR/JF+VGBwN1P2N535gccpv7hAOqDW0EpHsulDC17FEBTBwOpJbwgvEpYHGZDW1wPk5DsVJslJM+YHmu9D/iU= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793218751103243.19853128427962; Wed, 28 Oct 2026 13:19:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMA4l-00059R-UQ; Wed, 28 Oct 2026 16:16:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMA4b-00052c-TQ for qemu-devel@nongnu.org; Wed, 28 Oct 2026 16:16:38 -0400 Received: from mail-dy1-x132a.google.com ([2607:f8b0:4864:20::132a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xMA4Z-0002Fe-8I for qemu-devel@nongnu.org; Wed, 28 Oct 2026 16:16:37 -0400 Received: by mail-dy1-x132a.google.com with SMTP id 5a478bee46e88-369f33df08eso2610865eec.0 for ; Wed, 28 Oct 2026 13:16:34 -0700 (PDT) Received: from DESKTOP-Q716RM7 ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id 5a478bee46e88-36a23951e00sm12016896eec.20.2026.10.28.13.16.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2026 13:16:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793218594; x=1793823394; 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:content-type; bh=NuBToxGTKV+VzeXb2lZn4OChHw2LGBi0yxV28yWFalg=; b=RD+I2klCz3R1BipNv7t+heexbnZftLEpRW9eCIJlb7TZ3c1CCOLM9IqhCuivpjj3Dl yC7pjvKwGNmNYH8NBPD5nq2Y5MhMmCV0H+QR7bwUgwrWjiCFH4qG3W8NxddxjB6Xf2B+ xvlldFnXNkL4qmixOakR6Njzk9HrqCyNpO5INU/Bacz0/5mCw5K+F+V3+nTbhtErCps2 AScPNaXwhbi4546aKcxeBqD91jGRwjWET0pD7/Xc7pnWCSwNVisxk5vKi/UO/wokH7yI /gIbfvz1zBLNljSe7i/MIWEfRQv4jjXX3gxbslOjP+QadmMtl3OGHRcS0TaX4RWTzKEk Delw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793218594; x=1793823394; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=NuBToxGTKV+VzeXb2lZn4OChHw2LGBi0yxV28yWFalg=; b=fhm2pZX70gAOQlmvuqEuD7L/UXYyepMHxoiEC3lgh2Mbp0pULG1FV7BIPj9f5BCz7E u18n5INSTdz0/zRLyXTlPv68ME2qeRwHbN8bMKRCLCqT00RO/HqA6ppIugwZ+/b/7LCU G6wB/wHEpEE94ofa0ERin3i4GpfuxvBx4iFTQhz80FwpEHA0fKYkk+h0DzSoriVqRpFC k+TaG8ZW0OYgtTXtp1fZeosdjX16ICJdiMN5GK6WGgg/6ExLm8lSbwKjA0ZVey7O6grN qY4V2vmNlURyHjvqj8kHnkyGjJPraTUJNoU59ZAJK6lckFLjwck/AjwXf5naSnnW87Rv TAOQ== X-Gm-Message-State: AFq9FYJljPqwyaX/rVOXfOXoGXw3UXtFqmbUaLUbGMTvfuEkfLhQ6Ytp cR5wRqrMUPGmFJAKsIEaz0u6k5ImX+f2VwYgMpSnRUVeFuWaNh1N2gnvULQVKSsm X-Gm-Gg: AYBFou0NUECHl2wyBPraMPYpIXPuZP42s0xIu77muS/adrZK47NzUtKuUThdC6V6xmR 6JVbroO3mj+rTPbUnugBt0OF12EZnszyRfnQ0pDJtu/TqjRzI2bZCDvbS5W/gNL39tNuaFL4/jV SdlxrdVQRs3A/Gd13yHwbNgoZfHP5TS/LXw4hUxGrDooh5AINloW3eWPN8S/Zrks45oNiwenQfU gnZeqXH7l6ndXPGZGdGehqxMp7P20qaU74zbBFeUCBH0jeIhkLl8g1/cHFmdpvKeONg5A8wxqMj /ZQlQqAa3fG+128d8N7M4ZFWH7G7syWfxNzP/ZIcHKvSRUj30Vmy88QONDnnJP7Q5ZKxjd4Os8l 9G469sUAwNXMreRGXRxvmobi1K+VE+syQ5SBfuIAkgOswzWW94ry236JBqf80VdHQgSPnJTz37k pyrVZISa+NWYJOdrVBSc7YwE1MfdZYMn8iUD51ADo5GPef1yWwf1vGMGOY3hjizm3mDmtQK8elD bPfj72/LOnBgBuyhUvZG7yIFr1Cor1M2Uo2W8IUknGAYVSIv8BoRAq/1bBQ9k5498BJiOuA45Gl H3MHPgQ4I3aALSOS54fXt2FBGD3rJWlccpeKxaKeRup9gzih X-Received: by 2002:a05:7301:618b:20b0:360:e2e6:f849 with SMTP id 5a478bee46e88-36a20138550mr5188420eec.28.1793218593540; Wed, 28 Oct 2026 13:16:33 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , David Hildenbrand , qemu-s390x@nongnu.org, Jiaxun Yang , Peter Maydell , Pierrick Bouvier , Eric Farman , Song Gao <17746591750@163.com>, Max Filippov , Cornelia Huck , Fam Zheng , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Matthew Rosato , Philippe Mathieu-Daude , qemu-arm@nongnu.org, "Edgar E. Iglesias" , Paolo Bonzini Subject: [PATCH 04/12] hw/xtensa/virt: select virt machine types with is_available Date: Thu, 29 Oct 2026 04:15:48 +0800 Message-ID: <20261028201557.2688-5-luoyonggang@gmail.com> X-Mailer: git-send-email 2.55.0.windows.3 In-Reply-To: <20261028201557.2688-1-luoyonggang@gmail.com> References: <20261028201557.2688-1-luoyonggang@gmail.com> MIME-Version: 1.0 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=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::132a; envelope-from=luoyonggang@gmail.com; helo=mail-dy1-x132a.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=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: qemu development 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 @gmail.com) X-ZM-MESSAGEID: 1793218753250154100 Content-Type: text/plain; charset="utf-8" The Xtensa virt machine uses the QOM name virt-machine, which other targets register as well. Register it only when the selected target is Xtensa, via target_xtensa(). Signed-off-by: Yonggang Luo Reviewed-by: Pierrick Bouvier --- hw/xtensa/virt.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/hw/xtensa/virt.c b/hw/xtensa/virt.c index 271f06e0953..2b30cb863d4 100644 --- a/hw/xtensa/virt.c +++ b/hw/xtensa/virt.c @@ -29,6 +29,7 @@ #include "qapi/error.h" #include "system/reset.h" #include "hw/core/boards.h" +#include "qemu/target-info.h" #include "hw/core/loader.h" #include "hw/pci-host/gpex.h" #include "net/net.h" @@ -124,4 +125,22 @@ static void xtensa_virt_machine_init(MachineClass *mc) mc->default_nic =3D "virtio-net-pci"; } =20 -DEFINE_MACHINE("virt", xtensa_virt_machine_init) +static void xtensa_virt_machine_class_init(ObjectClass *oc, const void *da= ta) +{ + xtensa_virt_machine_init(MACHINE_CLASS(oc)); +} + +static const TypeInfo xtensa_virt_machine_info =3D { + .name =3D MACHINE_TYPE_NAME("virt"), + .parent =3D TYPE_MACHINE, + .class_init =3D xtensa_virt_machine_class_init, + .instance_size =3D sizeof(MachineState), + .is_available =3D target_xtensa, +}; + +static void xtensa_virt_machine_register_types(void) +{ + type_register_static(&xtensa_virt_machine_info); +} + +type_init(xtensa_virt_machine_register_types) --=20 2.55.0.windows.3 From nobody Mon Nov 23 04:18:41 2026 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1793218654; cv=none; d=zohomail.com; s=zohoarc; b=BF7pPTy7bqpsaBga+NrSh2Z9a9gu2PxF81EAF6UzJCdSSonHHW+VWsi9QXniKT7hMW/VVeuzZXqbBJCYxFsmRjHnjWWGCa5kJLaK/JBmgrbiAskeIvgDI9GinOcO8O/ZWIWbgQirPid6VWRujyri5nTrPZYg7japZE134xZ/R+o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793218654; h=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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=obAwicYQArWnw8mdM95mb/RZp67/7GPYWgLKlbu+5L4=; b=m2pQakFZxPd2o31aAVIbtCro+hdqNoVgagZTigbOHMyo/+AYIV9FMJ+c0SE76YEpZnRb335no5aC8v2JnccrQVcv5xzMinVtRxb60wXrUg7iD4x4OA4JmP+q7+VFx6AgT12yzgstSn9LrX4hXPzOXJXJl5+8QNJUo9zmcSPnlqE= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793218654844445.8935759265197; Wed, 28 Oct 2026 13:17:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMA4n-0005AC-Jq; Wed, 28 Oct 2026 16:16:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMA4h-00055v-Ka for qemu-devel@nongnu.org; Wed, 28 Oct 2026 16:16:43 -0400 Received: from mail-dy1-x1330.google.com ([2607:f8b0:4864:20::1330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xMA4g-0002Gb-38 for qemu-devel@nongnu.org; Wed, 28 Oct 2026 16:16:43 -0400 Received: by mail-dy1-x1330.google.com with SMTP id 5a478bee46e88-36661f953e4so2232841eec.1 for ; Wed, 28 Oct 2026 13:16:41 -0700 (PDT) Received: from DESKTOP-Q716RM7 ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id 5a478bee46e88-36a23951e00sm12016896eec.20.2026.10.28.13.16.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2026 13:16:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793218600; x=1793823400; 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:content-type; bh=obAwicYQArWnw8mdM95mb/RZp67/7GPYWgLKlbu+5L4=; b=m93TdaKWpxlq1SrL06/yZi3GhlLaT46g/ce3U12RM5aCmVTZ3LFuUEwbhCANuuO9GH 4fvcXB/rOavcCzaHhmbsAKZhE7Mz1f6gVeAmCgQRPwChGhZWL1uqPPl9uka356ZE8kb6 a2mAFe5uLjV5Lhv2LxHR5dVQO1rHCfWAEXIQY3OzMnjBZUMppuVPCs8YI9QTF64KWMCs Th/pQKSP8vCaxDjEfHvV7d0h0dq992102eDbR43GS30F61P7cmT2ht3JIODjBZPHd1OG FnGTpFjY7ekY9M73Fgs+wPLQmKzpwFfIuFcV/V7cLm3TJ1EOyp4kEysacE59chgNPAlx KERg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793218600; x=1793823400; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=obAwicYQArWnw8mdM95mb/RZp67/7GPYWgLKlbu+5L4=; b=e7m5juUIDD9APBmuOoMW4TCZMHoUQNvAppX5le1MDMhVVmGDQ37JpUoVjfyoDmzERi gHHUBa9DUH2JHPl+PAHySAy7gbwpP9I8GTGeORGrW+Qp2r7/gnmLiaOo6LbUELVw5CuE 7PmakJ0StDtMv7jQ4DmA+QMvAZ0cybb14pyblyYyY+9F/kHH0+zVva5KR4P6PlJnwgrq YgGc0rvMTMnRY3db44ZDE4zLiLyMEN+WFOtdx7oG5zi5KNN8Leu5Uur+nAT0jx2EgMOR 8juTdGSzEvYhAdirBAeKW3BLBjvELpgDgex4fnm+15BUYJQYom2AxH77yZGlKChot1WP cXKw== X-Gm-Message-State: AFq9FYIdcmSullFCOsUaJT6aiAMKi3GqqByri1qFM7KOoLgcL0jPT8Dn paCgqohse1sYzA4Qc+qHcO3kKZO80jgLh2Y56UnyHvUcvfo7psF2+Mq3kw6+H48g X-Gm-Gg: AYBFou124bMyTe1SETgubsusz3JjldutZOcemH7jN5YmU1drZMnvrL5HNR9gVQUnrXD Ju76w/RLGQYNq9IcPQqe3zmFiBdMpiMMhMTK7R2GIEZxBez4z7tj7rdsM8KIdrJueHzg2ocv05e AvAoGRSt23TaLQESPswMuWQoTy7vPdwve8jT8Se1frqVy+yUtCzuJgY6tnBQEBeFCnrIGxNksvM CfVS9mxLx/dEm2zfQiit9K4ubr9AXJ8pbrk6No/vxeLUQTBr7xnCcKlqgKXP0S9ZaztFkZgbOA2 N0tlGgZfE5p+Smu/oHsYViEwY1BG0ZAy3ROEHQ2kpAXXUruvckXGtD6Y2DNBApBXm98VxDlgsqu /Rd1zCzaTfrJ6HuoCVGIGlG4t1x23TYY2UtyEVMFUoX9Amaa+GDxq0xnH2uSG3F5qS0DGrtS6+I vDL5kPK/7n/61ssSJIe8SXSz/6r/ResOVPWE0W4bUQBZexJ5vhPao3a9B1bKm4E847zSCrTE31V a2Mx6c0VUuZW7J0LhObm7xWSi8u0JuxSBDk3REXTNdcEAVz4flDaG5CM8+g1buH5IauqzrNcunz ol4nYvMpez+wR0yWn0+mOAiShL7jcjCHeImFN6LUKZk6FiAu X-Received: by 2002:a05:7300:7312:b0:358:ec5c:bef1 with SMTP id 5a478bee46e88-36a204773c0mr6758751eec.39.1793218599863; Wed, 28 Oct 2026 13:16:39 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , David Hildenbrand , qemu-s390x@nongnu.org, Jiaxun Yang , Peter Maydell , Pierrick Bouvier , Eric Farman , Song Gao <17746591750@163.com>, Max Filippov , Cornelia Huck , Fam Zheng , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Matthew Rosato , Philippe Mathieu-Daude , qemu-arm@nongnu.org, "Edgar E. Iglesias" , Paolo Bonzini Subject: [PATCH 05/12] target/arm: register separate max-v8 CPU types for arm and aarch64 Date: Thu, 29 Oct 2026 04:15:49 +0800 Message-ID: <20261028201557.2688-6-luoyonggang@gmail.com> X-Mailer: git-send-email 2.55.0.windows.3 In-Reply-To: <20261028201557.2688-1-luoyonggang@gmail.com> References: <20261028201557.2688-1-luoyonggang@gmail.com> MIME-Version: 1.0 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=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1330; envelope-from=luoyonggang@gmail.com; helo=mail-dy1-x1330.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=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: qemu development 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 @gmail.com) X-ZM-MESSAGEID: 1793218655910158500 Content-Type: text/plain; charset="utf-8" max-v8 was one TypeInfo whose instance initializer was chosen from the selected target at registration. Register both initializers, and let target_arm() and target_aarch64() select which type is available. Signed-off-by: Yonggang Luo Reviewed-by: Pierrick Bouvier --- target/arm/cpu.c | 1 + target/arm/cpu.h | 1 + target/arm/tcg/cpu-max-v8.c | 16 ++++++++++++---- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 510fc9eeb3b..6eb55242980 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -2695,6 +2695,7 @@ void arm_cpu_register(const ARMCPUInfo *info) .instance_init =3D arm_cpu_instance_init, .class_init =3D info->class_init ?: cpu_register_class_init, .class_data =3D info, + .is_available =3D info->is_available, }; =20 type_info.name =3D g_strdup_printf("%s-" TYPE_ARM_CPU, info->name); diff --git a/target/arm/cpu.h b/target/arm/cpu.h index add993ef101..3240a8633ee 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -1203,6 +1203,7 @@ typedef struct ARMCPUInfo { const char *deprecation_note; void (*initfn)(Object *obj); void (*class_init)(ObjectClass *oc, const void *data); + bool (*is_available)(void); } ARMCPUInfo; =20 /** diff --git a/target/arm/tcg/cpu-max-v8.c b/target/arm/tcg/cpu-max-v8.c index 65f851f2006..e819d07e6ce 100644 --- a/target/arm/tcg/cpu-max-v8.c +++ b/target/arm/tcg/cpu-max-v8.c @@ -121,10 +121,18 @@ void aarch32_max_v8_tcg_initfn(Object *obj) =20 static void cpu_max_v8_register_type(void) { - static const ARMCPUInfo max_v8[2] =3D { - { .name =3D "max-v8", .initfn =3D aarch32_max_v8_tcg_initfn }, - { .name =3D "max-v8", .initfn =3D aarch64_max_v8_tcg_initfn }, + static const ARMCPUInfo max_v8_aarch32 =3D { + .name =3D "max-v8", + .initfn =3D aarch32_max_v8_tcg_initfn, + .is_available =3D target_arm, }; - arm_cpu_register(&max_v8[target_aarch64()]); + static const ARMCPUInfo max_v8_aarch64 =3D { + .name =3D "max-v8", + .initfn =3D aarch64_max_v8_tcg_initfn, + .is_available =3D target_aarch64, + }; + + arm_cpu_register(&max_v8_aarch32); + arm_cpu_register(&max_v8_aarch64); } type_init(cpu_max_v8_register_type) --=20 2.55.0.windows.3 From nobody Mon Nov 23 04:18:41 2026 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1793218651; cv=none; d=zohomail.com; s=zohoarc; b=bCg39x+ua/mFNlZj2yzPGLyF2RpupTf/LXN7GLJ5P/p8VPl/nQ+OhzHArt94aKqtc9f3dhi1E/bZxXC7oxYvS4HhZumX8QvZStAsbWGkjo+UoHWMef5ni8V8/5KhovDGQngSGYX/+bxLyKvNgswo16YgjcmUKoO1GYq1H/Au9Uw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793218651; h=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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=QXd7cTdadNoW+gAtLomshjaW8dLnXiShl3RlnnollHA=; b=AMsfl1erATLJVDid56JH3TaOj84Tdq0rhdwDdvLxuywRhTsFmPGgIw8IUdwjM7JV3SMSFG3u+ent1EYmO+TyY+gF2Km9S4WiDsP6bKMY5OzKz00RLUJCIJ20s2eGvd/wAe7it46J+aFRGOcxaXA1wYBgfAuxkAv7riCWuHg8DrM= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793218651150104.63919968858465; Wed, 28 Oct 2026 13:17:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMA4x-0005DR-0h; Wed, 28 Oct 2026 16:16:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMA4n-0005AD-QI for qemu-devel@nongnu.org; Wed, 28 Oct 2026 16:16:51 -0400 Received: from mail-dy1-x1332.google.com ([2607:f8b0:4864:20::1332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xMA4l-0002Hc-6y for qemu-devel@nongnu.org; Wed, 28 Oct 2026 16:16:49 -0400 Received: by mail-dy1-x1332.google.com with SMTP id 5a478bee46e88-3550c917fd3so2011907eec.0 for ; Wed, 28 Oct 2026 13:16:46 -0700 (PDT) Received: from DESKTOP-Q716RM7 ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id 5a478bee46e88-36a23951e00sm12016896eec.20.2026.10.28.13.16.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2026 13:16:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793218606; x=1793823406; 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:content-type; bh=QXd7cTdadNoW+gAtLomshjaW8dLnXiShl3RlnnollHA=; b=k/sR4da0Eb3kQyHUrKNw3j2m3YVpoQNRQjqYG8N6HfacBMJKggQuzWfzTm9q2TqYbx Y3VOktJCkj3ruVIb5BCMj08ttA3zAj4jAOzvLiRS9TEBCG2dIlzAfm4ajtR3rQo/lkMm BqN902E6H3SaLjHihlJBqHgxwKbd73itBIcX/74uZQ3udj5vC6bQPhn4QKYQ4dM4yFlz xswRo9YEa5pcvz1jyO94oHceyh5AgUWIxkJeQrVWNG3vuzwkbbZNFxalVI11P9u7bu6k qwk0IO7H4bdSuc8aVFtF1rxVV49IG9MsPh7+rPbpyXFEEBznEkOsa37heqvD2nus15G0 ZW7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793218606; x=1793823406; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=QXd7cTdadNoW+gAtLomshjaW8dLnXiShl3RlnnollHA=; b=2A9LESrGyMl7dc6ldu843hyuhvmOjoZjHndZ584Ntuq0453cU1yb1HFc+pqLUTVmve AZDBK7TKS26UaxcoJwZkZuOwG4yoGVV4pSILbAX+i3WssoaEG0Yi/IGghjC5xu0s591r qArr0zs4LV6VWpL1/I/Af9iYq5j1758AABHxlIb7iCwu+rfUjd0YR83LVjnw0X/qVL7n 3Y7A9heg/eQGhM2WdGFLZadCo1ePrfSdKvagb2hDO47+OsPQxc14wxjWSnb8URtYmRwn cW5MDSllOtdATTMJwj/SnKm1BbDqcESwSlPPPDxdY22WztT/9m4j7EKEAFhodOtlE9qP rPjQ== X-Gm-Message-State: AFq9FYLKrJpwFSQvzijr9VdLZ/xGGfnkQRbOmmtUuL4h9fkj+To9TxNs JDAO6Pnkdf1S6jzfYvQxH29S4F7PE6YQz6AcgcEomIu0Qvsnx5BYB/i2wKAdbQLi X-Gm-Gg: AYBFou3E6y0CpGm6kEOBGXPJ0w9CnOCk8vqV4Q8E+GzUOjyH3UXIAcgSTf6lJTNG0lT qZ7NrsHh1by8mfwzS/xLLPzpgQR9GUazibqjTajjOYaobVtvpncuf3DOD9h+2J3aOZEj8G5VV+o dJ1/C6uQqD7SUoE89C98ZwYeWl9z6Oc00hpqIK7iuLpREYc+7lfAkPhWdAHHf8j9YMKHFDMGJ8Z 4wk+fEL5XqSz8qJ7wc01Z45iXPK+KS9FBEE1rFpdDQjKqcK61Et8PhxmR/6OtYyxzqGLkSIiGwF 82V7nadnVJreOfde7UxvNiRTjx1bXJx3zoP/Sea3ypDuKAxNsc/K2zs+gTPhiHovickPl7o0ENH Zzl+Mv22w5oGvc5Jn20eSWXsedwb4SSMzKobka3T+4eElN10KDNggmh4TTMDTTXVeXTFXByJvpc i3vAdtEsMroHlwuZVHYCEIVeKpqrxG+0ysHhB5+Dxl3IESKMgqQzFTAeJsZhMqsu2oOkiDataMH WlgWEIIs7M1c247aHV1A6MvSSrtpNLCwRC439Ji4bDaf61CTYEp/1ZFvj/+c+j4bS4aRbIwzhIG S1LdRe4RvfXO78902o64tMeArf1eQlMP8GKh5aiFOwSgguv1 X-Received: by 2002:a05:7300:2406:b0:35c:8b96:94d9 with SMTP id 5a478bee46e88-36a203bd31bmr4635772eec.19.1793218605677; Wed, 28 Oct 2026 13:16:45 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , David Hildenbrand , qemu-s390x@nongnu.org, Jiaxun Yang , Peter Maydell , Pierrick Bouvier , Eric Farman , Song Gao <17746591750@163.com>, Max Filippov , Cornelia Huck , Fam Zheng , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Matthew Rosato , Philippe Mathieu-Daude , qemu-arm@nongnu.org, "Edgar E. Iglesias" , Paolo Bonzini Subject: [PATCH 06/12] target-info: add target_not_s390x() Date: Thu, 29 Oct 2026 04:15:50 +0800 Message-ID: <20261028201557.2688-7-luoyonggang@gmail.com> X-Mailer: git-send-email 2.55.0.windows.3 In-Reply-To: <20261028201557.2688-1-luoyonggang@gmail.com> References: <20261028201557.2688-1-luoyonggang@gmail.com> MIME-Version: 1.0 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=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1332; envelope-from=luoyonggang@gmail.com; helo=mail-dy1-x1332.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=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: qemu development 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 @gmail.com) X-ZM-MESSAGEID: 1793218653802154100 Content-Type: text/plain; charset="utf-8" Add the negation of target_s390x() so an is_available callback can select every target except s390x. Signed-off-by: Yonggang Luo --- include/qemu/target-info.h | 7 +++++++ target-info.c | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/include/qemu/target-info.h b/include/qemu/target-info.h index 1d6c6f4472c..4bc25789d8d 100644 --- a/include/qemu/target-info.h +++ b/include/qemu/target-info.h @@ -134,6 +134,13 @@ bool target_ppc64(void); */ bool target_s390x(void); =20 +/** + * target_not_s390x: + * + * Returns whether the target architecture is not S390x. + */ +bool target_not_s390x(void); + /** * target_base_riscv: * diff --git a/target-info.c b/target-info.c index 07dc88fd366..d9e15c939d6 100644 --- a/target-info.c +++ b/target-info.c @@ -126,6 +126,11 @@ bool target_s390x(void) return target_arch() =3D=3D SYS_EMU_TARGET_S390X; } =20 +bool target_not_s390x(void) +{ + return !target_s390x(); +} + bool target_base_riscv(void) { switch (target_arch()) { --=20 2.55.0.windows.3 From nobody Mon Nov 23 04:18:41 2026 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1793218752; cv=none; d=zohomail.com; s=zohoarc; b=JLvBo6918xPA05QftqlHfZPAsNzlNVBdcrkSrMEUKC+ph2WwCJYXTVdZ2V2+QUfHb7YDda7Uxkrk9Qu3nUlo95Ir0wXspFs1ayUDotsph1j6P5cyMnUVbXA64V3nIZHNJhBMDIvxcxl6T4rVTpTfh3+JwWmLixHIZBH/NhaOmlk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793218752; h=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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=BxuYkSVQHoTJF2qd9tWd22NBfHJ+CcSwy1napmBXH5Y=; b=HkWqikT1oKWjrnY4xYRt2Mbh2MnP6xloyx0SadRvudr9LHUwcv7Rs8Vg1bMTNOBjCbRuTG3B8A73LCC+pZjp885p2pmj607wldAc5oSU9NM1Am1XjlB9LpxNghwdUrmMpvJxzgFjngotnc03MXX0h0kg0tpjlH0Zw+/3EE68hgY= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793218752362462.0995145153588; Wed, 28 Oct 2026 13:19:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMA50-0005FS-1y; Wed, 28 Oct 2026 16:17:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMA4s-0005BH-Rd for qemu-devel@nongnu.org; Wed, 28 Oct 2026 16:16:55 -0400 Received: from mail-dy1-x1336.google.com ([2607:f8b0:4864:20::1336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xMA4r-0002Ix-8R for qemu-devel@nongnu.org; Wed, 28 Oct 2026 16:16:54 -0400 Received: by mail-dy1-x1336.google.com with SMTP id 5a478bee46e88-36661f953e4so2233162eec.1 for ; Wed, 28 Oct 2026 13:16:52 -0700 (PDT) Received: from DESKTOP-Q716RM7 ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id 5a478bee46e88-36a23951e00sm12016896eec.20.2026.10.28.13.16.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2026 13:16:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793218612; x=1793823412; 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:content-type; bh=BxuYkSVQHoTJF2qd9tWd22NBfHJ+CcSwy1napmBXH5Y=; b=oKFpK81nzKLdEtVaxqymiMPAbBYX4607d8hzayqzjzRzn/FY8ZFPdtSUp6+V9dsBsx bzhSX6vwl6qtyUyE73hwgypvJr9+EbWw+/fjQPi3M0TSPtRg1FUcopZ3rrPYFEBNWL5O 1JC4lruXHNw73KzrbUUEiihU/ag+1jgKDVkNDu/UkUtKCEtQ7ysV73WcnKzwHU/0h7m8 18wQN22nv47B5PFI+xfJn8+I7Uez+AL1l2gVxSKgOuKCHgNrRO1QhQzJ630b4WQ63sS9 9mRSjq6SwimioOv34Hh0V2zdU5nPYmegjaG4pYRYc+LjMekGhIlUtnVShfycNMlItvQH Y+fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793218612; x=1793823412; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=BxuYkSVQHoTJF2qd9tWd22NBfHJ+CcSwy1napmBXH5Y=; b=ZSb3OANN5x0/GMSlJncRchPukpDQABsrHqWYkVQmlCaMwpOOmHikqXAyDRQ0u1M4a9 bvrrwY9kl7Dy1ehau8qAz3EMoUklV7c+kf1acl5U3ZWP2N9+eEVy702JxaYuzmWV5KUd 31q7nUWSSOyKO8iSti3GRdCLdg+6cuAT2a4ecsE1g3hSe46wuoxUCRL58y9FCYB1MFYG iY6+OEx4e/SMoCaoao63+dF3Vl79o8rQZbn1vrVXg8v66skhhMiF4cMFrj0u67z/kiG5 KLWL2ZEvnHbkdCQysp8fxV7wIDpXhp/uWuSME4KOpLy36q+O/i7d1TV3ukAX0gp+UYVJ mjgg== X-Gm-Message-State: AFq9FYJ1k9e+bIe6mOcTqk7gbN6zjCHrorlHq9NOQnGAbYDcZFcEP95r jS3As6qxe0AW6aCekOa78gyaIgQXTAHzT5seS2Cnu7rKISz6JdV7coZZpZpyKojc X-Gm-Gg: AYBFou0pIXbAXyRsyLEwaQNmBMifU1DNFtwOCO1yexhDOqWraUewDTq+EoPt/a2+YlY OALRwc0nZGLEZzEdhjxsOByH3fA0WxX5MHwQL+A4a8TvlApcOt++8nsVcbDqtEuIrkbhWdnN+76 vygTkdmgzh2QV9pEiyQ3NXKTtYh3vsGD3EbT/P7it2T29B1Oc4sYBDppxcaIsDGGFMop0d/Uah6 TS49llyt2ivEodjkHAkkEybzudDdH530lUrKTmy8YIV5uJCNLFPFALYi95i0BDWaRmlf4ohvd2w wfXbK7qaMmn03tpj1WaccN/BGWF63KoH8dG8STU1iyGOU282gdX2PmP1JmSkMHjn+4EGHsHg9ne ulnZ54RZTkxMUm6HW+d/F7v965pASvKeXgQjOpsJveNdIEWsUY+YEVwpot4bEMvdTraoXNDaHzo UTaIRcB+OdYmZ0urLIj4phbTztWEl5jE3qXmEgcSuazn+Xcikyx5/3yUqoqfcABemcDwgvI6ZHC b1XYJ1RsL1Iw14XJ6pWswg++Hu/wcB9yozzxBgYo94kb8mlPfdKcqEtxm4CWmZ/mRDF2MgFGycC sTHeJn3mHZRwsUknT6gvnaItmhanP4Zm6FhcKIGq13x38Hx/mA== X-Received: by 2002:a05:7300:7312:b0:358:ec5c:bef1 with SMTP id 5a478bee46e88-36a204773c0mr6759571eec.39.1793218611743; Wed, 28 Oct 2026 13:16:51 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , David Hildenbrand , qemu-s390x@nongnu.org, Jiaxun Yang , Peter Maydell , Pierrick Bouvier , Eric Farman , Song Gao <17746591750@163.com>, Max Filippov , Cornelia Huck , Fam Zheng , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Matthew Rosato , Philippe Mathieu-Daude , qemu-arm@nongnu.org, "Edgar E. Iglesias" , Paolo Bonzini Subject: [PATCH 07/12] hw/scsi/scsi-disk: register s390x scsi-hd and scsi-cd variants Date: Thu, 29 Oct 2026 04:15:51 +0800 Message-ID: <20261028201557.2688-8-luoyonggang@gmail.com> X-Mailer: git-send-email 2.55.0.windows.3 In-Reply-To: <20261028201557.2688-1-luoyonggang@gmail.com> References: <20261028201557.2688-1-luoyonggang@gmail.com> MIME-Version: 1.0 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=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1336; envelope-from=luoyonggang@gmail.com; helo=mail-dy1-x1336.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: qemu development 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 @gmail.com) X-ZM-MESSAGEID: 1793218755055154100 Content-Type: text/plain; charset="utf-8" scsi-hd and scsi-cd added the s390x loadparm property from class_init when target_s390x() was true. Register a second type for each name that always adds loadparm, and select the two with target_s390x() and target_not_s390x(). Signed-off-by: Yonggang Luo --- hw/scsi/scsi-disk.c | 43 +++++++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 6341089ddf2..f981dc2c903 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -3221,14 +3221,11 @@ static void scsi_property_add_specifics(DeviceClass= *dc) { ObjectClass *oc =3D OBJECT_CLASS(dc); =20 - /* The loadparm property is only supported on s390x */ - if (target_s390x()) { - object_class_property_add_str(oc, "loadparm", - scsi_property_get_loadparm, - scsi_property_set_loadparm); - object_class_property_set_description(oc, "loadparm", - "load parameter (s390x only)= "); - } + object_class_property_add_str(oc, "loadparm", + scsi_property_get_loadparm, + scsi_property_set_loadparm); + object_class_property_set_description(oc, "loadparm", + "load parameter (s390x only)"); } =20 static void scsi_disk_base_class_initfn(ObjectClass *klass, const void *da= ta) @@ -3362,14 +3359,26 @@ static void scsi_hd_class_initfn(ObjectClass *klass= , const void *data) dc->desc =3D "virtual SCSI disk"; device_class_set_props(dc, scsi_hd_properties); dc->vmsd =3D &vmstate_scsi_disk_state; +} =20 - scsi_property_add_specifics(dc); +static void scsi_hd_s390x_class_initfn(ObjectClass *klass, const void *dat= a) +{ + scsi_hd_class_initfn(klass, data); + scsi_property_add_specifics(DEVICE_CLASS(klass)); } =20 static const TypeInfo scsi_hd_info =3D { .name =3D "scsi-hd", .parent =3D TYPE_SCSI_DISK_BASE, .class_init =3D scsi_hd_class_initfn, + .is_available =3D target_not_s390x, +}; + +static const TypeInfo scsi_hd_s390x_info =3D { + .name =3D "scsi-hd", + .parent =3D TYPE_SCSI_DISK_BASE, + .class_init =3D scsi_hd_s390x_class_initfn, + .is_available =3D target_s390x, }; =20 static const Property scsi_cd_properties[] =3D { @@ -3405,14 +3414,26 @@ static void scsi_cd_class_initfn(ObjectClass *klass= , const void *data) dc->desc =3D "virtual SCSI CD-ROM"; device_class_set_props(dc, scsi_cd_properties); dc->vmsd =3D &vmstate_scsi_disk_state; +} =20 - scsi_property_add_specifics(dc); +static void scsi_cd_s390x_class_initfn(ObjectClass *klass, const void *dat= a) +{ + scsi_cd_class_initfn(klass, data); + scsi_property_add_specifics(DEVICE_CLASS(klass)); } =20 static const TypeInfo scsi_cd_info =3D { .name =3D "scsi-cd", .parent =3D TYPE_SCSI_DISK_BASE, .class_init =3D scsi_cd_class_initfn, + .is_available =3D target_not_s390x, +}; + +static const TypeInfo scsi_cd_s390x_info =3D { + .name =3D "scsi-cd", + .parent =3D TYPE_SCSI_DISK_BASE, + .class_init =3D scsi_cd_s390x_class_initfn, + .is_available =3D target_s390x, }; =20 #ifdef __linux__ @@ -3462,7 +3483,9 @@ static void scsi_disk_register_types(void) { type_register_static(&scsi_disk_base_info); type_register_static(&scsi_hd_info); + type_register_static(&scsi_hd_s390x_info); type_register_static(&scsi_cd_info); + type_register_static(&scsi_cd_s390x_info); #ifdef __linux__ type_register_static(&scsi_block_info); #endif --=20 2.55.0.windows.3 From nobody Mon Nov 23 04:18:41 2026 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1793218693; cv=none; d=zohomail.com; s=zohoarc; b=ja2d+LTXTc1PIlCxy55LeVUu1VsXjLcpxsBvv03PWj7JEwP0irY/m4B3UN4plS/84Eofuqu2/sl9IEcMwxdab3YI6GIdnBqywLnC4B0VJM9MvxsMxCcCt3rbusjVuUC+jfk6EUPlV9sn68SqBxVspnEUNZXrgr4C2flHAEtxQHw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793218693; h=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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+9DnP+gTwSEOX7zrI2haaQoi28yWED+v2p12ws9Ei1k=; b=drzYL/dk/e2z6ei7lwOOc2gSj35q9JgXagndznsdaxip0cztNLuGoDsaCuSyblx/m6haTHSEOz+BK6zuWStn9xYs5LOidSe6hShvpaLTHssoJfmobeGc7H1PTfjZmjOEy6Fhr78Wv6ASt3Ec0rd9ct5SAC+Fue0FRF1YbFJaedQ= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17932186931191.125560029106623; Wed, 28 Oct 2026 13:18:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMA52-0005GZ-R7; Wed, 28 Oct 2026 16:17:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMA4z-0005FB-8Q for qemu-devel@nongnu.org; Wed, 28 Oct 2026 16:17:01 -0400 Received: from mail-dy1-x1332.google.com ([2607:f8b0:4864:20::1332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xMA4x-0002Jx-K5 for qemu-devel@nongnu.org; Wed, 28 Oct 2026 16:17:00 -0400 Received: by mail-dy1-x1332.google.com with SMTP id 5a478bee46e88-369f33df08eso2611480eec.0 for ; Wed, 28 Oct 2026 13:16:59 -0700 (PDT) Received: from DESKTOP-Q716RM7 ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id 5a478bee46e88-36a23951e00sm12016896eec.20.2026.10.28.13.16.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2026 13:16:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793218618; x=1793823418; 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:content-type; bh=+9DnP+gTwSEOX7zrI2haaQoi28yWED+v2p12ws9Ei1k=; b=pqA0BJ369esX7TW4TefNW9h7r0U9jonXkHfaoDAbrgk6+VMitcMtnqoNjuvn3Gb3fS Hl5Ro948xAH2ka/Wa13sYeL37k4R+rtENYSUYWuqbGFg5SVufYlOqWSfLNu8v1WGT29I Cu/qEfZGAunMpHORyB1FFJq0fZobx5OgnaZOo/t2jnaeO+phWjABhXSwmZZKyCzlLrIW Eu0qnQCVPcF/0d+mBARIOgeqpkSJ819YwOEXuX8UOckVRpa5dnq9CGvDaIUc807A75Uz rHyB9MyFP2Rj7NW/zMtQ+lDnypwQKhnfJT+wZ3y55AjroDHNJBWN4mhN5XzgO7YcUpQN 9lTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793218618; x=1793823418; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=+9DnP+gTwSEOX7zrI2haaQoi28yWED+v2p12ws9Ei1k=; b=ap7mSCCTT7PLmo7yNwt62JKdf37ySogyX+vWXKFKft1uyuoI+MA/fUbOONjY9y3GDE OBIWVrgcPlXuh7VUrbp0FBN4LlUH/L8ZmvjhnI22JEp1xc0WTvy4Tx37//Hjq2Xn33fa sFZCvSBchAfElJQ5QrsnnwN4Cynj2HoVUNY6db6enXhJ11NjzTedy9D+9jO6cuNazCYO J6k1cxhSG7eCfDv+MwdE+JWdO9W40RStYdoaffxUC6tBkXXTBeAIhMIp1ZOf6y3koiPm l/vRb4mFPjHvDf+hjV2IX3Ml5DKc/hD+dx66bitadBSlp/3Q8wlZeQ4mL4EwhMdbRgon JIRg== X-Gm-Message-State: AFq9FYII3WFrdIKrcWakBH1ibx6Vx5XZsEWkX0AZ1wdqnVM+cM/V0bHE Cw0Djt1GhgEpqapy6ZZ7ivBk6kOt+5ZATWjlEeCAiOf1FBHekrCjP3fLgeVz4mdQ X-Gm-Gg: AYBFou2JWghWFloSJfJpaJol05WDdn0I3uciEO9S7WEwF4Q5WtFo2HXWSopMnl+6Q37 pyymhl+M2OZaMTTNhsBvsNCd43Y6MuRLhgp7CKx4BWpm78gZJfcnNuC6TJ5xZRRMg+8ABuUgj+0 FviMKr+n8dWiTXaLYUZueIxtcFg0KFq5xmmZ7hRot9meTOPSZuspk1NRVnY4xZstJN2PH7U4j+k xcu+aISawF0wyEXBe8exWMfaQHghGOQR0KdB9hxI2EHOsR7LOBbu0AaoyQq4ugyVjsJaee9r/U2 Z3l2X2oDlJQt6xqOD1XJb+7OJK4L7LYbP/S8YNDurPi3hS6Xj7tlLHP+ysG9q/L3f3ZacKd/Whq 47h4qsqX2GoMwd6tI3EHJs0T0zZeWEqF4za/iRbRhVJ8qundsEsThDy7mD1AEEwY0QBEYUt8aP7 N2ttbAQc1pGMEi87r38jAWmRrBsYsEXxcnbEMTyxM1p3C4KISylIgq5IkxRPORp8L9Vdyrrh9sn /SOPmlwSOO4fvnSEQInPdLmi1hCcyQjUpLDnILwbjDgsLn4Bs2yNEERiva2JR4BTNXVtAOhI9lX ayYOZvHmfScZRY9f2rPVvHGRn12YCXlFLPy0sLkFduNyQmUN8xCJJ721jvVjLXq1Dia6+A== X-Received: by 2002:a05:7300:fe43:b0:36a:1bd4:627f with SMTP id 5a478bee46e88-36a200b7256mr4740544eec.14.1793218618082; Wed, 28 Oct 2026 13:16:58 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , David Hildenbrand , qemu-s390x@nongnu.org, Jiaxun Yang , Peter Maydell , Pierrick Bouvier , Eric Farman , Song Gao <17746591750@163.com>, Max Filippov , Cornelia Huck , Fam Zheng , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Matthew Rosato , Philippe Mathieu-Daude , qemu-arm@nongnu.org, "Edgar E. Iglesias" , Paolo Bonzini Subject: [PATCH 08/12] hw/virtio/virtio-pci: pass is_available through VirtioPCIDeviceTypeInfo Date: Thu, 29 Oct 2026 04:15:52 +0800 Message-ID: <20261028201557.2688-9-luoyonggang@gmail.com> X-Mailer: git-send-email 2.55.0.windows.3 In-Reply-To: <20261028201557.2688-1-luoyonggang@gmail.com> References: <20261028201557.2688-1-luoyonggang@gmail.com> MIME-Version: 1.0 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=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1332; envelope-from=luoyonggang@gmail.com; helo=mail-dy1-x1332.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: qemu development 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 @gmail.com) X-ZM-MESSAGEID: 1793218696190154100 Content-Type: text/plain; charset="utf-8" virtio_pci_types_register() builds the base, generic, transitional and non-transitional TypeInfos for one virtio-pci device. Copy an is_available callback onto each of them so a device can register target-specific variants of the same names. Signed-off-by: Yonggang Luo --- hw/virtio/virtio-pci.c | 4 ++++ include/hw/virtio/virtio-pci.h | 1 + 2 files changed, 5 insertions(+) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index c73f1f546cb..1ce39e92e9d 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -2522,11 +2522,13 @@ void virtio_pci_types_register(const VirtioPCIDevic= eTypeInfo *t) .class_size =3D t->class_size, .abstract =3D true, .interfaces =3D t->interfaces, + .is_available =3D t->is_available, }; TypeInfo generic_type_info =3D { .name =3D t->generic_name, .parent =3D base_type_info.name, .class_init =3D virtio_pci_generic_class_init, + .is_available =3D t->is_available, .interfaces =3D (const InterfaceInfo[]) { { INTERFACE_PCIE_DEVICE }, { INTERFACE_CONVENTIONAL_PCI_DEVICE }, @@ -2562,6 +2564,7 @@ void virtio_pci_types_register(const VirtioPCIDeviceT= ypeInfo *t) .name =3D t->non_transitional_name, .parent =3D base_type_info.name, .instance_init =3D virtio_pci_non_transitional_instance_init, + .is_available =3D t->is_available, .interfaces =3D (const InterfaceInfo[]) { { INTERFACE_PCIE_DEVICE }, { INTERFACE_CONVENTIONAL_PCI_DEVICE }, @@ -2576,6 +2579,7 @@ void virtio_pci_types_register(const VirtioPCIDeviceT= ypeInfo *t) .name =3D t->transitional_name, .parent =3D base_type_info.name, .instance_init =3D virtio_pci_transitional_instance_init, + .is_available =3D t->is_available, .interfaces =3D (const InterfaceInfo[]) { /* * Transitional virtio devices work only as Conventional P= CI diff --git a/include/hw/virtio/virtio-pci.h b/include/hw/virtio/virtio-pci.h index ee50fb0d551..6c3561d319a 100644 --- a/include/hw/virtio/virtio-pci.h +++ b/include/hw/virtio/virtio-pci.h @@ -236,6 +236,7 @@ typedef struct VirtioPCIDeviceTypeInfo { void (*instance_init)(Object *obj); void (*instance_finalize)(Object *obj); void (*class_init)(ObjectClass *klass, const void *data); + bool (*is_available)(void); const InterfaceInfo *interfaces; } VirtioPCIDeviceTypeInfo; =20 --=20 2.55.0.windows.3 From nobody Mon Nov 23 04:18:41 2026 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1793218675; cv=none; d=zohomail.com; s=zohoarc; b=OwUSggfMIHLnpaWYDgqU6KSLa58E/FG2UfmtBcuJOwifjnvnlzC9HLCUIdyftt0BTcXpaZOjOnHWLGp+EHNFTeCtfkKwaA4hCwrfEbY6xBdH91zlwgjy1Uyi6HRbosqK3FI/JB4Oqpehq9z/qdc1j2bB7pL22y20JjoJ/jke26E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793218675; h=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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=B49HQpaDb0z0YnNrSTi7LO1bJgi1tGBwEu7rfsuG9hE=; b=RJBuJT0ckp8EiUUF8dC+jv017TDrv2PEofVcFy4xbOgdpNlb2KXlEGOKlym3pizP/xVmNDDwgjxutzwHqwK6y4v17bC0iZFtI0xjy6ycnEVXHAG34JhmngaWYSe0YOSWkoxTsNv+hJYVFuoJkEFpUTkrwkIy3Ywrp9RwCtG8ZWQ= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793218675143109.01179557487694; Wed, 28 Oct 2026 13:17:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMA59-0005Ls-Gn; Wed, 28 Oct 2026 16:17:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMA55-0005J2-Bm for qemu-devel@nongnu.org; Wed, 28 Oct 2026 16:17:07 -0400 Received: from mail-dy1-x1331.google.com ([2607:f8b0:4864:20::1331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xMA53-0002Kd-Fq for qemu-devel@nongnu.org; Wed, 28 Oct 2026 16:17:07 -0400 Received: by mail-dy1-x1331.google.com with SMTP id 5a478bee46e88-3282db206d3so1382675eec.0 for ; Wed, 28 Oct 2026 13:17:05 -0700 (PDT) Received: from DESKTOP-Q716RM7 ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id 5a478bee46e88-36a23951e00sm12016896eec.20.2026.10.28.13.16.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2026 13:17:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793218624; x=1793823424; 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:content-type; bh=B49HQpaDb0z0YnNrSTi7LO1bJgi1tGBwEu7rfsuG9hE=; b=gSwhfObo0IN20twNipcv8+RwFtySm4gzHp7rZqf6IjLkVGXBIT5WuKoavjfJiGM/RT 6nXP9KyWsw6tp4SSA6zr7sQ3UGnmVm/ygtbuBUq1FIBe+YoxPKjeSmbjR1E4ocD5xBQ4 iLhIYHok2O7jHpT7+QbXyNpeeWr6qw4E2uDk9Zqj90t9h4eQSxbFhvmrsvjYgD8AA5Jz 5Xf5ShYuW7N+Ra/W++48hhnI8Kn6CnEAxx8ytqM1SKZQErb149wyc2kaiS8nLiRkfLl4 EFM/HlJBZn9w3V9CAGOQFcIUfqRCw0BXuMW24gyWINDinw0Hnkn7sRgtbAcI3i3HYyIc PPIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793218624; x=1793823424; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=B49HQpaDb0z0YnNrSTi7LO1bJgi1tGBwEu7rfsuG9hE=; b=iazwDsCOlVpQzmjgjWo7BEESmOjF1WFfILJRxs3o2NjjL5GyB3mShiPownId9OYGud AiMKHNjrknyLQQQO1NRAfEbJ/sD9j9g28JYwUzfc7kTrzTJOln9G1xp8I70VS8Ds5aHe Mpmn3RqjLNsZMxejJDdQe5nmrlLHqP6w1q78XwOf2CE5eWDpWOtw8y7J4z/Ay6g2RiAv CPx8rjeeiE0NPBNEhWjm1Ibe1f8zqqi3+b0Jfl+XAFfzvxWltMFrRw1a2oCvUiAc4WJb YrCKgZsfbdoO73njNPlMNzFT2ZJfX/PyG5X3f52QH7JRgh4OgpDlHv5gvLeunhpzxH/c M+6Q== X-Gm-Message-State: AFq9FYJQuuz78WkcYmhltDycxrMLCEtFu5lENKiM+CV3eRsHseix119+ H6wBoXScw6BdU5ZJWmzP9DNlKuRn9eewEQ602NNsOSYluOfRL4WneQ6bzR/pcpXB X-Gm-Gg: AYBFou2YSLjzKD5VJPkf/wSFnKO1RRUhVjqdIMDaF2orCjIzOTCj005G9UD9hljGG0P B1QnGPjYJWqLVY0FsGKrGFRDS73ZCZsRjXnmeJognHhQkZIXwa2qLE28/831UjDx7kch+9IK/yu T3dw8o00yFI92YOY3VxS7/d1yTGEXDOx6npVTcMPz7NRFlaSxdbBwYz5biVk/D4vxnJwgegxMQn TAFCO9XABA14DG3LOmpX2od54vJIyfIaxhPsVonpuYaLaEeXQdd2YFlt4dp7lmbNYV+1ERij7HI svZq6wD3vn27b4bKPalQOX3Q1XZ9w+nb6s+HLVdkugTguXGBiNMa5l096f9ohzUhhBRLGiz842J 9Wa+pZENYSE1qAMz3nHyxbikH6S+/udKd2fvn2+AicFBVSnGfeBhu7U6B8/kAMaLgdk6tneV5Tc UL4k9kM/jmd85rMjTksG1L33ZtXwuPF0dlZsxOaPMNE2R509LNxs+ulO18ZdmoV7w81F1vtfcEF ghySQhhb9Fpw9UqKKi9ws3ZfbQKDO3cpPgtWTJ8r0xJohJ2nv70MsaSUIAgnbN4j4Ncnegrf3q7 n3d3iFVD+QiWJjuggfhpj6/IicpCPnESBmM5lyvnVim1XXMk X-Received: by 2002:a05:7300:f894:b0:368:4c93:544e with SMTP id 5a478bee46e88-36a202bc3f0mr5119208eec.1.1793218623951; Wed, 28 Oct 2026 13:17:03 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , David Hildenbrand , qemu-s390x@nongnu.org, Jiaxun Yang , Peter Maydell , Pierrick Bouvier , Eric Farman , Song Gao <17746591750@163.com>, Max Filippov , Cornelia Huck , Fam Zheng , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Matthew Rosato , Philippe Mathieu-Daude , qemu-arm@nongnu.org, "Edgar E. Iglesias" , Paolo Bonzini Subject: [PATCH 09/12] hw/virtio: register s390x virtio-blk-pci and virtio-net-pci variants Date: Thu, 29 Oct 2026 04:15:53 +0800 Message-ID: <20261028201557.2688-10-luoyonggang@gmail.com> X-Mailer: git-send-email 2.55.0.windows.3 In-Reply-To: <20261028201557.2688-1-luoyonggang@gmail.com> References: <20261028201557.2688-1-luoyonggang@gmail.com> MIME-Version: 1.0 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=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1331; envelope-from=luoyonggang@gmail.com; helo=mail-dy1-x1331.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: qemu development 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 @gmail.com) X-ZM-MESSAGEID: 1793218675689158500 Content-Type: text/plain; charset="utf-8" virtio-blk-pci and virtio-net-pci added the s390x loadparm property from class_init when target_s390x() was true. Register each VirtioPCIDeviceTypeInfo twice. The s390x variant calls pci_qdev_property_add_specifics(), which now always adds loadparm, and the other variant does not. target_s390x() and target_not_s390x() select the two. Signed-off-by: Yonggang Luo --- hw/pci/pci.c | 13 +++++-------- hw/virtio/virtio-blk-pci.c | 22 +++++++++++++++++++++- hw/virtio/virtio-net-pci.c | 22 +++++++++++++++++++++- 3 files changed, 47 insertions(+), 10 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 0efb4eb4bb0..e1bd3bb0e29 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2895,14 +2895,11 @@ void pci_qdev_property_add_specifics(DeviceClass *d= c) { ObjectClass *oc =3D OBJECT_CLASS(dc); =20 - /* The loadparm property is only supported on s390x */ - if (target_s390x()) { - object_class_property_add_str(oc, "loadparm", - pci_qdev_property_get_loadparm, - pci_qdev_property_set_loadparm); - object_class_property_set_description(oc, "loadparm", - "load parameter (s390x only)= "); - } + object_class_property_add_str(oc, "loadparm", + pci_qdev_property_get_loadparm, + pci_qdev_property_set_loadparm); + object_class_property_set_description(oc, "loadparm", + "load parameter (s390x only)"); } =20 MemoryRegion *pci_address_space(PCIDevice *dev) diff --git a/hw/virtio/virtio-blk-pci.c b/hw/virtio/virtio-blk-pci.c index 3eecc23a657..f4f86f7b428 100644 --- a/hw/virtio/virtio-blk-pci.c +++ b/hw/virtio/virtio-blk-pci.c @@ -22,6 +22,7 @@ #include "hw/virtio/virtio-pci.h" #include "qapi/error.h" #include "qemu/module.h" +#include "qemu/target-info.h" #include "qom/object.h" =20 typedef struct VirtIOBlkPCI VirtIOBlkPCI; @@ -71,7 +72,6 @@ static void virtio_blk_pci_class_init(ObjectClass *klass,= const void *data) =20 set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); device_class_set_props(dc, virtio_blk_pci_properties); - pci_qdev_property_add_specifics(dc); k->realize =3D virtio_blk_pci_realize; pcidev_k->vendor_id =3D PCI_VENDOR_ID_REDHAT_QUMRANET; pcidev_k->device_id =3D PCI_DEVICE_ID_VIRTIO_BLOCK; @@ -89,6 +89,13 @@ static void virtio_blk_pci_instance_init(Object *obj) "bootindex"); } =20 +static void virtio_blk_pci_s390x_class_init(ObjectClass *klass, + const void *data) +{ + virtio_blk_pci_class_init(klass, data); + pci_qdev_property_add_specifics(DEVICE_CLASS(klass)); +} + static const VirtioPCIDeviceTypeInfo virtio_blk_pci_info =3D { .base_name =3D TYPE_VIRTIO_BLK_PCI, .generic_name =3D "virtio-blk-pci", @@ -97,11 +104,24 @@ static const VirtioPCIDeviceTypeInfo virtio_blk_pci_in= fo =3D { .instance_size =3D sizeof(VirtIOBlkPCI), .instance_init =3D virtio_blk_pci_instance_init, .class_init =3D virtio_blk_pci_class_init, + .is_available =3D target_not_s390x, +}; + +static const VirtioPCIDeviceTypeInfo virtio_blk_pci_s390x_info =3D { + .base_name =3D TYPE_VIRTIO_BLK_PCI, + .generic_name =3D "virtio-blk-pci", + .transitional_name =3D "virtio-blk-pci-transitional", + .non_transitional_name =3D "virtio-blk-pci-non-transitional", + .instance_size =3D sizeof(VirtIOBlkPCI), + .instance_init =3D virtio_blk_pci_instance_init, + .class_init =3D virtio_blk_pci_s390x_class_init, + .is_available =3D target_s390x, }; =20 static void virtio_blk_pci_register(void) { virtio_pci_types_register(&virtio_blk_pci_info); + virtio_pci_types_register(&virtio_blk_pci_s390x_info); } =20 type_init(virtio_blk_pci_register) diff --git a/hw/virtio/virtio-net-pci.c b/hw/virtio/virtio-net-pci.c index 893d1905a97..d7aaf255507 100644 --- a/hw/virtio/virtio-net-pci.c +++ b/hw/virtio/virtio-net-pci.c @@ -22,6 +22,7 @@ #include "hw/virtio/virtio-pci.h" #include "qapi/error.h" #include "qemu/module.h" +#include "qemu/target-info.h" #include "qom/object.h" =20 typedef struct VirtIONetPCI VirtIONetPCI; @@ -77,7 +78,6 @@ static void virtio_net_pci_class_init(ObjectClass *klass,= const void *data) k->sriov_vf_user_creatable =3D true; set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); device_class_set_props(dc, virtio_net_properties); - pci_qdev_property_add_specifics(dc); vpciklass->realize =3D virtio_net_pci_realize; } =20 @@ -91,6 +91,13 @@ static void virtio_net_pci_instance_init(Object *obj) "bootindex"); } =20 +static void virtio_net_pci_s390x_class_init(ObjectClass *klass, + const void *data) +{ + virtio_net_pci_class_init(klass, data); + pci_qdev_property_add_specifics(DEVICE_CLASS(klass)); +} + static const VirtioPCIDeviceTypeInfo virtio_net_pci_info =3D { .base_name =3D TYPE_VIRTIO_NET_PCI, .generic_name =3D "virtio-net-pci", @@ -99,11 +106,24 @@ static const VirtioPCIDeviceTypeInfo virtio_net_pci_in= fo =3D { .instance_size =3D sizeof(VirtIONetPCI), .instance_init =3D virtio_net_pci_instance_init, .class_init =3D virtio_net_pci_class_init, + .is_available =3D target_not_s390x, +}; + +static const VirtioPCIDeviceTypeInfo virtio_net_pci_s390x_info =3D { + .base_name =3D TYPE_VIRTIO_NET_PCI, + .generic_name =3D "virtio-net-pci", + .transitional_name =3D "virtio-net-pci-transitional", + .non_transitional_name =3D "virtio-net-pci-non-transitional", + .instance_size =3D sizeof(VirtIONetPCI), + .instance_init =3D virtio_net_pci_instance_init, + .class_init =3D virtio_net_pci_s390x_class_init, + .is_available =3D target_s390x, }; =20 static void virtio_net_pci_register(void) { virtio_pci_types_register(&virtio_net_pci_info); + virtio_pci_types_register(&virtio_net_pci_s390x_info); } =20 type_init(virtio_net_pci_register) --=20 2.55.0.windows.3 From nobody Mon Nov 23 04:18:41 2026 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1793218669; cv=none; d=zohomail.com; s=zohoarc; b=jwP/3HuCA14vcNK3xRlwK8lxoZ6SszgfQ9ZWFIzr/SUtf166GJl8a2IymyfQDhzwET9H1ucnaw2396P/PNMdY+kn1dIUwEVYodKj597lEBo9eGif9KsQfuMvSZHPvZzyyrqRioKZmTU0zvHyAxGF9ASRLtpWWi7MttrNGJ9jlGo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793218669; h=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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Pd8ISBmCsatho7AhV+Cur/SqnrJPTwwxEIzKAKYv7CU=; b=aKNHjL/vYokGvyfWNCUUNWvedtHGJTxhIpQhiEkU2o5pXYRP9VeZWCjymmhjGuf9+9bRKmBByzMFs5HRii9JUv0Bub3pW3HBY8f9K0OcQPjLsBmaIUlOp3MtNxz/H7bF/vbcSL5Vt+u56JtpvbgYYTp5dzuZJHLNWT2sWy/FLyE= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793218669425397.36869137159044; Wed, 28 Oct 2026 13:17:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMA5N-0005aD-Sp; Wed, 28 Oct 2026 16:17:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMA5D-0005Nb-5E for qemu-devel@nongnu.org; Wed, 28 Oct 2026 16:17:16 -0400 Received: from mail-dy1-x1336.google.com ([2607:f8b0:4864:20::1336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xMA59-0002LQ-I1 for qemu-devel@nongnu.org; Wed, 28 Oct 2026 16:17:13 -0400 Received: by mail-dy1-x1336.google.com with SMTP id 5a478bee46e88-3550c917fd3so2012405eec.0 for ; Wed, 28 Oct 2026 13:17:11 -0700 (PDT) Received: from DESKTOP-Q716RM7 ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id 5a478bee46e88-36a23951e00sm12016896eec.20.2026.10.28.13.17.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2026 13:17:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793218630; x=1793823430; 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:content-type; bh=Pd8ISBmCsatho7AhV+Cur/SqnrJPTwwxEIzKAKYv7CU=; b=ogAxHUSTaoIUduopi+eKeRwwr60xzFWpUmxvzAKaZDjn+qCsyC3m8xXC4wLMtdpxUu TNZUvve+RseQ2gLf5r12uRZ6WcDX+Zqv8obIbIp90Q4vO762S62M+fKnS+aDuPAKN42A Opos/uQKK5new+lPNTto84+2a1No8QJij9UP36LpFaUDR3Qf/6+pA/sxefDr/+3XP+h5 0ZjUqgrV0ToPdr7Faw3kcm0SSslhl7Xwc2WMvphHoaKNeDd474pNJQlRPQ6lpc7nUltx vJzfHDRuupOxnbppTQQWkTTpxJkS/BnJ6b5uQR+y1JcrVyf2WNOnprX4Ee/aF3hvW1lW lx5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793218630; x=1793823430; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=Pd8ISBmCsatho7AhV+Cur/SqnrJPTwwxEIzKAKYv7CU=; b=QWjhr5udjeodKnzil14rcB+/Q9Bbuh1E0iW89fq5fuKo/y6YUYk/mxPEIBcqfUjMwH F2YBqIFpuMvU/+/0z7lS0vt/QWmKFNSxhiwOSU7iHlCaUn9Xt1Z1f0F+8xex+YGGs99r sLoSUj8wIQBoM2mZo2EiX8aJBml1E8+KVWR5ZwC4rFziBXsKVo8OTZRAAYT4eCdDTsXp Al2aaifrqLAIqySESwELA8UfY9nYELnccOk4u6GApO91eGmIVHj1xhQmXLl5HFqzYPsJ TJwqXHOrqaRS7XUbvon/xRYmOdqrAaE+ppaMYDDMRT/sqk++Shy8Oq0mxdWxMhgaCK+I kvzA== X-Gm-Message-State: AFq9FYImKyJnEMrgFmtD57g9GOdKHkphq6CUIvOKF9IgsuQalfWjKYO/ 5fmxpcaPM/PqmScLpfXpY1dnnmA545N05GxL3IqoCUQ3jC9j1LeonjHTAFs47/+U X-Gm-Gg: AYBFou16em1oHAqVSseQrrea1JK/H04vQJmTcbn3rXhJJ+yJ9JHV5qzDgcDlxvolsDQ s6s1UOOpm4uPFWgcBzHWOmJlvs5F9Ba2J9LjXKVdad9KebTIap6YvWOoHqgeYHSapBbA0IiHt+p DttKLo5OQrLMLAawmfjZ872ePQQX9yykcUMSMJTZdXLHilzB15/dn4z68soMM70h8WMV7M/XToc Sh1IddPbwtq/IF3eJCsnEDvUSFUAzCDgVz+P0YnIldB8fX8O4Qvh2RlsLFW+PuTELsZap8N/FTx EqOYY1O7+Tn8CLsRFxBWS1dybFwlx6kMKsb1fttfMrlVfGk40wk1yZcchMeI/Wz8GMHsqPxRMgv YgI1hSdU21mURq31VWHoWCfD9MnBXOV4FvctQncWMjtXU++N9BBp21fQIBu14HAl7+UxHDzZnzj 25wMCZku2yOoBM8hzqVQ8fkixrhJk3S1kbfY29IZaDQftK8zzumoqvXJMSFzo1pTaLls0IcmjXL 3ocVcUxmruzNk6ZlDl8rXz5q+x2QqqdMKGpt6XR9yTJX5bh2OWvnmimJalzg8Iz7gbz3y0DdwyG XK8InAmeOf5Be01vPrYTwZGp5PGbUybPZ/OVfQjzzxKhWarN X-Received: by 2002:a05:7300:d589:b0:35e:a225:3ba6 with SMTP id 5a478bee46e88-36a203909ffmr4540193eec.13.1793218629989; Wed, 28 Oct 2026 13:17:09 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , David Hildenbrand , qemu-s390x@nongnu.org, Jiaxun Yang , Peter Maydell , Pierrick Bouvier , Eric Farman , Song Gao <17746591750@163.com>, Max Filippov , Cornelia Huck , Fam Zheng , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Matthew Rosato , Philippe Mathieu-Daude , qemu-arm@nongnu.org, "Edgar E. Iglesias" , Paolo Bonzini Subject: [PATCH 10/12] target-info: add target_base_i386() and target_not_base_i386() Date: Thu, 29 Oct 2026 04:15:54 +0800 Message-ID: <20261028201557.2688-11-luoyonggang@gmail.com> X-Mailer: git-send-email 2.55.0.windows.3 In-Reply-To: <20261028201557.2688-1-luoyonggang@gmail.com> References: <20261028201557.2688-1-luoyonggang@gmail.com> MIME-Version: 1.0 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=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1336; envelope-from=luoyonggang@gmail.com; helo=mail-dy1-x1336.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=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: qemu development 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 @gmail.com) X-ZM-MESSAGEID: 1793218671700158500 Content-Type: text/plain; charset="utf-8" target_base_arm(), target_base_ppc() and target_base_riscv() report whether the selected target belongs to a CPU family. Add the same predicate for i386 and x86_64, and target_not_base_i386() as its negation. Signed-off-by: Yonggang Luo --- include/qemu/target-info.h | 14 ++++++++++++++ target-info.c | 16 ++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/include/qemu/target-info.h b/include/qemu/target-info.h index 4bc25789d8d..48206d01ba9 100644 --- a/include/qemu/target-info.h +++ b/include/qemu/target-info.h @@ -57,6 +57,20 @@ bool target_heterogeneous(void); */ bool target_base_arm(void); =20 +/** + * target_base_i386: + * + * Returns whether the target architecture is i386 or x86_64. + */ +bool target_base_i386(void); + +/** + * target_not_base_i386: + * + * Returns whether the target architecture is not i386 or x86_64. + */ +bool target_not_base_i386(void); + /** * target_arm: * diff --git a/target-info.c b/target-info.c index d9e15c939d6..32ba85691b7 100644 --- a/target-info.c +++ b/target-info.c @@ -59,6 +59,22 @@ bool target_base_arm(void) } } =20 +bool target_base_i386(void) +{ + switch (target_arch()) { + case SYS_EMU_TARGET_I386: + case SYS_EMU_TARGET_X86_64: + return true; + default: + return false; + } +} + +bool target_not_base_i386(void) +{ + return !target_base_i386(); +} + bool target_arm(void) { return target_arch() =3D=3D SYS_EMU_TARGET_ARM; --=20 2.55.0.windows.3 From nobody Mon Nov 23 04:18:41 2026 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1793218752; cv=none; d=zohomail.com; s=zohoarc; b=k8yoPCBR6z7VmJfLtu1Rvxd5zsdrzqS+O7PeLc4gdedvyxQcyLkR71/lD9Wlf5nWpLqbyhF53XctKGd91lGwVADSeB0+XRROxY6D0pAb8RCOyl13gbzQohvzTgDMhpWZoApj8/C4gcmTcKrKRu7eQH3n5C8HAM1MBABNFjhltCQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793218752; h=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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=A2nlZgLz6sOn2cs4PXVlolOczLlJRNmVj0kMGdu8wlM=; b=R4gV8FCbZTm/DQmgHlWqNVctYQPRzpoM13Q9Z+YIgwbnTaAvA8DVQGlfXYx/Ta0FzDazuWLHGnK61cO9l698Y5z9Sq0CAFo6h9+FpTcQgylfacDsU+dprNsH2YroXhZ5XYEIg5Vnk4gdOHi2khhWwhFP+6yDnJavXmfUoKasn40= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793218752378663.681135380565; Wed, 28 Oct 2026 13:19:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMA5O-0005cw-UE; Wed, 28 Oct 2026 16:17:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMA5I-0005Ug-QP for qemu-devel@nongnu.org; Wed, 28 Oct 2026 16:17:20 -0400 Received: from mail-dy1-x132c.google.com ([2607:f8b0:4864:20::132c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xMA5G-0002M6-SA for qemu-devel@nongnu.org; Wed, 28 Oct 2026 16:17:20 -0400 Received: by mail-dy1-x132c.google.com with SMTP id 5a478bee46e88-36661f953e4so2233775eec.1 for ; Wed, 28 Oct 2026 13:17:17 -0700 (PDT) Received: from DESKTOP-Q716RM7 ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id 5a478bee46e88-36a23951e00sm12016896eec.20.2026.10.28.13.17.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2026 13:17:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793218636; x=1793823436; 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:content-type; bh=A2nlZgLz6sOn2cs4PXVlolOczLlJRNmVj0kMGdu8wlM=; b=qJaBMQnpuVoilaeUh32c3c0R98wrFN5357aJXuLbfzgSHZMcr6pvjE+m9/CoVy0sHc nHSbGwPpZdf70CoqNAdNdx7d1qh+2RgV1iVk7c15ZmhjT7QpdB22M6nE3F2aQAqeGJ1S Qfug4x+56V6DuUbSeQs4c+LYXRu84DG1ZHtgbReH2lOOwV5pGSgpaBjbPnxNioZJC/Kj APTnMj4xfR4EMbARvxr+IX22A5Q+WlQALuEQ0Yqb0Hm1xfLgcdPo7KOd446GDW3j++hz A8TSQ9y7gws5Nmhl/BSshYtI6yZPvFXeBLy+m8EoyU84Bd76AAnWXvwPEMWwn7ZenXtZ J80A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793218636; x=1793823436; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=A2nlZgLz6sOn2cs4PXVlolOczLlJRNmVj0kMGdu8wlM=; b=VBPaWU8Nh75TIx8JYXnyZL5JdormeaWQulJsu5P3tVriiUT3WTcjLgH46owvZ3BuND +ORNy0X8yl53cwHbMw4LkygiskpBDMmX/00mgN3VuShfIwLT3yujcHK8j5zqfExQZnrb +hfigtPftfhr8O9FLZ3KsgW0jQUSzSspMKzyVapjdHpfGKGrKOeQvHkr09kZ8R/qZmvb ZrPFBDz02wg9/oQTGXhKvK/G7NAxNXEncQF7NTbxFkk89YfIHCWfX1cKf4a6uU38qffR xun8ZLURveYuKgZHCq19/mGEJOl+qAZR2f6ftXpLzrjI05629MpQmkM8Yp1U3Mlnc9cX Obzg== X-Gm-Message-State: AFq9FYLe+ST/Se1HSi5g+tJTHs4nq9vQYjKvmQw2LumohKmWPooDGqbn wpdRbSy+GplTaSVysterG6wXDTxIkMBWu9vl79pHwGJn9aARgyUt2iP9Qtfzxwxh X-Gm-Gg: AYBFou0iwynbOuNUecWwjkG0sZNfYTM1XsiqZtHKzLmN3cUX2So7CQ6d3YcHyw94kmV 2QBnzBvkFdeYd9fq9eoVuo0yO4d3Ao+/bUkosVDmVwTRej8JCc5gS6aFSQ9zcq8DhSzHcqvmEKA opKimNPelpc0QTthxzsIr6Q5bphmaQpZeBvRno4qbYRKL9te0Upx/O7KC3pr8vm1A4+Tup1Kgps LQFt+ndXaP+VS+WRwKfmQY9X0i46sfknj80XbFPn06MZjzA/hvz0kUzdvQfXy06eYbDN1Adg46b JqqRbNe5In0HJWMMdSQgrc6fUHvUytDiv6gcWLNyhfA+tOrYEnu4H3zN8o7AF4Nmy9AgOda446Z JhFKYRJw+rQdDNAXWXTb55JPUpZlKmRW2T/88DBSwPNINyZrJR8i0Ge99YeeeSXqkVswCGUs1Ny pDUKgJLv2X1/mT5a2Mm9Io6aMd3mZmF54zNiUcYqhDjQREoA0al8w47ien/oGzsQ307olHxaQWV qWoIkxGk/pXvXYnTdnUCXsiMSySphwnQxZ5GxjwzGczo3USv+/i5tg6wbpaeRNgrJiX7DEMDMlD gu/UKb6g4sYdbaKKJgeZvyRXz8Ms1w3uhGHI4UnFtzxr7gyb X-Received: by 2002:a05:7300:c7ca:b0:359:1b05:ed30 with SMTP id 5a478bee46e88-36a202d5537mr4429450eec.4.1793218635936; Wed, 28 Oct 2026 13:17:15 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , David Hildenbrand , qemu-s390x@nongnu.org, Jiaxun Yang , Peter Maydell , Pierrick Bouvier , Eric Farman , Song Gao <17746591750@163.com>, Max Filippov , Cornelia Huck , Fam Zheng , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Matthew Rosato , Philippe Mathieu-Daude , qemu-arm@nongnu.org, "Edgar E. Iglesias" , Paolo Bonzini Subject: [PATCH 11/12] hw/virtio/virtio-mem: register legacy-guest variant with is_available Date: Thu, 29 Oct 2026 04:15:55 +0800 Message-ID: <20261028201557.2688-12-luoyonggang@gmail.com> X-Mailer: git-send-email 2.55.0.windows.3 In-Reply-To: <20261028201557.2688-1-luoyonggang@gmail.com> References: <20261028201557.2688-1-luoyonggang@gmail.com> MIME-Version: 1.0 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=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::132c; envelope-from=luoyonggang@gmail.com; helo=mail-dy1-x132c.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: qemu development 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 @gmail.com) X-ZM-MESSAGEID: 1793218755078154100 Content-Type: text/plain; charset="utf-8" virtio-mem decided in class_init and realize whether x86 guests can leave unplugged memory accessible. Register a second virtio-mem type that adds virtio_mem_legacy_guests_properties and sets VirtIOMEMClass.has_legacy_guests. Select the two with target_base_i386() and target_not_base_i386(). Signed-off-by: Yonggang Luo --- hw/virtio/virtio-mem.c | 47 +++++++++++++++++++--------------- include/hw/virtio/virtio-mem.h | 2 ++ 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c index 7130ed852d9..bf241a3112b 100644 --- a/hw/virtio/virtio-mem.c +++ b/hw/virtio/virtio-mem.c @@ -15,6 +15,7 @@ #include "qemu/cutils.h" #include "qemu/error-report.h" #include "qemu/units.h" +#include "qemu/target-info.h" #include "qemu/target-info-qapi.h" #include "system/memory.h" #include "system/numa.h" @@ -35,22 +36,6 @@ =20 static const VMStateDescription vmstate_virtio_mem_device_early; =20 -static bool virtio_mem_has_legacy_guests(void) -{ - /* - * We only had legacy x86 guests that did not support - * VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE. Other targets don't have - * legacy guests. - */ - switch (target_arch()) { - case SYS_EMU_TARGET_I386: - case SYS_EMU_TARGET_X86_64: - return true; - default: - return false; - } -} - /* * Let's not allow blocks smaller than 1 MiB, for example, to keep the tra= cking * bitmap small. @@ -859,7 +844,7 @@ static void virtio_mem_device_realize(DeviceState *dev,= Error **errp) rb =3D vmem->memdev->mr.ram_block; page_size =3D qemu_ram_pagesize(rb); =20 - if (virtio_mem_has_legacy_guests()) { + if (VIRTIO_MEM_GET_CLASS(vmem)->has_legacy_guests) { switch (vmem->unplugged_inaccessible) { case ON_OFF_AUTO_AUTO: if (virtio_mem_has_shared_zeropage(rb)) { @@ -1635,9 +1620,6 @@ static void virtio_mem_class_init(ObjectClass *klass,= const void *data) RamDiscardSourceClass *rdsc =3D RAM_DISCARD_SOURCE_CLASS(klass); =20 device_class_set_props(dc, virtio_mem_properties); - if (virtio_mem_has_legacy_guests()) { - device_class_set_props(dc, virtio_mem_legacy_guests_properties); - } dc->vmsd =3D &vmstate_virtio_mem; =20 set_bit(DEVICE_CATEGORY_MISC, dc->categories); @@ -1660,6 +1642,14 @@ static void virtio_mem_class_init(ObjectClass *klass= , const void *data) rdsc->is_populated =3D virtio_mem_rds_is_populated; } =20 +static void virtio_mem_legacy_class_init(ObjectClass *klass, const void *d= ata) +{ + virtio_mem_class_init(klass, data); + device_class_set_props(DEVICE_CLASS(klass), + virtio_mem_legacy_guests_properties); + VIRTIO_MEM_CLASS(klass)->has_legacy_guests =3D true; +} + static const TypeInfo virtio_mem_info =3D { .name =3D TYPE_VIRTIO_MEM, .parent =3D TYPE_VIRTIO_DEVICE, @@ -1668,6 +1658,22 @@ static const TypeInfo virtio_mem_info =3D { .instance_finalize =3D virtio_mem_instance_finalize, .class_init =3D virtio_mem_class_init, .class_size =3D sizeof(VirtIOMEMClass), + .is_available =3D target_not_base_i386, + .interfaces =3D (const InterfaceInfo[]) { + { TYPE_RAM_DISCARD_SOURCE }, + { } + }, +}; + +static const TypeInfo virtio_mem_legacy_info =3D { + .name =3D TYPE_VIRTIO_MEM, + .parent =3D TYPE_VIRTIO_DEVICE, + .instance_size =3D sizeof(VirtIOMEM), + .instance_init =3D virtio_mem_instance_init, + .instance_finalize =3D virtio_mem_instance_finalize, + .class_init =3D virtio_mem_legacy_class_init, + .class_size =3D sizeof(VirtIOMEMClass), + .is_available =3D target_base_i386, .interfaces =3D (const InterfaceInfo[]) { { TYPE_RAM_DISCARD_SOURCE }, { } @@ -1677,6 +1683,7 @@ static const TypeInfo virtio_mem_info =3D { static void virtio_register_types(void) { type_register_static(&virtio_mem_info); + type_register_static(&virtio_mem_legacy_info); } =20 type_init(virtio_register_types) diff --git a/include/hw/virtio/virtio-mem.h b/include/hw/virtio/virtio-mem.h index 5d1d19c6bec..f367959ecb0 100644 --- a/include/hw/virtio/virtio-mem.h +++ b/include/hw/virtio/virtio-mem.h @@ -134,6 +134,8 @@ struct VirtIOMEMClass { VirtioDeviceClass parent_class; =20 /* public */ + bool has_legacy_guests; + void (*fill_device_info)(const VirtIOMEM *vmen, VirtioMEMDeviceInfo *v= i); MemoryRegion *(*get_memory_region)(VirtIOMEM *vmem, Error **errp); void (*decide_memslots)(VirtIOMEM *vmem, unsigned int limit); --=20 2.55.0.windows.3 From nobody Mon Nov 23 04:18:41 2026 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1793218720; cv=none; d=zohomail.com; s=zohoarc; b=aXoTgWWj7/w59f5mdUUrIy+BK8RHQ8b+AdWMl9crcUx4wB5y01Tv5pH4NzLBt8U7McgxYJK+Yaaytls/wcXKXvIRTyOjL9vEZ9BLG5efeV3uL42eDejmdTOZZK/UIpb26GAFN4YbKHgEwd74JXNB+3jr8YqWU54Zd5K3Eo2nilE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793218720; h=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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=qeJic+QEw42e1R7DnD3Kz3eNjwxP8HN6flh/y3Ftq3M=; b=nGpLded8F3uyXLdPyP5AflzVhqvBepsU+qVxpYldZ9sropNyofqTb7xkZ6/aiHE0YrL3Nfa6D8MzOcpPNhjNnVjY2FinArR6MwN75eUQTdBw4T8O0J9GnI+x7pPobahhbEobXu7+gchc9SkCVgc/zGJgDrtbvR4/+Hh1L+RuSBI= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 179321872080858.02802886092638; Wed, 28 Oct 2026 13:18:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMA5V-0005mh-ON; Wed, 28 Oct 2026 16:17:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMA5O-0005cX-Ml for qemu-devel@nongnu.org; Wed, 28 Oct 2026 16:17:26 -0400 Received: from mail-dl1-x1233.google.com ([2607:f8b0:4864:20::1233]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xMA5M-0002Mm-6I for qemu-devel@nongnu.org; Wed, 28 Oct 2026 16:17:26 -0400 Received: by mail-dl1-x1233.google.com with SMTP id a92af1059eb24-1a2761c69fbso3297571c88.0 for ; Wed, 28 Oct 2026 13:17:23 -0700 (PDT) Received: from DESKTOP-Q716RM7 ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id 5a478bee46e88-36a23951e00sm12016896eec.20.2026.10.28.13.17.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2026 13:17:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793218642; x=1793823442; 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:content-type; bh=qeJic+QEw42e1R7DnD3Kz3eNjwxP8HN6flh/y3Ftq3M=; b=hsZAewhxJs9pRBCpOVtHdP7DjVbPuwRsc7TCdkOKS/bXEOQYVMJbVNrGmXfWsbnmAX BysNciOFt5iCU/Ijq3WF0phN0u7XiCDnXeckrmwmfDNKD/mIPecpqcvtHiqt2J3FMkWw kF/Ml+YU/8UMLH9Zy0+jiqUkDVaSerN4CAFzE/ZRHQjgVAHmyGdyyDM4/zZevpeCiJso wk2UxSTIURmvbDSEkL8tmSwwHmrYUeqG433YVFa0JRO+aQw1h15EElww80J/xour8QIp OIfvT7f6LJyErKtoaxL3UfGAQREOuUtQKPx1q9zd+h/d5awOhwfZwBUzwSvhGI0K2Mrx 7j8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793218642; x=1793823442; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=qeJic+QEw42e1R7DnD3Kz3eNjwxP8HN6flh/y3Ftq3M=; b=EgeBkkUbMdLEwSy9PCiKA7sjbuP4mPBmVeO6WCFVYzwJfyUJINYP3VEjqGexI1lWQs Q1AFJ9oF20BcbTAq2qNwJBUasn0m447drrRSPpXbJGyTq43QBRZU+IwZ0gRHNHXhamyv OICEOcei6CHKCFIg58A1DCaValMvsgHRWddJZmyHzIh5zgFH0ApD2CHJNPxqDXF6othK spMCUaHE57jp13FDdVgp7za0aEBiGyo80H0iW/7LDqakpTAFZnaMFl14nG4lmfJkK7Io jw/VyoH22FuOu7DZ+MYruDiY/eJhDg2VoLE70pIQh6qTOLORSWfpzhtMO5lLATHY5TL2 N7Xw== X-Gm-Message-State: AFq9FYJk0oLiXKguYvRFzSvkW9uPRGY4ySMuRvtXRMw01hTpP5q+Ii+z A0rZiouNXwR8vHIe3Q6ilh0Dcc1azPswyuFTcsOHjoYQlcOC5lA66mIfiU4sg+/C X-Gm-Gg: AYBFou37IOg+dn54CIx/dxdMjoo7LhwyT5JDdOpjUrpWGNKr0hT1ZhjC6E5iuBOxrJP csOR7oeIGNNOUECYbNLe4lNxdHYjAKQEJYvWZ0OXrcSKeidwwp0wUptC5NQ5nPJw0brp7dshMSR P7Gk0B3WVXexvKOmgJQtfPOrob6ETslkY+KeNR2TeSR7CYWtVEi4cDb045y0ClFeE0bj94aBNQL iVbl9fkBwjZQqt7h+YrkeGzTLtl1NFKlUiVw4rcW8pqE69wrVUGpLodf+CAomPXMcQBrTO7B4W6 dQB2b0bocpjdN4bZqqJa2w/Dk1wyUvk84dY02UTdvWvyBhTG7NmodJVWSCFUDegXYB6H1yyBZpd zjvs0jfXIZPNWEp1UOBb/TMjfrCgOIkBTIdR35pJKT46mPJIG4yXajNdM7MMaOYeZ/a2O+k4AQA cesvkSjo4V5O3rEHmyRgpeQxFQorsfZhVrIXwIUiqdOpve9ANl+Ee4KZwZIyVZWfh3NR5S+9eF9 FeVbGgdbGctbuRpqyII9YO3QEs/uyoVmdiL9+x7jXORa6UUkX+i7Mtf1XpMOZsWfwHHsX5m6u3l 7lPtmc8Bwgela23KAx/+z8LNYhoDCgPP1bN5kf4Hie5JbI2Q X-Received: by 2002:a05:693c:61cb:b0:369:f277:7f09 with SMTP id 5a478bee46e88-36a2046b1dcmr5271033eec.25.1793218641889; Wed, 28 Oct 2026 13:17:21 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , David Hildenbrand , qemu-s390x@nongnu.org, Jiaxun Yang , Peter Maydell , Pierrick Bouvier , Eric Farman , Song Gao <17746591750@163.com>, Max Filippov , Cornelia Huck , Fam Zheng , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Matthew Rosato , Philippe Mathieu-Daude , qemu-arm@nongnu.org, "Edgar E. Iglesias" , Paolo Bonzini Subject: [PATCH 12/12] hw/microblaze: defer PetaLogix endianness default until init Date: Thu, 29 Oct 2026 04:15:56 +0800 Message-ID: <20261028201557.2688-13-luoyonggang@gmail.com> X-Mailer: git-send-email 2.55.0.windows.3 In-Reply-To: <20261028201557.2688-1-luoyonggang@gmail.com> References: <20261028201557.2688-1-luoyonggang@gmail.com> MIME-Version: 1.0 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=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1233; envelope-from=luoyonggang@gmail.com; helo=mail-dl1-x1233.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=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: qemu development 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 @gmail.com) X-ZM-MESSAGEID: 1793218721900158500 Content-Type: text/plain; charset="utf-8" The PetaLogix machine read its endianness default from target_big_endian() in class_init. In a multi-target binary the target is not selected yet at class_init, so the default cannot be computed there. Set the property default to "unspecified" instead, and resolve it to big or little in petalogix_s3adsp1800_init(), where the target is known. Until the machine is initialized, endianness reads back as "unspecified" rather than big or little. Signed-off-by: Yonggang Luo Reviewed-by: Pierrick Bouvier --- hw/microblaze/petalogix_s3adsp1800_mmu.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/hw/microblaze/petalogix_s3adsp1800_mmu.c b/hw/microblaze/petal= ogix_s3adsp1800_mmu.c index c5f64319009..4abb6e0f0bf 100644 --- a/hw/microblaze/petalogix_s3adsp1800_mmu.c +++ b/hw/microblaze/petalogix_s3adsp1800_mmu.c @@ -83,7 +83,13 @@ petalogix_s3adsp1800_init(MachineState *machine) MemoryRegion *phys_ram =3D g_new(MemoryRegion, 1); qemu_irq irq[32]; MemoryRegion *sysmem =3D get_system_memory(); - EndianMode endianness =3D psms->endianness; + EndianMode endianness; + + if (psms->endianness =3D=3D ENDIAN_MODE_UNSPECIFIED) { + psms->endianness =3D target_big_endian() ? ENDIAN_MODE_BIG : + ENDIAN_MODE_LITTLE; + } + endianness =3D psms->endianness; =20 cpu =3D MICROBLAZE_CPU(object_new(TYPE_MICROBLAZE_CPU)); object_property_set_str(OBJECT(cpu), "version", "7.10.d", &error_abort= ); @@ -178,8 +184,7 @@ static void petalogix_s3adsp1800_machine_class_init(Obj= ectClass *oc, &EndianMode_lookup, machine_get_endianness, machine_set_endianness); - object_property_set_default_str(prop, target_big_endian() ? "big" - : "little"); + object_property_set_default_str(prop, "unspecified"); object_class_property_set_description(oc, "endianness", "Defines whether the machine runs in big or little endian mode= "); } --=20 2.55.0.windows.3