From nobody Mon Feb 9 03:17:06 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1769988634; cv=none; d=zohomail.com; s=zohoarc; b=B7Y/YZmfS8RQOMeYbasBEEqsZ2NuVJT87HjZLKxUUcLmCbFUZtbtpEUDUl4Ryq4Ytrnl8Aelk/GPtF5WTnPUV+T4T79Fl30VVdAW2S9axUjknGksUS1oKV7zOBnx5yP/CmVvDZUi5LjtxTSEaA4UBF13XxNc0cuhCdL0DtapAiE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769988634; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=qak0qGdqEv+ckuqbzm8qmTzP57U15an7kYIfscsbE3g=; b=fagX3RDZaX9M8/HbHiliwkys5uOCcyR6iMYU51boxpYA5WG24T5HAYmjtMpZNgtE58/4+w28FbhSatDvI/wwsFPatycjO6/5S12ORdJhgbEtOjqdLopjwF1vCWxdZI12APDpxeeuuva/sxNP9Rfgx0HbyUvcd/Oge4nQ+KCKPrI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769988634112652.845060751693; Sun, 1 Feb 2026 15:30:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmgsq-0003NJ-9Z; Sun, 01 Feb 2026 18:29:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vmgsp-0003Me-OQ for qemu-devel@nongnu.org; Sun, 01 Feb 2026 18:29:35 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vmgso-0002WP-BX for qemu-devel@nongnu.org; Sun, 01 Feb 2026 18:29:35 -0500 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-47ee0291921so35044695e9.3 for ; Sun, 01 Feb 2026 15:29:33 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-482dbd0f043sm90313135e9.7.2026.02.01.15.29.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 01 Feb 2026 15:29:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769988573; x=1770593373; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qak0qGdqEv+ckuqbzm8qmTzP57U15an7kYIfscsbE3g=; b=wGekI/0VCbMWohKIoeIxWFJfzV6eiN3Pmy8acHbLL+74Wlvw4R/OVJsSY9H5GLUuBF kGhrJaj3rtXK8AJCvfWozHeyqaHR4dGW/98PyUHT6MBzexkv1UoJ3kMOmN/9PheAoIjW 6ptIa9tfaDhlnt/1c59xKmPyoxFDck/gCkQAqHxOb6UGVAoOFwnRfXZAWVory3STDMuY oknRMNHIBKRVWI1spFClgKp3j020jBu2ynQCipYtCQFQE4lA5sWA6cQQpuVjRBmRW4Ar BNKnFwjGSHGpBGaqM5BiAl6dsrc5aihCLUJosEcFy33SC40zQoThTeQ93ZpLRnMcnr1z dWfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769988573; x=1770593373; 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; bh=qak0qGdqEv+ckuqbzm8qmTzP57U15an7kYIfscsbE3g=; b=pXCf/+r4aA5igDjHEbRQv+65EResL4c16+4NwYl5m6oUUTDHm1MIpgv3lnXgzeAhx3 Uwl67qPlImwQ67b1CwRT0mNMxoVsYYxztkkO/FKZsCmM+4xalQTYSdZB4Ao6eJB8zlTo Pl4Sb5tFfvETdAlkqZmkBRsPP4N2b8N8FKTXFhEZ789u+GLRunUV7273NptUpykDJGuU gxE9FhOMuT2ma165lXy5cqRRKqz3T6LEZ5kRMfQzEBzx84Nq4df7Eutoqn2OXp8z741D KGQY+LjP3RL4liU+ELtIAyn9dBPgaPEUeDdjufx1w/NNu0cvGbzTXN+LAa4DFnFiEB1h i/UA== X-Gm-Message-State: AOJu0YyR1RskmgPEW+lKI8KoRlVpVVO8KVXWd6hpPg7wQxZEHYWQUybd ZhAvff/LwP3my2Dmo0VHUprHYKVSkXvGCs2t0i4VZXUY9snUSoy1sDhfFBahDLul9gk3oiT5E7a j8Akd1R4= X-Gm-Gg: AZuq6aLtBqfIRi6hiAWt0lhJByUrDVI6a2GIGD09VGpfWdZfo79iyw+Z/sSVbsY87RE RW/OQ4kOl1MeSoWzKU4IRiAnW35/3aNPtQEaC5zewxL9l0Ae/lgHs3oEzfOjDc4gPRZt0a/26B0 QJsMZRkjHgS/19ft/eE9m+D4QnMdO7Atsr6HS8coY7HAUS5zF3mj+D3T2PMvC//5wV2bBBKxFKF Yx8JFcOIE+af/L77WCujwRukDiL9Ig+PKbEZv/WL3MVbXChxiRsoMGHQzoICr5D4S9qXjZpy2EU bwS/1nCldKTC8RiHpIBl7A+auOgyaMRMHS5txDJo5xM3tkKRvSfA9i7ExxhU6QdBqsieowW7Xlg gUs4raG8NWOmSMg2uFOZlG/t+WvUk2RzJBTAZOfyIa2ALHb4F/FPjoMNeg+dMzLqIqJrHY7yUNO uJjxkEM09DW/Dn7cJP32+i0OMyoZUYQIs79V9Fkzmtq7TSluqQ+V+sRfZKkN17 X-Received: by 2002:a05:600c:4fc7:b0:480:68ed:1e73 with SMTP id 5b1f17b1804b1-482db4f39fcmr120566075e9.36.1769988572650; Sun, 01 Feb 2026 15:29:32 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Harsh Prateek Bora , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefano Garzarella , "Michael S. Tsirkin" , Pierrick Bouvier , Nicholas Piggin , qemu-ppc@nongnu.org Subject: [PATCH v3 01/11] target-info: add target_base_ppc, target_ppc and target_ppc64 Date: Mon, 2 Feb 2026 00:29:13 +0100 Message-ID: <20260201232924.93399-2-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260201232924.93399-1-philmd@linaro.org> References: <20260201232924.93399-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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 @linaro.org) X-ZM-MESSAGEID: 1769988636014158500 From: Pierrick Bouvier Signed-off-by: Pierrick Bouvier Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/qemu/target-info.h | 21 +++++++++++++++++++++ target-info.c | 21 +++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/include/qemu/target-info.h b/include/qemu/target-info.h index 62359622232..e3287334304 100644 --- a/include/qemu/target-info.h +++ b/include/qemu/target-info.h @@ -71,4 +71,25 @@ bool target_arm(void); */ bool target_aarch64(void); =20 +/** + * target_base_ppc: + * + * Returns whether the target architecture is PowerPC 32-bit or 64-bit. + */ +bool target_base_ppc(void); + +/** + * target_ppc: + * + * Returns whether the target architecture is PowerPC 32-bit. + */ +bool target_ppc(void); + +/** + * target_ppc64: + * + * Returns whether the target architecture is PowerPC 64-bit. + */ +bool target_ppc64(void); + #endif diff --git a/target-info.c b/target-info.c index 24696ff4111..5a6d7282524 100644 --- a/target-info.c +++ b/target-info.c @@ -73,3 +73,24 @@ bool target_aarch64(void) { return target_arch() =3D=3D SYS_EMU_TARGET_AARCH64; } + +bool target_base_ppc(void) +{ + switch (target_arch()) { + case SYS_EMU_TARGET_PPC: + case SYS_EMU_TARGET_PPC64: + return true; + default: + return false; + } +} + +bool target_ppc(void) +{ + return target_arch() =3D=3D SYS_EMU_TARGET_PPC; +} + +bool target_ppc64(void) +{ + return target_arch() =3D=3D SYS_EMU_TARGET_PPC64; +} --=20 2.52.0 From nobody Mon Feb 9 03:17:06 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1769988611; cv=none; d=zohomail.com; s=zohoarc; b=ZS9iSpa4Rlna9rVFV6K9f7ZnHwvkWEU6v3kqhvzQDf2BSdfjH7/i8pQUP1Xjk7tVUqqVWdJvizKIrfMTJwAFMGyI0pSomdfd8LAkBZmLJA/p0DgQ8EcEl7UEaY8z+DgCkPNQNqvivT+/ZPqWQI+4welyS6psCTfP4tEoK/saSuU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769988611; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+h8fxES7OJzZ8FiNM/iLx0nwAq7x7TFBCRMWBp9kdf4=; b=F9j6lTzLi76Ri/JwLRijmeN/YtToy9e2sFHkGXiJUA9RRgrbEw3Ez39nlB15p5Msv0WocPyo7LZLlV/MLic0ta2BfSxTLPIgYEP4vADSlR1BBOIuf9gAiCTtbGVmcrB97dKxcE6RIAwhUFXIECAw9H85m0ZfFuOp80eLxa1cwN8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769988610997713.9486415984978; Sun, 1 Feb 2026 15:30:10 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmgsy-0003TN-35; Sun, 01 Feb 2026 18:29:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vmgsw-0003Qv-LZ for qemu-devel@nongnu.org; Sun, 01 Feb 2026 18:29:42 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vmgsv-0002Yc-B4 for qemu-devel@nongnu.org; Sun, 01 Feb 2026 18:29:42 -0500 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-43590777e22so2368907f8f.3 for ; Sun, 01 Feb 2026 15:29:40 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-435e10e48a6sm38436771f8f.8.2026.02.01.15.29.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 01 Feb 2026 15:29:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769988579; x=1770593379; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+h8fxES7OJzZ8FiNM/iLx0nwAq7x7TFBCRMWBp9kdf4=; b=HwRjuDdXMSYrK5iYbnqoMWPQIx0Gd/kXa7l1TTiDA+ict5lip8BZo1sGkmWeystFqD 9nMKGXveyebuA1Ec7JZiwq4XCkTNp+ZdgK27jt9Z+/uXn7JVf9sIY1IJzwxN0bxtBEht o8RZ1wwmtZGQABH8/utp8IuAfT4cCuLAcMInwGc5GxQBe5ylBpCoSDvPyOdg3aqRR6uJ f5NwRUrCHcPfj9OIco6tAelPYxRdltMGOIgWCCkqpii4vsBEuIg66TdikASAmpgT5TnQ 548/9rehHUsD6JDJ9Y83UQBMhIyncrPvk2jb+tdzy1ZMbfYXop/SOlufy/toWfcnjOQM LSzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769988579; x=1770593379; 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; bh=+h8fxES7OJzZ8FiNM/iLx0nwAq7x7TFBCRMWBp9kdf4=; b=VIxmGXpCOwafxcPRdRTUhPGL32E99jhe1pRdUSHOLvaDhwoTV5qdQCGQkiIOgHz42+ W3227eekYBQI28MxSywZhrqooQfMFq3KIl0Ozo06O87AfPTXpxvj+y0oP97kjOPUQx41 y/Yy1+QH5oEPz9McIBxtNkY8Ww78nHJrQUt0JvcguWY3zfBVB+8m8WHP1OUjzY/7jtg3 AWZRGdRtBLghxrt/BCM33CS0PNZUKaHOMBm7tQOI9HF1y552Mt3iWhE/2RwVkhEzFynS GcOacop2qu5NTOvh04Ou9J1S17SABcGwni/6rV3Q6jbhyEkgfLlAaEQR6F+aDfhTXYo5 1UcQ== X-Gm-Message-State: AOJu0Yzvr5He3a9xC+WYPk8jo34L6wJgidhzXHhJPrK17qxYVMRE5IFi ahVLWDlruiCqMepCeeNAEbxcZTAVq0uGjmCYgg20zWaefurLcH5ulRRsoSwDSi7PV7yYPWYUNcg NbcQtN+Q= X-Gm-Gg: AZuq6aIng0PendLTUEz8RNdjdLYBsQElm/3ufueDnu3LM9GDr8j/j+sspo5ALIak8t3 pc/V16pMbet7640bP/KgYQRelxl0TA6Ab5uS7sFCzjsf/ims0NqMRuujbgvRCK2bPvyGH+tCrV7 4KLAUdTKPou4qhbAK8REy9eDAtkpLEHxJXXNkjQC6+HVEZYZP1duX8WN4bBFpXrUNOdJ9TYtPVk Yz8YZUihbyTCaqLcHQV6GJgm6oHp7eb83WniG9Mi6tr3sqavtuMa+KQl2M3+ybIiv8mGB1Y94xc HPcS4vFc2LRJLU72KqA1AGL4QGT3LwlNfqINw0tNHmdRSHYuhj19ywjs3AQnIwd55s24P74Lc6s PM3oajSSYQgQ50onqPA6aogWHcnza4SwLc9Am5xNMetziSKPBexYvebvRoAafYEmlp5n0vMqhX/ jnG9qnVT9u2AGfWDXlPCbzglQDRc8EX1jJqGh+Py/XdtF+FM3EEo3NtigSLcRG X-Received: by 2002:a5d:5d13:0:b0:435:a160:4480 with SMTP id ffacd0b85a97d-435f3aa9270mr16179455f8f.29.1769988579445; Sun, 01 Feb 2026 15:29:39 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Harsh Prateek Bora , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefano Garzarella , "Michael S. Tsirkin" , Pierrick Bouvier , Nicholas Piggin , qemu-ppc@nongnu.org Subject: [PATCH v3 02/11] hw/virtio: Constify virtio_is_big_endian() argument Date: Mon, 2 Feb 2026 00:29:14 +0100 Message-ID: <20260201232924.93399-3-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260201232924.93399-1-philmd@linaro.org> References: <20260201232924.93399-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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 @linaro.org) X-ZM-MESSAGEID: 1769988611957158500 VirtIODevice argument is accessed read-only, make it const. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/virtio/virtio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index fcaa9b03b4a..17b105c146d 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -468,7 +468,7 @@ static inline bool virtio_host_has_feature(VirtIODevice= *vdev, return virtio_has_feature(vdev->host_features, fbit); } =20 -static inline bool virtio_is_big_endian(VirtIODevice *vdev) +static inline bool virtio_is_big_endian(const VirtIODevice *vdev) { if (!virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) { assert(vdev->device_endian !=3D VIRTIO_DEVICE_ENDIAN_UNKNOWN); --=20 2.52.0 From nobody Mon Feb 9 03:17:06 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1769988648; cv=none; d=zohomail.com; s=zohoarc; b=HM+ESYbPWyGWd477SDmjhDzv7Ltg1yF8918ps2kPgZD2ckq5tBFa4LwD2zCAtF8ldxGFJft97mTchfBSS5HwcnyUVn+je9A8p0KgbEUp/GksDpOD5YCLL0sQEZAV0ewSLSj5tvkCMRO9ZmqkxSizEZ/WlQMWTIpENHqao5ObCps= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769988648; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=EAuDEWjgtcjAI73PpDk9D1EoNYCz8v3TBHOpftqU/Uk=; b=aj/GdE3FT7qLyxb2ZnNFxTs1PQUPAwYzhBo+hO/QJCUVGTMA1MtWZe4SF+qZD1xbJhToARUvuJw4JdUs63hR0IlYBCVG3lL2HzdYXFzWpaa0iSPujFtPfytremxrbl1kw02YjisnguAOAmqhsrBTPDa7uJzizM+KkTICU2Pf7rc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769988648189713.0407385348024; Sun, 1 Feb 2026 15:30:48 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmgt4-0003Wj-O4; Sun, 01 Feb 2026 18:29:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vmgt3-0003Ut-Gj for qemu-devel@nongnu.org; Sun, 01 Feb 2026 18:29:49 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vmgt2-0002eZ-3j for qemu-devel@nongnu.org; Sun, 01 Feb 2026 18:29:49 -0500 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-4806f3fc50bso39254435e9.0 for ; Sun, 01 Feb 2026 15:29:47 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-482e047d863sm80727295e9.1.2026.02.01.15.29.45 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 01 Feb 2026 15:29:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769988586; x=1770593386; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EAuDEWjgtcjAI73PpDk9D1EoNYCz8v3TBHOpftqU/Uk=; b=So9C8JDY1XKP4r9FKGLfUxr7JHFLluv2VfTiUm9XieOrx3APkGDBScdcR+9GrtjjD6 pP6pzG7sLIGay+GCcnEm62iydzVSvxTwbR7Hf7E4aOGJFgkwSAb/10NNh9e9JyVUIhmf 6cNNIc4JZdf1gl13ssH+fmHDpMxD6P2uMRaB8gu+TwYMkUPl26THSRlNwM4LbjSxK5+D +a/LF+RCkDu0M3oYCD2PzQmIRlAuHA5jcB2i3pDDhkdOOXIQRIiPJ0hfyFPlqr9+wYmk HcPYsgEWjX2q+LmF39ATltPAto3OCj0B9NSDbabvHqP0gCEb/X16NteVEs/CGu4drUWV 7hXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769988586; x=1770593386; 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; bh=EAuDEWjgtcjAI73PpDk9D1EoNYCz8v3TBHOpftqU/Uk=; b=L0vHXOAA+LvQmDg6dDNw8DRJWcfvUQIaXEQXRrLBEIazKi4kgrZrlzVQjCcpX/wXMg wi/sREK47oPCKu9PO3IOiBgqBNzNaNu2SW5f4CYZgZy0LlmLHnsud5UUM7nPiNAhBjjJ BCh2oJwHJERJOIVedlynxt+lbKTO8t30ZVeWWhB22Uc4d/qwaFyajzP/x7som9sR3Aa/ V//guJJHfAYd9fxkcL7iCTqttZ1ZeveHhgvT5hBsxFURV7jXij9gtmXroF5Z6+rm0htw AgCgRSLLS0X5vAxoGsnmDatH86hKVc6mWspS2eTFFESst03hiZT2Eu+Fl8oBckPm00cM +7rw== X-Gm-Message-State: AOJu0Yxl1XFrCQVhs65+57OCUZ5Pxp1m2AXiI54b0qre0qxAxRfdHUS7 7rq0JGf3P66RW9Z04gUN+/98i1AM/Fx91etihOFO61T5/Usj8gAjtjqzLNSGj41eZMujQOmx6b6 c02ItlO8= X-Gm-Gg: AZuq6aKtwG6ni0bTeUxbUAK+KK73LO6B4TkoirSoe48wu3ibNFP53yTpAEr6dZMNeKY TuX/CURe/wETJQQfDX8hu1BHkUupGxTMpLRWagCa/jmcPer9h/qXzXXg/lH0oZ/p3jnxhyUsbnE K96naRooMfCkziBH/H5I/tKk1U9bveAvWxPtRiVVhDvbAwNm5eCDw8qoN5gzlDkC7apiygbMBPy ggCDqTASbR2nfTM+2siMx9lJYFslspqYfRYyboFkwIYgXhiJ64VcdGZkldQqHnqNYRWiHZh8ogg foztAKvroXGxKTbPxioSSGu/AQO2rWSgT1cbx/9R+Dk15t3ggJ/0rV25TXFgbhfDtdi9xlL1X7c Ld8eMihaUdIJ1xt4iKUFs+MLc4cCa36EPi3clfxiJiBoUR+ixBeZo0Sx+/rudKj6v1Z6lR82Mzl NUg0CFYEPlHIXkljYRz4sJ2oAWxN/JrhkHq3A2YIPrjJyb3JIXcjm7qRLaUlnt X-Received: by 2002:a05:600c:64c6:b0:477:5ad9:6df1 with SMTP id 5b1f17b1804b1-482db4593a1mr130157765e9.3.1769988586350; Sun, 01 Feb 2026 15:29:46 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Harsh Prateek Bora , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefano Garzarella , "Michael S. Tsirkin" , Pierrick Bouvier , Nicholas Piggin , qemu-ppc@nongnu.org Subject: [PATCH v3 03/11] hw/virtio: Introduce VirtIODevice::access_is_big_endian boolean field Date: Mon, 2 Feb 2026 00:29:15 +0100 Message-ID: <20260201232924.93399-4-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260201232924.93399-1-philmd@linaro.org> References: <20260201232924.93399-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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 @linaro.org) X-ZM-MESSAGEID: 1769988650086158500 VirtIODevice::access_is_big_endian boolean field, initialized on device reset, represents whether load/store accesses are ordered using big endianness. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/virtio/virtio.h | 5 +++++ hw/virtio/virtio.c | 1 + 2 files changed, 6 insertions(+) diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index 17b105c146d..7a4f7de7475 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -154,6 +154,11 @@ struct VirtIODevice VMChangeStateEntry *vmstate; char *bus_name; uint8_t device_endian; + /** + * @access_is_big_endian: whether load/store memory accesses are order= ed + * using big endianness. Might change during device resets. + */ + bool access_is_big_endian; /** * @user_guest_notifier_mask: gate usage of ->guest_notifier_mask() ca= llback. * This is used to suppress the masking of guest updates for diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 86fc0e262f7..242c207a591 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -3247,6 +3247,7 @@ void virtio_reset(VirtIODevice *vdev) /* System reset */ vdev->device_endian =3D virtio_default_endian(); } + vdev->access_is_big_endian =3D virtio_access_is_big_endian(vdev); =20 if (k->get_vhost) { struct vhost_dev *hdev =3D k->get_vhost(vdev); --=20 2.52.0 From nobody Mon Feb 9 03:17:06 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1769988610; cv=none; d=zohomail.com; s=zohoarc; b=cw/GloKlRC6/x5ckXzclPFNACMgtfoMKInpYUN1gkHnZr83lSqRWFUMg+K9Q5brE/HtwAgsQquM4aqPzUWE11VuLOvAoJyXSaihrHYiAHd1aaRKx1d9THbj6WZD/zF5wM2mnFp2dI/lDH4ecUwZcjopcilqjBzZLI9a4zrnqpAo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769988610; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/mFBINwlnbUzimo0bMmKTtdWLFjMVHtdrIxAzG6it5I=; b=dZskEg2lfQsfzoZzxCoOl+6Wy4gH2I4/YeTqOruH7PlwWfRFDmowQq4D6ek03L+ED2oO9OBioaEB6krd2q1Rq2bml7SmHjnlN4NUEKokFz06ynqAyuS5d9ougtmG3eg4C7cU2q5YowLzdEp85Iwo14NZhYRPzZ5lRktOnUEv+H0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769988610928450.0766046401834; Sun, 1 Feb 2026 15:30:10 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmgtD-0003ge-7D; Sun, 01 Feb 2026 18:29:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vmgtB-0003dW-30 for qemu-devel@nongnu.org; Sun, 01 Feb 2026 18:29:57 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vmgt9-0002iV-DT for qemu-devel@nongnu.org; Sun, 01 Feb 2026 18:29:56 -0500 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-4359a316d89so2905872f8f.0 for ; Sun, 01 Feb 2026 15:29:54 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4806ce56068sm345846735e9.13.2026.02.01.15.29.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 01 Feb 2026 15:29:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769988593; x=1770593393; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/mFBINwlnbUzimo0bMmKTtdWLFjMVHtdrIxAzG6it5I=; b=ywQUNexV2ybIRA1VPcvXg583cW9MEQo6ZyMwb7tyhmpDW/ii735Dc7Vdd+3fOzEUPU hCsDERjoZBSQN7a7UV3neQ71tF/Mq4n1y6xRSoZPvL4td9dyigDAaQQOgoxABvK5OYOn W+PE0zIwkuYhR4E+5TW5qHYDeWWNid/kBexfRG2PCy8FsLZfxzgnqDh8YSsILKb0TxcP NThBYwksr+NS5fh8ghcY8SPWezVGcOMhRG+pFbrQ5u2URrx5tgIi53zTc9A6h10x+VpJ uS6Z3aE3enNBAUnJ8E1Dl6yzqeqYc8Z/z0bE+nAv7LXKnsVt82qN9kmkNrw0MrozOxHT ZgOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769988593; x=1770593393; 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; bh=/mFBINwlnbUzimo0bMmKTtdWLFjMVHtdrIxAzG6it5I=; b=UxYhYTigFd69uVikXwvBMKH21f/iyexlR5NLaYlaa8n6VPtpebo/tP2N6rLpG/mAP0 rc0/nAUmgG0X/rzNZS2NQQjD8VjIa5umaUNIR6nLRVq49OPS4/8pTd7dP0+fcCco0Bz6 wF7gVDzUhLcakXzOnsqnsFpx8zmsIr6Dx/r2yjpmv3Mubeh7Qk2pDhc00iydfzjTYly0 5vxqcrMtGjdTVvFghAAfTaYMGoMjylWwuwsqOyo5ADscIMf74ruQqboXo2xPeSmcBRG4 a+fsgq92Tw4+JwzOw9RAfBYPJk1emhwJkffrJ/foEYON3E9qBegLeMjocmq3gjNTrW5b mlMQ== X-Gm-Message-State: AOJu0Yw8GaS+SOTQWRU82BRT5IExnllgFAEKfxUMA4fBOpuP6zDsXxEE VOexk2lLS46fDjUrTxZ4z9UHkpHkjPpL4ZZvEA8ZZ44oTm66dKDfcFfhEk9n/nd/LLZ97KCBWK8 G3LriJOc= X-Gm-Gg: AZuq6aKlotMZe1k3ML/JjSFQ9mPmrcyKgJQNbctK2JlRiAvGM2FaJniln8Aw3ThMX6/ WZjaZ/AqvqboLyWY+ud/i+2Y0EDD5YPIToMbB4V6s7zBjjA7ACb1Xke+zlrXnWViKh3/7vyZWRe frc5U1+q/yhbjkBEixc5zeEXsPf7vP1LMqGXH6IPVvrN6s33jG+xXtwNpEDyQZ72M9SoOtRH2FG bVpzSx4PBkGccVqENLlRokKmBSPaUIZCvzUCzwJuslg9yVm+SmxoENlETzofEM42XWbudcOs5Zd xbt6cb0KX13/0KyG/gS87Nss8mbg+ng2VkGMtAdVOeuDsGFGD9wloGu5ZuBReKaMfm1yZBMafda +qro7vTdjDkXXrbuhza0IlHZ8jW054LtsX/TkImKCW1vj3OezB7oyJum/zZMNIhhuPQsRRENIgv I4mtU7kNPDP6XMrlrIc6jZfS11Kn1QCGjjEqOvzhYXxGc8XB9j9BdXvv7kmzb3 X-Received: by 2002:a05:600c:818f:b0:47e:e2ec:995b with SMTP id 5b1f17b1804b1-482db45fa3emr124043035e9.9.1769988593088; Sun, 01 Feb 2026 15:29:53 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Harsh Prateek Bora , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefano Garzarella , "Michael S. Tsirkin" , Pierrick Bouvier , Nicholas Piggin , qemu-ppc@nongnu.org Subject: [PATCH v3 04/11] hw/virtio: Use VirtIODevice::access_is_big_endian field Date: Mon, 2 Feb 2026 00:29:16 +0100 Message-ID: <20260201232924.93399-5-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260201232924.93399-1-philmd@linaro.org> References: <20260201232924.93399-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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 @linaro.org) X-ZM-MESSAGEID: 1769988612014158500 Endianness access is constant between device resets. Use the field instead of calling the same function. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/virtio/virtio-access.h | 24 ++++++++++++------------ hw/virtio/virtio.c | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/hw/virtio/virtio-access.h b/include/hw/virtio/virtio-a= ccess.h index cd17d0c87eb..f3b4d0075b5 100644 --- a/include/hw/virtio/virtio-access.h +++ b/include/hw/virtio/virtio-access.h @@ -42,7 +42,7 @@ static inline bool virtio_access_is_big_endian(VirtIODevi= ce *vdev) =20 static inline void virtio_stw_p(VirtIODevice *vdev, void *ptr, uint16_t v) { - if (virtio_access_is_big_endian(vdev)) { + if (vdev->access_is_big_endian) { stw_be_p(ptr, v); } else { stw_le_p(ptr, v); @@ -51,7 +51,7 @@ static inline void virtio_stw_p(VirtIODevice *vdev, void = *ptr, uint16_t v) =20 static inline void virtio_stl_p(VirtIODevice *vdev, void *ptr, uint32_t v) { - if (virtio_access_is_big_endian(vdev)) { + if (vdev->access_is_big_endian) { stl_be_p(ptr, v); } else { stl_le_p(ptr, v); @@ -60,7 +60,7 @@ static inline void virtio_stl_p(VirtIODevice *vdev, void = *ptr, uint32_t v) =20 static inline void virtio_stq_p(VirtIODevice *vdev, void *ptr, uint64_t v) { - if (virtio_access_is_big_endian(vdev)) { + if (vdev->access_is_big_endian) { stq_be_p(ptr, v); } else { stq_le_p(ptr, v); @@ -69,7 +69,7 @@ static inline void virtio_stq_p(VirtIODevice *vdev, void = *ptr, uint64_t v) =20 static inline int virtio_lduw_p(VirtIODevice *vdev, const void *ptr) { - if (virtio_access_is_big_endian(vdev)) { + if (vdev->access_is_big_endian) { return lduw_be_p(ptr); } else { return lduw_le_p(ptr); @@ -78,7 +78,7 @@ static inline int virtio_lduw_p(VirtIODevice *vdev, const= void *ptr) =20 static inline int virtio_ldl_p(VirtIODevice *vdev, const void *ptr) { - if (virtio_access_is_big_endian(vdev)) { + if (vdev->access_is_big_endian) { return ldl_be_p(ptr); } else { return ldl_le_p(ptr); @@ -87,7 +87,7 @@ static inline int virtio_ldl_p(VirtIODevice *vdev, const = void *ptr) =20 static inline uint64_t virtio_ldq_p(VirtIODevice *vdev, const void *ptr) { - if (virtio_access_is_big_endian(vdev)) { + if (vdev->access_is_big_endian) { return ldq_be_p(ptr); } else { return ldq_le_p(ptr); @@ -97,9 +97,9 @@ static inline uint64_t virtio_ldq_p(VirtIODevice *vdev, c= onst void *ptr) static inline uint16_t virtio_tswap16(VirtIODevice *vdev, uint16_t s) { #if HOST_BIG_ENDIAN - return virtio_access_is_big_endian(vdev) ? s : bswap16(s); + return vdev->access_is_big_endian ? s : bswap16(s); #else - return virtio_access_is_big_endian(vdev) ? bswap16(s) : s; + return vdev->access_is_big_endian ? bswap16(s) : s; #endif } =20 @@ -111,9 +111,9 @@ static inline void virtio_tswap16s(VirtIODevice *vdev, = uint16_t *s) static inline uint32_t virtio_tswap32(VirtIODevice *vdev, uint32_t s) { #if HOST_BIG_ENDIAN - return virtio_access_is_big_endian(vdev) ? s : bswap32(s); + return vdev->access_is_big_endian ? s : bswap32(s); #else - return virtio_access_is_big_endian(vdev) ? bswap32(s) : s; + return vdev->access_is_big_endian ? bswap32(s) : s; #endif } =20 @@ -125,9 +125,9 @@ static inline void virtio_tswap32s(VirtIODevice *vdev, = uint32_t *s) static inline uint64_t virtio_tswap64(VirtIODevice *vdev, uint64_t s) { #if HOST_BIG_ENDIAN - return virtio_access_is_big_endian(vdev) ? s : bswap64(s); + return vdev->access_is_big_endian ? s : bswap64(s); #else - return virtio_access_is_big_endian(vdev) ? bswap64(s) : s; + return vdev->access_is_big_endian ? bswap64(s) : s; #endif } =20 diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 242c207a591..1dc60d37cb4 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -220,7 +220,7 @@ static inline uint16_t virtio_lduw_phys_cached(VirtIODe= vice *vdev, MemoryRegionCache *cache, hwaddr pa) { - if (virtio_access_is_big_endian(vdev)) { + if (vdev->access_is_big_endian) { return lduw_be_phys_cached(cache, pa); } return lduw_le_phys_cached(cache, pa); @@ -230,7 +230,7 @@ static inline void virtio_stw_phys_cached(VirtIODevice = *vdev, MemoryRegionCache *cache, hwaddr pa, uint16_t value) { - if (virtio_access_is_big_endian(vdev)) { + if (vdev->access_is_big_endian) { stw_be_phys_cached(cache, pa, value); } else { stw_le_phys_cached(cache, pa, value); --=20 2.52.0 From nobody Mon Feb 9 03:17:06 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1769988632; cv=none; d=zohomail.com; s=zohoarc; b=EEecKWFfYOohLipeLOIDAbPkmYB1H6SZNqvAoerpeOGw0cQzIskq07vxFaSHy+N947ix4XCTg74vRt75WboudaSvZgDI+W8NBK1duQ6OEF4hhxfoM9HV9UjIO4HeZyofRgP/ao99XChoY5R0p1qavD6gmnlzSprU2C0rpCfAxPk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769988632; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=qLtJ/i/Ej2+3rrcoaflUWytYyH2WFju1TAatGa5vnlY=; b=I5nECNpF/b/RIN9UedMfAhkXNghHsoqbHYaRKL4tlV5OQYiLRvXI8b6r1L4qe+6P3ay/yuhs9aGTwQW9uL+Mm6CCTy/LnGAlxJ+31j+16ZIm3RVCNB902d/BtDbbUKSQ/aXD2Y25k/NKjPBPzdFwLPJiRFTfrOKs9pWDAyW5BPc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769988632604616.6689750284119; Sun, 1 Feb 2026 15:30:32 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmgtJ-0003iS-P4; Sun, 01 Feb 2026 18:30:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vmgtI-0003iB-OY for qemu-devel@nongnu.org; Sun, 01 Feb 2026 18:30:04 -0500 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vmgtH-0002t5-4M for qemu-devel@nongnu.org; Sun, 01 Feb 2026 18:30:04 -0500 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-432da746749so2148430f8f.0 for ; Sun, 01 Feb 2026 15:30:02 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-435e1353f8bsm37568608f8f.39.2026.02.01.15.29.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 01 Feb 2026 15:30:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769988601; x=1770593401; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qLtJ/i/Ej2+3rrcoaflUWytYyH2WFju1TAatGa5vnlY=; b=eYa9CD/6RKI1vS+byiaMOSY+QsSTUCyQDpr8R22oU8KB4now0dvzag0xL4eagghBU3 K3n9arAk72fcRSynQUWoPr4FSU/WNJQchZolkr3c0VfpFmFvemikDQjaKEM6m7/aoUnI dHiydfdf/WJWO3kSHmsNyHmdiNDR/RNfjGxJsUeOi3KZfLd3Q71Jwb1pvJcHjA8Ninwp lb+zHwTqio48Tlc6dkC4ytlQlsV/a6zwYaPpIrKpYDzWNNNvad23rD01RmBSTcsVUBoy /c7NC6o3imTfbSrDyccgxUYAKEpDIHRYf5rf99ZNQTZCygMdYjy+RCqWZ7dLlKo9Kd93 5qhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769988601; x=1770593401; 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; bh=qLtJ/i/Ej2+3rrcoaflUWytYyH2WFju1TAatGa5vnlY=; b=E++LmCpeOnUyY7gZDBbH9UVtRXISlMMiCMZ6+SmUdmkbEq0yiIiOv+YuJdGyEgZ1Fp WxoU5xWQ05DURdWuX23Ow4Vu4CAp2Sioo18afI7UvHl7Bj2C24lyYSeeHYHUBx5vM/pF i65vX2HN1qWzT1atTWWIx3L65qW5tnKf9tl52FTRHGfpX2QnF8QQqN7SfNdh1fd+jRvZ OyR+imXvhVmoLj/3hzF0sis62JaNjboXLBpC+XjK5ZIr/yTj7DLm92uDMMVHN3tzTdkE h/3iQHblxgJEPx7bVPdl0ropCg0/8651Ew2l7ewig4OaSo2EbIb7JbhHMzpdwJytFjqP a+qQ== X-Gm-Message-State: AOJu0Yzt/Dhy+degMAOG7zDnlpiZ+FqcIccKqVfF0IcWzGA7dS9MEVdb Yrz1p7WyZeul5bKbTxod0iqoT/MJf/Y+tAek9PZJUh3q/uy03YbVPx31BRSBfjg9d3Cby+4qwys GUq0VGZQ= X-Gm-Gg: AZuq6aKC0urc1fjAruzenpbL7VZgjaxwecRYFQ9VguTfNtRBsGQxqQ+HdzT8GWzayYL e3p3l+Bb9L26pZ4dlP7/MPiSkOpYpYm8SvyAbl8F8p8zll7dSe2pBD/WAG4IMGvBnU8XeafY4T6 6jgnnsvZSvQj/SkfweQUKjUe9GtTXAbugIruTjPd7RnUL1RhVQYz7x/E5W5ssQ618aH7mA/1yrt Mcav2M+DJoUYN8pxNGGoAMAE6uBSxu9O6TbR47aSrVHkYvo7Hu65v7UsrDGrBBlqy1LBh195RYO FTh72Wu8o/GLq6qR184MCz5UfCZijuAPMSezTImE4iHlQ9CzIj3lWeSl2g41+Qd7csGHD+ek5Zg 1Ii6p6rq4h/NVm9DVCmcM4JdBfn24cpeBgbKgVPI0Ab3mk7mELqYELA8km6OuLcWlJjIPJaWN+m 5axoju5CQR/3IkuGj/cjGWh5QKwNVGP89PXGNu12654pKaZyKQemoPUcdAU5Ne X-Received: by 2002:a05:6000:400e:b0:435:8fd6:5949 with SMTP id ffacd0b85a97d-435f3abb1c5mr15681095f8f.46.1769988601357; Sun, 01 Feb 2026 15:30:01 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Harsh Prateek Bora , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefano Garzarella , "Michael S. Tsirkin" , Pierrick Bouvier , Nicholas Piggin , qemu-ppc@nongnu.org Subject: [PATCH v3 05/11] hw/virtio: Reduce virtio_access_is_big_endian() scope Date: Mon, 2 Feb 2026 00:29:17 +0100 Message-ID: <20260201232924.93399-6-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260201232924.93399-1-philmd@linaro.org> References: <20260201232924.93399-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=philmd@linaro.org; helo=mail-wr1-x430.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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 @linaro.org) X-ZM-MESSAGEID: 1769988634011158500 virtio_access_is_big_endian() is only used once in virtio_reset(). Make the VirtIODevice argument const. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/virtio/virtio-access.h | 22 +--------------------- hw/virtio/virtio.c | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/include/hw/virtio/virtio-access.h b/include/hw/virtio/virtio-a= ccess.h index f3b4d0075b5..c6b76979749 100644 --- a/include/hw/virtio/virtio-access.h +++ b/include/hw/virtio/virtio-access.h @@ -16,29 +16,9 @@ #ifndef QEMU_VIRTIO_ACCESS_H #define QEMU_VIRTIO_ACCESS_H =20 -#include "exec/hwaddr.h" +#include "qemu/bswap.h" #include "system/memory_cached.h" #include "hw/virtio/virtio.h" -#include "hw/virtio/virtio-bus.h" - -#if defined(TARGET_PPC64) || defined(TARGET_ARM) -#define LEGACY_VIRTIO_IS_BIENDIAN 1 -#endif - -static inline bool virtio_access_is_big_endian(VirtIODevice *vdev) -{ -#if defined(LEGACY_VIRTIO_IS_BIENDIAN) - return virtio_is_big_endian(vdev); -#elif TARGET_BIG_ENDIAN - if (virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) { - /* Devices conforming to VIRTIO 1.0 or later are always LE. */ - return false; - } - return true; -#else - return false; -#endif -} =20 static inline void virtio_stw_p(VirtIODevice *vdev, void *ptr, uint16_t v) { diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 1dc60d37cb4..627a929b063 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -3233,6 +3233,25 @@ int virtio_set_features_ex(VirtIODevice *vdev, const= uint64_t *features) return ret; } =20 +#if defined(TARGET_PPC64) || defined(TARGET_ARM) +#define LEGACY_VIRTIO_IS_BIENDIAN 1 +#endif + +static bool virtio_access_is_big_endian(const VirtIODevice *vdev) +{ +#if defined(LEGACY_VIRTIO_IS_BIENDIAN) + return virtio_is_big_endian(vdev); +#elif TARGET_BIG_ENDIAN + if (virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) { + /* Devices conforming to VIRTIO 1.0 or later are always LE. */ + return false; + } + return true; +#else + return false; +#endif +} + void virtio_reset(VirtIODevice *vdev) { VirtioDeviceClass *k =3D VIRTIO_DEVICE_GET_CLASS(vdev); --=20 2.52.0 From nobody Mon Feb 9 03:17:06 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1769988654; cv=none; d=zohomail.com; s=zohoarc; b=KzOe+P0zwWL68hogP3O5dbB7wA+k3yHcuH2PLt5Cd4qqurgmd1AOqX/lkUkMde24RphbeqBEe/LVhbelqUGrHKGpxWSYGYVieo2FzyDMxuEmZt0sYCReOSBnX2rPfBdlPvk8Vvj5t+3RHpXFndyyfZxqKPmk1YPtfmp9pHEvKGc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769988654; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=7jNtMN+TApjyuOmbux0fVfOi0ZSmxtuwv6TQan6eaBM=; b=dyCglUH3vEcEULZDUwLQcuTz+m3AE20GSfH3oLzDAe7tS9SOjyf01AaFqUG/w4Ya47qojOhkKt+9mRZsTOIAf7ihrwZyZFZsB9ikt5zmonStiEF/0bTmmOCib8LzB+/tAIpo4fJhdF1Y/x9GyrUAx5sM5N1xsrZPQHMDAir0194= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769988654336689.8574966631608; Sun, 1 Feb 2026 15:30:54 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmgtR-0003vZ-Qw; Sun, 01 Feb 2026 18:30:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vmgtQ-0003sY-0l for qemu-devel@nongnu.org; Sun, 01 Feb 2026 18:30:12 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vmgtO-00038N-B3 for qemu-devel@nongnu.org; Sun, 01 Feb 2026 18:30:11 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-480706554beso41880645e9.1 for ; Sun, 01 Feb 2026 15:30:09 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-435e10e4757sm40860174f8f.5.2026.02.01.15.30.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 01 Feb 2026 15:30:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769988608; x=1770593408; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7jNtMN+TApjyuOmbux0fVfOi0ZSmxtuwv6TQan6eaBM=; b=JjnuRlNeMzJ23Ud7Tx1fAPBjOrYbAxQYfIZElNNf6/Nezk4I252f5MMBqLCx3DlZ6I szCFVxSffqfO4WYrNZSkkd5IN7kLTJ8n8pVsyeQ//CkFCKBzZRmDlthKTgCS3xySoQZ6 4yGshYyd6eSU0XlmdIbwFEyjL43YgDxhFb5c4E/pbZZ1TEaS0mO3ycrPbGgJZr7Qz9z9 /JIMerUTn4OTVTHd4z38R4/X7/WV5j7B7AFvQFmIff73gDg7RcVTuA1ZMXOxlH61XBQ9 bkRhi1xsW03k1ZhZi3dXCR8FzdvTyA80R/mLhivUyYsBDsSaVq6HcHB6GZSpZzIFlGmN MYVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769988608; x=1770593408; 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; bh=7jNtMN+TApjyuOmbux0fVfOi0ZSmxtuwv6TQan6eaBM=; b=e4zb+y7LeMzwgLzG4lvIpR8MQIK1iQsg+6gZiTE4JhEW6ddJ6etEjuK13Q1CruCjdq iRGe7oQZt56TAzC6I7hIzI4uC0Px3mfosN8R7F7Hd9RLoCM9QIXDrzroTCL7iSFkRufH BW2Ytli/vHIYnpyAYcs299PcCDK0QxG1A/Tl5RMbtMIb/9aVasdbQQt2gquvUMNdJWDl nvomDuzo1WgWKkTh6RUP2v8m0TGubz91JGmXKcXOfGzEcg2O+EJV6nwzkyl3Ju8oLWTn 0wSmznfZwAD3jKqEB2JqmtWvluWYGf9Lb4L0uZEr+D0JTRc7HWuuVM8pSbd8Qssb4Vmk Rm1w== X-Gm-Message-State: AOJu0YwawITxpFY+qXpvOu0U4lXCh4OdlW9EIOI0hvznMC9asDq3kMiO Hhz6KmszqyIpDHSMmsgYu0LdwySTW8Dbjbvyq2EBNEMoD8EUU+agURd/Vpbim3zPzrx04xts6Xy NkG3FXU8= X-Gm-Gg: AZuq6aL9wBAki3WFRV0qR5oPfUxrtLXvfSIRfIHtA8lqNQiFY/ypsLYRyXN+7yj+7bJ WG1C7qfE47wqdQbEtt6PHIngUv6F5VgOwhwRxEz/9P8wJmcYTdQN6uKeDv7k6Ty66BWRfaw9Y0+ ED898nls+QkUSDlTnmWMvIMJNdSHzkdxnooHC8Qar/V379FJoz56/ngob0m+BXUAE4zHS5fFn19 z+Bhlmo1C5MKDh6lG8P/RnVa66SlrB5L5/ft6XSA8XI/2rH89kYHaxyVLv4EFzC9wGsBRTrm0Jm L01g8ZLH6348RNNpTETSHYynFxqMRB3vTtZl5YuuUAUinL37oF/oNsZpRefdAZ+oQgPjy4nQgWS wh+xvJ0GQUmKXuZC4Men2OshTA2Wcr0vN7zCVM/I11HMh8yTfLP2SKJMFXw4f4F1KXR6rwP9opu 5wJZ/Vwe8640cSgcvcKQ2zvE251vyosBVUzEJru5xfdqF3LcnhfpcQTz8kbJFs X-Received: by 2002:a5d:5f51:0:b0:435:add0:3d68 with SMTP id ffacd0b85a97d-435f3abb466mr13958872f8f.58.1769988608371; Sun, 01 Feb 2026 15:30:08 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Harsh Prateek Bora , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefano Garzarella , "Michael S. Tsirkin" , Pierrick Bouvier , Nicholas Piggin , qemu-ppc@nongnu.org Subject: [PATCH v3 06/11] hw/virtio: Check target supports legacy bi-endianness at runtime Date: Mon, 2 Feb 2026 00:29:18 +0100 Message-ID: <20260201232924.93399-7-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260201232924.93399-1-philmd@linaro.org> References: <20260201232924.93399-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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 @linaro.org) X-ZM-MESSAGEID: 1769988656054158500 Convert build-time check by a runtime one using the TargetInfo API. Inspired-by: Pierrick Bouvier Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/virtio/virtio.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 627a929b063..d64ecc29a89 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -3233,15 +3233,17 @@ int virtio_set_features_ex(VirtIODevice *vdev, cons= t uint64_t *features) return ret; } =20 -#if defined(TARGET_PPC64) || defined(TARGET_ARM) -#define LEGACY_VIRTIO_IS_BIENDIAN 1 -#endif +static bool target_is_legacy_virtio_biendian(void) +{ + return target_ppc64() || target_base_arm(); +} =20 static bool virtio_access_is_big_endian(const VirtIODevice *vdev) { -#if defined(LEGACY_VIRTIO_IS_BIENDIAN) - return virtio_is_big_endian(vdev); -#elif TARGET_BIG_ENDIAN + if (target_is_legacy_virtio_biendian()) { + return virtio_is_big_endian(vdev); + } +#if TARGET_BIG_ENDIAN if (virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) { /* Devices conforming to VIRTIO 1.0 or later are always LE. */ return false; --=20 2.52.0 From nobody Mon Feb 9 03:17:06 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1769988713; cv=none; d=zohomail.com; s=zohoarc; b=fosRUzkj69iCFwmKPUBIsi74p13pMJb2FLwnMLvjqGL4NPzDeGGfAgkL8iQ829jvOjohuNfcfGGJHgQafngHGypz/CSSrKjU/94upVhcr/pDV1BzpYBZf8Cq6szHS6hG0uAIyOJh8S6QTXZhDqyAonhs+AED291MSUE+N7CUps4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769988713; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=lJ2uWCeP8pV22XPIuG+XMR/jSRA5vjFNUShUwB++kLM=; b=ffDPEn6QD89OULjJnlKFciyNOztyqOc1vz2k36MfpMvT71AtAfBeEZoMnPkrloQeqBTudFz/Lzev2qb1DFgYQES//zMxitnT0OTnmBu1ywKsVK2H+0+4QQ5RzcdFgqMo/ZWndB70PF1IREc/QwGNYV50qTz4aqM+V59Ma4vx5ZU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769988713379927.7705476490755; Sun, 1 Feb 2026 15:31:53 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmgtr-0004fh-ID; Sun, 01 Feb 2026 18:30:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vmgtX-00049t-Ls for qemu-devel@nongnu.org; Sun, 01 Feb 2026 18:30:27 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vmgtV-0003C5-8s for qemu-devel@nongnu.org; Sun, 01 Feb 2026 18:30:19 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4806dffc64cso28142745e9.1 for ; Sun, 01 Feb 2026 15:30:16 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-482e256f639sm73915185e9.13.2026.02.01.15.30.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 01 Feb 2026 15:30:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769988615; x=1770593415; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lJ2uWCeP8pV22XPIuG+XMR/jSRA5vjFNUShUwB++kLM=; b=Bc3UPe15C4jwv163KA2VoeHtwBG5rmZtZ/acFQN9MOQIb9d42B7ShTRjPT9xvfp2Ca Gg4vj8vwZFHPGe4BNBm0YMjBTBd7dv6+McwNNiueyRLV2veg1Es642JRpevk6uwVujy6 Q5U0OOFqb38R9west5RivY2xTGMjGWi6VvyEx/TdJc3zIzOkaErLyEPjvKhrIHsBEctC JOBRGqzPP7SQugaxMS3puQ/Z6DpwUdbkDI/9JsXw3n7JKZAXf8W9GQWR09h+0bdfJxqE FvGiQgKHIGGpaIdrWiPJooZYnIPjfhp+/m1qIADfe0mw4yVHXnL37lYMct5YoxIMDHzr aTJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769988615; x=1770593415; 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; bh=lJ2uWCeP8pV22XPIuG+XMR/jSRA5vjFNUShUwB++kLM=; b=YizuhlhAaoYivA0ksyWSibnhvzkrN/wggvUF+mQk5SQTQoAYJ4mSyT+fdlBYKZhiSv 0QR9LS0S4RUrbjLV+aPh80QckCcB/xHTyTIZXPXOeRo153y635zb9QeQ/60ykWAtnFf/ DYYZHqePxZ4fXULgQkenhQXfHA+0wXW9Jod8M7pJTLhmGpHMXPpMm4z7MZMc+VyOSsik kZQ7jct18+UPw16222nJ+0ajAOL0lsSfBmsw4ftiTIgxb0dxT7ukYb4xvlj4VUOVxtp/ 0PZi7zXW2i0RxgoY9s4jkPCVV4RovnwlweKwiixHjToVNnl1ra/uAjaH9tIbZANDjLJs xdfg== X-Gm-Message-State: AOJu0YytCevOuTHGBXRlb+m0XubXptxrfyjnHdqq1q7LAcmaMKzhBv/0 BcxLSxsMVC3Lg5UMFmqEzT6tdkh8Mt2aui5exI31CPREuWp9ZngloKXcrwflX6aA7cKcmHcyKoM 8fV/b0b8= X-Gm-Gg: AZuq6aIRTu+7XdHpzdVkrqd+xGVQb1JWd2poOR4NVwH7xcAqk0gcpnUk+DLy3oNg/6j 3B61sgqtUxQONOyxLOMWAGa6J5mXml0KGYq4I254drwBvBogWNmywplNVuVcsGunz78Xa6/NtxQ 992DvlpfcYGBEJPZU+R+LYq13YX95wYKvrNlH0lsTMH/X3aS1GjgrkW09NBjzI7HJD2ovFlusha k/vERrg0sbAVLPIAHHtM1rO4QsfYvY99i1un+vx6VVAYS8/HFeUMY8f5WOP28nzN3Cv7q0z5t8S 7wcRbB5QBwpO9dimsQ8yWCBfiEEkHacI1hqRIb/HQKlPYh5mLbQ5J+xZvgALMlc5WXrLw4yP9dq sMbsWfD/5wMiDBTT749jF94A1e3mS84ohSQUZq7i30u4SVTxxYnz6n9951nzbyOJcZpL+Au0PEz sk+vGTNoOUprmzKBXuey5CmU5FsIf2ktKNeVIPft8xt8Wwmh6jsIQsR94+0G47 X-Received: by 2002:a05:600c:474f:b0:47a:810f:1d06 with SMTP id 5b1f17b1804b1-482db4576b0mr147823285e9.4.1769988615470; Sun, 01 Feb 2026 15:30:15 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Harsh Prateek Bora , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefano Garzarella , "Michael S. Tsirkin" , Pierrick Bouvier , Nicholas Piggin , qemu-ppc@nongnu.org Subject: [PATCH v3 07/11] hw/virtio: Replace TARGET_BIG_ENDIAN -> target_big_endian() Date: Mon, 2 Feb 2026 00:29:19 +0100 Message-ID: <20260201232924.93399-8-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260201232924.93399-1-philmd@linaro.org> References: <20260201232924.93399-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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 @linaro.org) X-ZM-MESSAGEID: 1769988714210158500 Check endianness at runtime to remove the target-specific TARGET_BIG_ENDIAN definition. Inspired-by: Pierrick Bouvier Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/virtio/virtio.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index d64ecc29a89..9c5563f9bec 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -3243,15 +3243,14 @@ static bool virtio_access_is_big_endian(const VirtI= ODevice *vdev) if (target_is_legacy_virtio_biendian()) { return virtio_is_big_endian(vdev); } -#if TARGET_BIG_ENDIAN + if (!target_big_endian()) { + return false; + } if (virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) { /* Devices conforming to VIRTIO 1.0 or later are always LE. */ return false; } return true; -#else - return false; -#endif } =20 void virtio_reset(VirtIODevice *vdev) --=20 2.52.0 From nobody Mon Feb 9 03:17:06 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1769988666; cv=none; d=zohomail.com; s=zohoarc; b=ecHQ7ZKQUJKsgyiWRDpD18RagSB5CspM2KtxHd+PS93qybOmqP7gEsQuTMBpdAtfzzo2Lp8S2p5SoYacZXTooV3wkSydvZKswwHx1/O/CZmWKLpsVzcgtbwyzowdWwy6IyMJVlyIsNyrKLlEPnXPfxgSHjgKjEBYVcRpJWrdhJc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769988666; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Ndt0lbeDD0ND0g1x/Jn9T0fK6A3JG1sO3tAPHAKkC/A=; b=J/jXku4TiYN5tfapfFZTIqE8IKNhJjJ3wLNJGm5y5aaXT7XTZ+23cX44wMI5lJi8Gu7S7BjzuHlW9vwRSrf27WQbZIORe80zP+bs5rn1SPoSSQr8aySW9pAqcGSJBFQbVmpSMiiFYXEECWX5GIHW2/cXvnMe18A9Ihq04JOMh4g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769988666021901.9396806283474; Sun, 1 Feb 2026 15:31:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmgts-0004ot-LB; Sun, 01 Feb 2026 18:30:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vmgtd-0004EK-Lr for qemu-devel@nongnu.org; Sun, 01 Feb 2026 18:30:28 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vmgtc-0003Ih-5f for qemu-devel@nongnu.org; Sun, 01 Feb 2026 18:30:25 -0500 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-47ff94b46afso34669535e9.1 for ; Sun, 01 Feb 2026 15:30:23 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-435e10f82aesm42482450f8f.19.2026.02.01.15.30.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 01 Feb 2026 15:30:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769988622; x=1770593422; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ndt0lbeDD0ND0g1x/Jn9T0fK6A3JG1sO3tAPHAKkC/A=; b=gif+MgpG8c7ywLj5Flsz2AYJkmQJt+rfvbjor9UGiOFVSkEHe3JRrjXVG3nIczkoRk Fg8pY3o4w++9vATyXIDTAYktg6xjO2YLI1kgWYJW0c+gHViCQPKh/O5rhDXT0U5oxE6O Q9YlVgiCuU8131/lwJTcmG+t+7ZuYY2qShZW7G2+RQ0z0dX1f4tciDsKClDXCLohPtz+ v8/iB/IA156D1hM/dHJzmzQW5lIQu/h8jrVPlJg92kvEBTRNAtkpkZunj5gxLM2sBoFZ zxLdS1ij9OrwmjNFXHtWSaUpMFjQX1z79eO804lYfctdDoGyWsJRqNbEE9STBw7tJLZu 6qCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769988622; x=1770593422; 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; bh=Ndt0lbeDD0ND0g1x/Jn9T0fK6A3JG1sO3tAPHAKkC/A=; b=LDtg5PKkjXB9xE+L8uExMtjEfitOlKztRo8oSduOIsrtOoruZikp7iZ7qqxitWkhwB +sw4WqO7nJEKUX/1lSfr8iJQN6p3mc2f/cbDjKme89tzPq+68uxnnmMIqiK5aUVSqRdE 6KIq786H17GZl7rgweZUCPUGB3qQStaXH0lM0oVMA0WTDzgIq8FrPsQm8vw2t3hNZIBe cvpf+CoCcT/YumUHDLWFUFPTkxt8QO+WoYJ6qw57DCDzPQ8+YhYIHv8cyf28AioXRzDA D0ujH/vzgmcURr0/Kl6b0KHTw9dv1tyvDjkaPIG541cqdKtbYsOpz8FUGixkU+O9HNrq sFzA== X-Gm-Message-State: AOJu0YxunG+NKtK71jfwemxdbLK3llAdIi2iEnmyzMznWhi6NpPEWBGT seDTGAMevYilIxdaxf48JCATdTx6JtZMgVTOulhvkJP3iFej+XI7eVSBq1Sot5NucepALB06phE azSxr6Yw= X-Gm-Gg: AZuq6aKL0fG61CG9evIUc2I1V+O9ca3tz5ryoVbp5nUqBSYlhT2M5XND7DNlf8GX1pX SJN+3l+gsP0XGx4wwCjnaJU8pHVbbri3qrVQ5vzuzuLMpRn5LsfAiL/d00sNmt3TFZRiyZbyU6g muzaKXtEmyJ5R3Sd+hwi7S+j7J1JwpZKbcqiplxI+8faO0PBS2kHi5q2f6TSt4ILjwNZE+Nl8Gl 7GSuoK8cVCQ/fUD3SuLKDQINkxRqWvQPwPkzJO89VG9GLIjIvg46MazfVEKLR8jgKkmiRIwa4z8 npYShWBuaxNzO6+jzggZT/PrOda73hWovabJV5HkY55Os+GtT5kDXSpBpeAhZIoJpIscm51FK2m YHKsupN7aQ7RjrAk4jnEY445iYJqctxM3GyXVFS+q8NzWQp7zIemEyWaSsQPJ1D5Zbfa/MAaKLa PS+wtnKCm58AgtIYqcPmkJ+47XJdEEpmBTJ7iwdp5uxE+PAcNJzuxPo/NbKper X-Received: by 2002:a05:600c:19c7:b0:47e:e981:78b4 with SMTP id 5b1f17b1804b1-482db477009mr143262975e9.12.1769988622247; Sun, 01 Feb 2026 15:30:22 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Harsh Prateek Bora , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefano Garzarella , "Michael S. Tsirkin" , Pierrick Bouvier , Nicholas Piggin , qemu-ppc@nongnu.org Subject: [PATCH v3 08/11] hw/ppc/spapr: extract SPAPR_MAX_RAM_SLOTS in a new header Date: Mon, 2 Feb 2026 00:29:20 +0100 Message-ID: <20260201232924.93399-9-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260201232924.93399-1-philmd@linaro.org> References: <20260201232924.93399-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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 @linaro.org) X-ZM-MESSAGEID: 1769988668142158501 From: Pierrick Bouvier Allow to include it from common code (vhost-user, in next commit), else it pulls ppc/cpu.h which has target specifics. Signed-off-by: Pierrick Bouvier Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/ppc/spapr.h | 8 +------- include/hw/ppc/spapr_common.h | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 include/hw/ppc/spapr_common.h diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index 5476ac7ce7b..b022f8dd25d 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -4,6 +4,7 @@ #include "qemu/units.h" #include "system/dma.h" #include "hw/core/boards.h" +#include "hw/ppc/spapr_common.h" #include "hw/ppc/spapr_drc.h" #include "hw/mem/pc-dimm.h" #include "hw/ppc/spapr_ovec.h" @@ -946,13 +947,6 @@ int spapr_rtc_import_offset(SpaprRtcState *rtc, int64_= t legacy_offset); =20 #define SPAPR_MEMORY_BLOCK_SIZE ((hwaddr)1 << 28) /* 256MB */ =20 -/* - * This defines the maximum number of DIMM slots we can have for sPAPR - * guest. This is not defined by sPAPR but we are defining it to 32 slots - * based on default number of slots provided by PowerPC kernel. - */ -#define SPAPR_MAX_RAM_SLOTS 32 - /* 1GB alignment for hotplug memory region */ #define SPAPR_DEVICE_MEM_ALIGN (1 * GiB) =20 diff --git a/include/hw/ppc/spapr_common.h b/include/hw/ppc/spapr_common.h new file mode 100644 index 00000000000..a315b685805 --- /dev/null +++ b/include/hw/ppc/spapr_common.h @@ -0,0 +1,17 @@ +/* + * Common definitions for PPC sPAPR + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef HW_SPAPR_COMMON_H +#define HW_SPAPR_COMMON_H + +/* + * The maximum number of DIMM slots we can have for sPAPR guest. + * This is not defined by sPAPR but we are defining it to 32 slots + * based on default number of slots provided by PowerPC kernel. + */ +#define SPAPR_MAX_RAM_SLOTS 32 + +#endif /* HW_SPAPR_COMMON_H */ --=20 2.52.0 From nobody Mon Feb 9 03:17:06 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1769988717; cv=none; d=zohomail.com; s=zohoarc; b=Fu4igC7rd+0tvX0YW8BRZ+Ww+L4ZIyhv89yisx3qPIFeM8nToabSj0is1wKQQ1pHhMYTgndECLrkcqKq9Ihqiks6tJlYwTy/e0Hz06dSn2FXeSuV4MtPXOHiy4QkTq8PJz/h/4ZkKq0u5mzRz+Kd+CC6RNiSnZJTk5ddTE6h1yg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769988717; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=3y8sx2MjjH2xIWfAsCvCax2QQJrx+zY+UiIZh3tX/d0=; b=jaxkTUQYYWnRau/mvi0Ji3p34kTPlyYofeskJ8+OYmycndWG5RSJ9G4/1DLIAgGfnLwe3cDvGUCD4vAQRK2LrlDaWLv6yS4v0fwYfMA02KbJuKNSLx4uV9adtCeBLLxPqtPaSrNCoQGnqp8bU9KmBMpqbiV8X2tw7K2uyKXCltk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769988717327393.6703708182321; Sun, 1 Feb 2026 15:31:57 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmgtr-0004eB-5g; Sun, 01 Feb 2026 18:30:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vmgtm-0004Vh-4l for qemu-devel@nongnu.org; Sun, 01 Feb 2026 18:30:34 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vmgtj-0003Ni-4o for qemu-devel@nongnu.org; Sun, 01 Feb 2026 18:30:33 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4806bf03573so18264325e9.2 for ; Sun, 01 Feb 2026 15:30:30 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-435e132356dsm41644763f8f.33.2026.02.01.15.30.28 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 01 Feb 2026 15:30:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769988629; x=1770593429; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3y8sx2MjjH2xIWfAsCvCax2QQJrx+zY+UiIZh3tX/d0=; b=nzh+NouGmqYNyUiylKK8lT8fJHqXkPjp71iSfFH8hoZxQ/1R9unAZ8ngBWn18Yh13j HcgVpeUj+w58hLMCRWYGbI1biwA9wJN7jOgfULT9pdDlpZCPZ5ciOtDdsYn9c/EanDp3 L0G+2bFdGLxhd8hcK2LzpGGJaUYwf0P/jSpgIFvxR0rH7bYGx+vCykhvnq73blsXgeE9 Lhj+ru1rywN4rVlv5wCjhQfnSipnsTfXzxvL7zFn4To4KoWCOrBd8DHDDzfzHT/Ilid5 rB3bPSv/7FEq3iPxTpt2EeOvS9VBb8qFAo2/Ghr1WZkb1MhNjX1EbTcdyvDTupHDT1qq zQ0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769988629; x=1770593429; 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; bh=3y8sx2MjjH2xIWfAsCvCax2QQJrx+zY+UiIZh3tX/d0=; b=oil0PW+MiF0VuQLFkvVlq8Sa0ITYrDiTUiD2tXUkEBaJR8R15/NHw3Uzdw571TEmQw Y0VULX2O3Mwg/m18DcnqaF0K1tJUl2IZSu1IKbXV8vqrk7t+CEaGPsW4gtXAigoA2O19 d3pJ306emyPdMseAA1PmXuJYeZDBgC8ZxCxJR7EWTYIEzk9xA41xlTtbD+I66DfqAf3J hfO4N4L/h8QgwPVHCFKWAvfbkPjYFg/iLC1lE8UUSWCCigr1T8uHXcWsnHGwU+5YsnZZ tZPtClcQfC7si51Np8utkL2TII/PaZ2tyPHIEpldOk2YRlmdN8TKCCHwIdgebMA7mWJ/ 2Wjg== X-Gm-Message-State: AOJu0YzqYuuRZT5EjcZM1oZipjhSEbOWdcL8aUnp0ZoVT+0AMWDTjaKS r9sotYNAjKilhYiWcoCqKwWN5D5hpwElVPP34Sqrz+6cGr8pIPduTF7sjR6tKqmjIUxExzcBTa8 ltVhwH/0= X-Gm-Gg: AZuq6aLjr00Pa0m3kN2B0SZuPjBrQ+57sZqZeomQD+kFJQH9MSU9LI25rJUezYym0z6 5UvB/CC5CPrVdUwpZA9ZKyNKC5TIp33L16G42hqOlmhMVJXwrInu3KQmg33yzsmptAQfk8e5Nvc OuPqfIMQy4Zl2WEHFY2EfJ+H8mOWP/g3f2jcrLhw0VxGSBFM4Ba5rNU9+WnmtOyK0SYyVgpL97l pYoZOZkNUq8Ar9fFCKf0LK89fyo7gVpx+jG05dp+SMwKJvmDSYw0lRbCS8WFFYVjV9KysrqcZuh h4dbXU79mCJ2w3JWaWjFEyHCW5AxW79NLpSSWQ9dqtWRgUp4t46xsN7N5qhVu/TXqI0huQjnl7x bpPY1gGMJa2aeoqEIaUnPQD8s5U4HiBPKRak/wp8I3ilWXgsNqntjLvDxBf13gBK+TT8nQgxIxw hFXr94FQgeDbydnhcBu6SVu32o9Cki0Ggilqocj7Y7lY3b1/NKbd19F/XiEzfo X-Received: by 2002:a05:600c:8b12:b0:47e:e20e:bbb7 with SMTP id 5b1f17b1804b1-482db499535mr122443635e9.25.1769988629137; Sun, 01 Feb 2026 15:30:29 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Harsh Prateek Bora , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefano Garzarella , "Michael S. Tsirkin" , Pierrick Bouvier , Nicholas Piggin , qemu-ppc@nongnu.org Subject: [PATCH v3 09/11] hw/virtio/vhost-user: make compilation unit common Date: Mon, 2 Feb 2026 00:29:21 +0100 Message-ID: <20260201232924.93399-10-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260201232924.93399-1-philmd@linaro.org> References: <20260201232924.93399-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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 @linaro.org) X-ZM-MESSAGEID: 1769988718350158500 From: Pierrick Bouvier PPC architectures use a custom value for VHOST_USER_MAX_RAM_SLOTS (32 instead of 512). vhost_user struct and several functions use VHOST_USER_MAX_RAM_SLOTS to define stack allocated buffers. To avoid changing all functions to use heap allocated buffers, we keep this max, and simply add a target_base_ppc() conditional for the single place where size really matters. Signed-off-by: Pierrick Bouvier Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/virtio/vhost-user.c | 11 ++++------- hw/virtio/meson.build | 3 +-- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index 63fa9a1b4b1..c8a004c6d2d 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -44,13 +44,8 @@ #define VHOST_USER_F_PROTOCOL_FEATURES 30 #define VHOST_USER_BACKEND_MAX_FDS 8 =20 -#if defined(TARGET_PPC) || defined(TARGET_PPC64) -#include "hw/ppc/spapr.h" -#define VHOST_USER_MAX_RAM_SLOTS SPAPR_MAX_RAM_SLOTS - -#else +#include "hw/ppc/spapr_common.h" #define VHOST_USER_MAX_RAM_SLOTS 512 -#endif =20 /* * Maximum size of virtio device config space @@ -2280,7 +2275,9 @@ static int vhost_user_backend_init(struct vhost_dev *= dev, void *opaque, return -EINVAL; } =20 - u->user->memory_slots =3D MIN(ram_slots, VHOST_USER_MAX_RAM_SL= OTS); + const uint64_t vhost_user_max_ram_slots =3D target_base_ppc() ? + SPAPR_MAX_RAM_SLOTS : VHOST_USER_MAX_RAM_SLOTS; + u->user->memory_slots =3D MIN(ram_slots, vhost_user_max_ram_sl= ots); } } =20 diff --git a/hw/virtio/meson.build b/hw/virtio/meson.build index affd66887db..ee397aaf196 100644 --- a/hw/virtio/meson.build +++ b/hw/virtio/meson.build @@ -17,8 +17,7 @@ if have_vhost system_virtio_ss.add(files('vhost.c')) system_virtio_ss.add(files('vhost-backend.c', 'vhost-iova-tree.c')) if have_vhost_user - # fixme - this really should be generic - specific_virtio_ss.add(files('vhost-user.c')) + system_virtio_ss.add(files('vhost-user.c')) system_virtio_ss.add(files('vhost-user-base.c')) =20 # MMIO Stubs --=20 2.52.0 From nobody Mon Feb 9 03:17:06 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1769988743; cv=none; d=zohomail.com; s=zohoarc; b=U+vW8bQRYjpSX9HWVk4tNKznoVRIqc4MyT0cOKMlE2X2T+z84WrhW1+RspL6Yw4G96kLaYDtOn0WZpuOYA1mFRG2j5vVo+Yo3IkCw2X5kK3s6uzEFhk7em0VggO8/idkAn51qICietBLNE5USP1xhROFV8iPNZcJEgxyKKh242Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769988743; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=XI4QauyUtUX66wtBIBxmVsjci7j411/fWovI3rGHj/g=; b=k0Lqd5rYyBx9EgWPIlpJbKDw0Tt1HFEtI27rB4b3wOPvgD7/Z9rom/iyL72pjQ7tA6Ja7vvc6xr3hXUGgsRl4HfoWw88XRatu+f3pALK0jFoSscDox8LWibyXPC1SRBEZro+EyueG7dPSTHvLAqmwjjz4L0vFLML99GCscMPM0w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769988743895809.5500274325466; Sun, 1 Feb 2026 15:32:23 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmgtt-0004zf-UX; Sun, 01 Feb 2026 18:30:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vmgts-0004of-HY for qemu-devel@nongnu.org; Sun, 01 Feb 2026 18:30:40 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vmgtq-0003Uv-6h for qemu-devel@nongnu.org; Sun, 01 Feb 2026 18:30:40 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-48068ed1eccso34710955e9.2 for ; Sun, 01 Feb 2026 15:30:37 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-482e2545101sm72575905e9.10.2026.02.01.15.30.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 01 Feb 2026 15:30:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769988636; x=1770593436; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XI4QauyUtUX66wtBIBxmVsjci7j411/fWovI3rGHj/g=; b=dNM8vRAVUEWF74F52Q4X/APcoifqvqZXI3YzS5eX5UjCUuxff0qBTjgLikgRuOQjpd EmTVwVT057nc39OgFN1tMIS13IQbvL2hkA9CqWSGuusGJnj2I60agDYE9vrIijHiO/Hs 00GGW22fSIF1rqz5jL4jjb1JNCNWQ/9hQR20dm6B7P/+GhIz9wEcuY4e8pLDTsWknv6p UVVH3PpRLf9XpMAbz2MJ8j5CswQB7IINvIrkMrqJWNCKPGZj7ukYkOMMExErFUYHFAge h418qtj6IzaMyAOUufvDwtHj9y6ZF15Lv6HJsg7VqidO3J2K00KYNpRRMGms4e8coP6G j/3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769988636; x=1770593436; 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; bh=XI4QauyUtUX66wtBIBxmVsjci7j411/fWovI3rGHj/g=; b=dyAK6yJ4/58+MzKnL2eQ/aWliR9E23IPIUd8U0ZAvgweIgrG1NMD82dWG7rOuRIkTp wplMnS/Rlx1jJ3xYazcyvz6/VCAjtsdYDNXZVP4+WsJmu0JNFTHaVDUCZ1wlSI3qK9AV XVpN9VTABoMGxjN244Y089zAHCgmhmr9tuFwFnk4XRF9hlqBF03fp30KmFZfyHVQ2p2y fdR/M3Q3t3YLbPmd5ifeD1kh6vupXRUlMaclKcVh5kTRU/kAvbLQ5UVofnno5hnygswI 2j7IYMzppGta5nI5Bj5vIBqsmhdPtPapsQQ07pmk0iFPVnYo/Rmbfqm5nhSo6hY/x268 LeYQ== X-Gm-Message-State: AOJu0YzCXMglq+vIaUpRO+j2QYptI6XOCld3cRCeXBtWYuBgz7ql2mcM rY6sSThi7Ym/8RrI0WBu1u6pWu5WtY3G5NS3SJ8tVFgdK/FyKYaWpPVFjuMqGP3RILhdwkdzzMJ hQDGuGUY= X-Gm-Gg: AZuq6aIYPBqVFS4SgtjpsrEJQV9lHix4Z5IMvJK2lNjCVbf+Rzuc72YKWiIcOeMQB7z eQeGByfCN+y+n4U8zHJmLu1DqYbY0l3qRmWfgHdHigWNTvAjF7o0tI8bhLs9N+nFPw4lUo6jllr 3VwW2V+kBe0Opo98d/A2qvgKSgnQBFKUOSuP9z9QKkw0AwwCcaaGoVowXkfhcN6Hnf9gO9rbUD4 9LfszY3KLRTZkqJ5uVLw2wRNN4sJrP3HpaoqHGUISNKpprUmKDN3HeX5CT1YDKp/2cIsq971/WG 13qbSNy00csh6OBsIO0NmNQypyzHAiVonRrbyDR5Em9iX2xhzBmtm+h+veOrA5KCOTbSnW+wE23 ZvcisIwhYRXEZHg7O1LVYPF85rTGCY5dcHR2cVbtFp6QawHEYqEbN/MPQ+pq885FSIHIF/ml4w1 pn4hi//fxG3Rz7bp5duoE7XRkHoT4TI65tesaWOQiZ9OcWcU3bl+DvwtjCL5FHLxUw9zQHG5A= X-Received: by 2002:a05:600c:1385:b0:480:3b4e:41b8 with SMTP id 5b1f17b1804b1-482db497d9bmr124651885e9.33.1769988636083; Sun, 01 Feb 2026 15:30:36 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Harsh Prateek Bora , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefano Garzarella , "Michael S. Tsirkin" , Pierrick Bouvier , Nicholas Piggin , qemu-ppc@nongnu.org Subject: [PATCH v3 10/11] hw/virtio/virtio-qmp: make compilation unit common Date: Mon, 2 Feb 2026 00:29:22 +0100 Message-ID: <20260201232924.93399-11-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260201232924.93399-1-philmd@linaro.org> References: <20260201232924.93399-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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 @linaro.org) X-ZM-MESSAGEID: 1769988744476158500 From: Pierrick Bouvier All compile time conditionals have no impact at runtime, since they are representing only possible features for devices present at runtime. In case they are not present, associated features table will never be used. In case they are present but some features are not, matching bits will never be enabled, so those entries will be unused. Thus, simply expose everything and call it a day. Signed-off-by: Pierrick Bouvier Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/virtio/virtio-qmp.c | 70 ------------------------------------------ hw/virtio/meson.build | 2 +- 2 files changed, 1 insertion(+), 71 deletions(-) diff --git a/hw/virtio/virtio-qmp.c b/hw/virtio/virtio-qmp.c index 968299fda0c..f9cdca50d99 100644 --- a/hw/virtio/virtio-qmp.c +++ b/hw/virtio/virtio-qmp.c @@ -33,21 +33,17 @@ #include "standard-headers/linux/virtio_vsock.h" #include "standard-headers/linux/virtio_gpio.h" =20 -#include CONFIG_DEVICES - #define FEATURE_ENTRY(name, desc) (qmp_virtio_feature_map_t) \ { .virtio_bit =3D name, .feature_desc =3D desc } =20 /* Virtio transport features mapping */ static const qmp_virtio_feature_map_t virtio_transport_map[] =3D { /* Virtio device transport features */ -#ifndef VIRTIO_CONFIG_NO_LEGACY FEATURE_ENTRY(VIRTIO_F_NOTIFY_ON_EMPTY, \ "VIRTIO_F_NOTIFY_ON_EMPTY: Notify when device runs out of avai= l. " "descs. on VQ"), FEATURE_ENTRY(VIRTIO_F_ANY_LAYOUT, \ "VIRTIO_F_ANY_LAYOUT: Device accepts arbitrary desc. layouts"), -#endif /* !VIRTIO_CONFIG_NO_LEGACY */ FEATURE_ENTRY(VIRTIO_F_VERSION_1, \ "VIRTIO_F_VERSION_1: Device compliant for v1 spec (legacy)"), FEATURE_ENTRY(VIRTIO_F_IOMMU_PLATFORM, \ @@ -149,7 +145,6 @@ static const qmp_virtio_feature_map_t virtio_config_sta= tus_map[] =3D { }; =20 /* virtio-blk features mapping */ -#ifdef CONFIG_VIRTIO_BLK static const qmp_virtio_feature_map_t virtio_blk_feature_map[] =3D { FEATURE_ENTRY(VIRTIO_BLK_F_SIZE_MAX, \ "VIRTIO_BLK_F_SIZE_MAX: Max segment size is size_max"), @@ -173,7 +168,6 @@ static const qmp_virtio_feature_map_t virtio_blk_featur= e_map[] =3D { "VIRTIO_BLK_F_SECURE_ERASE: Secure erase supported"), FEATURE_ENTRY(VIRTIO_BLK_F_ZONED, \ "VIRTIO_BLK_F_ZONED: Zoned block devices"), -#ifndef VIRTIO_BLK_NO_LEGACY FEATURE_ENTRY(VIRTIO_BLK_F_BARRIER, \ "VIRTIO_BLK_F_BARRIER: Request barriers supported"), FEATURE_ENTRY(VIRTIO_BLK_F_SCSI, \ @@ -183,7 +177,6 @@ static const qmp_virtio_feature_map_t virtio_blk_featur= e_map[] =3D { FEATURE_ENTRY(VIRTIO_BLK_F_CONFIG_WCE, \ "VIRTIO_BLK_F_CONFIG_WCE: Cache writeback and writethrough mod= es " "supported"), -#endif /* !VIRTIO_BLK_NO_LEGACY */ FEATURE_ENTRY(VHOST_F_LOG_ALL, \ "VHOST_F_LOG_ALL: Logging write descriptors supported"), FEATURE_ENTRY(VHOST_USER_F_PROTOCOL_FEATURES, \ @@ -191,10 +184,8 @@ static const qmp_virtio_feature_map_t virtio_blk_featu= re_map[] =3D { "negotiation supported"), { -1, "" } }; -#endif =20 /* virtio-serial features mapping */ -#ifdef CONFIG_VIRTIO_SERIAL static const qmp_virtio_feature_map_t virtio_serial_feature_map[] =3D { FEATURE_ENTRY(VIRTIO_CONSOLE_F_SIZE, \ "VIRTIO_CONSOLE_F_SIZE: Host providing console size"), @@ -204,10 +195,8 @@ static const qmp_virtio_feature_map_t virtio_serial_fe= ature_map[] =3D { "VIRTIO_CONSOLE_F_EMERG_WRITE: Emergency write supported"), { -1, "" } }; -#endif =20 /* virtio-gpu features mapping */ -#ifdef CONFIG_VIRTIO_GPU static const qmp_virtio_feature_map_t virtio_gpu_feature_map[] =3D { FEATURE_ENTRY(VIRTIO_GPU_F_VIRGL, \ "VIRTIO_GPU_F_VIRGL: Virgl 3D mode supported"), @@ -227,10 +216,8 @@ static const qmp_virtio_feature_map_t virtio_gpu_featu= re_map[] =3D { "negotiation supported"), { -1, "" } }; -#endif =20 /* virtio-input features mapping */ -#ifdef CONFIG_VIRTIO_INPUT static const qmp_virtio_feature_map_t virtio_input_feature_map[] =3D { FEATURE_ENTRY(VHOST_F_LOG_ALL, \ "VHOST_F_LOG_ALL: Logging write descriptors supported"), @@ -239,10 +226,8 @@ static const qmp_virtio_feature_map_t virtio_input_fea= ture_map[] =3D { "negotiation supported"), { -1, "" } }; -#endif =20 /* virtio-net features mapping */ -#ifdef CONFIG_VIRTIO_NET static const qmp_virtio_feature_map_t virtio_net_feature_map[] =3D { FEATURE_ENTRY(VIRTIO_NET_F_CSUM, \ "VIRTIO_NET_F_CSUM: Device handling packets with partial check= sum " @@ -313,10 +298,8 @@ static const qmp_virtio_feature_map_t virtio_net_featu= re_map[] =3D { "device with same MAC addr. supported"), FEATURE_ENTRY(VIRTIO_NET_F_SPEED_DUPLEX, \ "VIRTIO_NET_F_SPEED_DUPLEX: Device set linkspeed and duplex"), -#ifndef VIRTIO_NET_NO_LEGACY FEATURE_ENTRY(VIRTIO_NET_F_GSO, \ "VIRTIO_NET_F_GSO: Handling GSO-type packets supported"), -#endif /* !VIRTIO_NET_NO_LEGACY */ FEATURE_ENTRY(VHOST_NET_F_VIRTIO_NET_HDR, \ "VHOST_NET_F_VIRTIO_NET_HDR: Virtio-net headers for RX and TX " "packets supported"), @@ -341,10 +324,8 @@ static const qmp_virtio_feature_map_t virtio_net_featu= re_map[] =3D { "header"), { -1, "" } }; -#endif =20 /* virtio-scsi features mapping */ -#ifdef CONFIG_VIRTIO_SCSI static const qmp_virtio_feature_map_t virtio_scsi_feature_map[] =3D { FEATURE_ENTRY(VIRTIO_SCSI_F_INOUT, \ "VIRTIO_SCSI_F_INOUT: Requests including read and writable dat= a " @@ -364,10 +345,8 @@ static const qmp_virtio_feature_map_t virtio_scsi_feat= ure_map[] =3D { "negotiation supported"), { -1, "" } }; -#endif =20 /* virtio/vhost-user-fs features mapping */ -#ifdef CONFIG_VHOST_USER_FS static const qmp_virtio_feature_map_t virtio_fs_feature_map[] =3D { FEATURE_ENTRY(VHOST_F_LOG_ALL, \ "VHOST_F_LOG_ALL: Logging write descriptors supported"), @@ -376,10 +355,8 @@ static const qmp_virtio_feature_map_t virtio_fs_featur= e_map[] =3D { "negotiation supported"), { -1, "" } }; -#endif =20 /* virtio/vhost-user-i2c features mapping */ -#ifdef CONFIG_VIRTIO_I2C_ADAPTER static const qmp_virtio_feature_map_t virtio_i2c_feature_map[] =3D { FEATURE_ENTRY(VIRTIO_I2C_F_ZERO_LENGTH_REQUEST, \ "VIRTIO_I2C_F_ZERO_LEGNTH_REQUEST: Zero length requests suppor= ted"), @@ -390,10 +367,8 @@ static const qmp_virtio_feature_map_t virtio_i2c_featu= re_map[] =3D { "negotiation supported"), { -1, "" } }; -#endif =20 /* virtio/vhost-vsock features mapping */ -#ifdef CONFIG_VHOST_VSOCK static const qmp_virtio_feature_map_t virtio_vsock_feature_map[] =3D { FEATURE_ENTRY(VIRTIO_VSOCK_F_SEQPACKET, \ "VIRTIO_VSOCK_F_SEQPACKET: SOCK_SEQPACKET supported"), @@ -404,10 +379,8 @@ static const qmp_virtio_feature_map_t virtio_vsock_fea= ture_map[] =3D { "negotiation supported"), { -1, "" } }; -#endif =20 /* virtio-balloon features mapping */ -#ifdef CONFIG_VIRTIO_BALLOON static const qmp_virtio_feature_map_t virtio_balloon_feature_map[] =3D { FEATURE_ENTRY(VIRTIO_BALLOON_F_MUST_TELL_HOST, \ "VIRTIO_BALLOON_F_MUST_TELL_HOST: Tell host before reclaiming " @@ -424,19 +397,15 @@ static const qmp_virtio_feature_map_t virtio_balloon_= feature_map[] =3D { "VIRTIO_BALLOON_F_REPORTING: Page reporting VQ enabled"), { -1, "" } }; -#endif =20 /* virtio-crypto features mapping */ -#ifdef CONFIG_VIRTIO_CRYPTO static const qmp_virtio_feature_map_t virtio_crypto_feature_map[] =3D { FEATURE_ENTRY(VHOST_F_LOG_ALL, \ "VHOST_F_LOG_ALL: Logging write descriptors supported"), { -1, "" } }; -#endif =20 /* virtio-iommu features mapping */ -#ifdef CONFIG_VIRTIO_IOMMU static const qmp_virtio_feature_map_t virtio_iommu_feature_map[] =3D { FEATURE_ENTRY(VIRTIO_IOMMU_F_INPUT_RANGE, \ "VIRTIO_IOMMU_F_INPUT_RANGE: Range of available virtual addrs.= " @@ -458,15 +427,11 @@ static const qmp_virtio_feature_map_t virtio_iommu_fe= ature_map[] =3D { "available"), { -1, "" } }; -#endif =20 /* virtio-mem features mapping */ -#ifdef CONFIG_VIRTIO_MEM static const qmp_virtio_feature_map_t virtio_mem_feature_map[] =3D { -#ifndef CONFIG_ACPI FEATURE_ENTRY(VIRTIO_MEM_F_ACPI_PXM, \ "VIRTIO_MEM_F_ACPI_PXM: node_id is an ACPI PXM and is valid"), -#endif /* !CONFIG_ACPI */ FEATURE_ENTRY(VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE, \ "VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE: Unplugged memory cannot = be " "accessed"), @@ -475,10 +440,8 @@ static const qmp_virtio_feature_map_t virtio_mem_featu= re_map[] =3D { "plugged when suspending+resuming"), { -1, "" } }; -#endif =20 /* virtio-rng features mapping */ -#ifdef CONFIG_VIRTIO_RNG static const qmp_virtio_feature_map_t virtio_rng_feature_map[] =3D { FEATURE_ENTRY(VHOST_F_LOG_ALL, \ "VHOST_F_LOG_ALL: Logging write descriptors supported"), @@ -487,10 +450,8 @@ static const qmp_virtio_feature_map_t virtio_rng_featu= re_map[] =3D { "negotiation supported"), { -1, "" } }; -#endif =20 /* virtio/vhost-gpio features mapping */ -#ifdef CONFIG_VHOST_USER_GPIO static const qmp_virtio_feature_map_t virtio_gpio_feature_map[] =3D { FEATURE_ENTRY(VIRTIO_GPIO_F_IRQ, \ "VIRTIO_GPIO_F_IRQ: Device supports interrupts on GPIO lines"), @@ -499,7 +460,6 @@ static const qmp_virtio_feature_map_t virtio_gpio_featu= re_map[] =3D { "negotiation supported"), { -1, "" } }; -#endif =20 #define CONVERT_FEATURES(type, map, is_status, bitmap) \ ({ \ @@ -595,96 +555,66 @@ VirtioDeviceFeatures *qmp_decode_features(uint16_t de= vice_id, =20 /* device features */ switch (device_id) { -#ifdef CONFIG_VIRTIO_SERIAL case VIRTIO_ID_CONSOLE: features->dev_features =3D CONVERT_FEATURES_EX(strList, virtio_serial_feature_map, bitmap= ); break; -#endif -#ifdef CONFIG_VIRTIO_BLK case VIRTIO_ID_BLOCK: features->dev_features =3D CONVERT_FEATURES_EX(strList, virtio_blk_feature_map, bitmap); break; -#endif -#ifdef CONFIG_VIRTIO_GPU case VIRTIO_ID_GPU: features->dev_features =3D CONVERT_FEATURES_EX(strList, virtio_gpu_feature_map, bitmap); break; -#endif -#ifdef CONFIG_VIRTIO_NET case VIRTIO_ID_NET: features->dev_features =3D CONVERT_FEATURES_EX(strList, virtio_net_feature_map, bitmap); break; -#endif -#ifdef CONFIG_VIRTIO_SCSI case VIRTIO_ID_SCSI: features->dev_features =3D CONVERT_FEATURES_EX(strList, virtio_scsi_feature_map, bitmap); break; -#endif -#ifdef CONFIG_VIRTIO_BALLOON case VIRTIO_ID_BALLOON: features->dev_features =3D CONVERT_FEATURES_EX(strList, virtio_balloon_feature_map, bitma= p); break; -#endif -#ifdef CONFIG_VIRTIO_IOMMU case VIRTIO_ID_IOMMU: features->dev_features =3D CONVERT_FEATURES_EX(strList, virtio_iommu_feature_map, bitmap); break; -#endif -#ifdef CONFIG_VIRTIO_INPUT case VIRTIO_ID_INPUT: features->dev_features =3D CONVERT_FEATURES_EX(strList, virtio_input_feature_map, bitmap); break; -#endif -#ifdef CONFIG_VHOST_USER_FS case VIRTIO_ID_FS: features->dev_features =3D CONVERT_FEATURES_EX(strList, virtio_fs_feature_map, bitmap); break; -#endif -#ifdef CONFIG_VHOST_VSOCK case VIRTIO_ID_VSOCK: features->dev_features =3D CONVERT_FEATURES_EX(strList, virtio_vsock_feature_map, bitmap); break; -#endif -#ifdef CONFIG_VIRTIO_CRYPTO case VIRTIO_ID_CRYPTO: features->dev_features =3D CONVERT_FEATURES_EX(strList, virtio_crypto_feature_map, bitmap= ); break; -#endif -#ifdef CONFIG_VIRTIO_MEM case VIRTIO_ID_MEM: features->dev_features =3D CONVERT_FEATURES_EX(strList, virtio_mem_feature_map, bitmap); break; -#endif -#ifdef CONFIG_VIRTIO_I2C_ADAPTER case VIRTIO_ID_I2C_ADAPTER: features->dev_features =3D CONVERT_FEATURES_EX(strList, virtio_i2c_feature_map, bitmap); break; -#endif -#ifdef CONFIG_VIRTIO_RNG case VIRTIO_ID_RNG: features->dev_features =3D CONVERT_FEATURES_EX(strList, virtio_rng_feature_map, bitmap); break; -#endif -#ifdef CONFIG_VHOST_USER_GPIO case VIRTIO_ID_GPIO: features->dev_features =3D CONVERT_FEATURES_EX(strList, virtio_gpio_feature_map, bitmap); break; -#endif /* No features */ case VIRTIO_ID_9P: case VIRTIO_ID_PMEM: diff --git a/hw/virtio/meson.build b/hw/virtio/meson.build index ee397aaf196..d913b94e1ca 100644 --- a/hw/virtio/meson.build +++ b/hw/virtio/meson.build @@ -11,7 +11,7 @@ system_virtio_ss.add(when: 'CONFIG_VHOST_VDPA_DEV', if_tr= ue: files('vdpa-dev.c') =20 specific_virtio_ss =3D ss.source_set() specific_virtio_ss.add(files('virtio.c')) -specific_virtio_ss.add(files('virtio-qmp.c')) +system_virtio_ss.add(files('virtio-qmp.c')) =20 if have_vhost system_virtio_ss.add(files('vhost.c')) --=20 2.52.0 From nobody Mon Feb 9 03:17:06 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1769988706; cv=none; d=zohomail.com; s=zohoarc; b=CXKNxXBwiiTpMq+zzQncXjHrDcBuzIY4YgKveK3YM3hP8szyeoxUAgzP+fAzk7YS7tD2VYR2BcClQiL9ZJdWCTxAoH1iSZsUqaN2B434eh+wZuwhlAUtrDoJxb6iHHA9wwwex2iIA8mEInpJ254xxD+P5dmWZ2KaiFeCl2+CTmI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769988706; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=FazXBSYedPJMCAc2qLR8vcJOR6e+azw1WcJZB+T60Vc=; b=fdbe2Z26zAv3wJ5ZKwg8F/CH5vk/3E+ZyfhxLl63Fumw2wg5TkfwbiPvmyOARXroU8b/hflTu0Fg6VRbr5wwHw9Orc7VxFhQ/Ai9uEURrs6I625VahgDmkdmGTN16DwIk39NJospRkNSqaaq5tz/ISfCjHVyyhXDQ+iMNELK5hY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769988706821155.57939299744658; Sun, 1 Feb 2026 15:31:46 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmguS-0005aZ-VK; Sun, 01 Feb 2026 18:31:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vmgtz-0005NF-Qu for qemu-devel@nongnu.org; Sun, 01 Feb 2026 18:30:50 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vmgtx-0003Yg-Vr for qemu-devel@nongnu.org; Sun, 01 Feb 2026 18:30:47 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4806bf39419so29160345e9.1 for ; Sun, 01 Feb 2026 15:30:45 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-435e13235f5sm38437563f8f.29.2026.02.01.15.30.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 01 Feb 2026 15:30:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769988644; x=1770593444; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FazXBSYedPJMCAc2qLR8vcJOR6e+azw1WcJZB+T60Vc=; b=buXhS0rkZ9pcO2P/LPgaA3OyWb9kxPoX6E+Un8s/EydoYls+ni0vDynunaA8CciIl7 wIYJMpza0mrWCZvFgCf5SJ0kNj8saJTdAF3Ac/TJOfjdcY+S8+4V7trnMf2w8mQPDgWq a0pY1cvI2Kqgbf32Tj14+Uk3ahSPErH2KJpsupXOVUSrTc7jdJ/UoPNJ+acbbh1bDIIF qkPAZAHu0zbcD7M5uJpoYFJrYJVAzxguNy1Vkic1pQAOjmlAC2TQmuR7pQn+JZgrzHMQ B3yZCmeSwHPR51bJJb0iGU1G5EEtRsrMOX+YOGdpeCF9NWJ4cDzds6uWa2KcuC9xO4i4 n/Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769988644; x=1770593444; 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; bh=FazXBSYedPJMCAc2qLR8vcJOR6e+azw1WcJZB+T60Vc=; b=OiTfAG1MIXYDIAWPKIWN09Td1zH82lgVuPBapOjFh281wMpAUaPOv+3Xpw0OUmCt+n V10WkAnPLHJumU2QostJLCLyrhszhF6Gavm6+o1wQYYzGw49YuiKMFp+i/gEsn74OvZ9 yIMOJ7EKLG2AsaIwgXqXtKeIbuawtr7FjrBqg/AfuHn54a6pm0dZCSUreZxsh9nIURuh hePKuHQea9Vph+a1D5hAPhMqp4NimXazerOvN6rRJG3+gMfCv0UjaoV4Gx2LWgDNs+pH x1KfP0LF7yZH3BFwsPxk4NN8dhFUSo1hFTEl2ywhRXXoxKfaZKxOOqlsu1XbggBEbcuz o1NA== X-Gm-Message-State: AOJu0YzPs0wkb+cg59Ku/foQfoT0DJX3qTDZQ5glyEGUwZMUqIAd68Tv 2BO/Rs99IMwpIDbrIBuEI+/ZMiEYlzGg9ZoNy61vh3NVtB+mcVFMfPmKApTbfufc0+CUAv/3xbu OlEN0TR0= X-Gm-Gg: AZuq6aJHx5udO1RMVn/tk3rG+DnpJohqab1Tjq7vlGdtKroJ9GwJPuxf8Y9woQBodtJ 8K/baLXR9Z7Hg70apvJ3Sdi4zgBMIHyEQw9YVyHZ9pGbHe+YC1dowBabVS5T8FQKG5iLndzcaHj d0fNZeUsSRnUoRS8Y2z3Dqn73Nh+UCV4JYDSPyaa29m5v3uuyvWCHcQ5auXlCdXebM9Tr0/jl35 LEtWTTDuAB91ZK04NQVFCoeICDK/x6YYNOJeU3FFQAzSMkxwNrN/53El35CZmeXV7dX8EvRBi7H kCFL5OpQsStSrXkDx+aYzWZHlSTP8zmMvSEc0vEWEpJ5ZPhOmFKwya+tEE2JIYRE6K7Jt4mGc2y ZG2nbvH0UpycDKEqDSEUnpOebMKnosWjpTT5O0qujUTLw6AJ7wjF9GCih7fVO/1B5WHalH16r/f ZMIy6LleocybVDyNlLgM5UW+g0X7pZs6CPBgaOSa0Bp2Hwii18Auo/sDOrQCTx X-Received: by 2002:a05:6000:40da:b0:431:8bf:f08c with SMTP id ffacd0b85a97d-435f42eb489mr13639346f8f.21.1769988643901; Sun, 01 Feb 2026 15:30:43 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Harsh Prateek Bora , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefano Garzarella , "Michael S. Tsirkin" , Pierrick Bouvier , Nicholas Piggin , qemu-ppc@nongnu.org Subject: [PATCH v3 11/11] hw/virtio: make all compilation units common Date: Mon, 2 Feb 2026 00:29:23 +0100 Message-ID: <20260201232924.93399-12-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260201232924.93399-1-philmd@linaro.org> References: <20260201232924.93399-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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 @linaro.org) X-ZM-MESSAGEID: 1769988708499158500 From: Pierrick Bouvier Signed-off-by: Pierrick Bouvier Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/virtio/meson.build | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/hw/virtio/meson.build b/hw/virtio/meson.build index d913b94e1ca..4f308beb961 100644 --- a/hw/virtio/meson.build +++ b/hw/virtio/meson.build @@ -9,8 +9,7 @@ system_virtio_ss.add(when: 'CONFIG_VHOST_VSOCK_COMMON', if_= true: files('vhost-vs system_virtio_ss.add(when: 'CONFIG_VIRTIO_IOMMU', if_true: files('virtio-i= ommu.c')) system_virtio_ss.add(when: 'CONFIG_VHOST_VDPA_DEV', if_true: files('vdpa-d= ev.c')) =20 -specific_virtio_ss =3D ss.source_set() -specific_virtio_ss.add(files('virtio.c')) +system_virtio_ss.add(files('virtio.c')) system_virtio_ss.add(files('virtio-qmp.c')) =20 if have_vhost @@ -52,10 +51,10 @@ endif system_virtio_ss.add(when: 'CONFIG_VHOST_USER_VSOCK', if_true: files('vhos= t-user-vsock.c')) system_virtio_ss.add(when: 'CONFIG_VIRTIO_RNG', if_true: files('virtio-rng= .c')) =20 -specific_virtio_ss.add(when: 'CONFIG_VIRTIO_BALLOON', if_true: files('virt= io-balloon.c')) -specific_virtio_ss.add(when: 'CONFIG_VHOST_USER_FS', if_true: files('vhost= -user-fs.c')) -specific_virtio_ss.add(when: 'CONFIG_VIRTIO_PMEM', if_true: files('virtio-= pmem.c')) -specific_virtio_ss.add(when: 'CONFIG_VHOST_VSOCK', if_true: files('vhost-v= sock.c')) +system_virtio_ss.add(when: 'CONFIG_VIRTIO_BALLOON', if_true: files('virtio= -balloon.c')) +system_virtio_ss.add(when: 'CONFIG_VHOST_USER_FS', if_true: files('vhost-u= ser-fs.c')) +system_virtio_ss.add(when: 'CONFIG_VIRTIO_PMEM', if_true: files('virtio-pm= em.c')) +system_virtio_ss.add(when: 'CONFIG_VHOST_VSOCK', if_true: files('vhost-vso= ck.c')) system_virtio_ss.add(when: 'CONFIG_VIRTIO_MEM', if_true: files('virtio-mem= .c')) system_virtio_ss.add(when: 'CONFIG_VIRTIO_NSM', if_true: files('virtio-nsm= .c')) system_virtio_ss.add(when: 'CONFIG_VIRTIO_NSM', if_true: [files('cbor-help= ers.c'), libcbor]) @@ -97,5 +96,4 @@ system_ss.add(when: ['CONFIG_VIRTIO_MD', 'CONFIG_VIRTIO_P= CI'], =20 system_ss.add(files('virtio-hmp-cmds.c')) =20 -specific_ss.add_all(when: 'CONFIG_VIRTIO', if_true: specific_virtio_ss) system_ss.add(when: 'CONFIG_ACPI', if_true: files('virtio-acpi.c')) --=20 2.52.0