From nobody Wed Nov 27 09:59:42 2024 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=1699268675; cv=none; d=zohomail.com; s=zohoarc; b=S3kuSbpsI41XvkYvfA+GQhqHL8QHgihpRhT9hywk6KpWgps2NpXN2/+7PAm9sNPbeQPmBrtdfl5555jKDDZ20j6arL9bIEiUMqBxFzo2nGOkHWE7Qh2L8G4+cVWZxIuASwpkicTOV2RtAGvaUGwFgZu4QPb7zKwUmTnbekTm+Ss= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699268675; 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=1L9VmGyQhU2xkGMEVSpI4IfVFp3akp+nAwSDeWPJyrs=; b=OlSxH20lxwA+Ulg6Pv887PBQYW3T3RYwD/i9Zrj+zOdNlaXb36uTRLSmgzYUS0sfZk6/CUn3Cd9X5pNYPMOZUlPT4biRwZUDefaB3YhQ9flxJmq8Hha/1lh/EJk5l6GHojWNUCv5cxNpZnPnzpw+AeucAYv2GBKqg46CY9hNkLc= 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 1699268675923577.5699437988092; Mon, 6 Nov 2023 03:04:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxOc-0005nu-TE; Mon, 06 Nov 2023 06:03:54 -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 1qzxOa-0005cs-87 for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:03:52 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxOX-0003dE-ET for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:03:51 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-40836ea8cbaso30715805e9.0 for ; Mon, 06 Nov 2023 03:03:49 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id q8-20020a05600c46c800b0040776008abdsm11817395wmo.40.2023.11.06.03.03.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:03:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268627; x=1699873427; 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=1L9VmGyQhU2xkGMEVSpI4IfVFp3akp+nAwSDeWPJyrs=; b=LIoO2fuQ9OU9oX1Bhu58CpGkOJ9jlhlkr7CtXH1xJDHbrolk2MmD8MduyFUaXaHBNl YyNbNuIZMgI2mymGfLTfJJ7ztjCShWAop2W20ylWQ3xnOzzsQAJn/F2UH/sNNED8K/0+ F4VXiJ6Nu7Dsjrx3prMHRXGa3+CjnMXi2rMA+r55LCDi78wPOzQcvbsLsqTySsSIDk6y 05oS6ShTbo3ZZ93bUxdaNh6Tihkrhp1/t/X7FCCAcN/isYQveeltNjZ4QzAmhkNSwUq8 MK6eM4A0yGuYeCDOjPZkjxARb5O+qI4ofPsiOXGOtQuYRMfWg9XcqIIPKdpPTnFosbLI MURA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268627; x=1699873427; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1L9VmGyQhU2xkGMEVSpI4IfVFp3akp+nAwSDeWPJyrs=; b=JusNo9yUYqB4mTyzq3PsbL0ylrh44uJlO8tDASySVpUj1p3QlrFnOCesYk6uCNSdb2 3C5w/EmLbcibTvqNltoRrrvxWlx+wMjavTj5Yc9fSvKYVddh4uCIERgqN2bVPO1pyRK4 4/NyuCHFyTywgRANtpdc5KDe6RSG4Afdu/Zzk7I3bp7pCmkxGQYGra5gNmCj6D5Pev2S GsOQCxKAhw7fYKp1AhronbiyoklvOIOGKBINQtF72VyXxYL6LyI20RNbVGyAA/qOOghM E9R1uNAgDnvHOzSMIl8/VLR/vXzOdVFqebfrLHjE1ySRK5tK62LVEfybzxZzpbW2veQQ qp8Q== X-Gm-Message-State: AOJu0YzFjzyHFmFM6Oz+dJv2V4oHyVLSE4A9Zn+CZ8xmEfaVYDb0Fr+T IZwr+PSXnDXgMktF/smT4F9VTmwa4/wVAalKK6o= X-Google-Smtp-Source: AGHT+IGVsR41OZiJW09UO8f2QQjHedYyrhNpAeIFY/pbatQ8PPEnpOP8OnIgt0CWNcPde4ZS+yy1Rw== X-Received: by 2002:a05:600c:19ca:b0:406:8c7a:9520 with SMTP id u10-20020a05600c19ca00b004068c7a9520mr22789124wmq.36.1699268625910; Mon, 06 Nov 2023 03:03:45 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Akihiko Odaki , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini Subject: [PULL 01/60] vl: Free machine list Date: Mon, 6 Nov 2023 12:02:33 +0100 Message-ID: <20231106110336.358-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699268676604100002 From: Akihiko Odaki Free machine list and make LeakSanitizer happy. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20230722062641.18505-1-akihiko.odaki@daynix.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- system/vl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system/vl.c b/system/vl.c index 3fb569254a..ff76eb0d07 100644 --- a/system/vl.c +++ b/system/vl.c @@ -1529,7 +1529,8 @@ static gint machine_class_cmp(gconstpointer a, gconst= pointer b) =20 static void machine_help_func(const QDict *qdict) { - GSList *machines, *el; + g_autoptr(GSList) machines =3D NULL; + GSList *el; const char *type =3D qdict_get_try_str(qdict, "type"); =20 machines =3D object_class_get_list(TYPE_MACHINE, false); --=20 2.41.0 From nobody Wed Nov 27 09:59:42 2024 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=1699268675; cv=none; d=zohomail.com; s=zohoarc; b=M2DgTV/pawl59D3jT6EIjNdmWlPWPKuft1lpYVWonkZg9rlLtMYcTZooLB3ov+51zv7ZTjxMSFnkSvxxA5g1kQcxDOdWDEmbExUfKK857YDDEmfSnRJJQGHkvqyPAJpzzbiyj/rFOsHnVa0W1l+OrJo2mIQqTHU9YFPqrugKYxc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699268675; 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=d9nIh4jZ3rUpsBw4LSZSNiaZI1TuJJRNoEVBCo+5kN8=; b=U7ec5uT7IGIUNnaKJ1G5OhqpHbCFGFvaGrtYuTCKUTCCpKatPaYWDSlL7gGrwK4Tbi9nEgiFp6Fj/ThaM7GYgbUF4tgUXJ5KygORCh5+rihRsaLXsA8qCxLQm06i7zco4DLptDzJt44bHmSDsbig96xkkH8B9Q70Wi4tKWrZbMU= 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 1699268675084132.13032652843697; Mon, 6 Nov 2023 03:04:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxOi-0005xr-6L; Mon, 06 Nov 2023 06:04:00 -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 1qzxOf-0005t7-Tj for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:03:57 -0500 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxOd-0003ef-6Y for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:03:57 -0500 Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-507f1c29f25so5576573e87.1 for ; Mon, 06 Nov 2023 03:03:54 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id p12-20020adfce0c000000b0032dc1fc84f2sm9188671wrn.46.2023.11.06.03.03.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:03:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268633; x=1699873433; 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=d9nIh4jZ3rUpsBw4LSZSNiaZI1TuJJRNoEVBCo+5kN8=; b=EZIH/H0s97wWfUIPaXzcEEcqaaarDAJnoo8Gmvjoh4RpMpoL/YsHjrB0FprkKHYsxo uvcRgZ3prKQfXDsgFP6FOZ2UbCYtEc1k7XDlTVWW4X5FklABIMVb/oxLCJ9PsJcqrq5o Y+Wf5+4/QU/p7HXwdt9nmb3rL+q6mEkUNgtKtWXLiKVXCNo4QmV0UZG7dp7T5kbzJwzO z43nCYy7pgl9ss7FlhThUVeDW4IQOJVenHG28F72E886aNqOujy+wZCMTkjLpbp6Nd6Z auUeMhVAK4h14BrCY1Opnz+MQEH2xd6igDmeMGvUa4oJy07jbYIlxcQgjLm3L/xyY4uQ Ul+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268633; x=1699873433; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=d9nIh4jZ3rUpsBw4LSZSNiaZI1TuJJRNoEVBCo+5kN8=; b=g+E/o798t/hn4ER/q55lmk7LLtu4phKW87AmTvgQ3XRHoMxVakECqAlvTMf/6/YYzc TVmJqQIeuUY84nMgDj9jSFcO4z1ElgRbEnzwmNBUXWsjcPAkcwcR7AsuzGUCeGlgDH5F f2hfi8HOfHfcCtRJOOKxfco7BYEOJo27R/b9vv8FseElWqpu2ZCo9TOJ6K82JivkV26A o9ANtYBXyaZx/NPA9A8O5xBQX9C7i6R3mRBlyhKHF9Sriz6rPc/UHctPE41XTrGJSp97 1Mq+Ug0DDTgi6Me5vB8PYJLqeSavpnxYiBlG3r+sUeUE8o3w4A1ZxwEGREQrGmz/+L6C Fj9Q== X-Gm-Message-State: AOJu0Yz/RvqMCHrpdbQYJGEfqBPsCIK+YsP3uvFZUH4rrvfkvcBaepCP hDwW+Jzm+Vm85xeM0tPCJ9p1/b2DxrHWyyAzPd0= X-Google-Smtp-Source: AGHT+IExKZ0rki8Pzt9Fq9bSXa3p5OpCW6d2acd5GD6zgVvNcXpLdpP4uLK9kjEGGioQ4HTvFd820g== X-Received: by 2002:ac2:51b0:0:b0:500:b7ed:105a with SMTP id f16-20020ac251b0000000b00500b7ed105amr19847445lfk.29.1699268633369; Mon, 06 Nov 2023 03:03:53 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini Subject: [PULL 02/60] vl: constify default_list Date: Mon, 6 Nov 2023 12:02:34 +0100 Message-ID: <20231106110336.358-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::135; envelope-from=philmd@linaro.org; helo=mail-lf1-x135.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699268676592100001 From: Marc-Andr=C3=A9 Lureau It's not modified, let's make it const. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231030101529.105266-1-marcandre.lureau@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- system/vl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/vl.c b/system/vl.c index ff76eb0d07..8c803228f4 100644 --- a/system/vl.c +++ b/system/vl.c @@ -194,7 +194,7 @@ static int default_sdcard =3D 1; static int default_vga =3D 1; static int default_net =3D 1; =20 -static struct { +static const struct { const char *driver; int *flag; } default_list[] =3D { --=20 2.41.0 From nobody Wed Nov 27 09:59:42 2024 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=1699268923; cv=none; d=zohomail.com; s=zohoarc; b=BuNjB9jU6nbytMC7Fa9Jdbem7VcOH8uOAFNflub6d6c/l/OuJbUVqpc0ZTO/X0hXXg1tTGW7W5ue6k87SuIc7JVdm6Ru5Q18/iIHeQJpaagBaZ8mYyIFtbb2ISrU66U/EFs0iO7xCMDwOKHnmKBuv4eRjfbeZGYm3AuIPFCTNKk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699268923; 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=OPtEnXMJWXTavrW+hTGrjLz6IdGpJzROhuSvymabGIo=; b=cALMifPherkNx/tDl/C3H6MLQInxaj2JayZ/WJueHn7PnVI0C2iBjhHc1w8QY+1bnLjhh8GTCT08u6PxEDh7mIPtosmMBZyCHGAdeKzlW0j61SD1Gf/3x3GkbDpfsszPzJ2LROaYdtFFDNjD7UqxszJmkfH9QV+KlOBJnKm4Rzk= 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 1699268922997245.70495018595147; Mon, 6 Nov 2023 03:08:42 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxOr-00069c-PM; Mon, 06 Nov 2023 06:04:14 -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 1qzxOm-000644-K1 for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:04:04 -0500 Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxOk-0003gS-Ly for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:04:04 -0500 Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2c5629fdbf8so53865771fa.0 for ; Mon, 06 Nov 2023 03:04:02 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id l10-20020adff48a000000b0032fdcbfb093sm19447wro.81.2023.11.06.03.03.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:04:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268640; x=1699873440; 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=OPtEnXMJWXTavrW+hTGrjLz6IdGpJzROhuSvymabGIo=; b=p9co09EvtEhyV+0iMFvP8l/SD6Zri4nNAVsabpDWHywl4jXrqKB48H3ttuYAKNrMFy LQ1VkvMJEYiEWlOMZauNo763B0962SlMVQ+YqXHuA/6lhz6jBZ+/3QUZRDM4ZSXTYnMC ESKPz+t+8v0S+8t+UVtw4tYcmJeTf7rIPB4exwjgWSBglgYwktNRwX9fTubURCf+eOSK CBjmG2kMoFf4rlH6XFR2N70fhK3pjbqBv7KulUNcm+UoiLVD7V5D/xH2CIxL37ghkM9b aM8QVK4xi0qHMsZGSCaDzwMEAsLl5arOzatiiOGbvYtXpsvE0b2boP12YIRhiWTgbyAv cu1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268640; x=1699873440; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OPtEnXMJWXTavrW+hTGrjLz6IdGpJzROhuSvymabGIo=; b=cQKIiiJR+59ECXpAZ1n2HK0RNKAkQA62zB5X+NZDqp9zX3NJ1BYrcI4P/cDOK1765T X7nIRQ2PMsA9fTjSxFfZPaVkrstjSY61pNRJtHXLO20wjHhItdlr/POLXZ2P3aeNlBA/ wjKu8klrUDOikdLuAAx5bUZzvYkHiEgsxddE9svYbjS3x3SC/aUPzFTslHK9e1juwU3P sYL2xmRholJAq9kiHQS4EvGsxG9/QhMajkrBe37KAlhTnkX+IQmrgbHX/SsAWzlruQwI OuYVHRz/DtiUbHr57JjibYvJhskVHhS/KLs84MRVYRsuOyJofXug/n5Crkeq2rHCqhS5 c/cg== X-Gm-Message-State: AOJu0Yx3w6NTJ0irz2b13kz8ndkZ6YoMVugBUQA/7xv8JndIOAY48Qtx yGvmvZ08XezwpnNEOhMxwfkeOX/tY+zB/ytgXfI= X-Google-Smtp-Source: AGHT+IHnmaFN+GKLxd2N49xPwJp/PkOfW8YFcpTs0zHKDnkUPvcBfxvj2jLWyUiBIPgGTifMjl5zjg== X-Received: by 2002:a05:6512:1282:b0:505:6ede:20a9 with SMTP id u2-20020a056512128200b005056ede20a9mr26978590lfs.65.1699268640437; Mon, 06 Nov 2023 03:04:00 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal Subject: [PULL 03/60] tests/vm/ubuntu.aarch64: Correct comment about TCG specific delay Date: Mon, 6 Nov 2023 12:02:35 +0100 Message-ID: <20231106110336.358-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::22d; envelope-from=philmd@linaro.org; helo=mail-lj1-x22d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699268923723100001 Wether we use a software MMU or not to set the SSH timeout isn't really relevant. What we want to know is if we use a hardware or software accelerator (TCG). Replace the 'softmmu' mention by 'TCG'. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson Message-Id: <20231002145104.52193-2-philmd@linaro.org> --- tests/vm/ubuntu.aarch64 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/vm/ubuntu.aarch64 b/tests/vm/ubuntu.aarch64 index 666947393b..eeda281f87 100755 --- a/tests/vm/ubuntu.aarch64 +++ b/tests/vm/ubuntu.aarch64 @@ -25,7 +25,7 @@ DEFAULT_CONFIG =3D { "apt-get install -y libfdt-dev pkg-config language-pa= ck-en ninja-build", # We increase beyond the default time since during boot # it can take some time (many seconds) to log into the VM - # especially using softmmu. + # especially using TCG. 'ssh_timeout' : 60, } =20 --=20 2.41.0 From nobody Wed Nov 27 09:59:42 2024 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=1699268843; cv=none; d=zohomail.com; s=zohoarc; b=UFvU8dnXQ1hXDwuxEmjxQ68KBnUIr0PyTzK5txUEbWclI+G1guxBhryx/ZupwC7rxO4EJjQ7rHpwvYDrIDvkituyhcwoIATAKn4TDRHuO52pQcFwcFI4qdPb5UHt6eHFFtnZ/O9xsRR6d0HelihIN78v2p0OCbgtfyDeQz8bt0I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699268843; 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=th3yfEu9dsqZLmfk3I95d9IkQeEp24N2k4ODPshVYkY=; b=cmB4hWTqLjVuyJMK8pFA/JCFhnu1NRewNQj27mqdLMoLC60LzjBrIee7fSaZ22ewcjf62MFM+bJLsNwc4ZwCxNL/L0Hfc48GOmbVAnhhI5PSU7EQEev5iO0L6V5ZGqfPMm3XTQ1kDDYSUGHdDZDXc5HugLzxqgQz3BBJpPougN0= 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 1699268843572957.2384495869584; Mon, 6 Nov 2023 03:07:23 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxPF-0006aL-SS; Mon, 06 Nov 2023 06:04:33 -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 1qzxP5-0006Ir-IW for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:04:27 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxOs-0003if-Dj for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:04:19 -0500 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-32da9ef390fso2661117f8f.2 for ; Mon, 06 Nov 2023 03:04:08 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id k13-20020a5d6e8d000000b003196b1bb528sm9094731wrz.64.2023.11.06.03.04.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:04:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268647; x=1699873447; 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=th3yfEu9dsqZLmfk3I95d9IkQeEp24N2k4ODPshVYkY=; b=C3qkbzKHqKUp/q4CUgwwYnzNK8GmiuJJTQTYaoQ39Nk3RCg/Y4jsM7Bx3MjCxMZhx8 /caCjzgDW403J9uBXQXQOzBgKpt0PWTLxmZydvhNSBglbdlZ85S/h73ZO6unbJcC4qYL jKopi56eaxG2EORedykf5TVdzGeHILjSCz/X1MKkCcp1yuXX2+lMe8Uofw3zEXFf2BvA fyeq0vuq6637lm59BRlhfeobpX6/V/oS5UCSFGHS8LaZ8Olv+swqDNNiUrEebmchQkiH 73YGL8x6peeAYPpmTp93T9bdaEiiVO+AeYXejDrJn5a5Xjou9V1oOjEf9RJLw1E7Qbsv qOPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268647; x=1699873447; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=th3yfEu9dsqZLmfk3I95d9IkQeEp24N2k4ODPshVYkY=; b=Tx+sRlLkKV5KZLkZdtK3DUlKZq4c2FoQA4ddaLdI6rynJvJLWtApWhOL+0XGv+NLWZ 0UEmbyYbgrcsUKn7GGBFutCO73iE61Yfyk5ZT2CYZvW3kqvlgu+RqSCdCHNkfsjwcbEv zVoMWBb0UfWVjKn8gl/SgqjpPZ6DWripk4GOR4tKsxlE4vAe07722ou3iWQfFACo47+X QUuqxwN9u0f5wBbh0YJJ2PxpRWbnut39DP++LhKBKEf8cDIAUtn2JTRg6n8EBHOSSpvb ksT79hvB1e4xpDAplebj7dlJDTNubVka4JY+lCsarDaE6eQWThLSbxr01sX6051t4dJn REKw== X-Gm-Message-State: AOJu0YxddJNF8MMcSMW4JMl8QoJ6OuB1LiEejfegpYR/kXDl5X4n+1zJ w/11aP5KVDhDL+uh8e/RZw06b+pc7D4VUnE0dmE= X-Google-Smtp-Source: AGHT+IHAXSkBUxdCa+OOuf1KcH7iclZXA5c2IEfRwgd7qngftXdgZjVXH3qTMwMRLHD15LdpD+DqZg== X-Received: by 2002:adf:fd82:0:b0:32d:9a87:b7a with SMTP id d2-20020adffd82000000b0032d9a870b7amr17402964wrr.50.1699268646998; Mon, 06 Nov 2023 03:04:06 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 04/60] tests/unit/test-seccomp: Remove mentions of softmmu in test names Date: Mon, 6 Nov 2023 12:02:36 +0100 Message-ID: <20231106110336.358-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699268845373100007 Wether we are using a software MMU or not is irrelevant for the seccomp facility. The facility is restricted to system emulation, but such detail isn't really helpful, so directly drop the 'softmmu' mention from the test names. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20231002145104.52193-3-philmd@linaro.org> --- tests/unit/test-seccomp.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/unit/test-seccomp.c b/tests/unit/test-seccomp.c index f02c79cafd..bab93fd6da 100644 --- a/tests/unit/test-seccomp.c +++ b/tests/unit/test-seccomp.c @@ -229,26 +229,26 @@ int main(int argc, char **argv) g_test_init(&argc, &argv, NULL); if (can_play_with_seccomp()) { #ifdef SYS_fork - g_test_add_func("/softmmu/seccomp/sys-fork/on", + g_test_add_func("/seccomp/sys-fork/on", test_seccomp_sys_fork_on); - g_test_add_func("/softmmu/seccomp/sys-fork/on-nospawn", + g_test_add_func("/seccomp/sys-fork/on-nospawn", test_seccomp_sys_fork_on_nospawn); - g_test_add_func("/softmmu/seccomp/sys-fork/off", + g_test_add_func("/seccomp/sys-fork/off", test_seccomp_sys_fork_off); #endif =20 - g_test_add_func("/softmmu/seccomp/fork/on", + g_test_add_func("/seccomp/fork/on", test_seccomp_fork_on); - g_test_add_func("/softmmu/seccomp/fork/on-nospawn", + g_test_add_func("/seccomp/fork/on-nospawn", test_seccomp_fork_on_nospawn); - g_test_add_func("/softmmu/seccomp/fork/off", + g_test_add_func("/seccomp/fork/off", test_seccomp_fork_off); =20 - g_test_add_func("/softmmu/seccomp/thread/on", + g_test_add_func("/seccomp/thread/on", test_seccomp_thread_on); - g_test_add_func("/softmmu/seccomp/thread/on-nospawn", + g_test_add_func("/seccomp/thread/on-nospawn", test_seccomp_thread_on_nospawn); - g_test_add_func("/softmmu/seccomp/thread/off", + g_test_add_func("/seccomp/thread/off", test_seccomp_thread_off); =20 if (doit_sched() =3D=3D 0) { @@ -256,11 +256,11 @@ int main(int argc, char **argv) * musl doesn't impl sched_setscheduler, hence * we check above if it works first */ - g_test_add_func("/softmmu/seccomp/sched/on", + g_test_add_func("/seccomp/sched/on", test_seccomp_sched_on); - g_test_add_func("/softmmu/seccomp/sched/on-nores", + g_test_add_func("/seccomp/sched/on-nores", test_seccomp_sched_on_nores); - g_test_add_func("/softmmu/seccomp/sched/off", + g_test_add_func("/seccomp/sched/off", test_seccomp_sched_off); } } --=20 2.41.0 From nobody Wed Nov 27 09:59:42 2024 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=1699269970; cv=none; d=zohomail.com; s=zohoarc; b=JVdsQG4/Ia1imEm7+7BcxCgkO8YNbkXaeolFVoDfTf5OhF03bhgIdo4TkBLeGZ6OYYKzBZk1JI5/aApbalohBoICBmZnSq48yM1aMcZbJDpd69t4GrZwlKEZqibTvpXOIhF+EAh8YEZl6skAgwTZbFXJifv9jHu6Yjcr3q8ePfE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699269970; 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=e2dhS3KlkYuIzlj4JyHbDi+Agmw3+gkCUCmK+83aHSA=; b=AVh2iQ4hY1I1T7yh1mOuDiFTunLvrHpJx8j1mIpA6YBN4ee/5ihYAdkgoQZ0aBgKwGIcC1DlrJBW8cvLrct9eKsNQDWp1t/Inl1ZUWRPxpbNMjH+k98yuCiZfbaxvP+0mScQaWcIPHmOZA6hslxylZZKVfxUD2ZinsQwmiaB4tU= 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 1699269970122731.7896517790701; Mon, 6 Nov 2023 03:26:10 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxPE-0006T8-9A; Mon, 06 Nov 2023 06:04:32 -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 1qzxP7-0006JG-L7 for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:04:29 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxOz-0003ku-K4 for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:04:25 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-40853c639abso32189175e9.0 for ; Mon, 06 Nov 2023 03:04:15 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id n26-20020a1c721a000000b0040849ce7116sm11652236wmc.43.2023.11.06.03.04.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:04:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268654; x=1699873454; 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=e2dhS3KlkYuIzlj4JyHbDi+Agmw3+gkCUCmK+83aHSA=; b=zM/lSLDJZoWrUiPfLiWEm6JPS513QZiUswjJ6zyMleaP/eHaI2O0GUWmvdkucXiBPr LebUnms051R2VgoFf9n4R8EGTqrj/WBwfYHUuSvDNbPZpb955Vf6+Bv8zanCr3zy4G+N ZT8XjJ1pvQFEOyl8fdDoDNwjL+YX/Pd3XTGkm/lJ3gdK9FgGNovzoYchkEijf/zsNqtI a1XL0uS6e+FWltNf14UH1yrWuwqwqprP4eCyAkNmGDBQvNIu9CN4rZoCdqTEhgCzm1if kG3J49GpiGILaCXfybJL0tjAdBvP2rOLQoY3c/1g67sQckUFuF4sb+tVrpgQwKPHYTTG JbUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268654; x=1699873454; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=e2dhS3KlkYuIzlj4JyHbDi+Agmw3+gkCUCmK+83aHSA=; b=uSO5ijcCgXPefoWnGKHJv7ufqcEK1NpBstdGspFokSFLLJLL3X0F+XOiQr51UpbFfJ 90PnBGYs/r1wNnCcStw1hYWdGoFW6MOdSSGkhPUgbQifjpkYYbT+8Fti1Spv5sfdezuP wr5B5cVRPDSV6Fpmcx+2KrX6SX/rPk+07ihg6UKGrob7hUzPtY8ldCfwd76vcecbkRC8 iUwqvdfdNkYqc3dIVr9b3zQrrjb75JFhdX5anAbaf/RKiBkImlui+57VBIeKOG2xlUzs tMfU23crazA8ubrjjtS5EEvtbWj69lQfebzeNY7YxoNUYYJQJmJ/4EKYkyv0imKvph94 BhLg== X-Gm-Message-State: AOJu0YwSCyXHS9OloyrvuEP5zEOJwuGPBgOfYWXkzWxPtn/q/5cC0lry 3aYoUDL6/eB+hmSqTzCohthnbQFP8mJV7q81Bbs= X-Google-Smtp-Source: AGHT+IEBVIn/0r+UoLYA97Mnp+piCsSmfP4bBhuQ8Q479GVHXuAJkDevEs+mH3EZ9a+ZFr4LoWGeXw== X-Received: by 2002:a05:600c:5116:b0:409:2825:6dd5 with SMTP id o22-20020a05600c511600b0040928256dd5mr23574505wms.13.1699268653839; Mon, 06 Nov 2023 03:04:13 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Anton Johansson , Richard Henderson , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Alexandre Iooss , Mahmoud Mandour Subject: [PULL 05/60] accel/tcg: Declare tcg_flush_jmp_cache() in 'exec/tb-flush.h' Date: Mon, 6 Nov 2023 12:02:37 +0100 Message-ID: <20231106110336.358-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699269971964100003 "exec/cpu-common.h" is meant to contain the declarations related to CPU usable with any accelerator / target combination. tcg_flush_jmp_cache() is specific to TCG, so restrict its declaration by moving it to "exec/tb-flush.h". Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Anton Johansson Reviewed-by: Richard Henderson Message-Id: <20230918104153.24433-2-philmd@linaro.org> --- include/exec/cpu-common.h | 1 - include/exec/tb-flush.h | 2 ++ accel/tcg/cputlb.c | 1 + accel/tcg/tcg-accel-ops.c | 1 + hw/core/cpu-common.c | 1 + plugins/core.c | 1 - 6 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h index 30c376a4de..f700071d12 100644 --- a/include/exec/cpu-common.h +++ b/include/exec/cpu-common.h @@ -46,7 +46,6 @@ void cpu_list_unlock(void); unsigned int cpu_list_generation_id_get(void); =20 void tcg_flush_softmmu_tlb(CPUState *cs); -void tcg_flush_jmp_cache(CPUState *cs); =20 void tcg_iommu_init_notifier_list(CPUState *cpu); void tcg_iommu_free_notifier_list(CPUState *cpu); diff --git a/include/exec/tb-flush.h b/include/exec/tb-flush.h index d92d06565b..142c240d94 100644 --- a/include/exec/tb-flush.h +++ b/include/exec/tb-flush.h @@ -23,4 +23,6 @@ */ void tb_flush(CPUState *cs); =20 +void tcg_flush_jmp_cache(CPUState *cs); + #endif /* _TB_FLUSH_H_ */ diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index b8c5e345b8..6ea95ca03c 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -24,6 +24,7 @@ #include "exec/memory.h" #include "exec/cpu_ldst.h" #include "exec/cputlb.h" +#include "exec/tb-flush.h" #include "exec/memory-internal.h" #include "exec/ram_addr.h" #include "tcg/tcg.h" diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index d885cc1d3c..7ddb05c332 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -34,6 +34,7 @@ #include "qemu/timer.h" #include "exec/exec-all.h" #include "exec/hwaddr.h" +#include "exec/tb-flush.h" #include "exec/gdbstub.h" =20 #include "tcg-accel-ops.h" diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index bab8942c30..29c917c5dc 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -27,6 +27,7 @@ #include "qemu/main-loop.h" #include "exec/log.h" #include "exec/cpu-common.h" +#include "exec/tb-flush.h" #include "qemu/error-report.h" #include "qemu/qemu-print.h" #include "sysemu/tcg.h" diff --git a/plugins/core.c b/plugins/core.c index fcd33a2bff..49588285dd 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -21,7 +21,6 @@ #include "qemu/xxhash.h" #include "qemu/rcu.h" #include "hw/core/cpu.h" -#include "exec/cpu-common.h" =20 #include "exec/exec-all.h" #include "exec/tb-flush.h" --=20 2.41.0 From nobody Wed Nov 27 09:59:42 2024 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=1699268816; cv=none; d=zohomail.com; s=zohoarc; b=ZXeyoOcAdRA9763aYdmzNwcpPoACumkPXGyzaRhn9ODzbOh9cnii2l1qNa4BV5MDlg1V11YkyfVvb+gxGB8C20lrpDdZvlnUZKF5sgRgUhTacyZLL1pGJhI0JvHmwLUv4zF55yxLZE8KAENmvxRfnnqITg0bahAxGU+3+PN9tQI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699268816; 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=vBU4Pso0gSsGUJn6Y+tUxfBbchAwyEFBu11FifHIio4=; b=hmmLdnlnM/DXvrXHHvev+wuSTNOFT4iDuZVcREnE80vgK606wE4yKtZXcGpxJGqBnGyTHCOsPi08FM9vPUHkcLXIAYzT2VibDfeOP7IJkhvQqBAkhyw9L/Dkw3vqghZS2NPrh+0HiILBeAX9OvGIeG30+qucEz66AVCTVwZFDyU= 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 169926881652348.1691590946366; Mon, 6 Nov 2023 03:06:56 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxPO-0006rR-PZ; Mon, 06 Nov 2023 06:04:42 -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 1qzxPK-0006kg-I4 for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:04:40 -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 1qzxP7-0003lv-Cx for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:04:37 -0500 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-4083f61312eso33502425e9.3 for ; Mon, 06 Nov 2023 03:04:21 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id g20-20020a05600c4ed400b003fee8793911sm12010027wmq.44.2023.11.06.03.04.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:04:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268660; x=1699873460; 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=vBU4Pso0gSsGUJn6Y+tUxfBbchAwyEFBu11FifHIio4=; b=Z8lKU3NJxTdKZ97dZh4jm5cl3iptXXrfEQq5bveHNK1z7hyV+t8aIUkPg5Rj41AfZU zTSwHWjrJDnAhfhCm45HyKVLLU2VM1//YbFunZyw5PLCxjruO9ZaLAxTNc8szuKheh9w YuNlwcPjfyP5vjyZWC5QSwQ3WHh2XodaiYLI8DENc/3PVstRfc6A0mVez8ar6mqoXQKY xCdJ41dHgWkSofHqomJ34PdhUfJ5rsTpMz68RNw2JbSuuCKw9KqsY8JYBXW4C0LfBDdm pyIvdxdgNts8nWZI7MAsS/KJCNdXM4ophvBrhllPFmDRnVqcNuvTk85sRph0K22k01oa aq5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268660; x=1699873460; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vBU4Pso0gSsGUJn6Y+tUxfBbchAwyEFBu11FifHIio4=; b=R5pcf9N1TVWrTC3s07UshzxF+8hfjbGp0cldnQIxQlINNDHh4lpDSdeGM7iPG9UJ1m JoEFIJ6DEMIKR1eNoifEIvk12mOpULWfII0qxQ8TrviALpcE4uzK2QdoTevFx0MhImE4 PVNVo7REiWfE9R/IEusVFxu4XQxJ6Rf+9I7PDWlTfyncCFOGuvMDnCX/lhAmPq0MyOqx /cBG1WZ+1DPhP7H8ChjzC4JyzteDYguIOLZlUPMUUOOBmu8meURFkvj2Ce6t0EKZOEgp XkkCqIOQUr8hPnNHtQXKAC9dfyqawel5AKjS85esdOZfvKQ/GM79cT7WG7PwS+g2wYTC hB3w== X-Gm-Message-State: AOJu0YyF7kKKhyFCrfOBcrN+ZhjGLEuk8dK1PJTnfG7LnmOsrwNxXpHu n950uNvtGSOvGX3IO2BaG7+q6tpXyCchnSkqocU= X-Google-Smtp-Source: AGHT+IFNaWNTXm6/JgnRLDfhCwlt529RJlrSNb5hfX6nFr1uBzGpsDlgEDrmBYL8mOG8EZ2XGLOTgg== X-Received: by 2002:a05:600c:1906:b0:408:3b8d:f7e8 with SMTP id j6-20020a05600c190600b004083b8df7e8mr24996294wmq.33.1699268660546; Mon, 06 Nov 2023 03:04:20 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Anton Johansson , Richard Henderson , Riku Voipio , Paolo Bonzini , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 06/60] accel: Introduce cpu_exec_reset_hold() Date: Mon, 6 Nov 2023 12:02:38 +0100 Message-ID: <20231106110336.358-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699268817119100001 Introduce cpu_exec_reset_hold() which call an accelerator specific AccelOpsClass::cpu_reset_hold() handler. Define a stub on TCG user emulation, because CPU reset is irrelevant there. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Anton Johansson Reviewed-by: Richard Henderson Message-Id: <20230918104153.24433-3-philmd@linaro.org> --- include/hw/core/cpu.h | 1 + include/sysemu/accel-ops.h | 1 + accel/tcg/user-exec-stub.c | 4 ++++ hw/core/cpu-common.c | 1 + system/cpus.c | 7 +++++++ 5 files changed, 14 insertions(+) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 18593db5b2..6373aa4501 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -1153,6 +1153,7 @@ void cpu_class_init_props(DeviceClass *dc); void cpu_exec_initfn(CPUState *cpu); void cpu_exec_realizefn(CPUState *cpu, Error **errp); void cpu_exec_unrealizefn(CPUState *cpu); +void cpu_exec_reset_hold(CPUState *cpu); =20 /** * target_words_bigendian: diff --git a/include/sysemu/accel-ops.h b/include/sysemu/accel-ops.h index 3c1fab4b1e..ef91fc28bb 100644 --- a/include/sysemu/accel-ops.h +++ b/include/sysemu/accel-ops.h @@ -30,6 +30,7 @@ struct AccelOpsClass { void (*ops_init)(AccelOpsClass *ops); =20 bool (*cpus_are_resettable)(void); + void (*cpu_reset_hold)(CPUState *cpu); =20 void (*create_vcpu_thread)(CPUState *cpu); /* MANDATORY NON-NULL */ void (*kick_vcpu_thread)(CPUState *cpu); diff --git a/accel/tcg/user-exec-stub.c b/accel/tcg/user-exec-stub.c index 2dc6fd9c4e..4fbe2dbdc8 100644 --- a/accel/tcg/user-exec-stub.c +++ b/accel/tcg/user-exec-stub.c @@ -14,6 +14,10 @@ void qemu_init_vcpu(CPUState *cpu) { } =20 +void cpu_exec_reset_hold(CPUState *cpu) +{ +} + /* User mode emulation does not support record/replay yet. */ =20 bool replay_exception(void) diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index 29c917c5dc..7d266c36ac 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -137,6 +137,7 @@ static void cpu_common_reset_hold(Object *obj) cpu->crash_occurred =3D false; cpu->cflags_next_tb =3D -1; =20 + cpu_exec_reset_hold(cpu); if (tcg_enabled()) { tcg_flush_jmp_cache(cpu); tcg_flush_softmmu_tlb(cpu); diff --git a/system/cpus.c b/system/cpus.c index 0848e0dbdb..952f15868c 100644 --- a/system/cpus.c +++ b/system/cpus.c @@ -201,6 +201,13 @@ bool cpus_are_resettable(void) return true; } =20 +void cpu_exec_reset_hold(CPUState *cpu) +{ + if (cpus_accel->cpu_reset_hold) { + cpus_accel->cpu_reset_hold(cpu); + } +} + int64_t cpus_get_virtual_clock(void) { /* --=20 2.41.0 From nobody Wed Nov 27 09:59:42 2024 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=1699268797; cv=none; d=zohomail.com; s=zohoarc; b=gY/vHGZjxgvY5A44CO6UguM3UP6a7iYgtjyU3J89lFHdgkGKz101dH/AeU1irBb9LGj44gMMrejEi2Y8LtUPKZQKH0WgwM60H0BjRvTWrZA3Tv53Af+def3nHcIe+hqILitrPvy4NyausWJXnvY1eqHisemTQhJsKH/TqSny9D8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699268797; 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=599/Bj9mord/rWtxWCsNHAuRNbZVNvVu72yn9cQly6g=; b=SSzngNkTQB8XESVHzq/auj8GC4YOYqAXxMey2SY4wc+/4RGsB7+R+G4PawMBFJgi0Peef7GGc8nk3pNxRdnfeUCVRXHEEiuRKL7NK140GCzQK2juIzLN6lSpd7Y0R1qzHno27djejM2sH2KtAdUqWiWUQyritKxadRez/vTy+ec= 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 1699268797531237.65212669707034; Mon, 6 Nov 2023 03:06:37 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxPO-0006pA-63; Mon, 06 Nov 2023 06:04:42 -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 1qzxPF-0006Xx-2e for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:04:33 -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 1qzxPB-0003nF-4W for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:04:32 -0500 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-40839652b97so32697765e9.3 for ; Mon, 06 Nov 2023 03:04:28 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id s7-20020a05600c45c700b003fc16ee2864sm11816561wmo.48.2023.11.06.03.04.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:04:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268667; x=1699873467; 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=599/Bj9mord/rWtxWCsNHAuRNbZVNvVu72yn9cQly6g=; b=Yxgy1zQGP+Iyqy4ROUU1gtZZj/ITd4ikqfV+CeUXLztYdTcbVzE8Xu5D8BEJYXX0ce e5AunMIoSvXr/bXwcQklmj4zO6DV09oUeLNUONgBDGne8vciEdyUAh/jDCPhYRGE8hx3 sHd+eICPeJyVa8zkAVecr0kmjFx+Ccn0n1wb/CCUJ9oJu9kIzADrHSuHhdw8vd8ZD1d1 ur8KpY8ig5uVRs6idcm6ilzo7JAobdbkTeB6xl3F55zeAqPRJH3qbHGe/X8ngfkZ+ZjD 3OPzDOsDMZKj7g8fmOayBVOc7M2em+xgu6rqFs542gBd7lblBobpFACwCaDKiWEOZSXm H5xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268667; x=1699873467; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=599/Bj9mord/rWtxWCsNHAuRNbZVNvVu72yn9cQly6g=; b=lJaknXVhsYL3ulABBNhB/kXI05NMbWV2IbPac1J8CocRz3xRHQ8UOQL4Yn1/R/PhcG 0c6b236UMV9QmdrqHEJx84tTn1dm5+h+q+xg5DrpX3faRQlvBL+4q4duoN6mZqYMv/jF SPcxMWglEJKybkQayxqgq6rCRU0GiVKRPDyov9E5wPSQK9Q8lXAhMstaeayER3ULqmS/ ChoDsHlv+cTmuSgcdm2Kf0NfqpzX/Dof572qEhy7DAlh+BU2c85fxtoYlFVTiAIWd9Mk IAoPGfxNXuDNQECH8IDkN3z37+tvvCxUWYeexymB5VZVjkDpLvGXgiYloEmfmXSlHjP8 ueTQ== X-Gm-Message-State: AOJu0YxCTANpaEFBFkvoPlle7rk8GAMuHfinLLJ/GHV+RS1k7+4da7tF FEdpcpu1NJEIByzvYtfNartd+9GtmfbJtUBqugE= X-Google-Smtp-Source: AGHT+IEzp/mPbFUy8SkmetAAoTy+TS+vDzZzjoAJkoCTBAmaD/KNwWEWoOROTPCc4oN0cNW9yDLu/w== X-Received: by 2002:a05:600c:488a:b0:408:3c8f:afd9 with SMTP id j10-20020a05600c488a00b004083c8fafd9mr22199866wmp.3.1699268667013; Mon, 06 Nov 2023 03:04:27 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Anton Johansson , Richard Henderson , Paolo Bonzini Subject: [PULL 07/60] accel/tcg: Factor tcg_cpu_reset_hold() out Date: Mon, 6 Nov 2023 12:02:39 +0100 Message-ID: <20231106110336.358-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699268799114100001 Factor the TCG specific code from cpu_common_reset_hold() to tcg_cpu_reset_hold() within tcg-accel-ops.c. Since this file is sysemu specific, we can inline tcg_flush_softmmu_tlb(), removing its declaration in "exec/cpu-common.h". Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Anton Johansson Reviewed-by: Richard Henderson Message-Id: <20230918104153.24433-4-philmd@linaro.org> --- include/exec/cpu-common.h | 2 -- accel/stubs/tcg-stub.c | 4 ---- accel/tcg/tcg-accel-ops.c | 8 ++++++++ accel/tcg/translate-all.c | 8 -------- hw/core/cpu-common.c | 5 ----- 5 files changed, 8 insertions(+), 19 deletions(-) diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h index f700071d12..41115d8919 100644 --- a/include/exec/cpu-common.h +++ b/include/exec/cpu-common.h @@ -45,8 +45,6 @@ void cpu_list_lock(void); void cpu_list_unlock(void); unsigned int cpu_list_generation_id_get(void); =20 -void tcg_flush_softmmu_tlb(CPUState *cs); - void tcg_iommu_init_notifier_list(CPUState *cpu); void tcg_iommu_free_notifier_list(CPUState *cpu); =20 diff --git a/accel/stubs/tcg-stub.c b/accel/stubs/tcg-stub.c index a9e7a2d5b4..8a496a2a6f 100644 --- a/accel/stubs/tcg-stub.c +++ b/accel/stubs/tcg-stub.c @@ -22,10 +22,6 @@ void tlb_set_dirty(CPUState *cpu, vaddr vaddr) { } =20 -void tcg_flush_jmp_cache(CPUState *cpu) -{ -} - int probe_access_flags(CPUArchState *env, vaddr addr, int size, MMUAccessType access_type, int mmu_idx, bool nonfault, void **phost, uintptr_t retaddr) diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index 7ddb05c332..1b57290682 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -78,6 +78,13 @@ int tcg_cpus_exec(CPUState *cpu) return ret; } =20 +static void tcg_cpu_reset_hold(CPUState *cpu) +{ + tcg_flush_jmp_cache(cpu); + + tlb_flush(cpu); +} + /* mask must never be zero, except for A20 change call */ void tcg_handle_interrupt(CPUState *cpu, int mask) { @@ -206,6 +213,7 @@ static void tcg_accel_ops_init(AccelOpsClass *ops) } } =20 + ops->cpu_reset_hold =3D tcg_cpu_reset_hold; ops->supports_guest_debug =3D tcg_supports_guest_debug; ops->insert_breakpoint =3D tcg_insert_breakpoint; ops->remove_breakpoint =3D tcg_remove_breakpoint; diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 8cb6ad3511..27e8152f0a 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -800,11 +800,3 @@ void tcg_flush_jmp_cache(CPUState *cpu) qatomic_set(&jc->array[i].tb, NULL); } } - -/* This is a wrapper for common code that can not use CONFIG_SOFTMMU */ -void tcg_flush_softmmu_tlb(CPUState *cs) -{ -#ifdef CONFIG_SOFTMMU - tlb_flush(cs); -#endif -} diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index 7d266c36ac..baa6d28b64 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -27,7 +27,6 @@ #include "qemu/main-loop.h" #include "exec/log.h" #include "exec/cpu-common.h" -#include "exec/tb-flush.h" #include "qemu/error-report.h" #include "qemu/qemu-print.h" #include "sysemu/tcg.h" @@ -138,10 +137,6 @@ static void cpu_common_reset_hold(Object *obj) cpu->cflags_next_tb =3D -1; =20 cpu_exec_reset_hold(cpu); - if (tcg_enabled()) { - tcg_flush_jmp_cache(cpu); - tcg_flush_softmmu_tlb(cpu); - } } =20 static bool cpu_common_has_work(CPUState *cs) --=20 2.41.0 From nobody Wed Nov 27 09:59:42 2024 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=1699268710; cv=none; d=zohomail.com; s=zohoarc; b=EL0i74fJrHuGCkXKTMVzQYuSAt0XHhW3W3asti431VRuqS9SZal1578WdRYilkTqWDK962lfvTW1jXiU1B1XZXZRrcgHT/vJDzV0qUE+TZd+G7eZNes9a+RhlTpP30P2bReRa4Uv3B2TSj7K5E6iIqwHSIYH0QcX0ZW/4Gg22NQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699268710; 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=5exP2PnN1x4Gjh5C/d3tcoOclvUbJ8KnxJFGqP8eGFA=; b=HjGEK1NujWAPQxfw8ngWRlg5QvL+9NnnPxlnKMN/H+inoP53A67vhj7mvZPW0jKUFYYrYGTXxJvdISKPzV4DDEZthFbbv3JVt/bOii0HwskGSkuEalig55jN7m4fHjxP59LRYZv238K39ekn5iuYok8C08g2NB1iJKWWAK6YRWk= 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 1699268710567488.14318533824144; Mon, 6 Nov 2023 03:05:10 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxPa-0007LK-9T; Mon, 06 Nov 2023 06:04:54 -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 1qzxPT-00075R-9k for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:04:47 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxPL-0003pz-Ed for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:04:47 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-32f7c44f6a7so2607720f8f.1 for ; Mon, 06 Nov 2023 03:04:37 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id m9-20020adfe949000000b003253523d767sm120250wrn.109.2023.11.06.03.04.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:04:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268677; x=1699873477; 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=5exP2PnN1x4Gjh5C/d3tcoOclvUbJ8KnxJFGqP8eGFA=; b=XGKYc9XR0uKlKrvypCOAj+VrXvyfeonKE1XuECRFQINmT94fFHD5f//PRYPcXKQud5 4GWVcQsx1eEX7VeCrTQAqhp1ugCEzX/QDcQWNOAX9iIungqbdNansWrLl//VmdnB8gLh UedcUGzTVfeuPC1jR7vgIq2Nj7HdVbcstOB0+Su+b5l1ikG62qw2lbrlem58fcxs86/L TAMonMNPBDigmUmufBxBR8atyynwPQeRecPx8FZZfgc6q/rb5O2IfXsP1VTeM9l1RMNq Ymhh1/kagcxVfiTY/n7YAB3IcXwhu3SAFxH0y66Mr9fWXRbv5qDIGpzGkcyOR+5rUidD XQvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268677; x=1699873477; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5exP2PnN1x4Gjh5C/d3tcoOclvUbJ8KnxJFGqP8eGFA=; b=nz0OtJ5PAYeoZ5SgoiFgC68/ySa+HUOi3qhnZLUDyqnj/UQV+Fj+G0NNVP7iVA/81b 4UndxFNyvzeA1FRXZqdv8kpGv+ac8tqk2d1AwuUN25UD0P/9E+47wCmpnvCNcXxMMZXy K5huAYtwNjlX4rbjPP4V6QOyds3jyqMIkTHQ4myCpVSHd1fgznRcbGUUpzokoKGWLYA8 VfMkFdH8gRqU4RjKieyVx6sgxJZJ6toCjoo54N8ArzQNld95FqIFNvybFAgT/ApUxYi8 f9JKv3N4ACQChqQX8lVtAEDG/z9GXDAn3IogjSK+m7dFCJh+5XNhha57sIgJ+bvGerbo CZXg== X-Gm-Message-State: AOJu0Yx9BLCK/iO6YSbYdQM/FcVRQ+Q6c9QFA1cDAiwMrVZwk1oCt5G5 6CpsLozu46t1e6Ng/aWhKfgh52a8FdfmOytIfw4= X-Google-Smtp-Source: AGHT+IFBVT/Gojs6LXLFwf6yzKXBVTiT6H6oSpXIbb3ONqzrM6zgUqAETF1GAh2U4mDSLHTJ2M0bhA== X-Received: by 2002:a05:6000:1ace:b0:32f:908e:c7de with SMTP id i14-20020a0560001ace00b0032f908ec7demr16575818wry.57.1699268676473; Mon, 06 Nov 2023 03:04:36 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Zhao Liu , Peter Maydell , Michael Rolnik , "Edgar E. Iglesias" , Brian Cain , Song Gao , Laurent Vivier , Aurelien Jarno , Jiaxun Yang , Aleksandar Rikalo , Chris Wulff , Marek Vasut , Stafford Horne , Nicholas Piggin , Daniel Henrique Barboza , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Palmer Dabbelt , Alistair Francis , Bin Meng , Weiwei Li , Liu Zhiwei , Yoshinori Sato , Thomas Huth , David Hildenbrand , Ilya Leoshkevich , Mark Cave-Ayland , Artyom Tarasenko , Bastian Koppelmann , Max Filippov Subject: [PULL 08/60] target: Unify QOM style Date: Mon, 6 Nov 2023 12:02:40 +0100 Message-ID: <20231106110336.358-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699268711141100001 Enforce the style described by commit 067109a11c ("docs/devel: mention the spacing requirement for QOM"): The first declaration of a storage or class structure should always be the parent and leave a visual space between that declaration and the new code. It is also useful to separate backing for properties (options driven by the user) and internal state to make navigation easier. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Zhao Liu Message-Id: <20231013140116.255-2-philmd@linaro.org> --- target/alpha/cpu-qom.h | 2 -- target/alpha/cpu.h | 2 -- target/arm/cpu-qom.h | 4 ---- target/arm/cpu.h | 2 -- target/avr/cpu-qom.h | 3 +-- target/avr/cpu.h | 2 -- target/cris/cpu-qom.h | 2 -- target/cris/cpu.h | 2 -- target/hexagon/cpu.h | 5 +---- target/hppa/cpu-qom.h | 2 -- target/hppa/cpu.h | 2 -- target/i386/cpu-qom.h | 2 -- target/i386/cpu.h | 2 -- target/loongarch/cpu.h | 4 ---- target/m68k/cpu-qom.h | 2 -- target/m68k/cpu.h | 2 -- target/microblaze/cpu-qom.h | 2 -- target/microblaze/cpu.h | 2 -- target/mips/cpu-qom.h | 2 -- target/mips/cpu.h | 2 -- target/nios2/cpu.h | 4 ---- target/openrisc/cpu.h | 4 ---- target/ppc/cpu.h | 2 -- target/riscv/cpu-qom.h | 3 +-- target/riscv/cpu.h | 2 -- target/rx/cpu-qom.h | 2 -- target/rx/cpu.h | 2 -- target/s390x/cpu-qom.h | 3 +-- target/s390x/cpu.h | 2 -- target/sh4/cpu-qom.h | 2 -- target/sh4/cpu.h | 2 -- target/sparc/cpu-qom.h | 2 -- target/sparc/cpu.h | 2 -- target/tricore/cpu-qom.h | 2 -- target/tricore/cpu.h | 2 -- target/xtensa/cpu-qom.h | 2 -- target/xtensa/cpu.h | 2 -- 37 files changed, 4 insertions(+), 84 deletions(-) diff --git a/target/alpha/cpu-qom.h b/target/alpha/cpu-qom.h index 1f200724b6..c5fbd8f11a 100644 --- a/target/alpha/cpu-qom.h +++ b/target/alpha/cpu-qom.h @@ -35,9 +35,7 @@ OBJECT_DECLARE_CPU_TYPE(AlphaCPU, AlphaCPUClass, ALPHA_CP= U) * An Alpha CPU model. */ struct AlphaCPUClass { - /*< private >*/ CPUClass parent_class; - /*< public >*/ =20 DeviceRealize parent_realize; DeviceReset parent_reset; diff --git a/target/alpha/cpu.h b/target/alpha/cpu.h index e2a467ec17..c8d97ac27a 100644 --- a/target/alpha/cpu.h +++ b/target/alpha/cpu.h @@ -259,9 +259,7 @@ typedef struct CPUArchState { * An Alpha CPU. */ struct ArchCPU { - /*< private >*/ CPUState parent_obj; - /*< public >*/ =20 CPUAlphaState env; =20 diff --git a/target/arm/cpu-qom.h b/target/arm/cpu-qom.h index d06c08a734..153865d1bb 100644 --- a/target/arm/cpu-qom.h +++ b/target/arm/cpu-qom.h @@ -46,9 +46,7 @@ void aarch64_cpu_register(const ARMCPUInfo *info); * An ARM CPU model. */ struct ARMCPUClass { - /*< private >*/ CPUClass parent_class; - /*< public >*/ =20 const ARMCPUInfo *info; DeviceRealize parent_realize; @@ -62,9 +60,7 @@ DECLARE_CLASS_CHECKERS(AArch64CPUClass, AARCH64_CPU, TYPE_AARCH64_CPU) =20 struct AArch64CPUClass { - /*< private >*/ ARMCPUClass parent_class; - /*< public >*/ }; =20 void register_cp_regs_for_features(ARMCPU *cpu); diff --git a/target/arm/cpu.h b/target/arm/cpu.h index d51dfe48db..2f7ab22169 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -852,9 +852,7 @@ typedef struct { * An ARM CPU core. */ struct ArchCPU { - /*< private >*/ CPUState parent_obj; - /*< public >*/ =20 CPUARMState env; =20 diff --git a/target/avr/cpu-qom.h b/target/avr/cpu-qom.h index 01ea5f160b..d89be01e0f 100644 --- a/target/avr/cpu-qom.h +++ b/target/avr/cpu-qom.h @@ -36,9 +36,8 @@ OBJECT_DECLARE_CPU_TYPE(AVRCPU, AVRCPUClass, AVR_CPU) * A AVR CPU model. */ struct AVRCPUClass { - /*< private >*/ CPUClass parent_class; - /*< public >*/ + DeviceRealize parent_realize; ResettablePhases parent_phases; }; diff --git a/target/avr/cpu.h b/target/avr/cpu.h index 4ce22d8e4f..f8b065ed79 100644 --- a/target/avr/cpu.h +++ b/target/avr/cpu.h @@ -144,9 +144,7 @@ typedef struct CPUArchState { * A AVR CPU. */ struct ArchCPU { - /*< private >*/ CPUState parent_obj; - /*< public >*/ =20 CPUAVRState env; }; diff --git a/target/cris/cpu-qom.h b/target/cris/cpu-qom.h index 431a1d536a..c2fee242f4 100644 --- a/target/cris/cpu-qom.h +++ b/target/cris/cpu-qom.h @@ -36,9 +36,7 @@ OBJECT_DECLARE_CPU_TYPE(CRISCPU, CRISCPUClass, CRIS_CPU) * A CRIS CPU model. */ struct CRISCPUClass { - /*< private >*/ CPUClass parent_class; - /*< public >*/ =20 DeviceRealize parent_realize; ResettablePhases parent_phases; diff --git a/target/cris/cpu.h b/target/cris/cpu.h index 676b8e93ca..6aa445348f 100644 --- a/target/cris/cpu.h +++ b/target/cris/cpu.h @@ -174,9 +174,7 @@ typedef struct CPUArchState { * A CRIS CPU. */ struct ArchCPU { - /*< private >*/ CPUState parent_obj; - /*< public >*/ =20 CPUCRISState env; }; diff --git a/target/hexagon/cpu.h b/target/hexagon/cpu.h index 10cd1efd57..035ac4fb6d 100644 --- a/target/hexagon/cpu.h +++ b/target/hexagon/cpu.h @@ -130,17 +130,14 @@ typedef struct CPUArchState { OBJECT_DECLARE_CPU_TYPE(HexagonCPU, HexagonCPUClass, HEXAGON_CPU) =20 typedef struct HexagonCPUClass { - /*< private >*/ CPUClass parent_class; - /*< public >*/ + DeviceRealize parent_realize; ResettablePhases parent_phases; } HexagonCPUClass; =20 struct ArchCPU { - /*< private >*/ CPUState parent_obj; - /*< public >*/ =20 CPUHexagonState env; =20 diff --git a/target/hppa/cpu-qom.h b/target/hppa/cpu-qom.h index b96e0318c7..67f12422c4 100644 --- a/target/hppa/cpu-qom.h +++ b/target/hppa/cpu-qom.h @@ -35,9 +35,7 @@ OBJECT_DECLARE_CPU_TYPE(HPPACPU, HPPACPUClass, HPPA_CPU) * An HPPA CPU model. */ struct HPPACPUClass { - /*< private >*/ CPUClass parent_class; - /*< public >*/ =20 DeviceRealize parent_realize; DeviceReset parent_reset; diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 798d0c26d7..518ea94f4f 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -233,9 +233,7 @@ typedef struct CPUArchState { * An HPPA CPU. */ struct ArchCPU { - /*< private >*/ CPUState parent_obj; - /*< public >*/ =20 CPUHPPAState env; QEMUTimer *alarm_timer; diff --git a/target/i386/cpu-qom.h b/target/i386/cpu-qom.h index 2350f4ae60..58145717ef 100644 --- a/target/i386/cpu-qom.h +++ b/target/i386/cpu-qom.h @@ -47,9 +47,7 @@ typedef struct X86CPUModel X86CPUModel; * An x86 CPU model or family. */ struct X86CPUClass { - /*< private >*/ CPUClass parent_class; - /*< public >*/ =20 /* CPU definition, automatically loaded by instance_init if not NULL. * Should be eventually replaced by subclass-specific property default= s. diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 471e71dbc5..096f85483e 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1897,9 +1897,7 @@ struct kvm_msrs; * An x86 CPU. */ struct ArchCPU { - /*< private >*/ CPUState parent_obj; - /*< public >*/ =20 CPUX86State env; VMChangeStateEntry *vmsentry; diff --git a/target/loongarch/cpu.h b/target/loongarch/cpu.h index 8b54cf109c..8f0e9f0182 100644 --- a/target/loongarch/cpu.h +++ b/target/loongarch/cpu.h @@ -371,9 +371,7 @@ typedef struct CPUArchState { * A LoongArch CPU. */ struct ArchCPU { - /*< private >*/ CPUState parent_obj; - /*< public >*/ =20 CPULoongArchState env; QEMUTimer timer; @@ -398,9 +396,7 @@ OBJECT_DECLARE_CPU_TYPE(LoongArchCPU, LoongArchCPUClass, * A LoongArch CPU model. */ struct LoongArchCPUClass { - /*< private >*/ CPUClass parent_class; - /*< public >*/ =20 DeviceRealize parent_realize; ResettablePhases parent_phases; diff --git a/target/m68k/cpu-qom.h b/target/m68k/cpu-qom.h index 0ec7750a92..13d94c9fe3 100644 --- a/target/m68k/cpu-qom.h +++ b/target/m68k/cpu-qom.h @@ -35,9 +35,7 @@ OBJECT_DECLARE_CPU_TYPE(M68kCPU, M68kCPUClass, M68K_CPU) * A Motorola 68k CPU model. */ struct M68kCPUClass { - /*< private >*/ CPUClass parent_class; - /*< public >*/ =20 DeviceRealize parent_realize; ResettablePhases parent_phases; diff --git a/target/m68k/cpu.h b/target/m68k/cpu.h index 20afb0c94d..9ea18028ad 100644 --- a/target/m68k/cpu.h +++ b/target/m68k/cpu.h @@ -164,9 +164,7 @@ typedef struct CPUArchState { * A Motorola 68k CPU. */ struct ArchCPU { - /*< private >*/ CPUState parent_obj; - /*< public >*/ =20 CPUM68KState env; }; diff --git a/target/microblaze/cpu-qom.h b/target/microblaze/cpu-qom.h index cda9220fa9..2a734e644d 100644 --- a/target/microblaze/cpu-qom.h +++ b/target/microblaze/cpu-qom.h @@ -35,9 +35,7 @@ OBJECT_DECLARE_CPU_TYPE(MicroBlazeCPU, MicroBlazeCPUClass= , MICROBLAZE_CPU) * A MicroBlaze CPU model. */ struct MicroBlazeCPUClass { - /*< private >*/ CPUClass parent_class; - /*< public >*/ =20 DeviceRealize parent_realize; ResettablePhases parent_phases; diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h index e43c49d4af..e8000237d8 100644 --- a/target/microblaze/cpu.h +++ b/target/microblaze/cpu.h @@ -343,9 +343,7 @@ typedef struct { * A MicroBlaze CPU. */ struct ArchCPU { - /*< private >*/ CPUState parent_obj; - /*< public >*/ =20 CPUMBState env; =20 diff --git a/target/mips/cpu-qom.h b/target/mips/cpu-qom.h index 0dffab453b..c70b4a34be 100644 --- a/target/mips/cpu-qom.h +++ b/target/mips/cpu-qom.h @@ -39,9 +39,7 @@ OBJECT_DECLARE_CPU_TYPE(MIPSCPU, MIPSCPUClass, MIPS_CPU) * A MIPS CPU model. */ struct MIPSCPUClass { - /*< private >*/ CPUClass parent_class; - /*< public >*/ =20 DeviceRealize parent_realize; ResettablePhases parent_phases; diff --git a/target/mips/cpu.h b/target/mips/cpu.h index 5fddceff3a..617c373797 100644 --- a/target/mips/cpu.h +++ b/target/mips/cpu.h @@ -1209,9 +1209,7 @@ typedef struct CPUArchState { * A MIPS CPU. */ struct ArchCPU { - /*< private >*/ CPUState parent_obj; - /*< public >*/ =20 CPUMIPSState env; =20 diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h index 70b6377a4f..ede1ba2140 100644 --- a/target/nios2/cpu.h +++ b/target/nios2/cpu.h @@ -42,9 +42,7 @@ OBJECT_DECLARE_CPU_TYPE(Nios2CPU, Nios2CPUClass, NIOS2_CP= U) * A Nios2 CPU model. */ struct Nios2CPUClass { - /*< private >*/ CPUClass parent_class; - /*< public >*/ =20 DeviceRealize parent_realize; ResettablePhases parent_phases; @@ -214,9 +212,7 @@ typedef struct { * A Nios2 CPU. */ struct ArchCPU { - /*< private >*/ CPUState parent_obj; - /*< public >*/ =20 CPUNios2State env; =20 diff --git a/target/openrisc/cpu.h b/target/openrisc/cpu.h index 334997e9a1..29cda7279c 100644 --- a/target/openrisc/cpu.h +++ b/target/openrisc/cpu.h @@ -39,9 +39,7 @@ OBJECT_DECLARE_CPU_TYPE(OpenRISCCPU, OpenRISCCPUClass, OP= ENRISC_CPU) * A OpenRISC CPU model. */ struct OpenRISCCPUClass { - /*< private >*/ CPUClass parent_class; - /*< public >*/ =20 DeviceRealize parent_realize; ResettablePhases parent_phases; @@ -301,9 +299,7 @@ typedef struct CPUArchState { * A OpenRISC CPU. */ struct ArchCPU { - /*< private >*/ CPUState parent_obj; - /*< public >*/ =20 CPUOpenRISCState env; }; diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 30392ebeee..24dd6b1b0a 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -1313,9 +1313,7 @@ typedef struct PPCVirtualHypervisorClass PPCVirtualHy= pervisorClass; * A PowerPC CPU. */ struct ArchCPU { - /*< private >*/ CPUState parent_obj; - /*< public >*/ =20 CPUPPCState env; =20 diff --git a/target/riscv/cpu-qom.h b/target/riscv/cpu-qom.h index f3fbe37a2c..b9164a8e5b 100644 --- a/target/riscv/cpu-qom.h +++ b/target/riscv/cpu-qom.h @@ -63,9 +63,8 @@ OBJECT_DECLARE_CPU_TYPE(RISCVCPU, RISCVCPUClass, RISCV_CP= U) * A RISCV CPU model. */ struct RISCVCPUClass { - /*< private >*/ CPUClass parent_class; - /*< public >*/ + DeviceRealize parent_realize; ResettablePhases parent_phases; }; diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index f8ffa5ee38..f0dc257a75 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -389,9 +389,7 @@ struct CPUArchState { * A RISCV CPU. */ struct ArchCPU { - /* < private > */ CPUState parent_obj; - /* < public > */ =20 CPURISCVState env; =20 diff --git a/target/rx/cpu-qom.h b/target/rx/cpu-qom.h index 1c8466a187..f4cd5664e5 100644 --- a/target/rx/cpu-qom.h +++ b/target/rx/cpu-qom.h @@ -36,9 +36,7 @@ OBJECT_DECLARE_CPU_TYPE(RXCPU, RXCPUClass, RX_CPU) * A RX CPU model. */ struct RXCPUClass { - /*< private >*/ CPUClass parent_class; - /*< public >*/ =20 DeviceRealize parent_realize; ResettablePhases parent_phases; diff --git a/target/rx/cpu.h b/target/rx/cpu.h index f66754eb8a..8379f4a150 100644 --- a/target/rx/cpu.h +++ b/target/rx/cpu.h @@ -107,9 +107,7 @@ typedef struct CPUArchState { * A RX CPU */ struct ArchCPU { - /*< private >*/ CPUState parent_obj; - /*< public >*/ =20 CPURXState env; }; diff --git a/target/s390x/cpu-qom.h b/target/s390x/cpu-qom.h index 00cae2b131..1088965fd5 100644 --- a/target/s390x/cpu-qom.h +++ b/target/s390x/cpu-qom.h @@ -49,9 +49,8 @@ typedef enum cpu_reset_type { * An S/390 CPU model. */ struct S390CPUClass { - /*< private >*/ CPUClass parent_class; - /*< public >*/ + const S390CPUDef *cpu_def; bool kvm_required; bool is_static; diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index 40c5cedd0e..4f366f9e4e 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -172,9 +172,7 @@ static inline uint64_t *get_freg(CPUS390XState *cs, int= nr) * An S/390 CPU. */ struct ArchCPU { - /*< private >*/ CPUState parent_obj; - /*< public >*/ =20 CPUS390XState env; S390CPUModel *model; diff --git a/target/sh4/cpu-qom.h b/target/sh4/cpu-qom.h index 89785a90f0..08fbebc996 100644 --- a/target/sh4/cpu-qom.h +++ b/target/sh4/cpu-qom.h @@ -42,9 +42,7 @@ OBJECT_DECLARE_CPU_TYPE(SuperHCPU, SuperHCPUClass, SUPERH= _CPU) * A SuperH CPU model. */ struct SuperHCPUClass { - /*< private >*/ CPUClass parent_class; - /*< public >*/ =20 DeviceRealize parent_realize; ResettablePhases parent_phases; diff --git a/target/sh4/cpu.h b/target/sh4/cpu.h index f75a235973..dc0561b73b 100644 --- a/target/sh4/cpu.h +++ b/target/sh4/cpu.h @@ -204,9 +204,7 @@ typedef struct CPUArchState { * A SuperH CPU. */ struct ArchCPU { - /*< private >*/ CPUState parent_obj; - /*< public >*/ =20 CPUSH4State env; }; diff --git a/target/sparc/cpu-qom.h b/target/sparc/cpu-qom.h index 78bf00b9a2..b4a0db84ce 100644 --- a/target/sparc/cpu-qom.h +++ b/target/sparc/cpu-qom.h @@ -40,9 +40,7 @@ typedef struct sparc_def_t sparc_def_t; * A SPARC CPU model. */ struct SPARCCPUClass { - /*< private >*/ CPUClass parent_class; - /*< public >*/ =20 DeviceRealize parent_realize; ResettablePhases parent_phases; diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h index 758a4e8aaa..84a030e406 100644 --- a/target/sparc/cpu.h +++ b/target/sparc/cpu.h @@ -569,9 +569,7 @@ struct CPUArchState { * A SPARC CPU. */ struct ArchCPU { - /*< private >*/ CPUState parent_obj; - /*< public >*/ =20 CPUSPARCState env; }; diff --git a/target/tricore/cpu-qom.h b/target/tricore/cpu-qom.h index 612731daa0..b3b6c75a3a 100644 --- a/target/tricore/cpu-qom.h +++ b/target/tricore/cpu-qom.h @@ -27,9 +27,7 @@ OBJECT_DECLARE_CPU_TYPE(TriCoreCPU, TriCoreCPUClass, TRICORE_CPU) =20 struct TriCoreCPUClass { - /*< private >*/ CPUClass parent_class; - /*< public >*/ =20 DeviceRealize parent_realize; ResettablePhases parent_phases; diff --git a/target/tricore/cpu.h b/target/tricore/cpu.h index a357b573f2..b4a6ab141d 100644 --- a/target/tricore/cpu.h +++ b/target/tricore/cpu.h @@ -63,9 +63,7 @@ typedef struct CPUArchState { * A TriCore CPU. */ struct ArchCPU { - /*< private >*/ CPUState parent_obj; - /*< public >*/ =20 CPUTriCoreState env; }; diff --git a/target/xtensa/cpu-qom.h b/target/xtensa/cpu-qom.h index 419c7d8e4a..424bcbd8dd 100644 --- a/target/xtensa/cpu-qom.h +++ b/target/xtensa/cpu-qom.h @@ -47,9 +47,7 @@ typedef struct XtensaConfig XtensaConfig; * An Xtensa CPU model. */ struct XtensaCPUClass { - /*< private >*/ CPUClass parent_class; - /*< public >*/ =20 DeviceRealize parent_realize; ResettablePhases parent_phases; diff --git a/target/xtensa/cpu.h b/target/xtensa/cpu.h index c6bbef1e5d..85aab1bdf8 100644 --- a/target/xtensa/cpu.h +++ b/target/xtensa/cpu.h @@ -556,9 +556,7 @@ struct CPUArchState { * An Xtensa CPU. */ struct ArchCPU { - /*< private >*/ CPUState parent_obj; - /*< public >*/ =20 CPUXtensaState env; Clock *clock; --=20 2.41.0 From nobody Wed Nov 27 09:59:42 2024 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=1699268727; cv=none; d=zohomail.com; s=zohoarc; b=JGwhL80UUn7gaZOKpVPqZT6yWKLnY0PTQe1hL0b8iTu++XO/Nt/d+eqny6WoZ5YZw2+zCP9xL9msMkWi0Trd6IiNa7Y5hi85IGJYV+s6YMJzV266UdvE2LVyGs4/EBlqq9tv+PpBTSF0DbIqMP7W4ZPSkcCbIxmPVstayWWn7oM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699268727; 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=edoh0A4VIBHnomUl2UTL+gBl3YX8JThMwON2libfRQU=; b=dbNnceZhBJaMLQ+rzhJZd2TT+I7yBaJhbPb9926WrxVttdiN1O5N4ArJTVQCVlC3yDrl0EIxw6wAAbguzwj8+OR6fFXCYgJU5KGj398rZO3ojCkBtm9rfM2QmbGr5EB21n8bIHlqVJoa5hXYAsbaTHPAmSOCvwUgaZge38dkPnQ= 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 1699268726898491.67394398843555; Mon, 6 Nov 2023 03:05:26 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxPa-0007P5-Vo; Mon, 06 Nov 2023 06:04:55 -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 1qzxPW-0007E0-Te for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:04:53 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxPQ-0003r0-CL for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:04:50 -0500 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-32d81864e3fso2500003f8f.2 for ; Mon, 06 Nov 2023 03:04:43 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id y3-20020adfe6c3000000b003140f47224csm9111991wrm.15.2023.11.06.03.04.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:04:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268683; x=1699873483; 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=edoh0A4VIBHnomUl2UTL+gBl3YX8JThMwON2libfRQU=; b=mOi5+AJF2xz9OJV0kmOdWIhifUOk9CCzXvww3K8+CYgk43hxnbXLDknRg+VC/erPxb PpxWxbtg0kablkYcxWKqAvqjvbWVIzLD293aNWIY3++eAB+DwjC/5v196BZqztrJVvhG T66TqGFbh232mndE41cYJ/xrx8aVsKTOwhv1GYlMxt87fw37WBuChQBxAFcEexmCgM8s fNWOz1sGrU8P7Og/84lo4VnhANEe4QZxFDsQTShuQxdXV9TM7R0bTV4d7y/bxzvoVrJk 5DZt8STN3ypP2bdLmrzyKw2ewIBW7PRXckToBltbsYVPwyYG2d5WV9OlDqoEfB5OtoQ1 xozA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268683; x=1699873483; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=edoh0A4VIBHnomUl2UTL+gBl3YX8JThMwON2libfRQU=; b=Wvbzv/FqWwlWuWSj8dUfSVm47p07Au1vUh3K/sQvREy8nTxcudKekdenRu+5CcVvF5 1Zm0k3JrZ38Y49fF03nhEoekcf3R+R7p3dZaBdm8sj1RbFP0/Qsph8HxcesQQGF7RqQ6 uHY99YdG7wgUWjYK9xk+dlKRaEJqb4xtunJwU5LoXHvJTt/oq70JyIOg9RkOPK0g6eOy fG3M7NPA29Sczou8vHoFdD9/qwMFUdqonHRqzagG7/iIL5FUjTx5r/NExyNoVs6q9duS 7fETgHFJK+YN7YkP7cncsH1E4L3LEsyVbZwuoQ8k0OzMqA37hS3YKlZtDbBjf/DqZLFg f+8g== X-Gm-Message-State: AOJu0YzzfSuYjMpyOLWNewFTVWkvr3842loJTefYPO2n+ywtkpc4c2y/ NtI9Dg0M1peCK7EezY6c1sLcZkqLcDDDv4u7iLw= X-Google-Smtp-Source: AGHT+IFlBVNG2dMbfKa3SmCrF8WLEs8NXPQC60vm5+BiWuQcq5Hh8zZkMSTj4OjAvWykBZy1YCBg/g== X-Received: by 2002:adf:f0c8:0:b0:32d:a2a3:9533 with SMTP id x8-20020adff0c8000000b0032da2a39533mr23224446wro.59.1699268682776; Mon, 06 Nov 2023 03:04:42 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Peter Maydell , "Edgar E. Iglesias" Subject: [PULL 09/60] target: Mention 'cpu-qom.h' is target agnostic Date: Mon, 6 Nov 2023 12:02:41 +0100 Message-ID: <20231106110336.358-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::432; envelope-from=philmd@linaro.org; helo=mail-wr1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699268728644100004 "target/foo/cpu-qom.h" is supposed to be target agnostic (include-able by any target). Add such mention in the header. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20231013140116.255-3-philmd@linaro.org> --- target/arm/cpu-qom.h | 2 +- target/hppa/cpu-qom.h | 2 +- target/microblaze/cpu-qom.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/target/arm/cpu-qom.h b/target/arm/cpu-qom.h index 153865d1bb..dfb9d5b827 100644 --- a/target/arm/cpu-qom.h +++ b/target/arm/cpu-qom.h @@ -1,5 +1,5 @@ /* - * QEMU ARM CPU + * QEMU ARM CPU QOM header (target agnostic) * * Copyright (c) 2012 SUSE LINUX Products GmbH * diff --git a/target/hppa/cpu-qom.h b/target/hppa/cpu-qom.h index 67f12422c4..4b1d48f7ca 100644 --- a/target/hppa/cpu-qom.h +++ b/target/hppa/cpu-qom.h @@ -1,5 +1,5 @@ /* - * QEMU HPPA CPU + * QEMU HPPA CPU QOM header (target agnostic) * * Copyright (c) 2016 Richard Henderson * diff --git a/target/microblaze/cpu-qom.h b/target/microblaze/cpu-qom.h index 2a734e644d..78f549b57d 100644 --- a/target/microblaze/cpu-qom.h +++ b/target/microblaze/cpu-qom.h @@ -1,5 +1,5 @@ /* - * QEMU MicroBlaze CPU + * QEMU MicroBlaze CPU QOM header (target agnostic) * * Copyright (c) 2012 SUSE LINUX Products GmbH * --=20 2.41.0 From nobody Wed Nov 27 09:59:42 2024 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=1699268841; cv=none; d=zohomail.com; s=zohoarc; b=OOIvGn5mGr98biUntJQSiZpuYew0zMozz6Lh7pxIkVoyVGUZa1v7mfymkEHJz8VSNEhiKJRJYq+jKif3nhNpQ5YIRRjG72awLQibBbnSMqo/8ITDKr5ooPBYAqDbQkQz7CLeehmaxYGSRtJuXdBpRYGUyZeaG9EqIarbBVtLLm0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699268841; 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=5wOkrsA8z2Hole9awlJYsNuk4oh7gPmhIjtphAMJsw8=; b=RJI867y8J27H2kbs2YPdELRG0CaYXsK3Lds2gvHmbuN8EkAqwuJWxPOEltVNheNon0jJk4iooMcAVeaQjoKgFYEuUB8+8b/kHMSG95+1LzI5xXcSLlC3JJ6s+TzV4RBOGkKCxvek0sTpQY9FB7rqr6pT/kZyPlKJW+cR98SGobA= 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 1699268841654266.49214422705654; Mon, 6 Nov 2023 03:07:21 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxPi-0007kg-EZ; Mon, 06 Nov 2023 06:05:02 -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 1qzxPd-0007dH-SB for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:04:57 -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 1qzxPW-0003ss-P1 for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:04:57 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4079ed65582so32850625e9.1 for ; Mon, 06 Nov 2023 03:04:50 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id z2-20020a5d6402000000b0032d9caeab0fsm9209526wru.77.2023.11.06.03.04.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:04:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268689; x=1699873489; 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=5wOkrsA8z2Hole9awlJYsNuk4oh7gPmhIjtphAMJsw8=; b=psKUUSqMM8ZoFWJVSptQ91bZmUqMy3eKvQR+vkfVVJASMZ6TX7ck1cwxyW1w1TVK/O C5vHfnjkObntjoWCbljkPBfte8X0jRh43QG3Urah8dHg6i1JN21OtMfyCQveCVteLvDh qKsejHokN32O7+BVs09cpsjkRS1JDpr2zW8Phi29nBymILPmRSVArK+spZZFqqFvsWAh wgWCf6RnzItfbC9oaFMUVfq5PlqarUxBbzEdOHKJE14YVD9XgRVbZ6Msy3/ux60eFFUA oTtIbjn85np/qpSAdrsKrJe2i8Qu+oa5mvMeVjP/IbsO4dq7NG/uJmz2qkFJK8QvimnA IvEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268689; x=1699873489; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5wOkrsA8z2Hole9awlJYsNuk4oh7gPmhIjtphAMJsw8=; b=aJW4BS77hYLytJvzbsK+s37M0z4rDFKFvIAq3qVWcmAAa/rNTxD1vVhrJIAbRwynjo kykzegQfFFYitRX6t9oHPI2a6KuG4Gwa7F2xfoiCyazbJmCntmfIZyJ/FXVrH64VaiIy CpnuvDzlVXp+13tL+HCdP4/0nNLOKtk5EmK3axakRsVqcbesu0SLDHWI7E0Yahi/qyll cF7jI3xENJsEWCyZL2DCSOTnV1g1aEd/8EUs8ZjidJ/ysWRAIAgvjeqpzEDs3akGRk41 +VYXeL8hJUXB9C18FN63igU3Jf8gPywPvf+T07XS26yeVsOIaPVYlrvAIVLBQiCB4+xS GaLw== X-Gm-Message-State: AOJu0YzbHV4bKxfBh/BCGOACZH7fuYnpJ1W79IvwB2GERZPOMPHRkPJ1 reWZFcBP0Fw+F9HAWU71iKzTKi/zZKo2fq+9/iU= X-Google-Smtp-Source: AGHT+IECfFst9YsrR74+b52RmZLy9M9KXPMfA+PoNFzuGn/ZVvte53NMfTf9ib4YmQOSoxKMcxtfzw== X-Received: by 2002:a05:6000:18a9:b0:32f:9a39:777f with SMTP id b9-20020a05600018a900b0032f9a39777fmr15067192wri.62.1699268689108; Mon, 06 Nov 2023 03:04:49 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Peter Maydell Subject: [PULL 10/60] target/arm: Move internal declarations from 'cpu-qom.h' to 'cpu.h' Date: Mon, 6 Nov 2023 12:02:42 +0100 Message-ID: <20231106110336.358-11-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699268843319100003 These definitions and declarations are only used by target/arm/, no need to expose them to generic hw/. Reviewed-by: Richard Henderson Message-Id: <20231013140116.255-4-philmd@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: --- target/arm/cpu-qom.h | 28 ---------------------------- target/arm/cpu.h | 22 ++++++++++++++++++++++ target/arm/internals.h | 6 ++++++ 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/target/arm/cpu-qom.h b/target/arm/cpu-qom.h index dfb9d5b827..35c3b0924e 100644 --- a/target/arm/cpu-qom.h +++ b/target/arm/cpu-qom.h @@ -35,9 +35,6 @@ typedef struct ARMCPUInfo { void (*class_init)(ObjectClass *oc, void *data); } ARMCPUInfo; =20 -void arm_cpu_register(const ARMCPUInfo *info); -void aarch64_cpu_register(const ARMCPUInfo *info); - /** * ARMCPUClass: * @parent_realize: The parent class' realize handler. @@ -63,29 +60,4 @@ struct AArch64CPUClass { ARMCPUClass parent_class; }; =20 -void register_cp_regs_for_features(ARMCPU *cpu); -void init_cpreg_list(ARMCPU *cpu); - -/* Callback functions for the generic timer's timers. */ -void arm_gt_ptimer_cb(void *opaque); -void arm_gt_vtimer_cb(void *opaque); -void arm_gt_htimer_cb(void *opaque); -void arm_gt_stimer_cb(void *opaque); -void arm_gt_hvtimer_cb(void *opaque); - -#define ARM_AFF0_SHIFT 0 -#define ARM_AFF0_MASK (0xFFULL << ARM_AFF0_SHIFT) -#define ARM_AFF1_SHIFT 8 -#define ARM_AFF1_MASK (0xFFULL << ARM_AFF1_SHIFT) -#define ARM_AFF2_SHIFT 16 -#define ARM_AFF2_MASK (0xFFULL << ARM_AFF2_SHIFT) -#define ARM_AFF3_SHIFT 32 -#define ARM_AFF3_MASK (0xFFULL << ARM_AFF3_SHIFT) -#define ARM_DEFAULT_CPUS_PER_CLUSTER 8 - -#define ARM32_AFFINITY_MASK (ARM_AFF0_MASK|ARM_AFF1_MASK|ARM_AFF2_MASK) -#define ARM64_AFFINITY_MASK \ - (ARM_AFF0_MASK|ARM_AFF1_MASK|ARM_AFF2_MASK|ARM_AFF3_MASK) -#define ARM64_AFFINITY_INVALID (~ARM64_AFFINITY_MASK) - #endif diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 2f7ab22169..4a86c8f831 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -1116,11 +1116,33 @@ struct ArchCPU { uint64_t gt_cntfrq_hz; }; =20 +/* Callback functions for the generic timer's timers. */ +void arm_gt_ptimer_cb(void *opaque); +void arm_gt_vtimer_cb(void *opaque); +void arm_gt_htimer_cb(void *opaque); +void arm_gt_stimer_cb(void *opaque); +void arm_gt_hvtimer_cb(void *opaque); + unsigned int gt_cntfrq_period_ns(ARMCPU *cpu); void gt_rme_post_el_change(ARMCPU *cpu, void *opaque); =20 void arm_cpu_post_init(Object *obj); =20 +#define ARM_AFF0_SHIFT 0 +#define ARM_AFF0_MASK (0xFFULL << ARM_AFF0_SHIFT) +#define ARM_AFF1_SHIFT 8 +#define ARM_AFF1_MASK (0xFFULL << ARM_AFF1_SHIFT) +#define ARM_AFF2_SHIFT 16 +#define ARM_AFF2_MASK (0xFFULL << ARM_AFF2_SHIFT) +#define ARM_AFF3_SHIFT 32 +#define ARM_AFF3_MASK (0xFFULL << ARM_AFF3_SHIFT) +#define ARM_DEFAULT_CPUS_PER_CLUSTER 8 + +#define ARM32_AFFINITY_MASK (ARM_AFF0_MASK | ARM_AFF1_MASK | ARM_AFF2_MASK) +#define ARM64_AFFINITY_MASK \ + (ARM_AFF0_MASK | ARM_AFF1_MASK | ARM_AFF2_MASK | ARM_AFF3_MASK) +#define ARM64_AFFINITY_INVALID (~ARM64_AFFINITY_MASK) + uint64_t arm_cpu_mp_affinity(int idx, uint8_t clustersz); =20 #ifndef CONFIG_USER_ONLY diff --git a/target/arm/internals.h b/target/arm/internals.h index c837506e44..143d57c0fe 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -183,6 +183,12 @@ static inline int r14_bank_number(int mode) return (mode =3D=3D ARM_CPU_MODE_HYP) ? BANK_USRSYS : bank_number(mode= ); } =20 +void arm_cpu_register(const ARMCPUInfo *info); +void aarch64_cpu_register(const ARMCPUInfo *info); + +void register_cp_regs_for_features(ARMCPU *cpu); +void init_cpreg_list(ARMCPU *cpu); + void arm_cpu_register_gdb_regs_for_features(ARMCPU *cpu); void arm_translate_init(void); =20 --=20 2.41.0 From nobody Wed Nov 27 09:59:42 2024 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=1699269868; cv=none; d=zohomail.com; s=zohoarc; b=mz6jiC3qZ261c0aYOo6BxS6VA0DaF8wckflTXAgzwQ13PQ2F1uh+rQo8gH/Vn+/iDjwvIAubsw4Rrn6DejB/6UN/o4pmgEK3e8QGsCcv4j/Zb+6puxvQ7vUxnzrkNOK+TtOBEmroOaWjejEllJTIJmZwl/Wt0fOQt8JZ/RV4VuM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699269868; 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=vePePWiaVFUAUv821iwYutEeShxemZReiuwQp7UFnAo=; b=Z6kqpaZEDlDQuyqlKjJkTDBCg/YVq3bjtIBXphpVUpjVoRRthfPh52PlPNCwNLU+Ue+rkmPcbTMz8SlfnHrpJ2vcIo7WyNz7L1iLuu3a90Gavq04sAMoiD99O30xlvZjPm017CYhTZPMY1jzrdaol71j9302SlEinNDz64TJwCI= 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 1699269868000916.7053077428856; Mon, 6 Nov 2023 03:24:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxPm-0007oj-8S; Mon, 06 Nov 2023 06:05:06 -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 1qzxPi-0007l5-0m for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:05:02 -0500 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxPe-0003vA-Px for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:05:01 -0500 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-507a55302e0so5787103e87.0 for ; Mon, 06 Nov 2023 03:04:58 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id p12-20020adfce0c000000b0032dc1fc84f2sm9191301wrn.46.2023.11.06.03.04.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:04:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268696; x=1699873496; 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=vePePWiaVFUAUv821iwYutEeShxemZReiuwQp7UFnAo=; b=dRSL/hYuo9Mvs3/Uu2aM/U3y5KtxOU6FUOjtDHSTO811vk8PjAwvonEAdKv+4MSTO5 KhgrQ7U/SOHght8JGfhJ71WUg5+dPtRFSZD84ef7uYO7TjlyadJB0vgEIs6c0haD1GcW KdyU4/a97FgR2lNBNLBdLVUMJiz6iN5tOVv4WyiB+qH/nG7dcptikOt0H4IjNj/UkDsy VlYKtdV/audwFpCPYRbK/VCbHjze+OSLuJqkaYzockZyPnebr14RcjHV9AXTNVsPQqVF N91JWnzi3m/BBao49ojcZaB0eoi7OJXL8+KtpsqZbAYnmBODVOVRRJBGy3vGxKA/JUiP RkGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268696; x=1699873496; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vePePWiaVFUAUv821iwYutEeShxemZReiuwQp7UFnAo=; b=oHfoSPauCpIw5UtZq6gu2NgAisbq6DHxYK2lyhX8Hd+2c6YbuuKratFaM8/3Aaqm/+ +c8Ofm3ze5l8wMFFvrWx2ljRIxQpaprPR/JBg81AZXh/TnzIXxt0kzKLe1isGH5SY7tN Altbd9pqfN7TydLJCemQ0dNvI0qqCDAHVI4l1fFiXcwlTIwmMVan9v4T0sbCC6wqrti6 nhcH8dEgydRLXnzBGIAIeQ7/AzTKp5T0I/fhUxs8kax1+VGO5UiGHSArNeU7TMgCiXKZ OtDlVEietMyxb34q5ijagKBMpwOvVfE5nIYPjfQRlkSTGF7uMXWS59x/zbVfR/y6CsIp qv7Q== X-Gm-Message-State: AOJu0YwxjUzKkk5CXgTjQsbPwZVOgnTprtVy+z0oGrfeXJevelmLXRNQ 4QP0KFYp83GC/LUBHFndkp+u/Du1SPe2uxh/uzg= X-Google-Smtp-Source: AGHT+IGU7JDB32d3EmZv97kO2MEntQmcvvGtu7x3AN/j6r3vWH3xlZC+Z5FtDVtjxNdca8AyJOth4A== X-Received: by 2002:ac2:4d93:0:b0:507:b074:ecd4 with SMTP id g19-20020ac24d93000000b00507b074ecd4mr20448646lfe.7.1699268695795; Mon, 06 Nov 2023 03:04:55 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Nicholas Piggin , Daniel Henrique Barboza , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 11/60] target/ppc: Remove CPU_RESOLVING_TYPE from 'cpu-qom.h' Date: Mon, 6 Nov 2023 12:02:43 +0100 Message-ID: <20231106110336.358-12-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::133; envelope-from=philmd@linaro.org; helo=mail-lf1-x133.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699269869174100003 CPU_RESOLVING_TYPE is a per-target definition, and is irrelevant for other targets. Move it to "cpu.h". "target/ppc/cpu-qom.h" is supposed to be target agnostic (include-able by any target). Add such mention in the header. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20231013140116.255-5-philmd@linaro.org> --- target/ppc/cpu-qom.h | 3 +-- target/ppc/cpu.h | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/target/ppc/cpu-qom.h b/target/ppc/cpu-qom.h index be33786bd8..41df51269b 100644 --- a/target/ppc/cpu-qom.h +++ b/target/ppc/cpu-qom.h @@ -1,5 +1,5 @@ /* - * QEMU PowerPC CPU + * QEMU PowerPC CPU QOM header (target agnostic) * * Copyright (c) 2012 SUSE LINUX Products GmbH * @@ -33,7 +33,6 @@ OBJECT_DECLARE_CPU_TYPE(PowerPCCPU, PowerPCCPUClass, POWE= RPC_CPU) =20 #define POWERPC_CPU_TYPE_SUFFIX "-" TYPE_POWERPC_CPU #define POWERPC_CPU_TYPE_NAME(model) model POWERPC_CPU_TYPE_SUFFIX -#define CPU_RESOLVING_TYPE TYPE_POWERPC_CPU =20 #define TYPE_HOST_POWERPC_CPU POWERPC_CPU_TYPE_NAME("host") =20 diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 24dd6b1b0a..02619e5d54 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -27,6 +27,8 @@ #include "qom/object.h" #include "hw/registerfields.h" =20 +#define CPU_RESOLVING_TYPE TYPE_POWERPC_CPU + #define TCG_GUEST_DEFAULT_MO 0 =20 #define TARGET_PAGE_BITS_64K 16 --=20 2.41.0 From nobody Wed Nov 27 09:59:42 2024 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=1699270366; cv=none; d=zohomail.com; s=zohoarc; b=Rt+w/so7A1urOJG9hSFnVJi8HG04q+h0og6ob1ESsIqeGQ5CsMHLQrEW1UWeoJVyMXD9K+ALMjv2oVBKfGbkXpiKINy+Pg5d9N/xxWUzULOBf8P0mp+8B91un6+Qq/XXA6Yh5sThRQgHGPkRkuhyhMs6/HhDE5JdqzAV9Q/Eo/s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699270366; 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=RkZROkW3VJc36/l321YGkxp/mj9LkNXWejNsMfklYm4=; b=TelJR/V9Md0Ullh9OGkHAGWU3hBePKeLBWGWlNWFAQh11vtnsgVTkuMXqIF4RHoZbzrKEsgzHY4JwTEm+lRUdSBYxkdzDYFR788Hhj4ZbDxcI8UUd/ynjJRtHYfUJb97OgxO36x4U19F0blvi2bTlLmgASllkG96VplU905kQU0= 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 1699270365962868.6838519175977; Mon, 6 Nov 2023 03:32:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxPv-00085d-E5; Mon, 06 Nov 2023 06:05:15 -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 1qzxPo-0007tU-6v for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:05:08 -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 1qzxPl-00040C-6A for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:05:07 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-40907b82ab9so31025645e9.1 for ; Mon, 06 Nov 2023 03:05:03 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id k9-20020a056000004900b0032dbf26e7aesm8956250wrx.65.2023.11.06.03.05.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:05:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268702; x=1699873502; 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=RkZROkW3VJc36/l321YGkxp/mj9LkNXWejNsMfklYm4=; b=M0jyDKDuA29/C5IXYxKTLsJAiQuNekWnXhzb70fveFPwlNltGzICV1WS5yJTA1F0YD 911Hbxzw9s9vdh6MYv6JjslYwQpqZLIyaeSwv7BrxLinpsWvtglAr8ctVz/Qtk/nCyr1 uZdXSYjox5cCzfnCkYv5JjPcB1X1M3lNKrpPV6d4LMUbkyA1Wzgg+m2IZk8m3OF08fSW oZvNXOw9qG+wHH65zbdKEVs0ZlcAnmo59BOjjkX7Ya6+g3/GlHeOSwNko1L4mFIl29rS bUG4+oNr78LJW/rXCKxKSeV4MoLxnyLYLlqO3mNzlkjgxdkUWTYLGFYoJOTU9aFJnp5b eQHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268702; x=1699873502; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RkZROkW3VJc36/l321YGkxp/mj9LkNXWejNsMfklYm4=; b=MoV00E0zhVGZtrKLbUMc5ouCgmoomuyJJQ875mrd1M9W45U3Vx0dE7Ikf2o+sP4Gxn dph4Dv/hZuDBtw9/17MKuXFiSNyVKHBxHRsPVEsrupdKhrAleGTyus1Ge4kfiKCarg4X HIGdukDzWT2K50jQNNJTvJd0jh/OuJtCc9J0cIu0phhbm4puQU2wjwpEcKt3zhwjR9f7 ph/amDbXNSY4qLEbuQV/0FmdZgPmSUJ0xSLtt1nTvohFPQeVrIPl8CpO4ULVJ3oySakw I3IOXAAqH6YBuls0yLltzXnFFUHjstyrdh9pP76Jt+CEntYAXJ+fBR1625w+S6UHV/ew WwaA== X-Gm-Message-State: AOJu0YzSwG9pqUst757KSFAQMnNxQ+vXkTu+VstVVwZMJGdOYyZrQh2U lrR/hGtmt8OpI3CSlpyuqW5U8vUhwneYS6hum04= X-Google-Smtp-Source: AGHT+IGPi0CoBElw4e4e166oDDPnxqGeqjewSbN0jbUXOO8Wcvzxylrv4M0+O34JS3v7Ej+kyRAkyA== X-Received: by 2002:a05:6000:1845:b0:32d:a431:9045 with SMTP id c5-20020a056000184500b0032da4319045mr10462910wri.30.1699268702575; Mon, 06 Nov 2023 03:05:02 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , LIU Zhiwei , Richard Henderson , Palmer Dabbelt , Alistair Francis , Bin Meng , Weiwei Li , Daniel Henrique Barboza Subject: [PULL 12/60] target/riscv: Remove CPU_RESOLVING_TYPE from 'cpu-qom.h' Date: Mon, 6 Nov 2023 12:02:44 +0100 Message-ID: <20231106110336.358-13-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699270367830100002 CPU_RESOLVING_TYPE is a per-target definition, and is irrelevant for other targets. Move it to "cpu.h". Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: LIU Zhiwei Reviewed-by: Richard Henderson Message-Id: <20231013140116.255-6-philmd@linaro.org> --- target/riscv/cpu-qom.h | 1 - target/riscv/cpu.h | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/target/riscv/cpu-qom.h b/target/riscv/cpu-qom.h index b9164a8e5b..b78169093f 100644 --- a/target/riscv/cpu-qom.h +++ b/target/riscv/cpu-qom.h @@ -27,7 +27,6 @@ =20 #define RISCV_CPU_TYPE_SUFFIX "-" TYPE_RISCV_CPU #define RISCV_CPU_TYPE_NAME(name) (name RISCV_CPU_TYPE_SUFFIX) -#define CPU_RESOLVING_TYPE TYPE_RISCV_CPU =20 #define TYPE_RISCV_CPU_ANY RISCV_CPU_TYPE_NAME("any") #define TYPE_RISCV_CPU_MAX RISCV_CPU_TYPE_NAME("max") diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index f0dc257a75..144cc94cce 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -32,6 +32,8 @@ #include "qapi/qapi-types-common.h" #include "cpu-qom.h" =20 +#define CPU_RESOLVING_TYPE TYPE_RISCV_CPU + #define TCG_GUEST_DEFAULT_MO 0 =20 /* --=20 2.41.0 From nobody Wed Nov 27 09:59:42 2024 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=1699268966; cv=none; d=zohomail.com; s=zohoarc; b=jVhblGntuu0Zud6bpD84g78a9FKeTEwg9EJK00uTmNYIvv8eJqj8Gv1CoBBfbymB2jbz0Xd/nzzAk6ZWj7lJ3x7JuS2UYb1QO+SavcfarzECNweKKqq5JTrn7TSnikQGHMIDniWied5HKtDqqziEannp5r+49nnQxkMM6QlJXNQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699268966; 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=WxUmiCwPV5zJl3mXwLh1MUI3WD6xJyg5vO6bbT+CodM=; b=EZcLd+/jxjbpgYAMcqLoHeJSEjiKQo8RVdSMK5AASEQHHmpeiOCOIJ8i1772QMp/v3ZnT00yaauvnP/D2WxFC/s3UihQMEQpKU8OABIBqbBpTZZ/Vi9Z911XxewmN0hnB+7Bg4Xxi+YXlmHhw2it23rdacsHyfyT3Lh2aPvdsYc= 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 1699268966647736.3213171000309; Mon, 6 Nov 2023 03:09:26 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxQ0-0008St-PT; Mon, 06 Nov 2023 06:05:20 -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 1qzxPx-0008EQ-HE for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:05:17 -0500 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxPu-0004B7-DC for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:05:17 -0500 Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2c5629fdbf8so53883391fa.0 for ; Mon, 06 Nov 2023 03:05:12 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id a11-20020a05600c2d4b00b00405c33a9a12sm6133016wmg.0.2023.11.06.03.05.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:05:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268711; x=1699873511; 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=WxUmiCwPV5zJl3mXwLh1MUI3WD6xJyg5vO6bbT+CodM=; b=kq0nTazuB4qqGquARPQQnMIYklCVH7C8OMeJK7OIQBDu2EGNZGQuXNq7gtqL9blY9Z 9xMjaGJnz/A0ddisY1ir57jP7VlKnB0bwAMoSKUMuiLHt7Ny6Ro2bb2v7LGgNhh2hh8t LCohPs0Iyboi7L4wP4I2c4fx3fhLombW9zwxbPupVzYVpZOvEab+luSTVo/xrZgvC63Z Gh/YIIotRaa++DSyNJyC69GU6WOIsqujfYKF5f3GxDSlz/6W1t3Z8ubJ25j5DC357dOE NVH5sjScHVxS87dWeSzHtxLZEK9+BEPbE7kNL9aJ7zW9B2KrXo0eEOex0yjbZgU8DUq2 /9sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268711; x=1699873511; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WxUmiCwPV5zJl3mXwLh1MUI3WD6xJyg5vO6bbT+CodM=; b=fJ891ayLBkeure8x3zlR5/kOi+l+xQU2FHsYfRSUl4OlHBQ3S215qBdjdXZb3ZPnvx zaY03w2JT2J69TqZwK2XCKE/n3PwODv4kc3WZDxiSA5nO693tEkdyHH4/URkQuhwN1T3 nuZBKKGi8KP0dhtlGyppzwdmzMh3GhfoIi5JvxEb6hF5RHgKUq+pHQ6qDcPgHyrG+2Mo PQ2qWpq0BTCZfZZ9ZeoqLBpV2PU23Fs+MC1WMN7Dl6j+62AHEsql2J/oo2tmhUYPG30M qwzcCF4aCKqgOTSj4nEFpeNvMbzWUcmTudDtsX3l/aIdqS5XsuRBW2lvSrAfIvQ3RLZx r34w== X-Gm-Message-State: AOJu0YxjqydJpqQjyc5Fl+yqccfNqOfHu13micoRzv6G2pqykrufdME2 KTgmcnq1+6pTlNGL8HTS4xiUtXGxkfHIk8pGLqo= X-Google-Smtp-Source: AGHT+IGesghmwnsW7pNz/cPIy+OAEt0HtfvDXrPkmNh4TvVN2ENKoIeGC2Q+uLhqqoE2yhO8HQohrw== X-Received: by 2002:a2e:b0e5:0:b0:2c5:2813:5538 with SMTP id h5-20020a2eb0e5000000b002c528135538mr22071679ljl.21.1699268710824; Mon, 06 Nov 2023 03:05:10 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , LIU Zhiwei , Richard Henderson , Michael Rolnik , "Edgar E. Iglesias" , Laurent Vivier , Aurelien Jarno , Jiaxun Yang , Aleksandar Rikalo , Yoshinori Sato , David Hildenbrand , Ilya Leoshkevich , Thomas Huth , Mark Cave-Ayland , Artyom Tarasenko , Bastian Koppelmann , Max Filippov Subject: [PULL 13/60] target: Declare FOO_CPU_TYPE_NAME/SUFFIX in 'cpu-qom.h' Date: Mon, 6 Nov 2023 12:02:45 +0100 Message-ID: <20231106110336.358-14-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::229; envelope-from=philmd@linaro.org; helo=mail-lj1-x229.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699268968039100003 Hegerogeneous code needs access to the FOO_CPU_TYPE_NAME() macro to resolve target CPU types. Move the declaration (along with the required FOO_CPU_TYPE_SUFFIX) to "cpu-qom.h". "target/foo/cpu-qom.h" is supposed to be target agnostic (include-able by any target). Add such mention in the header. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: LIU Zhiwei Reviewed-by: Richard Henderson Message-Id: <20231013140116.255-7-philmd@linaro.org> --- target/alpha/cpu-qom.h | 5 ++++- target/alpha/cpu.h | 2 -- target/avr/cpu-qom.h | 5 ++++- target/avr/cpu.h | 2 -- target/cris/cpu-qom.h | 5 ++++- target/cris/cpu.h | 2 -- target/i386/cpu-qom.h | 3 +++ target/i386/cpu.h | 2 -- target/m68k/cpu-qom.h | 5 ++++- target/m68k/cpu.h | 2 -- target/mips/cpu-qom.h | 3 +++ target/mips/cpu.h | 2 -- target/rx/cpu-qom.h | 5 ++++- target/rx/cpu.h | 2 -- target/s390x/cpu-qom.h | 5 ++++- target/s390x/cpu.h | 2 -- target/sh4/cpu-qom.h | 5 ++++- target/sh4/cpu.h | 2 -- target/sparc/cpu-qom.h | 5 ++++- target/sparc/cpu.h | 2 -- target/tricore/cpu-qom.h | 5 +++++ target/tricore/cpu.h | 2 -- target/xtensa/cpu-qom.h | 5 ++++- target/xtensa/cpu.h | 2 -- 24 files changed, 47 insertions(+), 33 deletions(-) diff --git a/target/alpha/cpu-qom.h b/target/alpha/cpu-qom.h index c5fbd8f11a..c4a4523993 100644 --- a/target/alpha/cpu-qom.h +++ b/target/alpha/cpu-qom.h @@ -1,5 +1,5 @@ /* - * QEMU Alpha CPU + * QEMU Alpha CPU QOM header (target agnostic) * * Copyright (c) 2012 SUSE LINUX Products GmbH * @@ -27,6 +27,9 @@ =20 OBJECT_DECLARE_CPU_TYPE(AlphaCPU, AlphaCPUClass, ALPHA_CPU) =20 +#define ALPHA_CPU_TYPE_SUFFIX "-" TYPE_ALPHA_CPU +#define ALPHA_CPU_TYPE_NAME(model) model ALPHA_CPU_TYPE_SUFFIX + /** * AlphaCPUClass: * @parent_realize: The parent class' realize handler. diff --git a/target/alpha/cpu.h b/target/alpha/cpu.h index c8d97ac27a..3bff56c565 100644 --- a/target/alpha/cpu.h +++ b/target/alpha/cpu.h @@ -426,8 +426,6 @@ enum { =20 void alpha_translate_init(void); =20 -#define ALPHA_CPU_TYPE_SUFFIX "-" TYPE_ALPHA_CPU -#define ALPHA_CPU_TYPE_NAME(model) model ALPHA_CPU_TYPE_SUFFIX #define CPU_RESOLVING_TYPE TYPE_ALPHA_CPU =20 void alpha_cpu_list(void); diff --git a/target/avr/cpu-qom.h b/target/avr/cpu-qom.h index d89be01e0f..75590cdd97 100644 --- a/target/avr/cpu-qom.h +++ b/target/avr/cpu-qom.h @@ -1,5 +1,5 @@ /* - * QEMU AVR CPU + * QEMU AVR CPU QOM header (target agnostic) * * Copyright (c) 2016-2020 Michael Rolnik * @@ -28,6 +28,9 @@ =20 OBJECT_DECLARE_CPU_TYPE(AVRCPU, AVRCPUClass, AVR_CPU) =20 +#define AVR_CPU_TYPE_SUFFIX "-" TYPE_AVR_CPU +#define AVR_CPU_TYPE_NAME(name) (name AVR_CPU_TYPE_SUFFIX) + /** * AVRCPUClass: * @parent_realize: The parent class' realize handler. diff --git a/target/avr/cpu.h b/target/avr/cpu.h index f8b065ed79..0487399cb2 100644 --- a/target/avr/cpu.h +++ b/target/avr/cpu.h @@ -28,8 +28,6 @@ #error "AVR 8-bit does not support user mode" #endif =20 -#define AVR_CPU_TYPE_SUFFIX "-" TYPE_AVR_CPU -#define AVR_CPU_TYPE_NAME(name) (name AVR_CPU_TYPE_SUFFIX) #define CPU_RESOLVING_TYPE TYPE_AVR_CPU =20 #define TCG_GUEST_DEFAULT_MO 0 diff --git a/target/cris/cpu-qom.h b/target/cris/cpu-qom.h index c2fee242f4..d7e5f33e62 100644 --- a/target/cris/cpu-qom.h +++ b/target/cris/cpu-qom.h @@ -1,5 +1,5 @@ /* - * QEMU CRIS CPU + * QEMU CRIS CPU QOM header (target agnostic) * * Copyright (c) 2012 SUSE LINUX Products GmbH * @@ -27,6 +27,9 @@ =20 OBJECT_DECLARE_CPU_TYPE(CRISCPU, CRISCPUClass, CRIS_CPU) =20 +#define CRIS_CPU_TYPE_SUFFIX "-" TYPE_CRIS_CPU +#define CRIS_CPU_TYPE_NAME(name) (name CRIS_CPU_TYPE_SUFFIX) + /** * CRISCPUClass: * @parent_realize: The parent class' realize handler. diff --git a/target/cris/cpu.h b/target/cris/cpu.h index 6aa445348f..b821bb7983 100644 --- a/target/cris/cpu.h +++ b/target/cris/cpu.h @@ -240,8 +240,6 @@ enum { /* CRIS uses 8k pages. */ #define MMAP_SHIFT TARGET_PAGE_BITS =20 -#define CRIS_CPU_TYPE_SUFFIX "-" TYPE_CRIS_CPU -#define CRIS_CPU_TYPE_NAME(name) (name CRIS_CPU_TYPE_SUFFIX) #define CPU_RESOLVING_TYPE TYPE_CRIS_CPU =20 /* MMU modes definitions */ diff --git a/target/i386/cpu-qom.h b/target/i386/cpu-qom.h index 58145717ef..dffc74c1ce 100644 --- a/target/i386/cpu-qom.h +++ b/target/i386/cpu-qom.h @@ -32,6 +32,9 @@ =20 OBJECT_DECLARE_CPU_TYPE(X86CPU, X86CPUClass, X86_CPU) =20 +#define X86_CPU_TYPE_SUFFIX "-" TYPE_X86_CPU +#define X86_CPU_TYPE_NAME(name) (name X86_CPU_TYPE_SUFFIX) + typedef struct X86CPUModel X86CPUModel; =20 /** diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 096f85483e..6c6b066986 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -2239,8 +2239,6 @@ void cpu_x86_update_dr7(CPUX86State *env, uint32_t ne= w_dr7); /* hw/pc.c */ uint64_t cpu_get_tsc(CPUX86State *env); =20 -#define X86_CPU_TYPE_SUFFIX "-" TYPE_X86_CPU -#define X86_CPU_TYPE_NAME(name) (name X86_CPU_TYPE_SUFFIX) #define CPU_RESOLVING_TYPE TYPE_X86_CPU =20 #ifdef TARGET_X86_64 diff --git a/target/m68k/cpu-qom.h b/target/m68k/cpu-qom.h index 13d94c9fe3..df0cc8b7a3 100644 --- a/target/m68k/cpu-qom.h +++ b/target/m68k/cpu-qom.h @@ -1,5 +1,5 @@ /* - * QEMU Motorola 68k CPU + * QEMU Motorola 68k CPU QOM header (target agnostic) * * Copyright (c) 2012 SUSE LINUX Products GmbH * @@ -27,6 +27,9 @@ =20 OBJECT_DECLARE_CPU_TYPE(M68kCPU, M68kCPUClass, M68K_CPU) =20 +#define M68K_CPU_TYPE_SUFFIX "-" TYPE_M68K_CPU +#define M68K_CPU_TYPE_NAME(model) model M68K_CPU_TYPE_SUFFIX + /* * M68kCPUClass: * @parent_realize: The parent class' realize handler. diff --git a/target/m68k/cpu.h b/target/m68k/cpu.h index 9ea18028ad..7f34686a6f 100644 --- a/target/m68k/cpu.h +++ b/target/m68k/cpu.h @@ -561,8 +561,6 @@ enum { ACCESS_DATA =3D 0x20, /* Data load/store access */ }; =20 -#define M68K_CPU_TYPE_SUFFIX "-" TYPE_M68K_CPU -#define M68K_CPU_TYPE_NAME(model) model M68K_CPU_TYPE_SUFFIX #define CPU_RESOLVING_TYPE TYPE_M68K_CPU =20 #define cpu_list m68k_cpu_list diff --git a/target/mips/cpu-qom.h b/target/mips/cpu-qom.h index c70b4a34be..5822dfb1d2 100644 --- a/target/mips/cpu-qom.h +++ b/target/mips/cpu-qom.h @@ -31,6 +31,9 @@ =20 OBJECT_DECLARE_CPU_TYPE(MIPSCPU, MIPSCPUClass, MIPS_CPU) =20 +#define MIPS_CPU_TYPE_SUFFIX "-" TYPE_MIPS_CPU +#define MIPS_CPU_TYPE_NAME(model) model MIPS_CPU_TYPE_SUFFIX + /** * MIPSCPUClass: * @parent_realize: The parent class' realize handler. diff --git a/target/mips/cpu.h b/target/mips/cpu.h index 617c373797..12cc1bfafd 100644 --- a/target/mips/cpu.h +++ b/target/mips/cpu.h @@ -1301,8 +1301,6 @@ enum { */ #define CPU_INTERRUPT_WAKE CPU_INTERRUPT_TGT_INT_0 =20 -#define MIPS_CPU_TYPE_SUFFIX "-" TYPE_MIPS_CPU -#define MIPS_CPU_TYPE_NAME(model) model MIPS_CPU_TYPE_SUFFIX #define CPU_RESOLVING_TYPE TYPE_MIPS_CPU =20 bool cpu_type_supports_cps_smp(const char *cpu_type); diff --git a/target/rx/cpu-qom.h b/target/rx/cpu-qom.h index f4cd5664e5..6213d877f7 100644 --- a/target/rx/cpu-qom.h +++ b/target/rx/cpu-qom.h @@ -1,5 +1,5 @@ /* - * RX CPU + * QEMU RX CPU QOM header (target agnostic) * * Copyright (c) 2019 Yoshinori Sato * @@ -28,6 +28,9 @@ =20 OBJECT_DECLARE_CPU_TYPE(RXCPU, RXCPUClass, RX_CPU) =20 +#define RX_CPU_TYPE_SUFFIX "-" TYPE_RX_CPU +#define RX_CPU_TYPE_NAME(model) model RX_CPU_TYPE_SUFFIX + /* * RXCPUClass: * @parent_realize: The parent class' realize handler. diff --git a/target/rx/cpu.h b/target/rx/cpu.h index 8379f4a150..c81613770c 100644 --- a/target/rx/cpu.h +++ b/target/rx/cpu.h @@ -112,8 +112,6 @@ struct ArchCPU { CPURXState env; }; =20 -#define RX_CPU_TYPE_SUFFIX "-" TYPE_RX_CPU -#define RX_CPU_TYPE_NAME(model) model RX_CPU_TYPE_SUFFIX #define CPU_RESOLVING_TYPE TYPE_RX_CPU =20 const char *rx_crname(uint8_t cr); diff --git a/target/s390x/cpu-qom.h b/target/s390x/cpu-qom.h index 1088965fd5..fcd70daddf 100644 --- a/target/s390x/cpu-qom.h +++ b/target/s390x/cpu-qom.h @@ -1,5 +1,5 @@ /* - * QEMU S/390 CPU + * QEMU S/390 CPU QOM header (target agnostic) * * Copyright (c) 2012 SUSE LINUX Products GmbH * @@ -27,6 +27,9 @@ =20 OBJECT_DECLARE_CPU_TYPE(S390CPU, S390CPUClass, S390_CPU) =20 +#define S390_CPU_TYPE_SUFFIX "-" TYPE_S390_CPU +#define S390_CPU_TYPE_NAME(name) (name S390_CPU_TYPE_SUFFIX) + typedef struct S390CPUModel S390CPUModel; typedef struct S390CPUDef S390CPUDef; =20 diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index 4f366f9e4e..38d7197f4c 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -890,8 +890,6 @@ void s390_set_qemu_cpu_model(uint16_t type, uint8_t gen= , uint8_t ec_ga, =20 =20 /* helper.c */ -#define S390_CPU_TYPE_SUFFIX "-" TYPE_S390_CPU -#define S390_CPU_TYPE_NAME(name) (name S390_CPU_TYPE_SUFFIX) #define CPU_RESOLVING_TYPE TYPE_S390_CPU =20 /* interrupt.c */ diff --git a/target/sh4/cpu-qom.h b/target/sh4/cpu-qom.h index 08fbebc996..bd0ef49fa1 100644 --- a/target/sh4/cpu-qom.h +++ b/target/sh4/cpu-qom.h @@ -1,5 +1,5 @@ /* - * QEMU SuperH CPU + * QEMU SuperH CPU QOM header (target agnostic) * * Copyright (c) 2012 SUSE LINUX Products GmbH * @@ -31,6 +31,9 @@ =20 OBJECT_DECLARE_CPU_TYPE(SuperHCPU, SuperHCPUClass, SUPERH_CPU) =20 +#define SUPERH_CPU_TYPE_SUFFIX "-" TYPE_SUPERH_CPU +#define SUPERH_CPU_TYPE_NAME(model) model SUPERH_CPU_TYPE_SUFFIX + /** * SuperHCPUClass: * @parent_realize: The parent class' realize handler. diff --git a/target/sh4/cpu.h b/target/sh4/cpu.h index dc0561b73b..dbe00e29c2 100644 --- a/target/sh4/cpu.h +++ b/target/sh4/cpu.h @@ -250,8 +250,6 @@ int cpu_sh4_is_cached(CPUSH4State * env, target_ulong a= ddr); =20 void cpu_load_tlb(CPUSH4State * env); =20 -#define SUPERH_CPU_TYPE_SUFFIX "-" TYPE_SUPERH_CPU -#define SUPERH_CPU_TYPE_NAME(model) model SUPERH_CPU_TYPE_SUFFIX #define CPU_RESOLVING_TYPE TYPE_SUPERH_CPU =20 #define cpu_list sh4_cpu_list diff --git a/target/sparc/cpu-qom.h b/target/sparc/cpu-qom.h index b4a0db84ce..aca29415b4 100644 --- a/target/sparc/cpu-qom.h +++ b/target/sparc/cpu-qom.h @@ -1,5 +1,5 @@ /* - * QEMU SPARC CPU + * QEMU SPARC CPU QOM header (target agnostic) * * Copyright (c) 2012 SUSE LINUX Products GmbH * @@ -31,6 +31,9 @@ =20 OBJECT_DECLARE_CPU_TYPE(SPARCCPU, SPARCCPUClass, SPARC_CPU) =20 +#define SPARC_CPU_TYPE_SUFFIX "-" TYPE_SPARC_CPU +#define SPARC_CPU_TYPE_NAME(model) model SPARC_CPU_TYPE_SUFFIX + typedef struct sparc_def_t sparc_def_t; /** * SPARCCPUClass: diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h index 84a030e406..8c567037cb 100644 --- a/target/sparc/cpu.h +++ b/target/sparc/cpu.h @@ -660,8 +660,6 @@ hwaddr cpu_get_phys_page_nofault(CPUSPARCState *env, ta= rget_ulong addr, #endif #endif =20 -#define SPARC_CPU_TYPE_SUFFIX "-" TYPE_SPARC_CPU -#define SPARC_CPU_TYPE_NAME(model) model SPARC_CPU_TYPE_SUFFIX #define CPU_RESOLVING_TYPE TYPE_SPARC_CPU =20 #define cpu_list sparc_cpu_list diff --git a/target/tricore/cpu-qom.h b/target/tricore/cpu-qom.h index b3b6c75a3a..2598651008 100644 --- a/target/tricore/cpu-qom.h +++ b/target/tricore/cpu-qom.h @@ -1,4 +1,6 @@ /* + * QEMU TriCore CPU QOM header (target agnostic) + * * Copyright (c) 2012-2014 Bastian Koppelmann C-Lab/University Paderborn * * This library is free software; you can redistribute it and/or @@ -26,6 +28,9 @@ =20 OBJECT_DECLARE_CPU_TYPE(TriCoreCPU, TriCoreCPUClass, TRICORE_CPU) =20 +#define TRICORE_CPU_TYPE_SUFFIX "-" TYPE_TRICORE_CPU +#define TRICORE_CPU_TYPE_NAME(model) model TRICORE_CPU_TYPE_SUFFIX + struct TriCoreCPUClass { CPUClass parent_class; =20 diff --git a/target/tricore/cpu.h b/target/tricore/cpu.h index b4a6ab141d..c537a33ee8 100644 --- a/target/tricore/cpu.h +++ b/target/tricore/cpu.h @@ -268,8 +268,6 @@ static inline void cpu_get_tb_cpu_state(CPUTriCoreState= *env, vaddr *pc, *flags =3D new_flags; } =20 -#define TRICORE_CPU_TYPE_SUFFIX "-" TYPE_TRICORE_CPU -#define TRICORE_CPU_TYPE_NAME(model) model TRICORE_CPU_TYPE_SUFFIX #define CPU_RESOLVING_TYPE TYPE_TRICORE_CPU =20 /* helpers.c */ diff --git a/target/xtensa/cpu-qom.h b/target/xtensa/cpu-qom.h index 424bcbd8dd..03873ea50b 100644 --- a/target/xtensa/cpu-qom.h +++ b/target/xtensa/cpu-qom.h @@ -1,5 +1,5 @@ /* - * QEMU Xtensa CPU + * QEMU Xtensa CPU QOM header (target agnostic) * * Copyright (c) 2012 SUSE LINUX Products GmbH * All rights reserved. @@ -36,6 +36,9 @@ =20 OBJECT_DECLARE_CPU_TYPE(XtensaCPU, XtensaCPUClass, XTENSA_CPU) =20 +#define XTENSA_CPU_TYPE_SUFFIX "-" TYPE_XTENSA_CPU +#define XTENSA_CPU_TYPE_NAME(model) model XTENSA_CPU_TYPE_SUFFIX + typedef struct XtensaConfig XtensaConfig; =20 /** diff --git a/target/xtensa/cpu.h b/target/xtensa/cpu.h index 85aab1bdf8..d6d2fb1f4e 100644 --- a/target/xtensa/cpu.h +++ b/target/xtensa/cpu.h @@ -586,8 +586,6 @@ G_NORETURN void xtensa_cpu_do_unaligned_access(CPUState= *cpu, vaddr addr, =20 #define cpu_list xtensa_cpu_list =20 -#define XTENSA_CPU_TYPE_SUFFIX "-" TYPE_XTENSA_CPU -#define XTENSA_CPU_TYPE_NAME(model) model XTENSA_CPU_TYPE_SUFFIX #define CPU_RESOLVING_TYPE TYPE_XTENSA_CPU =20 #if TARGET_BIG_ENDIAN --=20 2.41.0 From nobody Wed Nov 27 09:59:42 2024 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=1699269371; cv=none; d=zohomail.com; s=zohoarc; b=MfwwkqfDIAzXaF8ZiofnYa4kZHbzubXJuA50Y83VmduwOUxCDM497oLvxw0KHBsDT1/h1njUoLubDpLoSQaPw9Kum2YfIMFLLb+bVpPybR62BsbpozgiIKwO5LRVbWvusRzR+9+o8F7NeygogDSWR8LVezN4cHMOQ83Ylxq3HTc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699269371; 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=vep8ejgClIB/0OUtyRO014f5iK14K4Tf/g8eVxuuhkY=; b=l7y3assny8fOmmFjuVGqPrvDNhO1J2xHgUGlKkwJ9ALsIfJudu28SNTNrqJI09kWXM9uqtCNzUeR2qmQN1Nc7JRCD6VuAtbcp1NOjBnsDh4cB5AQ3iYkKU96Ju8sW56famPsMSqASAQ3qNA4ZCf/OYa0SGvMw/RozunfvMsFtyM= 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 1699269371901313.6184492544072; Mon, 6 Nov 2023 03:16:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxQJ-0000W1-Ay; Mon, 06 Nov 2023 06:05: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 1qzxQB-0000HN-7C for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:05:32 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxPz-0004D6-8D for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:05:30 -0500 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-32f9268bf8cso2602456f8f.0 for ; Mon, 06 Nov 2023 03:05:18 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id l9-20020adfe589000000b0032f7d7ec4adsm9108143wrm.92.2023.11.06.03.05.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:05:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268717; x=1699873517; 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=vep8ejgClIB/0OUtyRO014f5iK14K4Tf/g8eVxuuhkY=; b=YQg8L2P0it4YSIoMv9sBPS3ZoO+DpcMyo6+SIY16dLD8EvJhcnw+LZJb3fZN+ESqdt XCXejmVRDVSe/pLrvF5JshqDB0ZLACWA4xTZ3EBU9H3uwhBbCRRdsaTyELT41wPFIA0g h3wM+8l+BBWvRl2Hh7DCJV2/cRdSoZnM2x4/LzQxjTzuk07JkE89e6iE5eozA/k2oEwH nYjeelWBiQT2an5HdtsnoyiS/xxuIHUxtTXAEn813cEcLzCwRdWcwGeIWuwKbDyu89mL sv37S/+cMk6QGv09fBT/KYHHhcExlBc6PBaU0eWFz5xITe+q1Wyc1OuViGQms700iyuS ce7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268717; x=1699873517; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vep8ejgClIB/0OUtyRO014f5iK14K4Tf/g8eVxuuhkY=; b=oS/IBCDeipZac/raA7pypfKZnNPFdBBRadsjXklBG/yFkJ0W5wE0PGJbpAOshofHgz /7bZnzuLbW2d2VXL2gIBBzkj3v9e3bc+ULgmmOFWLcaPqCdRPG9gWbJvc7uVbxFljjTT jPIY282X8uk12dJzJzMZakjR5pH3AgQ/HjSH8OM1dN4ABJkcdQLXGiE/hA5IhRZ6OSAK fQsTgBq9PLi7OhvJ+Bo4yxM1tQ0rv5ussCxMdtbCAiCHf2S8jaRj+jUSNQayM2nJ6Ee9 DlT2liTi3DiM3Yu6y+zmrPa1PJLw3vQC+XZLnc1c6SVp7e6a8KtiVqGrus1YbD+k2qdK VMJw== X-Gm-Message-State: AOJu0Yw62UWsdlNDiriOuEDedA5XXiJJmOWWBk+3zp813B5ePH7Iwgfm UOoAZYixaxYm5NpaozuBiaP4+VghpcHSB2Vr/cE= X-Google-Smtp-Source: AGHT+IFGvT0btHnF3YPkzx9cmFeVj8iEZzjdIY/tcCq/l6fv1iFj5XC77e6JGhJHntN6X+4R9AYh8Q== X-Received: by 2002:a05:6000:186c:b0:32f:7a65:da64 with SMTP id d12-20020a056000186c00b0032f7a65da64mr24414146wri.65.1699268717450; Mon, 06 Nov 2023 03:05:17 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Brian Cain Subject: [PULL 14/60] target/hexagon: Declare QOM definitions in 'cpu-qom.h' Date: Mon, 6 Nov 2023 12:02:46 +0100 Message-ID: <20231106110336.358-15-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699269373798100003 "target/foo/cpu.h" contains the target specific declarations. A heterogeneous setup need to access target agnostic declarations (at least the QOM ones, to instantiate the objects). Our convention is to add such target agnostic QOM declarations in the "target/foo/cpu-qom.h" header. Add a comment clarifying that in the header. Extract QOM definitions from "cpu.h" to "cpu-qom.h". Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Brian Cain Message-Id: <20231013140116.255-8-philmd@linaro.org> --- target/hexagon/cpu-qom.h | 28 ++++++++++++++++++++++++++++ target/hexagon/cpu.h | 15 +-------------- 2 files changed, 29 insertions(+), 14 deletions(-) create mode 100644 target/hexagon/cpu-qom.h diff --git a/target/hexagon/cpu-qom.h b/target/hexagon/cpu-qom.h new file mode 100644 index 0000000000..f02df7ee6f --- /dev/null +++ b/target/hexagon/cpu-qom.h @@ -0,0 +1,28 @@ +/* + * QEMU Hexagon CPU QOM header (target agnostic) + * + * Copyright(c) 2019-2023 Qualcomm Innovation Center, Inc. All Rights Rese= rved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef QEMU_HEXAGON_CPU_QOM_H +#define QEMU_HEXAGON_CPU_QOM_H + +#include "hw/core/cpu.h" +#include "qom/object.h" + +#define TYPE_HEXAGON_CPU "hexagon-cpu" + +#define HEXAGON_CPU_TYPE_SUFFIX "-" TYPE_HEXAGON_CPU +#define HEXAGON_CPU_TYPE_NAME(name) (name HEXAGON_CPU_TYPE_SUFFIX) + +#define TYPE_HEXAGON_CPU_V67 HEXAGON_CPU_TYPE_NAME("v67") +#define TYPE_HEXAGON_CPU_V68 HEXAGON_CPU_TYPE_NAME("v68") +#define TYPE_HEXAGON_CPU_V69 HEXAGON_CPU_TYPE_NAME("v69") +#define TYPE_HEXAGON_CPU_V71 HEXAGON_CPU_TYPE_NAME("v71") +#define TYPE_HEXAGON_CPU_V73 HEXAGON_CPU_TYPE_NAME("v73") + +OBJECT_DECLARE_CPU_TYPE(HexagonCPU, HexagonCPUClass, HEXAGON_CPU) + +#endif diff --git a/target/hexagon/cpu.h b/target/hexagon/cpu.h index 035ac4fb6d..7d16083c6a 100644 --- a/target/hexagon/cpu.h +++ b/target/hexagon/cpu.h @@ -20,11 +20,10 @@ =20 #include "fpu/softfloat-types.h" =20 +#include "cpu-qom.h" #include "exec/cpu-defs.h" #include "hex_regs.h" #include "mmvec/mmvec.h" -#include "qom/object.h" -#include "hw/core/cpu.h" #include "hw/registerfields.h" =20 #define NUM_PREGS 4 @@ -36,18 +35,8 @@ #define PRED_WRITES_MAX 5 /* 4 insns + endloop */ #define VSTORES_MAX 2 =20 -#define TYPE_HEXAGON_CPU "hexagon-cpu" - -#define HEXAGON_CPU_TYPE_SUFFIX "-" TYPE_HEXAGON_CPU -#define HEXAGON_CPU_TYPE_NAME(name) (name HEXAGON_CPU_TYPE_SUFFIX) #define CPU_RESOLVING_TYPE TYPE_HEXAGON_CPU =20 -#define TYPE_HEXAGON_CPU_V67 HEXAGON_CPU_TYPE_NAME("v67") -#define TYPE_HEXAGON_CPU_V68 HEXAGON_CPU_TYPE_NAME("v68") -#define TYPE_HEXAGON_CPU_V69 HEXAGON_CPU_TYPE_NAME("v69") -#define TYPE_HEXAGON_CPU_V71 HEXAGON_CPU_TYPE_NAME("v71") -#define TYPE_HEXAGON_CPU_V73 HEXAGON_CPU_TYPE_NAME("v73") - void hexagon_cpu_list(void); #define cpu_list hexagon_cpu_list =20 @@ -127,8 +116,6 @@ typedef struct CPUArchState { VTCMStoreLog vtcm_log; } CPUHexagonState; =20 -OBJECT_DECLARE_CPU_TYPE(HexagonCPU, HexagonCPUClass, HEXAGON_CPU) - typedef struct HexagonCPUClass { CPUClass parent_class; =20 --=20 2.41.0 From nobody Wed Nov 27 09:59:42 2024 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=1699269378; cv=none; d=zohomail.com; s=zohoarc; b=feKmB3I33qo+sS0ogdzN8oIRu8H03/sSq99SqNfIAr1AkvYOKVLHMrhlVLfRO32JiMRUK1kRc0mViDjzs+4cpeSg8FsCpibXSTSe2eO3iVTO3IgrluZBsGE5F9hSys+oD3z7ExmvnrWCxplz3oO9Ljf9nlyjTIONMGaAbKN9ljs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699269378; 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=JXuP88BtphoINz4Bov6u/pkpdXdezQqYli4OVAIpAZI=; b=GJjPVe3i2FrmbMTyAh5w6VcarZrHKB6ai0ftKKSDnaU2V/BLBDm3NtMkncQ32KhgBsrQVHwBjuiwCxD7sMQjUpKx6RbCQkJF2YChLgRVRWSsHEWDea3Qu/bBUpIjysOh1vT0h5bDoY0t1pTwcdM1M6uOhqFFeC6cqE5Z9yW/834= 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 1699269378843715.7193378092297; Mon, 6 Nov 2023 03:16:18 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxQI-0000TD-Ui; Mon, 06 Nov 2023 06:05:38 -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 1qzxQA-0000HC-C2 for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:05:32 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxQ6-0004FT-4p for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:05:28 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-32d895584f1so2595387f8f.1 for ; Mon, 06 Nov 2023 03:05:25 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id f6-20020a5d5686000000b0032f7eaa6e43sm9161653wrv.79.2023.11.06.03.05.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:05:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268724; x=1699873524; 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=JXuP88BtphoINz4Bov6u/pkpdXdezQqYli4OVAIpAZI=; b=E6sFIdPbRUgtedzhm31+W27IgBnLNqA870oNNPo7xpe2Epet+mWfdOg0Ozzfm/AeGZ 8xnBNQQUHMZ0cSAZMIhp9Os5+jL8+vdnSJ0LRguG3tiBnrZrVq+0EmA1LoCyGMwqO4td 1n7+ukVgLh2RSJSh/G2c9AP1R5Lh6wRtkz9J+s0NP7U0afk3lyn4S6/cZUY/s+OeBWIX 9M6KLaCjTloEWlurqMztSiXJDvD9Xo9Vzt/1aGG9WB5U+IzJVItIAKMWL8Lyuwsoa0ck vicMop8uV3SNmsW69MgTWUsjRWwjFPBkfeoAPK+W9W7s6JagXP0yclD9bpQ9juGR1Amy 6JUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268724; x=1699873524; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JXuP88BtphoINz4Bov6u/pkpdXdezQqYli4OVAIpAZI=; b=sCHXVt2NI9LRnFNwixHR4MMb+5KCmm7fvqntL/4NjcrOYhCSHp3/z2YQldpxJU4JVp pGSu3uEc2lmftRBA3eIDjh5o6rY/hHYYOiR3hNOIVLaBH6HXBxtGwHuijQxU8CGRwnYq sJSsgVWsTr3KSdsflDvngqWB8F59KzomwRDxPfn8ovwZh5njOWrsp3QBnXoJvpjN612m efnAEYhDFGyU0csFIIDCEbbpPNHL2XDJWsIMe86dXExW8SiVae+OkOlKW4W+8y5bqkP4 jfldlPUdKCZlIhjHslO34O6CAHAT92T9veg+TM5EKqKx+efehV9ekT7uMB/CthUezGLC Jl7g== X-Gm-Message-State: AOJu0Yw7MoM7BBwbquWoq2bOCoY/EE/H/oZlS65VPN3dWh/dZxzsYB1E 9qdyOQ9kzK99UZ8KoMwtfKW4Iw0zlfTZiwxvg+o= X-Google-Smtp-Source: AGHT+IHaBHUQklVP9Pu5QT4vT7r66jTjw7Yf4RVyFH1CKsmkdCj1+2Bfzei9MwaofGzJpViR1lgQOw== X-Received: by 2002:adf:e6c4:0:b0:32f:adaf:be86 with SMTP id y4-20020adfe6c4000000b0032fadafbe86mr8820884wrm.16.1699268724027; Mon, 06 Nov 2023 03:05:24 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Song Gao , Richard Henderson Subject: [PULL 15/60] target/loongarch: Declare QOM definitions in 'cpu-qom.h' Date: Mon, 6 Nov 2023 12:02:47 +0100 Message-ID: <20231106110336.358-16-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699269380016100002 "target/foo/cpu.h" contains the target specific declarations. A heterogeneous setup need to access target agnostic declarations (at least the QOM ones, to instantiate the objects). Our convention is to add such target agnostic QOM declarations in the "target/foo/cpu-qom.h" header. Add a comment clarifying that in the header. Extract QOM definitions from "cpu.h" to "cpu-qom.h". Reviewed-by: Song Gao Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20231013140116.255-9-philmd@linaro.org> --- target/loongarch/cpu-qom.h | 24 ++++++++++++++++++++++++ target/loongarch/cpu.h | 10 +--------- 2 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 target/loongarch/cpu-qom.h diff --git a/target/loongarch/cpu-qom.h b/target/loongarch/cpu-qom.h new file mode 100644 index 0000000000..82c86d146d --- /dev/null +++ b/target/loongarch/cpu-qom.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * QEMU LoongArch CPU QOM header (target agnostic) + * + * Copyright (c) 2021 Loongson Technology Corporation Limited + */ + +#ifndef LOONGARCH_CPU_QOM_H +#define LOONGARCH_CPU_QOM_H + +#include "hw/core/cpu.h" +#include "qom/object.h" + +#define TYPE_LOONGARCH_CPU "loongarch-cpu" +#define TYPE_LOONGARCH32_CPU "loongarch32-cpu" +#define TYPE_LOONGARCH64_CPU "loongarch64-cpu" + +OBJECT_DECLARE_CPU_TYPE(LoongArchCPU, LoongArchCPUClass, + LOONGARCH_CPU) + +#define LOONGARCH_CPU_TYPE_SUFFIX "-" TYPE_LOONGARCH_CPU +#define LOONGARCH_CPU_TYPE_NAME(model) model LOONGARCH_CPU_TYPE_SUFFIX + +#endif diff --git a/target/loongarch/cpu.h b/target/loongarch/cpu.h index 8f0e9f0182..c8839f4cff 100644 --- a/target/loongarch/cpu.h +++ b/target/loongarch/cpu.h @@ -17,6 +17,7 @@ #include "exec/memory.h" #endif #include "cpu-csr.h" +#include "cpu-qom.h" =20 #define IOCSRF_TEMP 0 #define IOCSRF_NODECNT 1 @@ -381,13 +382,6 @@ struct ArchCPU { const char *dtb_compatible; }; =20 -#define TYPE_LOONGARCH_CPU "loongarch-cpu" -#define TYPE_LOONGARCH32_CPU "loongarch32-cpu" -#define TYPE_LOONGARCH64_CPU "loongarch64-cpu" - -OBJECT_DECLARE_CPU_TYPE(LoongArchCPU, LoongArchCPUClass, - LOONGARCH_CPU) - /** * LoongArchCPUClass: * @parent_realize: The parent class' realize handler. @@ -478,8 +472,6 @@ void loongarch_cpu_list(void); =20 #include "exec/cpu-all.h" =20 -#define LOONGARCH_CPU_TYPE_SUFFIX "-" TYPE_LOONGARCH_CPU -#define LOONGARCH_CPU_TYPE_NAME(model) model LOONGARCH_CPU_TYPE_SUFFIX #define CPU_RESOLVING_TYPE TYPE_LOONGARCH_CPU =20 #endif /* LOONGARCH_CPU_H */ --=20 2.41.0 From nobody Wed Nov 27 09:59:42 2024 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=1699270110; cv=none; d=zohomail.com; s=zohoarc; b=SkitVUTV7YcDsmoga9rESoogAEecJ5s1SczCNm29c3ajJMGrp2fcN9WspJST81YHL03mLwqqlG7ZbuAEo33jbWsisJTb+kDgbczsJ/lc9ALXMQrDpY/oWVkUkbgYxS1JuxEgnwefjCATJTc4iopRVsj45jjoOH/aPxbJAPQj4FA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699270110; 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=q3038rtVd/3WYQydMHaBWtXOqOEbAhMugZOF+LS9h+c=; b=m+BLKweT8PBqj/+ddA9AAy/nvRn8/Fxv0HSAf5u+eT3HadV6QDHa+LET8LVTZPwOwp7g1KJKR4QUieWaQwk//gaBs098/GXeMh+Jg7exIO+qenTTC1dRiuR1g44H51Dmv5Sih1M73mtfsC61A/oivdYm3X/gRPDqOljjd0r48lk= 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 1699270110095946.1611151851984; Mon, 6 Nov 2023 03:28:30 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxQL-0000lP-Ms; Mon, 06 Nov 2023 06:05: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 1qzxQG-0000PF-IT for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:05:38 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxQC-0004Gy-PA for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:05:36 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4083f61322fso32082825e9.1 for ; Mon, 06 Nov 2023 03:05:32 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id o8-20020a05600c510800b00407752f5ab6sm12025312wms.6.2023.11.06.03.05.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:05:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268731; x=1699873531; 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=q3038rtVd/3WYQydMHaBWtXOqOEbAhMugZOF+LS9h+c=; b=tnXy+ljfqN/bFaqgguFy2kkMlkWY85zE0Ury7NcBz0Lt/hK5npWtZ2e6jiYjf84+Yj TbZoMVC04XGVL1uvXgMeKQPd/1jrUErAo4RavOkUCPlv7EtILVpig/L570C9XlBJt8i7 TXfXa5AFkAYqD1jjYxlJgfcKUt5AkSwtZ9Y9lXgIPogIfXRbfnD09xnnTg5Hoej0MRkh 7rS9WOtPt8wk98OKrAtivaPFb2uvGfto2IH0lOTrSVQKtVbMTjFEedBNkMxOyWshtDqm fvCj2Mu2jvSZw3cgWtwHd5g+WZoK3a0KFx9sPHeqiToZxAwM2OqePDHVYYjeKiGRH3CP 2P2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268731; x=1699873531; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=q3038rtVd/3WYQydMHaBWtXOqOEbAhMugZOF+LS9h+c=; b=YGMv34LfDzgrmekpZVFcEY45ZddmNatuVK15mgJyZvXwMcPN+ks7/r7oUV+MMqJROW 6lRtDnhES3RvK3IuVAiBvwTEnuQ9O2izzMs0hmhBWa4hEag9Zsr4CY1raXZpRJ1f0qiG m7mFLfrn5gZTaBWdf1jM0JYhd7q+O8RIuwtqycsh4IbV7Ufyge46FC0VZYaJ/8okZA2Z m4VDB97Sk9Xv0uW3Agy+Af2VM0UowZthY3GYF93w+0B2wjmwO1GZ60YfUuFsZ/noIbmV CuaotrwMkQSNDbFJh5U9NApTLh/BBBH6DPpheK2YuJ/ciS6bmvWegCVZegaFxh1hfKKT S94Q== X-Gm-Message-State: AOJu0YwhGHCBZtvNJB3CmJtU3bD7E+FAnrf+2YTSufBwqFZsjm+bUIsC bs/Yg298u4VaNacmStLxeYyZbptPsR0TXPnxvyg= X-Google-Smtp-Source: AGHT+IEmOjZD5v1Cylghy37IhDMNKkapCYPdrPhk6W27hiP8WG5JpxCt9Mc0gI0+angLDuM2K899rw== X-Received: by 2002:a05:600c:4897:b0:401:38dc:8916 with SMTP id j23-20020a05600c489700b0040138dc8916mr23234105wmp.10.1699268731199; Mon, 06 Nov 2023 03:05:31 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Chris Wulff , Marek Vasut Subject: [PULL 16/60] target/nios2: Declare QOM definitions in 'cpu-qom.h' Date: Mon, 6 Nov 2023 12:02:48 +0100 Message-ID: <20231106110336.358-17-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699270110618100003 "target/foo/cpu.h" contains the target specific declarations. A heterogeneous setup need to access target agnostic declarations (at least the QOM ones, to instantiate the objects). Our convention is to add such target agnostic QOM declarations in the "target/foo/cpu-qom.h" header. Add a comment clarifying that in the header. Extract QOM definitions from "cpu.h" to "cpu-qom.h". Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20231013140116.255-10-philmd@linaro.org> --- target/nios2/cpu-qom.h | 19 +++++++++++++++++++ target/nios2/cpu.h | 7 +------ 2 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 target/nios2/cpu-qom.h diff --git a/target/nios2/cpu-qom.h b/target/nios2/cpu-qom.h new file mode 100644 index 0000000000..931bc69b10 --- /dev/null +++ b/target/nios2/cpu-qom.h @@ -0,0 +1,19 @@ +/* + * QEMU Nios II CPU QOM header (target agnostic) + * + * Copyright (c) 2012 Chris Wulff + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef QEMU_NIOS2_CPU_QOM_H +#define QEMU_NIOS2_CPU_QOM_H + +#include "hw/core/cpu.h" +#include "qom/object.h" + +#define TYPE_NIOS2_CPU "nios2-cpu" + +OBJECT_DECLARE_CPU_TYPE(Nios2CPU, Nios2CPUClass, NIOS2_CPU) + +#endif diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h index ede1ba2140..2d79b5b298 100644 --- a/target/nios2/cpu.h +++ b/target/nios2/cpu.h @@ -21,20 +21,15 @@ #ifndef NIOS2_CPU_H #define NIOS2_CPU_H =20 +#include "cpu-qom.h" #include "exec/cpu-defs.h" -#include "hw/core/cpu.h" #include "hw/registerfields.h" -#include "qom/object.h" =20 typedef struct CPUArchState CPUNios2State; #if !defined(CONFIG_USER_ONLY) #include "mmu.h" #endif =20 -#define TYPE_NIOS2_CPU "nios2-cpu" - -OBJECT_DECLARE_CPU_TYPE(Nios2CPU, Nios2CPUClass, NIOS2_CPU) - /** * Nios2CPUClass: * @parent_phases: The parent class' reset phase handlers. --=20 2.41.0 From nobody Wed Nov 27 09:59:42 2024 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=1699268812; cv=none; d=zohomail.com; s=zohoarc; b=jJkF8PbbIMX4fAZTeqnHSWSkcRJdru2Zl3ivMPH/NLyscQpS81yFvLWzWlPztdTMNPiXR/qx7MaDsCEZ3VHmoEJONtDnZ9RlzmSQl0bjlbKMVVw3MgS5wIviTo6UavurX6kY4MBD5Oux1pUXDQorCRYM0ghcn/xYW8HpNtU+2e0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699268812; 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=nk4cWXrgP2wfdX8K07cLqFbkIit3uK5saNqg4nYpY5E=; b=e51aR5djcLFPtRELOWdFQ+Rn4kELcdssJPHCzb2oi5ZW2vEZIS4hlbCgwFERkYc3sbsQfVFofj7KZc6V4mBxiD6aj1ZRiHJvRmC7minO5C+ZA/aDQsRnDzAyLbJZnjpwtNpynZeFvr82qdomuCzwGngXWVOGgZM0fdaEr1ww/aY= 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 1699268812597497.1066614994983; Mon, 6 Nov 2023 03:06:52 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxQT-00011W-Qh; Mon, 06 Nov 2023 06:05:51 -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 1qzxQN-0000rB-3R for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:05:44 -0500 Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxQJ-0004IO-HD for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:05:42 -0500 Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2c4fdf94666so57407011fa.2 for ; Mon, 06 Nov 2023 03:05:39 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id o13-20020a05600c4fcd00b0040588d85b3asm11817685wmq.15.2023.11.06.03.05.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:05:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268737; x=1699873537; 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=nk4cWXrgP2wfdX8K07cLqFbkIit3uK5saNqg4nYpY5E=; b=RDUdqWboVD3quZSQuqcQzcpO6jciqNidy2pQK4F7zh6i78tgblRZPS3TgtVac+HWCt +5cBvsFrAT9xcPcJdpWdftDh08ezimBXywqnFMp8x72BPslMhbBjr7zC+pELhw3GyTZJ zF3Boh04xWn8HFVZopN9fPdPisDqmSD5q1Xsz4SXIAb+aZJE+VdI0o8+uzvuSSxJy2eK mDh4Uv3R3xsqOOF5M8DFKB5yTRsHyxr/GzZ+GQjxPKrwAfbKXYRkn8XM5o52cL73KEcR Tc0LdXJx/VK7llu6T+MfxIY0kcoQNRt/70pkYtJFknPO4WjpJO5k++5LikFZMIcAGilQ Y0wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268737; x=1699873537; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nk4cWXrgP2wfdX8K07cLqFbkIit3uK5saNqg4nYpY5E=; b=ZjYDH/sx7dj+pXsD2gqCJrcY1fqu992crnExfYT6jX/2m6GCChvH3MvKa8neQpPZar LExtgMl1XBsKa1q4jcUDPU83yGO9M/2vlT5OQF9QgzvkxfeJU/6DVzznHF8JMYert1XV pQ8hxxlOclCBFFoH3zCnr6J/QV83BN6yq9TQQ0tIxzMc1rO7nFm+km65dmUHOt6et0I+ BbycTTY0GJmqYqpY58FgCnzUK1vvl8V3pqQUCCcgq0nnV8QgizGN5b0SRcwYI+7UyoKK f/p9Q+j80KUSA6ML8wsYGFjjOHIywZvWjGvNOnDF/yq7gyWkPikk6glV5WF78dEBTzCq xWTg== X-Gm-Message-State: AOJu0Yza0adiSAHRcs6NSsg0V74yXQAgb4o+r14//xFbYLDNcsk/KGiE jn7SO9DwBTlVLK5BjDHtwWY1SjBCCSm1sqmkweI= X-Google-Smtp-Source: AGHT+IHKiC1CxF8T0vSr2BLcywa6c3PPTVgxII/mK+f6zwidK7EflGt0iUFCbELVhD20Vx3Mom76tg== X-Received: by 2002:a2e:9cc6:0:b0:2c5:1bd3:5657 with SMTP id g6-20020a2e9cc6000000b002c51bd35657mr22787612ljj.15.1699268737741; Mon, 06 Nov 2023 03:05:37 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Stafford Horne Subject: [PULL 17/60] target/openrisc: Declare QOM definitions in 'cpu-qom.h' Date: Mon, 6 Nov 2023 12:02:49 +0100 Message-ID: <20231106110336.358-18-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::22d; envelope-from=philmd@linaro.org; helo=mail-lj1-x22d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699268813092100001 "target/foo/cpu.h" contains the target specific declarations. A heterogeneous setup need to access target agnostic declarations (at least the QOM ones, to instantiate the objects). Our convention is to add such target agnostic QOM declarations in the "target/foo/cpu-qom.h" header. Add a comment clarifying that in the header. Extract QOM definitions from "cpu.h" to "cpu-qom.h". Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20231013140116.255-11-philmd@linaro.org> --- target/openrisc/cpu-qom.h | 22 ++++++++++++++++++++++ target/openrisc/cpu.h | 10 +--------- 2 files changed, 23 insertions(+), 9 deletions(-) create mode 100644 target/openrisc/cpu-qom.h diff --git a/target/openrisc/cpu-qom.h b/target/openrisc/cpu-qom.h new file mode 100644 index 0000000000..1ba9fb0a4c --- /dev/null +++ b/target/openrisc/cpu-qom.h @@ -0,0 +1,22 @@ +/* + * QEMU OpenRISC CPU QOM header (target agnostic) + * + * Copyright (c) 2011-2012 Jia Liu + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef QEMU_OPENRISC_CPU_QOM_H +#define QEMU_OPENRISC_CPU_QOM_H + +#include "hw/core/cpu.h" +#include "qom/object.h" + +#define TYPE_OPENRISC_CPU "or1k-cpu" + +OBJECT_DECLARE_CPU_TYPE(OpenRISCCPU, OpenRISCCPUClass, OPENRISC_CPU) + +#define OPENRISC_CPU_TYPE_SUFFIX "-" TYPE_OPENRISC_CPU +#define OPENRISC_CPU_TYPE_NAME(model) model OPENRISC_CPU_TYPE_SUFFIX + +#endif diff --git a/target/openrisc/cpu.h b/target/openrisc/cpu.h index 29cda7279c..dedeb89f8e 100644 --- a/target/openrisc/cpu.h +++ b/target/openrisc/cpu.h @@ -20,17 +20,12 @@ #ifndef OPENRISC_CPU_H #define OPENRISC_CPU_H =20 +#include "cpu-qom.h" #include "exec/cpu-defs.h" #include "fpu/softfloat-types.h" -#include "hw/core/cpu.h" -#include "qom/object.h" =20 #define TCG_GUEST_DEFAULT_MO (0) =20 -#define TYPE_OPENRISC_CPU "or1k-cpu" - -OBJECT_DECLARE_CPU_TYPE(OpenRISCCPU, OpenRISCCPUClass, OPENRISC_CPU) - /** * OpenRISCCPUClass: * @parent_realize: The parent class' realize handler. @@ -304,7 +299,6 @@ struct ArchCPU { CPUOpenRISCState env; }; =20 - void cpu_openrisc_list(void); void openrisc_cpu_dump_state(CPUState *cpu, FILE *f, int flags); int openrisc_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg= ); @@ -339,8 +333,6 @@ void cpu_openrisc_count_start(OpenRISCCPU *cpu); void cpu_openrisc_count_stop(OpenRISCCPU *cpu); #endif =20 -#define OPENRISC_CPU_TYPE_SUFFIX "-" TYPE_OPENRISC_CPU -#define OPENRISC_CPU_TYPE_NAME(model) model OPENRISC_CPU_TYPE_SUFFIX #define CPU_RESOLVING_TYPE TYPE_OPENRISC_CPU =20 #include "exec/cpu-all.h" --=20 2.41.0 From nobody Wed Nov 27 09:59:42 2024 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=1699269250; cv=none; d=zohomail.com; s=zohoarc; b=Gd45EDUthKeusrukV9J15efE/jsNzf8RyKb73OMQtGMat4cy9XK9JX3vWlWOksksikZ7bSPKL9uTlUwmlh5f+0JcU3wfBfQieKkBN+lWy2cl3GyWQOBDJRrK1xjlQG6mQbnSJmsEsoFz2msZswe9yG31J1eIRzNMtuI+ssm8IzM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699269250; 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=9TEM4y15WADC11ywrbeYDwNqe54vVpabH+nFuXXR9vo=; b=LWbzrT/4P2EsNmVSIjvQXYJHbHajwOzAWzB99yAthoqCo1DVWJOdHOapvZCQik6shehE8ArE26Lt6B4LeKRJw9O8uCIwnjLJ4KVA4tKbyd7Hheg2QSt7oUzAJRWo/7NoN28itgbEHPBWhMoxUbNgzILMu62qt7RTluzjN6XqOIU= 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 1699269250160607.9894674933647; Mon, 6 Nov 2023 03:14:10 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxQh-0001Kt-NI; Mon, 06 Nov 2023 06:06:03 -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 1qzxQT-000127-8t for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:05:49 -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 1qzxQQ-0004KE-Cs for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:05:48 -0500 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-32dcd3e5f3fso2648056f8f.1 for ; Mon, 06 Nov 2023 03:05:45 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id c12-20020adffb0c000000b0032fc5f5abafsm6040847wrr.96.2023.11.06.03.05.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:05:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268745; x=1699873545; 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=9TEM4y15WADC11ywrbeYDwNqe54vVpabH+nFuXXR9vo=; b=DDcTivuoAhQfj6RSh7yuR+7K2AVdOWgiSRdgQmx7FHUn6x1zjVndhc/DZ5JguQjKSv Zvm0vYst6JDUfzK8vte64voW1t4XR27Y/KQmk/uF8v4+BqztEWRyy1K9IYhKwUwLZafd gp4O97zNJz17/D79eT5mq44TvCzLUtt8WGshgY+1hiJplCe+Z/SjpNBTcPyI/VizUyOI azAlqlnFQ8UQIGf/H5fgEQtRO83SCdZpedowVPMVWeulvnM7XN2CwdmFRKYRz0KfpjKi 9Ox+iOaXwobN6/nD2b6/6LXIvMkVjHeJ4QMtP7lwSxPClbGTKErtHQZXfX3aPjwfJP9Q XxrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268745; x=1699873545; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9TEM4y15WADC11ywrbeYDwNqe54vVpabH+nFuXXR9vo=; b=ZntkFLW4DCCZ+LnUcpYvjHwE10T0tj4QDlm6ogaU+VYAcPcxn2vulSh6wt/CSI3ljT Q5FBZiCMo/LQex0whaXrCXt/LZ5SL/1D5ZllXi0d5FjxcRSfsNo8sdkGgTJ+iQ5cAiQE 893Og9ygDQY96bKJKWK8QbRWRGTmB4x55gQhl7FMSkFDuONARIZLI19bFyFX2CXnD8+D 6IflnIA+uJur4uOmf3iv+8nIbYTd2Nr5WjHwTBCjkRRIBBvh/kYitHJXYD2UyjZ/XeXv t+63kiZzILHH2upnfCYpZIu1SwfVxiHOegdw+zEM9qMIdXix3wlGh8X4CGUn+eQpTGgH PYGg== X-Gm-Message-State: AOJu0YzrAZVPCauKx1J5JWp/KiF1hedJuOpljcNbAboNnoT/b0WKiUMs BbsWMzutS4zuzejeMPU1Y3FEb6h5zxCs014CNb8= X-Google-Smtp-Source: AGHT+IGOZ/6VrX2QMc3mxuvaPC+0EbE+IDekhwAIoTOTC+UFQrQ0DCYUI0TONme61tWRfDpdV25NAA== X-Received: by 2002:a05:6000:1c0f:b0:32f:ba72:e80b with SMTP id ba15-20020a0560001c0f00b0032fba72e80bmr6504480wrb.54.1699268744791; Mon, 06 Nov 2023 03:05:44 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , LIU Zhiwei , Alistair Francis , Richard Henderson , Palmer Dabbelt , Bin Meng , Weiwei Li , Daniel Henrique Barboza Subject: [PULL 18/60] target/riscv: Move TYPE_RISCV_CPU_BASE definition to 'cpu.h' Date: Mon, 6 Nov 2023 12:02:50 +0100 Message-ID: <20231106110336.358-19-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699269251302100006 TYPE_RISCV_CPU_BASE depends on the TARGET_RISCV32/TARGET_RISCV64 definitions which are target specific. Such target specific definition taints "cpu-qom.h". Since "cpu-qom.h" must be target agnostic, remove its target specific definition uses by moving TYPE_RISCV_CPU_BASE to "target/riscv/cpu.h". "target/riscv/cpu-qom.h" is now fully target agnostic. Add a comment clarifying that in the header. Reviewed-by: LIU Zhiwei Reviewed-by: Alistair Francis Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20231013140116.255-12-philmd@linaro.org> --- target/riscv/cpu-qom.h | 8 +------- target/riscv/cpu.h | 6 ++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/target/riscv/cpu-qom.h b/target/riscv/cpu-qom.h index b78169093f..76efb614a6 100644 --- a/target/riscv/cpu-qom.h +++ b/target/riscv/cpu-qom.h @@ -1,5 +1,5 @@ /* - * QEMU RISC-V CPU QOM header + * QEMU RISC-V CPU QOM header (target agnostic) * * Copyright (c) 2023 Ventana Micro Systems Inc. * @@ -44,12 +44,6 @@ #define TYPE_RISCV_CPU_VEYRON_V1 RISCV_CPU_TYPE_NAME("veyron-v1") #define TYPE_RISCV_CPU_HOST RISCV_CPU_TYPE_NAME("host") =20 -#if defined(TARGET_RISCV32) -# define TYPE_RISCV_CPU_BASE TYPE_RISCV_CPU_BASE32 -#elif defined(TARGET_RISCV64) -# define TYPE_RISCV_CPU_BASE TYPE_RISCV_CPU_BASE64 -#endif - typedef struct CPUArchState CPURISCVState; =20 OBJECT_DECLARE_CPU_TYPE(RISCVCPU, RISCVCPUClass, RISCV_CPU) diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 144cc94cce..d832696418 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -34,6 +34,12 @@ =20 #define CPU_RESOLVING_TYPE TYPE_RISCV_CPU =20 +#if defined(TARGET_RISCV32) +# define TYPE_RISCV_CPU_BASE TYPE_RISCV_CPU_BASE32 +#elif defined(TARGET_RISCV64) +# define TYPE_RISCV_CPU_BASE TYPE_RISCV_CPU_BASE64 +#endif + #define TCG_GUEST_DEFAULT_MO 0 =20 /* --=20 2.41.0 From nobody Wed Nov 27 09:59:42 2024 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=1699269017; cv=none; d=zohomail.com; s=zohoarc; b=laCWynhRr7/NL9kqjt/pEy1SEf3NoSX/euwLzL0f28RUnhoWYnFppo2bwnTPAcRqqOWp9g8gmflf2oh6SY7G8PovXy0C2sUjeibBoPKHUAwuVOoftlI52A0CynT+Y1CeBoTuocAf/P/I8BemlTgnM8iBmdCJ068In1Rkxeeqfx4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699269017; 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=oZ4xqFJalLvpzsW1bcHeUL/13mhLi/mzZSAy+mux2v0=; b=i1r8jEhxlNnmWZ+C0KRZxRvEgTYyf6Rjz5A+wT7VDiTF1Jx09SOabAwExnUXPUSZPZLhaSYTfuc6dv/wYWm6ufZdiM+dK1nJh/AInzl4FQhx/JKFimE5jkyzbMB56tew6dpqebdwyt95cTadIJmZ76iCHhEpq/UpNQxTkhoZ9hs= 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 1699269017447869.3088963327922; Mon, 6 Nov 2023 03:10:17 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxQw-0001S0-69; Mon, 06 Nov 2023 06:06:18 -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 1qzxQa-0001Br-6V for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:05:57 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxQX-0004Lq-Gj for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:05:55 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-40907b82ab9so31032475e9.1 for ; Mon, 06 Nov 2023 03:05:53 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id bh5-20020a05600c3d0500b004094e565e71sm12164949wmb.23.2023.11.06.03.05.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:05:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268752; x=1699873552; 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=oZ4xqFJalLvpzsW1bcHeUL/13mhLi/mzZSAy+mux2v0=; b=QrGpKoJ+ZHnculWUTSEqv2x+dQvx34HmqcAoNg3rnaUvJfSUNSKNMsl2+ESXeRFx4N ZyiaT54qEsy0P3/cvO+2GAIE0v9/gQLuEqjFaVbqo/0rqHy/WEmZuWg+/Gc6tXjOs/3f 0FyOsiOEqK4NFBIia5GdVxUxu9c9doDre+aVRops+lgQEEDo4XnQ5/fCCvJ4Exjn5PdW uZFol2pzW1HKx0aE2QVsPJLl8EDNmBCkPlwua47ANoRR8zfXOunTAtaOd8Cbi1o4hm9o 92dp88kXn7FCcaTwpu+LasrqUtqTq+yOAjZW9opJeh+Mynv9Wa1Si3quKUV+gK0COdr5 YLVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268752; x=1699873552; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oZ4xqFJalLvpzsW1bcHeUL/13mhLi/mzZSAy+mux2v0=; b=ETFKS/GtUaXXkodbZNXqdKu35E4hyaNhg8wyAUjI0wE1Plgzaw96hbFHB9aenmvxlL PKYOYQhDngb7HiH3dH3TZG9iB+yMMm33JX/5P23tojwf3TgFk/fu1xEZEE4gP6Is3Mrb vXbKvoEuKYR7SBfN7ECWmKTgZve9EEMeTanAKsrshDZWS6wxtcEuEJgzm8PDKd061XEr qJ6k5DbdzLGc4ke7UOJSTTKkx9STvpxkx5aOiIgEweT6rxZqFl5h1Q9/0hKH6zUT+emn k3IBlB/Oe8wZVyH8aQT9v6tXj4UCgh6fkJ8FIwcskGJ705N9JHdYc6btCyiO+yS5IbRq Oohg== X-Gm-Message-State: AOJu0YyPATaox5GI7IAkAEB80c+W1gngzHM70RO+Y+OVSmfhnLU22vxe KPs7QYEUcUiggCH3otfIetsJiPZpHkj4o/sN2Ng= X-Google-Smtp-Source: AGHT+IG9mJw0F90hy4Uu6xuSpQrJC5TM2lMXtp6Q5jTJMspVFVuvMPHpaiGipu7vhxIPNtgi1AXh6Q== X-Received: by 2002:a7b:c7c9:0:b0:406:45c1:4dd with SMTP id z9-20020a7bc7c9000000b0040645c104ddmr10153754wmk.14.1699268751703; Mon, 06 Nov 2023 03:05:51 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Daniel Henrique Barboza , Richard Henderson , Alistair Francis , Nicholas Piggin , Daniel Henrique Barboza , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 19/60] target/ppc: Use env_archcpu() in helper_book3s_msgsndp() Date: Mon, 6 Nov 2023 12:02:51 +0100 Message-ID: <20231106110336.358-20-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699269018230100001 When CPUArchState* is available (here CPUPPCState*), we can use the fast env_archcpu() macro to get ArchCPU* (here PowerPCCPU*). The QOM cast POWERPC_CPU() macro will be slower when building with --enable-qom-cast-debug. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Daniel Henrique Barboza Reviewed-by: Richard Henderson Acked-by: Alistair Francis Message-Id: <20231009110239.66778-2-philmd@linaro.org> --- target/ppc/excp_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 7926114d5c..a42743a3e0 100644 --- a/target/ppc/excp_helper.c +++ b/target/ppc/excp_helper.c @@ -3136,7 +3136,7 @@ void helper_book3s_msgclrp(CPUPPCState *env, target_u= long rb) void helper_book3s_msgsndp(CPUPPCState *env, target_ulong rb) { CPUState *cs =3D env_cpu(env); - PowerPCCPU *cpu =3D POWERPC_CPU(cs); + PowerPCCPU *cpu =3D env_archcpu(env); CPUState *ccs; uint32_t nr_threads =3D cs->nr_threads; int ttir =3D rb & PPC_BITMASK(57, 63); --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699269053; cv=none; d=zohomail.com; s=zohoarc; b=AX7vS+GG5K4reV4cNtIPbdhXnNsq6htiSdYXLRgeXtPhGNckHW8tOwslHRs4hSzggDR3DEP5px1gOTWTpFCPP65As2o1NGZPBqVkovEt9nniUnDfGirDgKzqJWNo/73sXP4chuyq+eiS2M3C9KFtD4A/rEtpErNv8Yu86TAoFm4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699269053; 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=WdevyuV5vDNMMgKGndHL1Lb3pKI2mM3BGOnKiVXcZMA=; b=gRmoVv5PbVZ0e/mLir6Aekmfz8gTNKVR5gi8YOrMyWb2qR8WYHLBAlJc+zQpE9ELD6TQN/Ek+lIp8wXU12UDsRd6/yukaZtg93Nv3ZvVkLE+FRPclnjQmC53HgGzgL9HrpMiokG2pd7U4BSAg0YnRAQvdWEVvVZs+0mPjlEDh9I= 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 1699269053184414.8799457183221; Mon, 6 Nov 2023 03:10:53 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxRU-0002Js-KO; Mon, 06 Nov 2023 06:06:52 -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 1qzxQw-0001Zh-Vg for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:06:20 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxQg-0004NB-Nh for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:06:18 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-40850b244beso33448295e9.2 for ; Mon, 06 Nov 2023 03:06:00 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id r13-20020a05600c458d00b00406443c8b4fsm11744176wmo.19.2023.11.06.03.05.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:05:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268759; x=1699873559; 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=WdevyuV5vDNMMgKGndHL1Lb3pKI2mM3BGOnKiVXcZMA=; b=n3lXasjQ9MspPMWhijtRr4yhgrqcXudFV+laNDcjzm6qh2crncIb9f+EJ/kuD4ysZm lh6s1TCnhg7o6kEpnYmMu6NtyWeV92AwDVMlyUuyt/9rTZjnSpivQeSL53GjwtHk4OJ/ w6rKCxxoZqZZAUZsO7TBsF+HL5ZslLAiXHLkJuh9Oq04jPQbzfyXkCZrUFsJ8LD+T4Vt eAIZ76tWpwd6o3tV7JYmP1F58AgdV9CI+YfST+2ODpcL9j9gyNu5/fyy+Wbm4Su2noTv rG/frpzoMandao0+A3GXnecPths2LqPBno3N1/fkOfLFJ+JleIHjkT8hkBrFcHk2TjUO aKMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268759; x=1699873559; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WdevyuV5vDNMMgKGndHL1Lb3pKI2mM3BGOnKiVXcZMA=; b=srYKJGDXVIxL2Vk3P2CHThWD+iMXnJnYl9qeq5jQiYNBL2xcLjX+Sq8NJaZFkCUoD4 h/gL4NpCMHHhCrCgLlMERx9yrPxb+Lruvi2VY8V4ExvGN7Qp3RXtIvl9pmNLChgHHN2P IPyNmJsZpTIG46VmguQjaCowjnoRfFexXHp5PzHT7JhTFyH+GDeC8HremApPIxp224Eq EoIDO2n3nVIFAhyEFOlKKbOSRlQN91vu2MAazCeCvLgdWXOrHWmYg/7f03CEw7B66h0W gdh46fvuGu0nmngFnkkPIEb3WyUNUTarEIKz/q8bB2a6eGQpkTWLZwgxOY9hWLO3WxxM gMPg== X-Gm-Message-State: AOJu0YwwAjOSxWm8Gx5HQRl1ajdIuPlIcnPiEKx31F7qAudoN7oQ3Av1 /sthyRASJ30OJQFNelDYsU5Q0BVClm8HzUbZNjA= X-Google-Smtp-Source: AGHT+IHx5XXxhtGZu6ZCbciI1JQ5kvGzt8XZDokYAdmWLiQ+Wf2MWQYdjQaCgeHE7cevbJyqEkuPhw== X-Received: by 2002:a05:600c:1c9a:b0:401:d803:6243 with SMTP id k26-20020a05600c1c9a00b00401d8036243mr25577656wms.32.1699268759004; Mon, 06 Nov 2023 03:05:59 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Richard W . M . Jones" , Daniel Henrique Barboza , LIU Zhiwei , Richard Henderson , Alistair Francis , Palmer Dabbelt , Bin Meng , Weiwei Li Subject: [PULL 20/60] target/riscv: Use env_archcpu() in [check_]nanbox() Date: Mon, 6 Nov 2023 12:02:52 +0100 Message-ID: <20231106110336.358-21-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699269054480100003 When CPUArchState* is available (here CPURISCVState*), we can use the fast env_archcpu() macro to get ArchCPU* (here RISCVCPU*). The QOM cast RISCV_CPU() macro will be slower when building with --enable-qom-cast-debug. Inspired-by: Richard W.M. Jones Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Daniel Henrique Barboza Reviewed-by: LIU Zhiwei Reviewed-by: Richard W.M. Jones Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Message-Id: <20231009110239.66778-3-philmd@linaro.org> --- target/riscv/internals.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/riscv/internals.h b/target/riscv/internals.h index b5f823c7ec..8239ae83cc 100644 --- a/target/riscv/internals.h +++ b/target/riscv/internals.h @@ -87,7 +87,7 @@ enum { static inline uint64_t nanbox_s(CPURISCVState *env, float32 f) { /* the value is sign-extended instead of NaN-boxing for zfinx */ - if (RISCV_CPU(env_cpu(env))->cfg.ext_zfinx) { + if (env_archcpu(env)->cfg.ext_zfinx) { return (int32_t)f; } else { return f | MAKE_64BIT_MASK(32, 32); @@ -97,7 +97,7 @@ static inline uint64_t nanbox_s(CPURISCVState *env, float= 32 f) static inline float32 check_nanbox_s(CPURISCVState *env, uint64_t f) { /* Disable NaN-boxing check when enable zfinx */ - if (RISCV_CPU(env_cpu(env))->cfg.ext_zfinx) { + if (env_archcpu(env)->cfg.ext_zfinx) { return (uint32_t)f; } =20 @@ -113,7 +113,7 @@ static inline float32 check_nanbox_s(CPURISCVState *env= , uint64_t f) static inline uint64_t nanbox_h(CPURISCVState *env, float16 f) { /* the value is sign-extended instead of NaN-boxing for zfinx */ - if (RISCV_CPU(env_cpu(env))->cfg.ext_zfinx) { + if (env_archcpu(env)->cfg.ext_zfinx) { return (int16_t)f; } else { return f | MAKE_64BIT_MASK(16, 48); @@ -123,7 +123,7 @@ static inline uint64_t nanbox_h(CPURISCVState *env, flo= at16 f) static inline float16 check_nanbox_h(CPURISCVState *env, uint64_t f) { /* Disable nanbox check when enable zfinx */ - if (RISCV_CPU(env_cpu(env))->cfg.ext_zfinx) { + if (env_archcpu(env)->cfg.ext_zfinx) { return (uint16_t)f; } =20 --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699269295; cv=none; d=zohomail.com; s=zohoarc; b=oDh1lAJ6q9e5Tf/xAWi05r0q03fT7SY8sQbTomj979JH/S4ZS3qkdwaWSUQvQV/iBDDSdd7rcmXexo3AD6K3bIZfZN3VJiht9UuP4dwI+zEUHXlrtmJo9SKK4qOU0WDBKzQe2mKIdSsM8T4FM6KTdqJKx10t27CR94i+OYJ3PD4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699269295; 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=R87QIdTSbuBFqtOuBBqCdN1J8XfSkpLJYhBFwzXT2iA=; b=RMKQmLmzoHS2EErxpoK9ODqcVqJ7k6jN5dnohvZHYnZP+yJ0QFrlpi79ecZHlKafqsMoNxAK/JDpl3TuSGa8gtwCNr7i++FrA9pl7tEjOVaJ6LyxoEYQns2cK8ATZRc4XZYL3t50ISaRPBAPGK88JzZ0rJwBUchGivOzr/8RZRk= 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 1699269295405783.5255199405849; Mon, 6 Nov 2023 03:14:55 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxRW-0002Vi-8b; Mon, 06 Nov 2023 06:06:54 -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 1qzxQz-0001ei-JZ for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:06:26 -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 1qzxQw-0004O5-Jx for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:06:21 -0500 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-4079ed65582so32860215e9.1 for ; Mon, 06 Nov 2023 03:06:06 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id i20-20020a05600c355400b0040839fcb217sm11896421wmq.8.2023.11.06.03.06.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:06:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268766; x=1699873566; 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=R87QIdTSbuBFqtOuBBqCdN1J8XfSkpLJYhBFwzXT2iA=; b=Kj/1LaOCc8ohvfAmi8Yz10wI2m4KbFPHjnDS4xi3yvwiMQPOAWM88ygVYIxCv7WE6o igHycHZ1IARjealLc8DwDef/bsE6vWViPkuyzYcmuWVNarBlrOx7JnHX99TgWu4oSYd0 TXpckHGQTlrzg2IMJASV/+1uF+j2jqlMRGaxVcxpfsxZbxWXwlqZDWeH+iYuPiZjHhtg o7fYOJTNTVFip8+civVvL77jpFN8ws/y37wyNxzxSLnelktqSKQzz+ph0NlJ1gpyHzyD vdaPi1M2MBgBwbYNPaIzXZVaFh0oq08rVJaGb3L/eHoLhyvou3bbwRrksAPCONXIiqT4 yt+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268766; x=1699873566; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=R87QIdTSbuBFqtOuBBqCdN1J8XfSkpLJYhBFwzXT2iA=; b=hDpq2HDUZw1F6P0OcN0RSchzZYK5N048TTKEhhsyzTQrE1tDxn5E4VnTIEPasxyc8/ 0SUmQEma63WKTobQtGRBQImOARWhClyAlhwP9baiZUgQf6hBT7MOKhqm05diTN3RHOmm EtLTLjaoFvBiiCUC3Sq8p+N9TRAQFhzI3DDvtpc8ntRcb2jFHHfQBSUIZbP6QTI8dudj zTHddzer3OVwT9XJkJ0kVhVNlhPICDsyT4LlqX0vNWHTmxL0TT+ec88xUm8zIAg/vXaM JKGghEx8gjK2n+EYEi+ubp0eX0A8OFDm9biE03CdZVmOWHksRgn/BXSlr703Dfisrix0 sAqA== X-Gm-Message-State: AOJu0Yx24lytU/jkrNHlUh+zqhKw8M3pVFJ3e7w0/Bp2REkRYGUM36qf 98cpLwMi27WK+OseY8cckyyv3ym7gBUh6Ky39xA= X-Google-Smtp-Source: AGHT+IEAb7mlXjiV+t8xOiAWlZzqIbRP1ddqvYwThww0DxTtH+DpaAZtlEj/6Pj1UY+lnDvwGergOA== X-Received: by 2002:a05:600c:3148:b0:405:1c19:b747 with SMTP id h8-20020a05600c314800b004051c19b747mr24127659wmo.15.1699268765817; Mon, 06 Nov 2023 03:06:05 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Alistair Francis , David Hildenbrand , Ilya Leoshkevich , Thomas Huth Subject: [PULL 21/60] target/s390x: Use env_archcpu() in handle_diag_308() Date: Mon, 6 Nov 2023 12:02:53 +0100 Message-ID: <20231106110336.358-22-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699269297411100003 When CPUArchState* is available (here CPUS390XState*), we can use the fast env_archcpu() macro to get ArchCPU* (here S390CPU*). The QOM cast S390_CPU() macro will be slower when building with --enable-qom-cast-debug. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Acked-by: Alistair Francis Message-Id: <20231009110239.66778-4-philmd@linaro.org> --- target/s390x/diag.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/s390x/diag.c b/target/s390x/diag.c index 8ce18e08f3..27ffd48576 100644 --- a/target/s390x/diag.c +++ b/target/s390x/diag.c @@ -77,7 +77,7 @@ void handle_diag_308(CPUS390XState *env, uint64_t r1, uin= t64_t r3, uintptr_t ra) { bool valid; CPUState *cs =3D env_cpu(env); - S390CPU *cpu =3D S390_CPU(cs); + S390CPU *cpu =3D env_archcpu(env); uint64_t addr =3D env->regs[r1]; uint64_t subcode =3D env->regs[r3]; IplParameterBlock *iplb; --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699269606; cv=none; d=zohomail.com; s=zohoarc; b=de9Blm7zR+Hrp/7E9kwIA8tGJIzznyY4FAMpzxpnYFPzr4HMciifInbZo7awqRfcWnGQr/PRDYUXWQBwnIy4CRO+Zb5NXT5Sk26Z6vNVYyNb+FG06ZvOQP2z/nhR9wmXu0FoYk/Iav1MpTA49tjhfQlHQs6N7e/Z7+0/RJU3mLQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699269606; 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=Kr5DULV07OwGLXl8unpIp7yrXhMhnI+29Dc5ljVlc2w=; b=MFIbrCQ4ppzcK8BebXXe/mUmOHM023ELrT8EUXT6u34N1Se7/pvM4/YjVcsIZ1yZVfs7UPxemmd1zPBFl7+usoXDGIUeZm/EV8fNwvOHgjY+Knhi5iItiHtDBB9Z93NzEBDB9gAxwC15m9MOXz7Qyhd1IB6LNKMpnevM4L0oAYw= 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 169926960641381.3176738194926; Mon, 6 Nov 2023 03:20:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxRV-0002RH-EP; Mon, 06 Nov 2023 06:06:54 -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 1qzxQz-0001f3-Mo for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:06:26 -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 1qzxQw-0004Q7-KA for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:06:21 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-40838915cecso32065055e9.2 for ; Mon, 06 Nov 2023 03:06:13 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id j11-20020a5d618b000000b0032db4825495sm9214037wru.22.2023.11.06.03.06.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:06:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268772; x=1699873572; 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=Kr5DULV07OwGLXl8unpIp7yrXhMhnI+29Dc5ljVlc2w=; b=sOxXyZefFQlVCV+4hcEIk9BVRvSlt4gjy6F/RpJzNFEhqKAl+2eungK6YZUlRb8NCK 9Kx3h29SWJuXqijqNwpBIYZw7JFGi5eYIuQUL50aIuwUIlRs4T8DCwz5boF5BGg1G9XL xTHu16OA1G5JuVsezh9BkUl29rUQnReWW1hJcNd5TmBMv8Alqrjnun8bIKeMj6p/E+2M 51BbXgBN9ub6QFoQ8xtAs+oDA1JB7HvvIKMm/LyMHJc/jwwEkJWMdWLYvPBjMeaxlqRL YijmgBZir6FvaJYSnxOmdC9hb7x1vhJJ362cgDVxAKm/ziP7K3GMVse0w1gbDbTlEAJ8 xmYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268772; x=1699873572; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Kr5DULV07OwGLXl8unpIp7yrXhMhnI+29Dc5ljVlc2w=; b=QRXprX8jZFl1LLa1fQtqA81KfiZsQI2qxDsuwZpKXtP5NHLKSln4u2cdI8yG/shqP6 BpHNAXZaCWHSqVHUPM2Wvg3LUf8dJtknN3IWN7f2CN+thDfRfd6nNgGMGT7imBz+ezPP 3XaRbD7XTXUbaHZ5QuPuionzub9/cuVyshHz7gEYLUFpea/w3yegspksnco8xNVzXe4w Vbu5cVhjk0pUnU0EWDfL+ze+aL0W3ehQex8XYIgAgxN8NqvV6EuG22jc4wJuh6gqXxN7 rzPUG8xaUcUcCo+KJGYbEirE1BhvVlOYq41CkEKpwqdtfMPc5mb11uEuD7o62FFkK9v0 BLNw== X-Gm-Message-State: AOJu0YzgV/h4A6TQHBejDYDsAWghXsT1Le16801aC4nXfwa4aHnK3kga cT+/X0md7M+Vin6VLs/DR7n/eSBDcd9IyMsBoRY= X-Google-Smtp-Source: AGHT+IH4BAo69cz3UuA35KFmjUUFhUkRdG+3mGsiR8W5V9QhANt/dkfHrFLlVjuREtmjDOTy7dt7Jw== X-Received: by 2002:a05:600c:35c9:b0:401:73b2:f039 with SMTP id r9-20020a05600c35c900b0040173b2f039mr24065294wmq.7.1699268772505; Mon, 06 Nov 2023 03:06:12 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Alistair Francis , Max Filippov Subject: [PULL 22/60] target/xtensa: Use env_archcpu() in update_c[compare|count]() Date: Mon, 6 Nov 2023 12:02:54 +0100 Message-ID: <20231106110336.358-23-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699269607464100003 When CPUArchState* is available (here CPUXtensaState*), we can use the fast env_archcpu() macro to get ArchCPU* (here XtensaCPU*). The QOM cast XTENSA_CPU() macro will be slower when building with --enable-qom-cast-debug. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Acked-by: Alistair Francis Message-Id: <20231009110239.66778-5-philmd@linaro.org> --- target/xtensa/op_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/xtensa/op_helper.c b/target/xtensa/op_helper.c index 7bb8cd6726..496754ba57 100644 --- a/target/xtensa/op_helper.c +++ b/target/xtensa/op_helper.c @@ -37,7 +37,7 @@ =20 void HELPER(update_ccount)(CPUXtensaState *env) { - XtensaCPU *cpu =3D XTENSA_CPU(env_cpu(env)); + XtensaCPU *cpu =3D env_archcpu(env); uint64_t now =3D qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); =20 env->ccount_time =3D now; @@ -58,7 +58,7 @@ void HELPER(wsr_ccount)(CPUXtensaState *env, uint32_t v) =20 void HELPER(update_ccompare)(CPUXtensaState *env, uint32_t i) { - XtensaCPU *cpu =3D XTENSA_CPU(env_cpu(env)); + XtensaCPU *cpu =3D env_archcpu(env); uint64_t dcc; =20 qatomic_and(&env->sregs[INTSET], --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699269786; cv=none; d=zohomail.com; s=zohoarc; b=FtawCvANTtfI7WZk+R3YCygSlS/YqPKICEm5iYrqgrxt2nHRf3s3nGwIT2azGMG5E9gHfkELJjJ/1OqL3xJZaWMOClzfR0BFgTsY7KOd1KMF/RFLgVD2W1Lg5s9u5EMKzSqFlI9zhnXc1nm/kYCYYD/leqZPEqq6jiu5HOiktb8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699269786; 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=9JKKmt1EY/kf3nircSCgd4NoTIWcG19r0u1T6OQDS20=; b=Zxoo+3kTl0JDv+Tp5I8Xj8jWmlBzH0ikdS5fsyBgMBYAL4PO4SZXs64fJHsG1273a9/RlDmA8tVMpQkH8qBBVvJL+ORAly3Igxp6Kxb4I4HfSusvOMe8vr1sHyo6wyolRLjrzqe7SqcSBjAFQXmos4uN1hSfi9bR379WPL3m3RY= 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 1699269786540535.5883903884643; Mon, 6 Nov 2023 03:23:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxRX-0002a2-8O; Mon, 06 Nov 2023 06:06:55 -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 1qzxR3-0001g2-OB for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:06:26 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxQz-0004RS-BP for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:06:25 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4079ed65471so32422895e9.1 for ; Mon, 06 Nov 2023 03:06:20 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id e22-20020a05600c109600b0040523bef620sm5449491wmd.0.2023.11.06.03.06.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:06:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268779; x=1699873579; 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=9JKKmt1EY/kf3nircSCgd4NoTIWcG19r0u1T6OQDS20=; b=QVC1LiYWkKwZSROe1Pmjp2J/0I+cmdIrUx/hucGTjKWd+TsJl18cMyQ4O6e20ongLi imefLK1PuwB1JwL3m/iaa5efCxWg85DhUGyQGPzTYgBI2qdg21T7wXlZKOP+HFzt6ESV 2bXCNkb/PFfE5dcQ34ZDYpzjK00ZFmAEgOtBLg3NsX1Gjs9S7uq9CKNf5mgxkEDiEVQK x0aIs2jc2HJgqDYQAfH9LNkpjamCqf/toEpJWbpnasBIh9nxjE0jOxUUBukJCNspWAVy AnKuUo94BM83K9mBMNxiCKLLQ7z8WQOzhtKVqTUbR/VF7qwJa12BLQRfQNs5At9eomDy GKoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268779; x=1699873579; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9JKKmt1EY/kf3nircSCgd4NoTIWcG19r0u1T6OQDS20=; b=DixDOtjD/6/fQslDRiHakxyoTbNm956Ncaj+iRbQxO6FmGViArl5sZfZcK3+qJ1JU/ tvQDmk9T/2GOI7mrrjy6Ih3D6JQHfIoyW3/aEuhEvThhhjAbQg0Q9fDXkV5xbXxt2IA2 Yd8gkbFk2s/+phdywpa4+eFhHvVmrzmPa8FdWhShfsKs8miZBikUhNlRVZwkYb6elSPI nrka7/3VaAmhSGtSLec3ZhnxF1vLfCO+IayU7wUTc0kX49q7frdYw3L/NR4kNQvd1TBu Vnr2TjcaDvnVQiKqLZ2cAIPDkc9NSLJHzJbCGkpBBFQDQ0gz7ACtB/pBy84r+KuJqPtB 1nqg== X-Gm-Message-State: AOJu0YytdBueWiItaCw75D5qdd0/R4P6AJdWVf503hJw3Ab6etqQ3zT6 OSwxmByZDB6qydY/CPIbky5xu7YlO2bBdg6fhcg= X-Google-Smtp-Source: AGHT+IEfybZ7H2Z3J3gHYnthxWPdDRlfQr2CrB6JP1W6Rr4GrrWr88wGlPvt7oAiYP8kPnl41aGPqw== X-Received: by 2002:a05:600c:1913:b0:409:351:873d with SMTP id j19-20020a05600c191300b004090351873dmr24821001wmq.31.1699268779697; Mon, 06 Nov 2023 03:06:19 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Roman Bolshakov , Zhao Liu , Cameron Esfahani , Roman Bolshakov Subject: [PULL 23/60] target/i386/hvf: Use x86_cpu in simulate_[rdmsr|wrmsr]() Date: Mon, 6 Nov 2023 12:02:55 +0100 Message-ID: <20231106110336.358-24-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699269788726100007 We already have 'x86_cpu =3D X86_CPU(cpu)'. Use the variable instead of doing another QOM cast with X86_CPU(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Roman Bolshakov Tested-by: Roman Bolshakov Reviewed-by: Zhao Liu Message-Id: <20231009110239.66778-6-philmd@linaro.org> --- target/i386/hvf/x86_emu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/i386/hvf/x86_emu.c b/target/i386/hvf/x86_emu.c index ccda568478..af1f205ecf 100644 --- a/target/i386/hvf/x86_emu.c +++ b/target/i386/hvf/x86_emu.c @@ -676,7 +676,7 @@ void simulate_rdmsr(struct CPUState *cpu) val =3D rdtscp() + rvmcs(cpu->accel->fd, VMCS_TSC_OFFSET); break; case MSR_IA32_APICBASE: - val =3D cpu_get_apic_base(X86_CPU(cpu)->apic_state); + val =3D cpu_get_apic_base(x86_cpu->apic_state); break; case MSR_IA32_UCODE_REV: val =3D x86_cpu->ucode_rev; @@ -776,7 +776,7 @@ void simulate_wrmsr(struct CPUState *cpu) case MSR_IA32_TSC: break; case MSR_IA32_APICBASE: - cpu_set_apic_base(X86_CPU(cpu)->apic_state, data); + cpu_set_apic_base(x86_cpu->apic_state, data); break; case MSR_FSBASE: wvmcs(cpu->accel->fd, VMCS_GUEST_FS_BASE, data); --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699269754; cv=none; d=zohomail.com; s=zohoarc; b=BKxa16T6ycuhr0h66c9QUecKy6wD1Qvblxgu3QaDBsfkjQQ71uGDKAGEM7qobZxvMAl2Im7QjH7/Ij7oC2DzvfNvbNLVKm18Q73xHycR2Z/brh4bZAsM1AtAv/rieNSAP+EJkDBALKs0nLxs7Z6p+PHBRR5z8UGC712B356gK5s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699269754; 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=3KIslD3tBGe6rvvH4379K4CtN4FVJCslZLzDLuVWSbo=; b=R5gmlzaPrG8A1ft0RbQd6zKYTJimWWOhC6S7JZhQigZslDBZ5GWpCkLzYoqzTWtp0vduZ0oajuex/2HD77uRNpywgc1En/yWngwi8j55oPvxvJtLWF7+sbBmh/BFJpB6Rb990darZ2L0lzldVhmzULpEVp0catkqDlDNiO2//iQ= 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 1699269754895352.60035780343776; Mon, 6 Nov 2023 03:22:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxRc-0002lr-3G; Mon, 06 Nov 2023 06:07:00 -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 1qzxRA-0001lz-VR for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:06:33 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxR5-0004TS-Uv for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:06:31 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4083dbc43cfso27296215e9.3 for ; Mon, 06 Nov 2023 03:06:27 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id j19-20020a05600c1c1300b004060f0a0fd5sm11856347wms.13.2023.11.06.03.06.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:06:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268786; x=1699873586; 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=3KIslD3tBGe6rvvH4379K4CtN4FVJCslZLzDLuVWSbo=; b=Rq+3HeA0OiicbS7A69fEArM/Ft4/X1mS2qio5jqF0HXRVwRHjZNpMqGZ0FXjOS266H zIIleitRruyfQVvQFis5VqBPXxU/GIFtFh67Bn0ADHTgKG03ddvaUeDsHVdX3s8zB1Rc chYpGYhJ1yWQ9+Rgq9MX7hqGuk+X1TGEu+li6kmffd8br3r2FZgUbwg+6GB0/4bxmH6T Y4pl3v9aZFoQMK8Ik/K/oDjYu44/H2OG5/UjPp7yhwjNwpRNapU8vVvIvEhDvAg1z6ax FvkxkuWbGEO3C+KsSOf45S+e3bGfDIYC4/Darj3nqNLayXjGubtUHMpzQwfSiXSZY37a E45A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268786; x=1699873586; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3KIslD3tBGe6rvvH4379K4CtN4FVJCslZLzDLuVWSbo=; b=ixLCwVc5FE18JHSwX3fxOrpwwcsJHf7AFReZn/OjJ1b9GUQR5BcEwk/pgpegXpXEjv fzGeKv81jHmPBIpm9CJb8B3ZBk/SoYNGloy9kLbtV5MNuYiGJ17zUJopY+waBtgEIu8J sxQ8IxW17aRwbwxY24PCQwqDVUdBCkkWrlGnqkLs4yndE5HBwPVmt//3bKXtN3FAmNsV xalsm3/a0pkxkYB/0aL9Ph0TpUmCMiCJD1ozoRHpvbHAvtGSxQFYzawOvGf/gEJEehYJ TQ1bnBl6cZaiaN3hdbSCD4hH4X5b74pLZnIC8hkJ8NIAVWsIprZKMI1J3ElWmXGUdmhh m36g== X-Gm-Message-State: AOJu0YxrJZDaDAcYaTW4veQ0bfsZXndWxwhALl3K3d3Q2ga90V5fSU3/ GpLQSAwCGl17g41sjaY/8JE4i9zsvy2r8NwNwPI= X-Google-Smtp-Source: AGHT+IFqstTlySqqtM85ehr6LLy2+6l54CyDhFwQFN2W5FnsbrQ2ysa+hdHfl+FfvhmGvxPogIc2ZA== X-Received: by 2002:a05:600c:1c27:b0:405:1c14:9227 with SMTP id j39-20020a05600c1c2700b004051c149227mr21583067wms.33.1699268786451; Mon, 06 Nov 2023 03:06:26 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Roman Bolshakov , Zhao Liu , Cameron Esfahani , Roman Bolshakov Subject: [PULL 24/60] target/i386/hvf: Use env_archcpu() in simulate_[rdmsr/wrmsr]() Date: Mon, 6 Nov 2023 12:02:56 +0100 Message-ID: <20231106110336.358-25-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699269756632100007 When CPUArchState* is available (here CPUX86State*), we can use the fast env_archcpu() macro to get ArchCPU* (here X86CPU*). The QOM cast X86_CPU() macro will be slower when building with --enable-qom-cast-debug. Pass CPUX86State* as argument to simulate_rdmsr / simulate_wrmsr instead of a CPUState* to avoid an extra cast. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Roman Bolshakov Tested-by: Roman Bolshakov Reviewed-by: Zhao Liu Message-Id: <20231009110239.66778-7-philmd@linaro.org> --- target/i386/hvf/x86_emu.h | 4 ++-- target/i386/hvf/hvf.c | 4 ++-- target/i386/hvf/x86_emu.c | 21 ++++++++++----------- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/target/i386/hvf/x86_emu.h b/target/i386/hvf/x86_emu.h index 640da90b30..4b846ba80e 100644 --- a/target/i386/hvf/x86_emu.h +++ b/target/i386/hvf/x86_emu.h @@ -29,8 +29,8 @@ bool exec_instruction(CPUX86State *env, struct x86_decode= *ins); void load_regs(struct CPUState *cpu); void store_regs(struct CPUState *cpu); =20 -void simulate_rdmsr(struct CPUState *cpu); -void simulate_wrmsr(struct CPUState *cpu); +void simulate_rdmsr(CPUX86State *env); +void simulate_wrmsr(CPUX86State *env); =20 target_ulong read_reg(CPUX86State *env, int reg, int size); void write_reg(CPUX86State *env, int reg, target_ulong val, int size); diff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c index cb2cd0b02f..20b9ca3ef5 100644 --- a/target/i386/hvf/hvf.c +++ b/target/i386/hvf/hvf.c @@ -591,9 +591,9 @@ int hvf_vcpu_exec(CPUState *cpu) { load_regs(cpu); if (exit_reason =3D=3D EXIT_REASON_RDMSR) { - simulate_rdmsr(cpu); + simulate_rdmsr(env); } else { - simulate_wrmsr(cpu); + simulate_wrmsr(env); } env->eip +=3D ins_len; store_regs(cpu); diff --git a/target/i386/hvf/x86_emu.c b/target/i386/hvf/x86_emu.c index af1f205ecf..b1f8a685d1 100644 --- a/target/i386/hvf/x86_emu.c +++ b/target/i386/hvf/x86_emu.c @@ -663,11 +663,10 @@ static void exec_lods(CPUX86State *env, struct x86_de= code *decode) env->eip +=3D decode->len; } =20 -void simulate_rdmsr(struct CPUState *cpu) +void simulate_rdmsr(CPUX86State *env) { - X86CPU *x86_cpu =3D X86_CPU(cpu); - CPUX86State *env =3D &x86_cpu->env; - CPUState *cs =3D env_cpu(env); + X86CPU *x86_cpu =3D env_archcpu(env); + CPUState *cpu =3D env_cpu(env); uint32_t msr =3D ECX(env); uint64_t val =3D 0; =20 @@ -746,8 +745,8 @@ void simulate_rdmsr(struct CPUState *cpu) val =3D env->mtrr_deftype; break; case MSR_CORE_THREAD_COUNT: - val =3D cs->nr_threads * cs->nr_cores; /* thread count, bits 15..0= */ - val |=3D ((uint32_t)cs->nr_cores << 16); /* core count, bits 31..1= 6 */ + val =3D cpu->nr_threads * cpu->nr_cores; /* thread count, bits 15= ..0 */ + val |=3D ((uint32_t)cpu->nr_cores << 16); /* core count, bits 31..= 16 */ break; default: /* fprintf(stderr, "%s: unknown msr 0x%x\n", __func__, msr); */ @@ -761,14 +760,14 @@ void simulate_rdmsr(struct CPUState *cpu) =20 static void exec_rdmsr(CPUX86State *env, struct x86_decode *decode) { - simulate_rdmsr(env_cpu(env)); + simulate_rdmsr(env); env->eip +=3D decode->len; } =20 -void simulate_wrmsr(struct CPUState *cpu) +void simulate_wrmsr(CPUX86State *env) { - X86CPU *x86_cpu =3D X86_CPU(cpu); - CPUX86State *env =3D &x86_cpu->env; + X86CPU *x86_cpu =3D env_archcpu(env); + CPUState *cpu =3D env_cpu(env); uint32_t msr =3D ECX(env); uint64_t data =3D ((uint64_t)EDX(env) << 32) | EAX(env); =20 @@ -856,7 +855,7 @@ void simulate_wrmsr(struct CPUState *cpu) =20 static void exec_wrmsr(CPUX86State *env, struct x86_decode *decode) { - simulate_wrmsr(env_cpu(env)); + simulate_wrmsr(env); env->eip +=3D decode->len; } =20 --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699268935; cv=none; d=zohomail.com; s=zohoarc; b=n6OzEEzOSrzclPzGh9Z15JdzttcUBNVCpR6hJYngqxHevyQrsrNlZpO0iqc4eS1ih7SGiudapjJigHpMZYMFkaFjusBDpqc3KatevzaNiHt/wC+GYlJSLvkXclYVfE368KkP2gJshUx3CWqOE1Q03IfVFD8uw06/UmSGST21TqQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699268935; 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=QkEvU4QtX35g0CiL+rllnKg5EMCBRsMDB6Gavwvy6mM=; b=GPa+AKoY8Sgp6B+DrWMZ+/bDA4N1QPdAJe2dNKTaUstx4oaeRdDJOLJJyFjNEptC2eLdBIfvDqfsD9aEsenFddilMbGqUTru0kCuPJT6upHuLoLb2HXOmfsAhi2aHmDKTR1yzI18H9BV1kmf7sXqUsmWFaUF8NIisSoLCX6//8U= 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 1699268935632500.47867491526404; Mon, 6 Nov 2023 03:08:55 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxRu-0003ax-S1; Mon, 06 Nov 2023 06:07:18 -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 1qzxRO-00023e-0K for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:06:46 -0500 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxRD-0004Uw-00 for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:06:43 -0500 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-9c41e95efcbso623757866b.3 for ; Mon, 06 Nov 2023 03:06:34 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id iv12-20020a05600c548c00b0040641a9d49bsm11948176wmb.17.2023.11.06.03.06.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:06:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268793; x=1699873593; 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=QkEvU4QtX35g0CiL+rllnKg5EMCBRsMDB6Gavwvy6mM=; b=A9kaRdSVWACV2BDy9cn5ts5ZnHoyOYqGTrqjjb+bpMygOwIuRvzGVPTjDvTDu8BdKm kwAY7XGhONdSMhXzgE9FjHqzIJrXnjzVPFgJL02zlExtwH49zsTaUFajrMTKIzGKyuSW y1SjYAo2mfqHNVQgs8sKITDVutEsE2oytycRdFUQtPohdk7YkKwpnLEjFpTJJpAoqa3x oWYvoc6RGQXzEtUiyWG7cqMc3HT2o5g+xARzuHROxamJsIJi8uG5rl3AL7U851xzvqwQ uoYtVpCvmRTGeAbJaIsocxWaqyHF7/VQTCBTdLd8klTIlpsFlAV8a7pCUrT0UMZ44GsN Yhyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268793; x=1699873593; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QkEvU4QtX35g0CiL+rllnKg5EMCBRsMDB6Gavwvy6mM=; b=W2m312927QLrdVuHB4zx2WA2XTgfjEYVYujYMieulIopR4yHlD0SwKikqiXplBbELX AwW3VgDCAkBkkZ04gQfzoXmDcltlBXMh+lDbaYlIGRehQPYH9fMNgSm/rc7WeowCZW2i WLYvZv+FuftIrJXEf4dRnyLrXHWhgPNGTGm4fjiUthRa1hpuRDm/0WIoeBnfF8192vgg VkuYKD/PZUVUhpW6fcSQ84cVowUfSMcjtfotoaTXEvaSsdQDEl0/cAK/TTK0kNGu8QvU h0vsVBgo10sge81VJE2Mbg4nkGu2otnNnlsZWjYrSLFu6lxMmlggKH6DWDd0AxQOl9J6 QrHQ== X-Gm-Message-State: AOJu0Ywj965aaE/TzBjpw/Kd3W0i63XpEGw60k3lFXfeuIK/uTP+ICq/ lHQdTqQ674rsrhsRhmZ/GpLWyqz6PsMFOSFmZIA= X-Google-Smtp-Source: AGHT+IFMgW1bfJ6Ek6vHroNC5F5c731oGSUYMxBHstbBSE+tYzXzXN3ikXIqjnIkkxPWlLbFWPB2pQ== X-Received: by 2002:a17:907:2ce2:b0:9be:36c2:162 with SMTP id hz2-20020a1709072ce200b009be36c20162mr13367612ejc.31.1699268793032; Mon, 06 Nov 2023 03:06:33 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Zhao Liu , Cameron Esfahani , Roman Bolshakov Subject: [PULL 25/60] target/i386/hvf: Use CPUState typedef Date: Mon, 6 Nov 2023 12:02:57 +0100 Message-ID: <20231106110336.358-26-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::634; envelope-from=philmd@linaro.org; helo=mail-ej1-x634.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699268937901100003 Follow C style guidelines and use CPUState forward declaration from "qemu/typedefs.h". No functional changes. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Zhao Liu Message-Id: <20231020111136.44401-2-philmd@linaro.org> --- target/i386/hvf/x86_emu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/i386/hvf/x86_emu.c b/target/i386/hvf/x86_emu.c index b1f8a685d1..cd7ef30126 100644 --- a/target/i386/hvf/x86_emu.c +++ b/target/i386/hvf/x86_emu.c @@ -45,7 +45,7 @@ #include "vmcs.h" #include "vmx.h" =20 -void hvf_handle_io(struct CPUState *cpu, uint16_t port, void *data, +void hvf_handle_io(CPUState *cpu, uint16_t port, void *data, int direction, int size, uint32_t count); =20 #define EXEC_2OP_FLAGS_CMD(env, decode, cmd, FLAGS_FUNC, save_res) \ @@ -1417,7 +1417,7 @@ static void init_cmd_handler() } } =20 -void load_regs(struct CPUState *cpu) +void load_regs(CPUState *cpu) { X86CPU *x86_cpu =3D X86_CPU(cpu); CPUX86State *env =3D &x86_cpu->env; @@ -1440,7 +1440,7 @@ void load_regs(struct CPUState *cpu) env->eip =3D rreg(cpu->accel->fd, HV_X86_RIP); } =20 -void store_regs(struct CPUState *cpu) +void store_regs(CPUState *cpu) { X86CPU *x86_cpu =3D X86_CPU(cpu); CPUX86State *env =3D &x86_cpu->env; --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699270741; cv=none; d=zohomail.com; s=zohoarc; b=Zo2vg59ACYIsEQl3DUfEiJwB+y/ZLMxGnLbDNW1FbYDU5otYFARXZH9U4QyhUFtJu7Mvb/YmMQV5Y8GRpDuyirVninbJ794pOaxp626n9Zo3NQTfPcw5Xlf1w74o04C9Ylm1qm1B6wT6lNc7c7bRiUju0K9vHPVXZTuidLHnwHs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699270741; 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=zvMSXcHtnsGDEEiq2Ygmmilt86JHxbxrpSYP17lWc2k=; b=VDyCzhnkhd+nWoEZt+Yw13JwrRzmBhQe60S/6DUX4aePaXL9gT1op8a1dd6f1vXUTY0zOigWjZmfW4a8P46q6O0tBf26q1LN9FHgmuROaSr4Y0KB2nLWFN3iMtj6K9JAWmpBNL4ZxpQnaZFMR7Vuy8E7qCLYvGT1kGno4GKk4ec= 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 1699270741124984.3096274089992; Mon, 6 Nov 2023 03:39:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxRx-0003pa-0B; Mon, 06 Nov 2023 06:07:21 -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 1qzxRT-0002DL-Nq for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:06:51 -0500 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxRN-0004Vo-Na for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:06:50 -0500 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2c6ed1b9a1cso58240751fa.3 for ; Mon, 06 Nov 2023 03:06:41 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id g20-20020a05600c4ed400b003fee8793911sm12017300wmq.44.2023.11.06.03.06.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:06:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268799; x=1699873599; 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=zvMSXcHtnsGDEEiq2Ygmmilt86JHxbxrpSYP17lWc2k=; b=GDbc/GdxbT3wA5pCR4kG+t8vb/viC0BIC+7Blkk8ktvwkarlNQ2GVuUek9RzthFHsU 7WAZj13NmK1D2Xvq2JeO6v8jLBXFnb745AIIS8k/sQISoMpn+xuARZoduFT12ve3+wJK Es4ve2q0scEuTiHNviRsXYlYqM2g/gOtgr/fMOxgX8NwSnC1QncgCjcLSk2yFK6QYgnm TwRhzIJPjOQ5Rsk4BRQzB3GezkDCkyy68+fHLadVC4OPTZxKrBz3t8E+14nmy2Mho9CR pZAlgNOtuaRJLs72I5myOBf8SuoO5YKqXgWyn1hcvULU2ydye4bH38viGkJ9KN6Rjtfg UfGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268799; x=1699873599; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zvMSXcHtnsGDEEiq2Ygmmilt86JHxbxrpSYP17lWc2k=; b=spDwF+5tavyrl3SXEUKtc8JO1OdprGRFlEIGKlYGWxomQf/UCrsNtDUkuSk+lzEP9Z 9roHvxaG18XOzVA5ems+4F/KV2Q1l9Cfgn501A8Vjwpc/44Dhc8zgucFB4OQL7IM/htY f//gYXE+uacyXIELGdUJ5/SO0r+oJxytrSssmEPL3gP8AWs36mb7yo/qAuGU8BCMsrrR xPrW1S62ZYyu9vNhxIjU4BI8jTtbQpEvYxiZlVf8z1gTW53yf6n7H+Jiw6weT+OUfakL 7i4DcNyHEYLSfxjz8gDo4wGXjVJHtONe0F4kGWsgpK6acTTs+ZVo53BQqCcHfoLVI3Ut twGQ== X-Gm-Message-State: AOJu0YyqGViekoLFfli8jjC6rktfyLeFAR94oFJUOfHQX5rD+Q2c4bjD FYJBs91c4w8C2pH/uERXdUSbCOZo79rYZGeGTTE= X-Google-Smtp-Source: AGHT+IFk6N3D8WZ9WThiL89QlbWI0KZq0GY/jC5dBPn7GsRDiYKFS2TWfXN5PF6/U9Fqhbvy1HoMPQ== X-Received: by 2002:a05:651c:210e:b0:2b6:df71:cff1 with SMTP id a14-20020a05651c210e00b002b6df71cff1mr28309158ljq.52.1699268799607; Mon, 06 Nov 2023 03:06:39 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Zhao Liu , Cameron Esfahani , Roman Bolshakov Subject: [PULL 26/60] target/i386/hvf: Rename 'CPUState *cpu' variable as 'cs' Date: Mon, 6 Nov 2023 12:02:58 +0100 Message-ID: <20231106110336.358-27-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::22b; envelope-from=philmd@linaro.org; helo=mail-lj1-x22b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699270742509100003 Follow the naming used by other files in target/i386/. No functional changes. Suggested-by: Zhao Liu Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Zhao Liu Message-Id: <20231020111136.44401-3-philmd@linaro.org> --- target/i386/hvf/x86_emu.c | 92 +++++++++++++++++++-------------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/target/i386/hvf/x86_emu.c b/target/i386/hvf/x86_emu.c index cd7ef30126..5b82e84778 100644 --- a/target/i386/hvf/x86_emu.c +++ b/target/i386/hvf/x86_emu.c @@ -45,7 +45,7 @@ #include "vmcs.h" #include "vmx.h" =20 -void hvf_handle_io(CPUState *cpu, uint16_t port, void *data, +void hvf_handle_io(CPUState *cs, uint16_t port, void *data, int direction, int size, uint32_t count); =20 #define EXEC_2OP_FLAGS_CMD(env, decode, cmd, FLAGS_FUNC, save_res) \ @@ -666,13 +666,13 @@ static void exec_lods(CPUX86State *env, struct x86_de= code *decode) void simulate_rdmsr(CPUX86State *env) { X86CPU *x86_cpu =3D env_archcpu(env); - CPUState *cpu =3D env_cpu(env); + CPUState *cs =3D env_cpu(env); uint32_t msr =3D ECX(env); uint64_t val =3D 0; =20 switch (msr) { case MSR_IA32_TSC: - val =3D rdtscp() + rvmcs(cpu->accel->fd, VMCS_TSC_OFFSET); + val =3D rdtscp() + rvmcs(cs->accel->fd, VMCS_TSC_OFFSET); break; case MSR_IA32_APICBASE: val =3D cpu_get_apic_base(x86_cpu->apic_state); @@ -681,16 +681,16 @@ void simulate_rdmsr(CPUX86State *env) val =3D x86_cpu->ucode_rev; break; case MSR_EFER: - val =3D rvmcs(cpu->accel->fd, VMCS_GUEST_IA32_EFER); + val =3D rvmcs(cs->accel->fd, VMCS_GUEST_IA32_EFER); break; case MSR_FSBASE: - val =3D rvmcs(cpu->accel->fd, VMCS_GUEST_FS_BASE); + val =3D rvmcs(cs->accel->fd, VMCS_GUEST_FS_BASE); break; case MSR_GSBASE: - val =3D rvmcs(cpu->accel->fd, VMCS_GUEST_GS_BASE); + val =3D rvmcs(cs->accel->fd, VMCS_GUEST_GS_BASE); break; case MSR_KERNELGSBASE: - val =3D rvmcs(cpu->accel->fd, VMCS_HOST_FS_BASE); + val =3D rvmcs(cs->accel->fd, VMCS_HOST_FS_BASE); break; case MSR_STAR: abort(); @@ -745,8 +745,8 @@ void simulate_rdmsr(CPUX86State *env) val =3D env->mtrr_deftype; break; case MSR_CORE_THREAD_COUNT: - val =3D cpu->nr_threads * cpu->nr_cores; /* thread count, bits 15= ..0 */ - val |=3D ((uint32_t)cpu->nr_cores << 16); /* core count, bits 31..= 16 */ + val =3D cs->nr_threads * cs->nr_cores; /* thread count, bits 15..= 0 */ + val |=3D ((uint32_t)cs->nr_cores << 16); /* core count, bits 31..1= 6 */ break; default: /* fprintf(stderr, "%s: unknown msr 0x%x\n", __func__, msr); */ @@ -767,7 +767,7 @@ static void exec_rdmsr(CPUX86State *env, struct x86_dec= ode *decode) void simulate_wrmsr(CPUX86State *env) { X86CPU *x86_cpu =3D env_archcpu(env); - CPUState *cpu =3D env_cpu(env); + CPUState *cs =3D env_cpu(env); uint32_t msr =3D ECX(env); uint64_t data =3D ((uint64_t)EDX(env) << 32) | EAX(env); =20 @@ -778,13 +778,13 @@ void simulate_wrmsr(CPUX86State *env) cpu_set_apic_base(x86_cpu->apic_state, data); break; case MSR_FSBASE: - wvmcs(cpu->accel->fd, VMCS_GUEST_FS_BASE, data); + wvmcs(cs->accel->fd, VMCS_GUEST_FS_BASE, data); break; case MSR_GSBASE: - wvmcs(cpu->accel->fd, VMCS_GUEST_GS_BASE, data); + wvmcs(cs->accel->fd, VMCS_GUEST_GS_BASE, data); break; case MSR_KERNELGSBASE: - wvmcs(cpu->accel->fd, VMCS_HOST_FS_BASE, data); + wvmcs(cs->accel->fd, VMCS_HOST_FS_BASE, data); break; case MSR_STAR: abort(); @@ -796,10 +796,10 @@ void simulate_wrmsr(CPUX86State *env) abort(); break; case MSR_EFER: - /*printf("new efer %llx\n", EFER(cpu));*/ - wvmcs(cpu->accel->fd, VMCS_GUEST_IA32_EFER, data); + /*printf("new efer %llx\n", EFER(cs));*/ + wvmcs(cs->accel->fd, VMCS_GUEST_IA32_EFER, data); if (data & MSR_EFER_NXE) { - hv_vcpu_invalidate_tlb(cpu->accel->fd); + hv_vcpu_invalidate_tlb(cs->accel->fd); } break; case MSR_MTRRphysBase(0): @@ -848,9 +848,9 @@ void simulate_wrmsr(CPUX86State *env) =20 /* Related to support known hypervisor interface */ /* if (g_hypervisor_iface) - g_hypervisor_iface->wrmsr_handler(cpu, msr, data); + g_hypervisor_iface->wrmsr_handler(cs, msr, data); =20 - printf("write msr %llx\n", RCX(cpu));*/ + printf("write msr %llx\n", RCX(cs));*/ } =20 static void exec_wrmsr(CPUX86State *env, struct x86_decode *decode) @@ -1417,56 +1417,56 @@ static void init_cmd_handler() } } =20 -void load_regs(CPUState *cpu) +void load_regs(CPUState *cs) { - X86CPU *x86_cpu =3D X86_CPU(cpu); + X86CPU *x86_cpu =3D X86_CPU(cs); CPUX86State *env =3D &x86_cpu->env; =20 int i =3D 0; - RRX(env, R_EAX) =3D rreg(cpu->accel->fd, HV_X86_RAX); - RRX(env, R_EBX) =3D rreg(cpu->accel->fd, HV_X86_RBX); - RRX(env, R_ECX) =3D rreg(cpu->accel->fd, HV_X86_RCX); - RRX(env, R_EDX) =3D rreg(cpu->accel->fd, HV_X86_RDX); - RRX(env, R_ESI) =3D rreg(cpu->accel->fd, HV_X86_RSI); - RRX(env, R_EDI) =3D rreg(cpu->accel->fd, HV_X86_RDI); - RRX(env, R_ESP) =3D rreg(cpu->accel->fd, HV_X86_RSP); - RRX(env, R_EBP) =3D rreg(cpu->accel->fd, HV_X86_RBP); + RRX(env, R_EAX) =3D rreg(cs->accel->fd, HV_X86_RAX); + RRX(env, R_EBX) =3D rreg(cs->accel->fd, HV_X86_RBX); + RRX(env, R_ECX) =3D rreg(cs->accel->fd, HV_X86_RCX); + RRX(env, R_EDX) =3D rreg(cs->accel->fd, HV_X86_RDX); + RRX(env, R_ESI) =3D rreg(cs->accel->fd, HV_X86_RSI); + RRX(env, R_EDI) =3D rreg(cs->accel->fd, HV_X86_RDI); + RRX(env, R_ESP) =3D rreg(cs->accel->fd, HV_X86_RSP); + RRX(env, R_EBP) =3D rreg(cs->accel->fd, HV_X86_RBP); for (i =3D 8; i < 16; i++) { - RRX(env, i) =3D rreg(cpu->accel->fd, HV_X86_RAX + i); + RRX(env, i) =3D rreg(cs->accel->fd, HV_X86_RAX + i); } =20 - env->eflags =3D rreg(cpu->accel->fd, HV_X86_RFLAGS); + env->eflags =3D rreg(cs->accel->fd, HV_X86_RFLAGS); rflags_to_lflags(env); - env->eip =3D rreg(cpu->accel->fd, HV_X86_RIP); + env->eip =3D rreg(cs->accel->fd, HV_X86_RIP); } =20 -void store_regs(CPUState *cpu) +void store_regs(CPUState *cs) { - X86CPU *x86_cpu =3D X86_CPU(cpu); + X86CPU *x86_cpu =3D X86_CPU(cs); CPUX86State *env =3D &x86_cpu->env; =20 int i =3D 0; - wreg(cpu->accel->fd, HV_X86_RAX, RAX(env)); - wreg(cpu->accel->fd, HV_X86_RBX, RBX(env)); - wreg(cpu->accel->fd, HV_X86_RCX, RCX(env)); - wreg(cpu->accel->fd, HV_X86_RDX, RDX(env)); - wreg(cpu->accel->fd, HV_X86_RSI, RSI(env)); - wreg(cpu->accel->fd, HV_X86_RDI, RDI(env)); - wreg(cpu->accel->fd, HV_X86_RBP, RBP(env)); - wreg(cpu->accel->fd, HV_X86_RSP, RSP(env)); + wreg(cs->accel->fd, HV_X86_RAX, RAX(env)); + wreg(cs->accel->fd, HV_X86_RBX, RBX(env)); + wreg(cs->accel->fd, HV_X86_RCX, RCX(env)); + wreg(cs->accel->fd, HV_X86_RDX, RDX(env)); + wreg(cs->accel->fd, HV_X86_RSI, RSI(env)); + wreg(cs->accel->fd, HV_X86_RDI, RDI(env)); + wreg(cs->accel->fd, HV_X86_RBP, RBP(env)); + wreg(cs->accel->fd, HV_X86_RSP, RSP(env)); for (i =3D 8; i < 16; i++) { - wreg(cpu->accel->fd, HV_X86_RAX + i, RRX(env, i)); + wreg(cs->accel->fd, HV_X86_RAX + i, RRX(env, i)); } =20 lflags_to_rflags(env); - wreg(cpu->accel->fd, HV_X86_RFLAGS, env->eflags); - macvm_set_rip(cpu, env->eip); + wreg(cs->accel->fd, HV_X86_RFLAGS, env->eflags); + macvm_set_rip(cs, env->eip); } =20 bool exec_instruction(CPUX86State *env, struct x86_decode *ins) { - /*if (hvf_vcpu_id(cpu)) - printf("%d, %llx: exec_instruction %s\n", hvf_vcpu_id(cpu), env->eip, + /*if (hvf_vcpu_id(cs)) + printf("%d, %llx: exec_instruction %s\n", hvf_vcpu_id(cs), env->eip, decode_cmd_to_string(ins->cmd));*/ =20 if (!_cmd_handler[ins->cmd].handler) { --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699268957; cv=none; d=zohomail.com; s=zohoarc; b=A1zGDg+4QLbFWr99URVvzbKi8Wk/SAHmQqTFpiSGhnF0zEhCvOl89QrEKM8rYeIFEhW2fVRDlwPiCnjqi2UtALfv/ZuwrhSPM4zeBT685zl0XBEvwOeD1RCM/l+q+FTunnbr/MiqrLjb0kLmCDmB/JoaBk/N+xBL7av59LAmUH4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699268957; 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=fVCnzhVZzYM83NLjfDBn8N7f5t+G1396ppAvAy7GW2E=; b=RrZpNSWU97X0C7KQ0EERuJgYDXFxVkpD1zoG6V5aYT7XKQKddf5TzELPxAvVgWRqpf6yA3Mebfj8MLizzmQ2HZI39i6NbBJpe0EDsi79lkID6b5nftj/z/G36EGOWb0MSbSDfSLUqf76GgP6jAlsGbDLWO+RxNFLk7xcpD72jDA= 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 1699268957560796.9146052114686; Mon, 6 Nov 2023 03:09:17 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxRu-0003ZW-Oy; Mon, 06 Nov 2023 06:07:18 -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 1qzxRf-0002wC-Ta for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:07:04 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxRT-0004X1-Fl for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:07:03 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4079ed65582so32865385e9.1 for ; Mon, 06 Nov 2023 03:06:47 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id n3-20020a05600c4f8300b004064288597bsm11904145wmq.30.2023.11.06.03.06.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:06:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268806; x=1699873606; 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=fVCnzhVZzYM83NLjfDBn8N7f5t+G1396ppAvAy7GW2E=; b=fvxWGOkBCuMWElPxE3gI9ceYPz6TEi31TOWPl2wVWF5UiY5aVqSpA5nCegYpyOxSe5 XEGDuE9wlR5g/Q2fnDTXr1eNifaGfxmI44EUjfpl0CjyMlSq/P51mqb0uns3iBw1QYya 3uDDEUPHOG5gYLr+lvjwfVlR43d+AZt2b0+eolk97cvWjePRcm72DpN8zK6EmcwpNUZF bPyQkr3giobvQ/8eUi7jsw9dYijWRm/gjywhIsDA8a3fvttJ2xJkz6gWVeih//wItInS gF1TqCOP7yEPLudBlB2w4HbN1hTwWAmxLQiJ+HCr47mLtvZl0yEZ/DpjVaMsK+F89l41 +DxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268806; x=1699873606; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fVCnzhVZzYM83NLjfDBn8N7f5t+G1396ppAvAy7GW2E=; b=UDIjukn/iaG+fawcpbIWf0uUKmtEbG2pJEVPq+KVB4aheFSHfF65ydwgF8WinfBGos lvyLF5L/2AJYg3HqHN5tak3zxV53wl8fu3Ae4bF9XZfgu/CJnZawHCHsuIY6bsek9cFa DDl+20ogt/F71ABlVuZTeIXL6XH669keqlUoxPYIY8uxrbCe2HwCiPK7DshPzql5vbzq kjNSHzx77ENuyv4h7n1+JZAt4wiNIlHDKCKZkS1wkvD4paKCoendHMgCIMERkosO1vx0 ZLqgN8Z3SsMNzpUXreqil2hn6uxhaWgVLwXo6jX93mOA+RptxI7hLSf6mFe7+tQQGsZR MKyA== X-Gm-Message-State: AOJu0Yx96mo6RWbrewJ0G/LkhLv6wluJWR8qUy0z2/ygDdLB5a+/eDtf 07VcXVg5lwB1NqEUXQf3oKsj0xr2JAHu8VQNncs= X-Google-Smtp-Source: AGHT+IEuDTQrO8cfHoeslXtrcco5KNUpzx8izu/DwKSeIwxrOOJugEKrgSkn8Nrwlb1DSs8x9XejMQ== X-Received: by 2002:a05:600c:1d0e:b0:402:8896:bb7b with SMTP id l14-20020a05600c1d0e00b004028896bb7bmr22306462wms.6.1699268806095; Mon, 06 Nov 2023 03:06:46 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Zhao Liu , Cameron Esfahani , Roman Bolshakov Subject: [PULL 27/60] target/i386/hvf: Rename 'X86CPU *x86_cpu' variable as 'cpu' Date: Mon, 6 Nov 2023 12:02:59 +0100 Message-ID: <20231106110336.358-28-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699268957806100001 Follow the naming used by other files in target/i386/. No functional changes. Suggested-by: Zhao Liu Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Zhao Liu Message-Id: <20231020111136.44401-4-philmd@linaro.org> --- target/i386/hvf/x86_emu.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/target/i386/hvf/x86_emu.c b/target/i386/hvf/x86_emu.c index 5b82e84778..3a3f0a50d0 100644 --- a/target/i386/hvf/x86_emu.c +++ b/target/i386/hvf/x86_emu.c @@ -665,7 +665,7 @@ static void exec_lods(CPUX86State *env, struct x86_deco= de *decode) =20 void simulate_rdmsr(CPUX86State *env) { - X86CPU *x86_cpu =3D env_archcpu(env); + X86CPU *cpu =3D env_archcpu(env); CPUState *cs =3D env_cpu(env); uint32_t msr =3D ECX(env); uint64_t val =3D 0; @@ -675,10 +675,10 @@ void simulate_rdmsr(CPUX86State *env) val =3D rdtscp() + rvmcs(cs->accel->fd, VMCS_TSC_OFFSET); break; case MSR_IA32_APICBASE: - val =3D cpu_get_apic_base(x86_cpu->apic_state); + val =3D cpu_get_apic_base(cpu->apic_state); break; case MSR_IA32_UCODE_REV: - val =3D x86_cpu->ucode_rev; + val =3D cpu->ucode_rev; break; case MSR_EFER: val =3D rvmcs(cs->accel->fd, VMCS_GUEST_IA32_EFER); @@ -766,7 +766,7 @@ static void exec_rdmsr(CPUX86State *env, struct x86_dec= ode *decode) =20 void simulate_wrmsr(CPUX86State *env) { - X86CPU *x86_cpu =3D env_archcpu(env); + X86CPU *cpu =3D env_archcpu(env); CPUState *cs =3D env_cpu(env); uint32_t msr =3D ECX(env); uint64_t data =3D ((uint64_t)EDX(env) << 32) | EAX(env); @@ -775,7 +775,7 @@ void simulate_wrmsr(CPUX86State *env) case MSR_IA32_TSC: break; case MSR_IA32_APICBASE: - cpu_set_apic_base(x86_cpu->apic_state, data); + cpu_set_apic_base(cpu->apic_state, data); break; case MSR_FSBASE: wvmcs(cs->accel->fd, VMCS_GUEST_FS_BASE, data); @@ -1419,8 +1419,8 @@ static void init_cmd_handler() =20 void load_regs(CPUState *cs) { - X86CPU *x86_cpu =3D X86_CPU(cs); - CPUX86State *env =3D &x86_cpu->env; + X86CPU *cpu =3D X86_CPU(cs); + CPUX86State *env =3D &cpu->env; =20 int i =3D 0; RRX(env, R_EAX) =3D rreg(cs->accel->fd, HV_X86_RAX); @@ -1442,8 +1442,8 @@ void load_regs(CPUState *cs) =20 void store_regs(CPUState *cs) { - X86CPU *x86_cpu =3D X86_CPU(cs); - CPUX86State *env =3D &x86_cpu->env; + X86CPU *cpu =3D X86_CPU(cs); + CPUX86State *env =3D &cpu->env; =20 int i =3D 0; wreg(cs->accel->fd, HV_X86_RAX, RAX(env)); --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699269250; cv=none; d=zohomail.com; s=zohoarc; b=jwOb9V8eZLvYGke45Nbi4MjM0WKmE+IVzwwzMCSg0VZqYZY3vvKFb9lLhl3UKaLJTMoJlRrnb9CWum2sjlFd08MsucmXx+Wv9CB2PvHPeGiW9J0dGFvbdijH4vEmYlqZTPl8Rke4MQFcO4Z2m9DUTt1bHJFopPEe2Ex1IzA8P1Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699269250; 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=+6pej+XFgeNy8hwy7UMk7tmyBIA+j/BAJUFV7Aiq4os=; b=SS6LkZeScBmjRWelCHwqBZFs/XamMvCl1EEjkerWjrtNYE+VtlLe6UUEgkymSGGkBVsQoYYlQ0md8WBFFbByX0w0smQTlMXNtp9tI/KRrNbjdWoAhnTxkXk/eZJwxul0+jrMs8cnEXU+pYRncJR1CoUXCzBbqgfOk7ZIt01Q+rY= 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 1699269250053482.2901031263159; Mon, 6 Nov 2023 03:14:10 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxS0-000496-I6; Mon, 06 Nov 2023 06:07:24 -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 1qzxRi-0002zg-T0 for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:07:08 -0500 Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxRX-0004YH-FN for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:07:06 -0500 Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2c50305c5c4so62262931fa.1 for ; Mon, 06 Nov 2023 03:06:53 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id r16-20020a05600c459000b003fefaf299b6sm11914693wmo.38.2023.11.06.03.06.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:06:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268812; x=1699873612; 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=+6pej+XFgeNy8hwy7UMk7tmyBIA+j/BAJUFV7Aiq4os=; b=BF/h/iH5toYq6bgJK2C9cjSw9pTCx7hrQEt9nxL3J8TaoAEpOol1ecp+8WN4bFsmJ4 q3KIJEG/SdfTtGuKzhKpvy4YPcdeF9Nt28L8UDdbE8Is8GiCPwWZWsDUgn29r7cwaKxN MpJEnaV+G8zgZS8GFX+EXpeY6rSt0D5oNrTjGOw92Y6t6oJvldyINIHZY0F4jjdZArRK BUgKmuqC9F/S7qjZNkeOY2FjHQ9wMhxI+PkdX5I4clObXoyIwemE92m+ywm+IqyvPwVK oe42Rl0A5opalJPXZdW3am0MtjbWU637zrfgofZ+uWLIeYYPpjV2tzcZ15I8EIIiv1T/ SfWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268812; x=1699873612; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+6pej+XFgeNy8hwy7UMk7tmyBIA+j/BAJUFV7Aiq4os=; b=rjDjRJFu3d64rdLwY5JctIyMAr+t+GsKoBOrWgKxkswVePG3N5HJ85YVxL2rUaHFhm ZXPNDrRU/pGZUHviVRhGyPrGu904iSMd+ToHuaxW6qIj+pTaw/o+BXemsnlKvic4T9Qr 6q0jMxYhMJolXg8JaB6qQpQI0XI0ndniG/pQgtFADGj0qHgp5hJxR9Rw3/2fjhn43Qtz piDp8MC1YhiAEGPWEyaihKbhQv7qfOhH2wuMLTtN2vSilwUbj6/nrnD7aM2vQe2KUd/b vrGRJ8hH16RLbMq4dM0uYGcBKtFOYI2P03PxNqys7jCnd//MbDAlWOHbNXUkZc19fjUQ FL+A== X-Gm-Message-State: AOJu0Yyq44b0i9HoJKTkxf2FjkCnfkWn7bBljqBbqDTHw5LfYG/jyYqF B9TVEF2npYXuUa37g+552ohV37wXayFAfpmGaTs= X-Google-Smtp-Source: AGHT+IH9cDYwLDc1MRsfDAEGSPwPoLCFIf+s8baeSOuvBOTKWXUgUmhGOWDpYJxS4pQKbqZtqaKfYw== X-Received: by 2002:a05:651c:200c:b0:2c5:2d7:412 with SMTP id s12-20020a05651c200c00b002c502d70412mr18916048ljo.19.1699268812592; Mon, 06 Nov 2023 03:06:52 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Paolo Bonzini , Marcelo Tosatti Subject: [PULL 28/60] target/i386/kvm: Correct comment in kvm_cpu_realize() Date: Mon, 6 Nov 2023 12:03:00 +0100 Message-ID: <20231106110336.358-29-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::22a; envelope-from=philmd@linaro.org; helo=mail-lj1-x22a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699269251289100005 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20230918160257.30127-4-philmd@linaro.org> --- target/i386/kvm/kvm-cpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/i386/kvm/kvm-cpu.c b/target/i386/kvm/kvm-cpu.c index 56c72f3c45..9c791b7b05 100644 --- a/target/i386/kvm/kvm-cpu.c +++ b/target/i386/kvm/kvm-cpu.c @@ -37,6 +37,7 @@ static bool kvm_cpu_realizefn(CPUState *cs, Error **errp) * -> cpu_exec_realizefn(): * -> accel_cpu_common_realize() * kvm_cpu_realizefn() -> host_cpu_realizefn() + * -> cpu_common_realizefn() * -> check/update ucode_rev, phys_bits, mwait */ if (cpu->max_features) { --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699271148; cv=none; d=zohomail.com; s=zohoarc; b=EH2cVC0AatbmHKEimHywfzsEdtk8EXpz0WMY0BMjSNMEURYNBJvo6Lwjv93i7sJcETktK3pVq/dLqTD8WcbCbOmOhQO7GxlbKPc7IK2TUdGIcQZ0aoSvxUUAgJtk65uJQ4IzefcVBNLeFIyUjc+oo16mZ5haKnurse3szcodUP4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699271148; 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=W+HrE2ba95t1ooYtGszc36ebWNEUF8WT6p6gpPtPmuY=; b=VwIckvQHy3BRGH2wzlm194CgjA4x/WW59x2e5NBuhqtmaX8sJivzi+cuhCUSBlJxYVGpRfA/oitYRkTSOmK8kR89XRAwis76v6O07wQr5FcIJHGC9Fp+3he4xxxBYl9vkF6yUXZKBkGBLEvrfBngx3v8OA/17/UIVC5HLd8RIEg= 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 1699271148720311.31224712966423; Mon, 6 Nov 2023 03:45:48 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxRx-0003qi-12; Mon, 06 Nov 2023 06:07:21 -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 1qzxRk-00031x-7y for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:07:08 -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 1qzxRc-0004Yx-PW for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:07:07 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4081ccf69dcso31182525e9.0 for ; Mon, 06 Nov 2023 03:07:00 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id f4-20020a5d6644000000b0032da49e18fasm9178802wrw.23.2023.11.06.03.06.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:06:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268819; x=1699873619; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=W+HrE2ba95t1ooYtGszc36ebWNEUF8WT6p6gpPtPmuY=; b=fzyOWbWY4jWCN7g0/rvVI8g/5Bdjd6C5sfGtpBo/b4HDMBPNSbN+I0q3U5SmnDKOFm RSfHuPhVQ9qSx8MSx95bl+TmJxflc6R3FBPfFrorOvuFrSvicXZZyUpqqPPzl8+wSJ47 LSS9+0YSDoBP+F01JqXyjat5RH4mttoGI7v1mL0cTamr5ZulXm8ImneBoyyC/Tsywgam EBFVVneKcbLCwgUxYSevWFrGQCMT4prfZUTTSBFoPeGAueCw866Uc0L4M/PstYnNWhl6 ft3Jai5zmbtvGtiOFIbWAuS1MLpe0NapWdeMyjaBmVbwUdQ+2wETErOhwqtmF49RFCTW pLow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268819; x=1699873619; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=W+HrE2ba95t1ooYtGszc36ebWNEUF8WT6p6gpPtPmuY=; b=gqyvcGL8J8kV1dTQQPI1IQgNBEHamba18zjvC2CzqOYzWe60v6WlDMZBpOInD9Huhf jt3tS1hu0QX+ItcfTVsrenwPb+OhQHgbxa/PIT+LOP7m6uOJyKcbAlL7th/LlLRfc/S3 dmR2xTH8ReQOAW40aq2qSE/nrMhQmehf6bvfwemnBBUXkEth2r9eU57pSKAQpHAME8t7 Ak4IPqp1bD8HPJUNjPmMLKoLJleTuGHUmnz6qUcfEbP3oPhSRQSFcsbS3BEKGqPhFMLs KgGgjOqMh/xGJaUoUbSK2JzH1zP+e00QAaYftdeeMNlGQzN30I2Ut8ez1WfBTHzuFiTW F3Tw== X-Gm-Message-State: AOJu0YwYj+QS7dHopS5/eEZoUPWVOWrP9W/OET5mh13uyPNy08FzDKAK +CjVBkUna0innGusPE0k7n12ZqUmxkLvw5A8Lus= X-Google-Smtp-Source: AGHT+IEt4PrEy7npLJh89eCdwNzRVAyjkPfVkzj/Lltpi44y5ZAeM5YDAM8Cq8QFxZb/uU2kaiqCHg== X-Received: by 2002:a05:6000:12ca:b0:32f:76a0:a99b with SMTP id l10-20020a05600012ca00b0032f76a0a99bmr8610843wrx.19.1699268819099; Mon, 06 Nov 2023 03:06:59 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Dongli Zhang , Joe Jin , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , David Woodhouse , Juan Quintela , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 29/60] target/i386/monitor: synchronize cpu state for lapic info Date: Mon, 6 Nov 2023 12:03:01 +0100 Message-ID: <20231106110336.358-30-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699271150539100001 From: Dongli Zhang While the default "info lapic" always synchronizes cpu state ... mon_get_cpu() -> mon_get_cpu_sync(mon, true) -> cpu_synchronize_state(cpu) -> ioctl KVM_GET_LAPIC (taking KVM as example) ... the cpu state is not synchronized when the apic-id is available as argument. The cpu state should be synchronized when apic-id is available. Otherwise the "info lapic " always returns stale data. Reference: https://lore.kernel.org/all/20211028155457.967291-19-berrange@redhat.com/ Cc: Joe Jin Signed-off-by: Dongli Zhang Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: David Woodhouse Message-ID: <20231030085336.2681386-1-armbru@redhat.com> Reviewed-by: Juan Quintela Message-ID: <20231026211938.162815-1-dongli.zhang@oracle.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/i386/monitor.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/target/i386/monitor.c b/target/i386/monitor.c index 6512846327..950ff9ccbc 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -28,6 +28,7 @@ #include "monitor/hmp-target.h" #include "monitor/hmp.h" #include "qapi/qmp/qdict.h" +#include "sysemu/hw_accel.h" #include "sysemu/kvm.h" #include "qapi/error.h" #include "qapi/qapi-commands-misc-target.h" @@ -654,7 +655,11 @@ void hmp_info_local_apic(Monitor *mon, const QDict *qd= ict) =20 if (qdict_haskey(qdict, "apic-id")) { int id =3D qdict_get_try_int(qdict, "apic-id", 0); + cs =3D cpu_by_arch_id(id); + if (cs) { + cpu_synchronize_state(cs); + } } else { cs =3D mon_get_cpu(mon); } --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699270888; cv=none; d=zohomail.com; s=zohoarc; b=nfi8p3R9t9TyIy8gCYl8a2YDE5O8imsEk8Vq4ScKVJ4Dnp68AhSkVomyXCj62JhN5FzL4wByaelwd18qx5l8uQ4epYT0hmjVQICcvVI/y+afXocmMFrxK+RQsHJT59MhbHTtmy6v0x6kiJLnv4dJpfaO/Xuoq9mVYplOS2CyQbc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699270888; 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=GyckcOuF1Bcu5rrRcor+Uzyh2YOL0vEJEmdAm/ud3/A=; b=Y0np3V3ng7MF/Fa2QfzmwZraSatBIYFRMfo1BFswHZd6QlVSzs7KZEKvKPXr1AwHnVlmS8RuLZI8C0Ib966RrN7p1uXauoqYxULBmju11OKXMOUkPdZfRmbUtrQbzUFJjxVw3DEXrxA4o+6pFLEmwBJ/ZpSzx1/OkSaISRtL4aU= 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 1699270888420931.3356123198558; Mon, 6 Nov 2023 03:41:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxRx-0003u1-Ee; Mon, 06 Nov 2023 06:07:21 -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 1qzxRo-00038V-4f for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:07:14 -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 1qzxRj-0004bB-Cz for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:07:11 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-409299277bbso30571595e9.2 for ; Mon, 06 Nov 2023 03:07:06 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id k18-20020a5d6d52000000b0032da4f70756sm9120501wri.5.2023.11.06.03.07.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:07:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268826; x=1699873626; 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=GyckcOuF1Bcu5rrRcor+Uzyh2YOL0vEJEmdAm/ud3/A=; b=XXchG9uinSaSNBsq+eynnl/NeEh+o4Cqa/IGVup0SrQCMTjMy441TEZomKX5QpFsPn 4it7aLf3FNJ4JTZyAdPi1xuh7xY7tIaaHZCjv+qBBAmGSWG0dx2gr4E4hztSyyC3v46b /p2YdA3HjrBTywt1hJRZWjMzZ4rpt7L/+Q0RQ7hUpbj1cQwABuFIhMFxx9Kt+47OiBzY rVaCO/RvQHB15lbfOwGnj39Ll5g7VlCKmkdDxMMkZ0Q9/V7EGA7UmJMX32q2qkCoBZEV h9dNUKlJbZTri3jjm28A5F+o+5bX0KKAd2GyYfv/ECerVC95OHOYaEloam8IB9P+Auzu /Iiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268826; x=1699873626; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GyckcOuF1Bcu5rrRcor+Uzyh2YOL0vEJEmdAm/ud3/A=; b=WLRNz/oi6tfBC7SBDfmAc8Ju0emKpJ+6yABJRsUwL5Wfa3H2o8vu+3djbjNU3Tins/ QhGi84lCorjqUuXQi0dbzDlYdCLFFQsJ3u8Y+1oC+SHVIJdl0Bn0/vKup1eQCp75aqWW cDLAH9mWMBzq2aKMHjoxUk0t88EszqBoTsgd4Vl6dVtdMzK/wHtryUyE2MSag8Cucn7p 3b8igrJ7KnFA8wFwqeWtaZ9dQ+kgqanNo8htu89J61vV37VhafgbGt+H/sL7G8TZDIlk ZLZ6mWOJsHSQoJp3ky/dDYwOWLZjw7P7bQvZOOQ4inx8+liR+U7I3PIQ+wX2cqPPURgG OFkg== X-Gm-Message-State: AOJu0Ywy7f6OAJI5XaPTZO9Nc5y/bCZRDxM+p4GZtKZkK617geigWWcf LRzcx9eXU3sFF7tG17TG7ijV34wEvuh2HqqnC/U= X-Google-Smtp-Source: AGHT+IFFKKaoUyusuMn43SnLhory9traUNVPbmAEOKUR6lhSW54LBkg8wsQBYrYSz3Gl8EhHfaGVqQ== X-Received: by 2002:a05:600c:4f02:b0:405:3885:490a with SMTP id l2-20020a05600c4f0200b004053885490amr23785982wmq.0.1699268825836; Mon, 06 Nov 2023 03:07:05 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-stable@nongnu.org, Sergey Evlashev , Richard Henderson , Aurelien Jarno , Jiaxun Yang , Aleksandar Rikalo Subject: [PULL 30/60] target/mips: Fix MSA BZ/BNZ opcodes displacement Date: Mon, 6 Nov 2023 12:03:02 +0100 Message-ID: <20231106110336.358-31-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699270889034100003 The PC offset is *signed*. Cc: qemu-stable@nongnu.org Reported-by: Sergey Evlashev Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1624 Fixes: c7a9ef7517 ("target/mips: Introduce decode tree bindings for MSA ASE= ") Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20230914085807.12241-1-philmd@linaro.org> --- target/mips/tcg/msa.decode | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/mips/tcg/msa.decode b/target/mips/tcg/msa.decode index 9575289195..4410e2a02e 100644 --- a/target/mips/tcg/msa.decode +++ b/target/mips/tcg/msa.decode @@ -31,8 +31,8 @@ =20 @lsa ...... rs:5 rt:5 rd:5 ... sa:2 ...... &r @ldst ...... sa:s10 ws:5 wd:5 .... df:2 &msa_i -@bz_v ...... ... .. wt:5 sa:16 &msa_bz df=3D3 -@bz ...... ... df:2 wt:5 sa:16 &msa_bz +@bz_v ...... ... .. wt:5 sa:s16 &msa_bz df=3D3 +@bz ...... ... df:2 wt:5 sa:s16 &msa_bz @elm_df ...... .... ...... ws:5 wd:5 ...... &msa_elm_df df= =3D%elm_df n=3D%elm_n @elm ...... .......... ws:5 wd:5 ...... &msa_elm @vec ...... ..... wt:5 ws:5 wd:5 ...... &msa_r df=3D0 --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699270393; cv=none; d=zohomail.com; s=zohoarc; b=WOdQ4ZCYiXWZU/PG79xMyPRreb8eA2vX9WIj+0MUsc8J371aiqPSKIU/FKxCVuULeD1dNfE9cWId1Co1LtJCnYzq6XdYR19y9O+DhL1bxQIQhsbmuYJhHM8Kz6WfAGpA6lXd/lpSfPJ0eguts2NZiqEy/XUfrXO841rfDqGuKqo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699270393; 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=ysTm3sVa8NXK5p6adWouAn7jMZtjrRCTYZ5tPCHuc7A=; b=FpJ2SVPdaXsVFOCG+3hduOyiCwG4BZ1Ts33hE1py9qJ1j96EFU8+8/t+IkDdMSfe0w2x8OSqU7SuZ75k6/Gj9dr4jvNl7okhzzctA6ttT3ki9vPb7Ghxd1wSSxBTDKwIeWRTfnI9NFLiZM16lN5NM48/cL6X8+tzbCx2pB22H0w= 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 1699270393118484.38490336845337; Mon, 6 Nov 2023 03:33:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxS2-0004Dl-9Q; Mon, 06 Nov 2023 06:07:26 -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 1qzxRr-0003Ej-OP for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:07:15 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxRq-0004f0-24 for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:07:15 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4083740f92dso32048665e9.3 for ; Mon, 06 Nov 2023 03:07:13 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id jg2-20020a05600ca00200b004065daba6casm11958500wmb.46.2023.11.06.03.07.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:07:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268832; x=1699873632; 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=ysTm3sVa8NXK5p6adWouAn7jMZtjrRCTYZ5tPCHuc7A=; b=SK9E1JI1dOxnqGGJCkijNACBPJw8IblqzpEN80ymUERXe5Ci4AtDUe/d88dvqF1cB3 gB/wHBvevbGtb72RFpdYZwhSknCvlB+sZe0V7FjnWzGEdRb6AdzxLEl9CM0Z2VPMcF4B 83oeBth1ED7cY1fYp0xW+HC81scKpHITX9NER3hwkesU6zFF76Pk7ct6UU/vCAUlZma8 XT3jV+US6IPi3n25077Pb7PShULxrJ2SXnjwtNL4wRM7cSmeOF6YbmJJNOEK7hCM+xQ6 9NbopSINGFcDUav1vUpOvCVM8aj9t18vsmYopmvnNkGUsZIMb0nwC3mTDhABfocCT8rO dgzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268832; x=1699873632; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ysTm3sVa8NXK5p6adWouAn7jMZtjrRCTYZ5tPCHuc7A=; b=ctnUrHC3lgehV8m9ZNe1dzEjzABe8aEkbitLDnRPwO/TmhFDk3aW7E+dlGZ+TAz07n OTbIfr1mO1piX2Z6Lg2nzghzenuBdn9zHpErJzCMiskmHarq4p4L+A8A6UexQ1zlitkF ryxIlvVguug6AUlfolz6nsbuKSfYNn5XpfBE/7PLmplszjfGBeFRkPO1LftEgyoOM3s0 l1NdjdeY0yvdkKLE7TnwjlzAjp+Uq8vW43gDTLgok4TE/VIBefqCsb0h3fzIa6R6jGVr UYhXiZnE91EtkEXtVoldF2W8WEYwxzpfb1XsoDqaCVzFGbZpkFOaG2wYLh5F03UcSBJ3 NRfA== X-Gm-Message-State: AOJu0Yxx5PgmBMtSRG0Q6gwBPX1fDxY46tSBA/Kki/XZrbQ9X9S57JCE Eyxdn0A10OBM/ySsYXw+X83KI6t6fUyWFto5i1s= X-Google-Smtp-Source: AGHT+IGkZmXraGC+Dqk5EDM2vOTL7rIZmIj2iksC9goOWR5dfHU27l8hEGkXXJizaXpag9YQzn2U8A== X-Received: by 2002:a05:600c:4f55:b0:408:3707:b199 with SMTP id m21-20020a05600c4f5500b004083707b199mr21831254wmq.3.1699268832460; Mon, 06 Nov 2023 03:07:12 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-stable@nongnu.org, Richard Henderson , Aurelien Jarno , Jiaxun Yang , Aleksandar Rikalo Subject: [PULL 31/60] target/mips: Fix TX79 LQ/SQ opcodes Date: Mon, 6 Nov 2023 12:03:03 +0100 Message-ID: <20231106110336.358-32-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699270393865100001 The base register address offset is *signed*. Cc: qemu-stable@nongnu.org Fixes: aaaa82a9f9 ("target/mips/tx79: Introduce LQ opcode (Load Quadword)") Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20230914090447.12557-1-philmd@linaro.org> --- target/mips/tcg/tx79.decode | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/mips/tcg/tx79.decode b/target/mips/tcg/tx79.decode index 57d87a2076..578b8c54c0 100644 --- a/target/mips/tcg/tx79.decode +++ b/target/mips/tcg/tx79.decode @@ -24,7 +24,7 @@ @rs ...... rs:5 ..... .......... ...... &r sa=3D0 rt= =3D0 rd=3D0 @rd ...... .......... rd:5 ..... ...... &r sa=3D0 rs=3D0 r= t=3D0 =20 -@ldst ...... base:5 rt:5 offset:16 &i +@ldst ...... base:5 rt:5 offset:s16 &i =20 ########################################################################### =20 --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699269579; cv=none; d=zohomail.com; s=zohoarc; b=JCX4/4sTofZh31lD0leSSs86sPtznDw8+unEDbvcsYDmQ+YzDZ7PCqTYOaPpGeyp4UthjuBR3Tzdsvxjf/knb5BHTBFgdkAZQiexlrcGpbI4gEn58KLF1m0hvEVUDMAFdTJ4cnuifStOrc8R34GtjIop/2B9c8o0ecVdJswAFYY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699269579; 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=S8/5vIGDLKMGAXYMu1UZsIS0RjKQzcO4h+Duvu/oNU4=; b=iDlAtInf7oP+q61cevGdtS4JXfdFJdfxZA6JQQpvRDQWu6aWPtywen2BnFduWuDnMnFu5lDt2t2NLpvVaPamYJFxIWnxOb0tds96J8P/XwilUaKxB4rMmbueYCW+Wez4poBs9jXWahIZJzFLJQ7t4RWPIdAaDCbuItIdWA28Uw0= 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 1699269579207574.7166334064195; Mon, 6 Nov 2023 03:19:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxS6-0004Iz-3b; Mon, 06 Nov 2023 06:07:30 -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 1qzxS3-0004GB-1D for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:07:27 -0500 Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxRw-0004hY-VH for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:07:26 -0500 Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2c501bd6ff1so60995751fa.3 for ; Mon, 06 Nov 2023 03:07:20 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id v9-20020a05600c470900b003feea62440bsm11701095wmo.43.2023.11.06.03.07.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:07:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268839; x=1699873639; 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=S8/5vIGDLKMGAXYMu1UZsIS0RjKQzcO4h+Duvu/oNU4=; b=T/Wo+Xn8U0u/8Pu1u7PgUN2SrXwHUG4+yDMEJVtknA2Ms426kFrCl5kkQqS0pOgPKn j4RT2uWEU7UtbTY7xrxW1jhG/kf3nb98Y3+ulGjjyTELu8/PiAOwvW16XWzUGN9L/xtm /retS4fJySK7pDKsXpj5Kk1IvxWvaGnYK1THsh4DqTzg7O+a80olhdVDZZY4tcwy4hXB 1KO3imu7EwikGTbYUjNsq4CkyYZeGvkbUYjGVr0Fk2jOk4M/muDLysLoTmvFRM8LDaHr p17lkxdtLNlV9IpgCZ3vb0wSwS/fKGOjTImrhmouAulqp2wkbB0ZnBK8Dke8Bi60alwD uMJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268839; x=1699873639; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=S8/5vIGDLKMGAXYMu1UZsIS0RjKQzcO4h+Duvu/oNU4=; b=WHuTHUqv/RT/zQybBdVw9Zx83VLKyku7gnbye8FpGOiaK7jCPRO/r8r0dk85R+7a37 UUEvJqZFbaLyDPk88rIPX5+aVblh1d+MAkQqSOYMrCmh1q48dXs3wjyOIsgsDOGzwa/9 dS1CS4auLmo2eF6PC4s5YPaqKnno4ydJPfkQA77x5qsBSORIHwFyoWvB4yL+DqNSW/VJ SM7wzeEnwiNr117DXb+K6EmGcvC036Ayqpj6ettZ97ljH7DOCRWbTnVLy+0+QK7a//Yn w9mVFalZqOc7F4Jw9OKG4qJX0Glf/mW1lViObjqTLlyjAXgYnDuBnaSjCp/FYdM1hlfA FmuQ== X-Gm-Message-State: AOJu0Yz0iuR3cwAXh+mFgoU8Dyr1UlNrW6Vg9fKt70Zt8clD5lU1GynW sxPLUfULUg9eIOKFmPDf0IfYWQ6h5ALdxamqgKg= X-Google-Smtp-Source: AGHT+IGUmAjl7n06mFubnd+gEr0baz8hJiaRcQUniE2ytONQaxbr97H+8iARFxziBtFUQ6m1v/mnVw== X-Received: by 2002:a2e:940e:0:b0:2c6:e46e:9849 with SMTP id i14-20020a2e940e000000b002c6e46e9849mr10927288ljh.15.1699268838970; Mon, 06 Nov 2023 03:07:18 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Michael Tokarev , Daniel Henrique Barboza , Paolo Bonzini , Nicholas Piggin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 32/60] sysemu/kvm: Restrict kvmppc_get_radix_page_info() to ppc targets Date: Mon, 6 Nov 2023 12:03:04 +0100 Message-ID: <20231106110336.358-33-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::231; envelope-from=philmd@linaro.org; helo=mail-lj1-x231.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699269581163100003 kvm_get_radix_page_info() is only defined for ppc targets (in target/ppc/kvm.c). The declaration is not useful in other targets, reduce its scope. Rename using the 'kvmppc_' prefix following other declarations from target/ppc/kvm_ppc.h. Suggested-by: Michael Tokarev Reviewed-by: Daniel Henrique Barboza Message-Id: <20231003070427.69621-2-philmd@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/sysemu/kvm.h | 1 - target/ppc/kvm.c | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index 80b69d88f6..d614878164 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -521,7 +521,6 @@ int kvm_set_one_reg(CPUState *cs, uint64_t id, void *so= urce); * Returns: 0 on success, or a negative errno on failure. */ int kvm_get_one_reg(CPUState *cs, uint64_t id, void *target); -struct ppc_radix_page_info *kvm_get_radix_page_info(void); =20 /* Notify resamplefd for EOI of specific interrupts. */ void kvm_resample_fd_notify(int gsi); diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index d0e2dcdc77..9b1abe2fc4 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -268,7 +268,7 @@ static void kvm_get_smmu_info(struct kvm_ppc_smmu_info = *info, Error **errp) "KVM failed to provide the MMU features it supports"); } =20 -struct ppc_radix_page_info *kvm_get_radix_page_info(void) +static struct ppc_radix_page_info *kvmppc_get_radix_page_info(void) { KVMState *s =3D KVM_STATE(current_accel()); struct ppc_radix_page_info *radix_page_info; @@ -2368,7 +2368,7 @@ static void kvmppc_host_cpu_class_init(ObjectClass *o= c, void *data) } =20 #if defined(TARGET_PPC64) - pcc->radix_page_info =3D kvm_get_radix_page_info(); + pcc->radix_page_info =3D kvmppc_get_radix_page_info(); =20 if ((pcc->pvr & 0xffffff00) =3D=3D CPU_POWERPC_POWER9_DD1) { /* --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699269633; cv=none; d=zohomail.com; s=zohoarc; b=fd5cy3NTj5/FK5aJR/Sf57iV82FGudwnlVJBLF2hJl+tlrgutul8kUy2xe8a04lPCCicwpmAhA5oDUSsXRpTgmOn0VZ8/IZtCTjfMnoBoTgotu/Pc8nDAEkjGFWYZTxK8JcvP4AQprPiFYIyM0TYYiJKPAxyR9LV6O5RjUFdlIc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699269633; 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=2OUN8qI3wvvK+6EjwaYybG9IZ1pKduK7zbEAWLMDuTw=; b=j9z0yVks/shjap+ljgnam5ITw41OrwFTg5SNFl76nBOwABrk6jXEUXX0lJ7xJbvTj78eOVb0mh0heHJwJiVqFB9PeN+TMLqO6Ws1a7EBfq/v6Tyf9YhnCXOxCaH1FADXInws4Aj1rlFwi+MS4Ro1OvmkGjW5qXQtog3GPyygPyU= 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 1699269633260283.3379750532457; Mon, 6 Nov 2023 03:20:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxSE-0004M9-Cr; Mon, 06 Nov 2023 06:07:38 -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 1qzxS6-0004Jo-WC for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:07:31 -0500 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxS3-0004ij-UM for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:07:30 -0500 Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2c5056059e0so62174941fa.3 for ; Mon, 06 Nov 2023 03:07:26 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id j8-20020a05600c1c0800b004063977eccesm11981849wms.42.2023.11.06.03.07.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:07:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268845; x=1699873645; 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=2OUN8qI3wvvK+6EjwaYybG9IZ1pKduK7zbEAWLMDuTw=; b=cMd584eRRikVJ08Fhohp3sLzYJje/Z+0re04hf+g5hslNQMvTma0FD1eEY58Z8Pg9b O5eGjcBnUFqaeg4heKG6qSGWgGPCaGJ2RQyHOGynPx5l2NFylAp1U7KfHy5UdBcVrGl2 YvnNB9NN3GhMTZekkjXV2ePWDwl/iTZrVl2r/igkGjonp/Vc8hmC06M4+u5m3t8Tw+Qv s0GUWD+xQGy5fjHvQOrLhuw2Vx8D7h4oBB8CciSuC7oNUMJsXlpSDOLyogPGx6wR7ONK BsqoRqGB7fFMQ4e+L55zHqa1INsOchiSl+djjTlo+AIKNMbqo+7zmXGBQy4fH4subREF zqiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268845; x=1699873645; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2OUN8qI3wvvK+6EjwaYybG9IZ1pKduK7zbEAWLMDuTw=; b=eSXR1ZmLFzRZ4Ji8Y2TrKw2pJhMzq7vS6KIi+Tqksl4GgkBp04CcickH2YyjdQSXOY DmQqdPHiEKgQRmbm6hU4RzSkfk3574VBaPa6xF1S7E3qFPPZYQg4O7c5nAwuoM+EjvNM XZ8vbqCZDmVwcmEODpA9LnjZB9eHEhZLxqWIjR1Ge+x7LmADfu+7cSjH4ZeNoZyl3RK+ 116Xt9wAR8u7/DVNDt9qWR2QgNjuIPSDKolTl2zJxkTsDaty9RrPKC52nYZiBCZx69gv RMtQ+wPkOUbvDE1v1IUiX2iNYjuas4M/dcYAWUkmIiU5lBJpG0ttr2Rjk21/t1x/udpA lQog== X-Gm-Message-State: AOJu0Yz09tPyiZSrv0Kwy4iKLMHRwfPk7RfLqrBg1eDHJ4uMVnGFhUSL ERtShR2d8CoQZQO5LsvberHwdpOZD6iQ5fsF/OA= X-Google-Smtp-Source: AGHT+IFLhhaF5dO3+8DYorxoIdQA7+GAd7X/cQ5bFHpXQKo5JyRHH2aTx5vdNP64N0ZZh22eyd9tMw== X-Received: by 2002:a2e:3816:0:b0:2c5:8a0:b502 with SMTP id f22-20020a2e3816000000b002c508a0b502mr21890109lja.48.1699268845464; Mon, 06 Nov 2023 03:07:25 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Michael Tokarev , Nicholas Piggin , Daniel Henrique Barboza , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 33/60] hw/ppc/e500: Restrict ppce500_init_mpic_kvm() to KVM Date: Mon, 6 Nov 2023 12:03:05 +0100 Message-ID: <20231106110336.358-34-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::234; envelope-from=philmd@linaro.org; helo=mail-lj1-x234.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699269633560100001 Inline and guard the single call to kvm_openpic_connect_vcpu() allows to remove kvm-stub.c. Reviewed-by: Michael Tokarev Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20231003070427.69621-3-philmd@linaro.org> --- hw/ppc/e500.c | 4 ++++ target/ppc/kvm-stub.c | 19 ------------------- target/ppc/meson.build | 2 +- 3 files changed, 5 insertions(+), 20 deletions(-) delete mode 100644 target/ppc/kvm-stub.c diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index e04114fb3c..384226296b 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -834,6 +834,7 @@ static DeviceState *ppce500_init_mpic_qemu(PPCE500Machi= neState *pms, static DeviceState *ppce500_init_mpic_kvm(const PPCE500MachineClass *pmc, IrqLines *irqs, Error **errp) { +#ifdef CONFIG_KVM DeviceState *dev; CPUState *cs; =20 @@ -854,6 +855,9 @@ static DeviceState *ppce500_init_mpic_kvm(const PPCE500= MachineClass *pmc, } =20 return dev; +#else + g_assert_not_reached(); +#endif } =20 static DeviceState *ppce500_init_mpic(PPCE500MachineState *pms, diff --git a/target/ppc/kvm-stub.c b/target/ppc/kvm-stub.c deleted file mode 100644 index b98e1d404f..0000000000 --- a/target/ppc/kvm-stub.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * QEMU KVM PPC specific function stubs - * - * Copyright Freescale Inc. 2013 - * - * Author: Alexander Graf - * - * This work is licensed under the terms of the GNU GPL, version 2 or late= r. - * See the COPYING file in the top-level directory. - * - */ -#include "qemu/osdep.h" -#include "cpu.h" -#include "hw/ppc/openpic_kvm.h" - -int kvm_openpic_connect_vcpu(DeviceState *d, CPUState *cs) -{ - return -EINVAL; -} diff --git a/target/ppc/meson.build b/target/ppc/meson.build index 97ceb6e7c0..eab4e3e1b3 100644 --- a/target/ppc/meson.build +++ b/target/ppc/meson.build @@ -30,7 +30,7 @@ gen =3D [ ] ppc_ss.add(when: 'CONFIG_TCG', if_true: gen) =20 -ppc_ss.add(when: 'CONFIG_KVM', if_true: files('kvm.c'), if_false: files('k= vm-stub.c')) +ppc_ss.add(when: 'CONFIG_KVM', if_true: files('kvm.c')) ppc_ss.add(when: 'CONFIG_USER_ONLY', if_true: files('user_only_helper.c')) =20 ppc_system_ss =3D ss.source_set() --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699270064; cv=none; d=zohomail.com; s=zohoarc; b=B+toqSZarSr3aIZDQUqvoYeqJHKpamsxXZwzjSO7yJE8SbryyJeKuUrLiRoiFQF5DHuMDOJlyTLLaSCijLFsqfa50M9GHBMH5/Akm3jSm1q8bOjGFkjD15glzCTbdTbG2/r0JNCLQ/K1aDaX3W5R3HKsSEKKwET9+5WMedTSPTk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699270064; 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=Cb2SoP+Kcg9QwI4B3FcAYm9BYCwnPa3WzQeoNeejBGE=; b=A/GMyi+zLvZag4vpr/rc10jgs6iHOmKuqyG70cZ5/Qg6HECghO+iZPtxxS4eWjCgrOUV/V2bcvvaxqAUHI5ur1LYKHW0rYJbKW4wxbHGTD8sQ3UkiahrWO42OQU/olw9G4nwQWIdL34KODkPuC12iZrh/7dJvWbVIw0fvXAukVo= 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 169927006441739.2553279052255; Mon, 6 Nov 2023 03:27:44 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxSP-00050j-5N; Mon, 06 Nov 2023 06:07:49 -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 1qzxSN-0004qB-0X for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:07:47 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxSA-0004ke-7s for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:07:46 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40839652b97so32718665e9.3 for ; Mon, 06 Nov 2023 03:07:33 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id f13-20020a05600c4e8d00b0040596352951sm11677086wmq.5.2023.11.06.03.07.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:07:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268852; x=1699873652; 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=Cb2SoP+Kcg9QwI4B3FcAYm9BYCwnPa3WzQeoNeejBGE=; b=sai4HMIyAnrFf0oZS3teI+VLwm5Mc3UWHOc5U48mdqxZ0uReRE6l/dH0a4Fsx8Cyar 1MliJ7943Hqp912l4o9JwiVt9FYo+ppGRw6dooqkY/maR2BwYltAuZF8+4xZXXxzX7TU u+VU5ieRsbx8DKr1VwVrh7e0uCRPStWm9RQGBcoIyh+0UqAX/G6j4lCW0U7nZfzzSqAe ErjAjQTMZgqmnVEc6Bld+KDah6M/iE7/+KND36UwmW0SC/mGh32iRMfOmuHAij3h+2fq u+x/oKFBBwHAgBE0XH/33nOgKcQdB5v9rwz74VpPnfP1T2xwAheXZaZuUaRFLsmgzS1M AbLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268852; x=1699873652; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Cb2SoP+Kcg9QwI4B3FcAYm9BYCwnPa3WzQeoNeejBGE=; b=fs0Sh+dZxiZ0QCLgRAVcrHup93ItDu3AlWUMbQkW3uqs3Ai1NW3XZwDXUv9qcfKicd haE3MnzIPYJfRRXYEhmNEJwikPf47IeNHExd2YkKwZIZCpUIWQvHMPIIghyiFs0ckrZn EoYGA91WRWwg0klUb+xRsqTV2gmh6uhHWjPTIDb3DdA8zjfXtf6DMxv8gqQ5WG9xMEWR tytj0ZHHUVq5Cz/c72D6wRyfXAdYM5DuegUJoSdYGL64T12tIRASHePVpRdbQ9nAoOdz 5WB5qjlG7ZtQDWL819NmMEdh+9UiuTTvQJsEeR95sB4DwckuEvNDkkK8UtvpQXBy3XMl yddQ== X-Gm-Message-State: AOJu0YxKUU04bJNvgNwN/k4sjLk906Gfp14ECXgwmu1TBguNxIZqd7V+ veb6rhi5HXnMsw82i4b4miIM02/Ky/Xt992HK9g= X-Google-Smtp-Source: AGHT+IGOwGb19To8VXCdR8ERpA0kEx5JDBtiDEBtx2l74K+wLoipriHx1wrJrWcABU//cghRcbbU9g== X-Received: by 2002:a05:600c:4fc6:b0:401:b652:b6cf with SMTP id o6-20020a05600c4fc600b00401b652b6cfmr23757960wmq.13.1699268851941; Mon, 06 Nov 2023 03:07:31 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Michael Tokarev , Nicholas Piggin , Daniel Henrique Barboza , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 34/60] target/ppc: Restrict KVM objects to system emulation Date: Mon, 6 Nov 2023 12:03:06 +0100 Message-ID: <20231106110336.358-35-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699270066431100003 CONFIG_KVM is always FALSE on user emulation, so 'kvm.c' won't be added to ppc_ss[] source set; direcly use the system specific ppc_system_ss[] source set. Reviewed-by: Michael Tokarev Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20231003070427.69621-4-philmd@linaro.org> --- target/ppc/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/ppc/meson.build b/target/ppc/meson.build index eab4e3e1b3..0b89f9b89f 100644 --- a/target/ppc/meson.build +++ b/target/ppc/meson.build @@ -30,7 +30,6 @@ gen =3D [ ] ppc_ss.add(when: 'CONFIG_TCG', if_true: gen) =20 -ppc_ss.add(when: 'CONFIG_KVM', if_true: files('kvm.c')) ppc_ss.add(when: 'CONFIG_USER_ONLY', if_true: files('user_only_helper.c')) =20 ppc_system_ss =3D ss.source_set() @@ -46,6 +45,7 @@ ppc_system_ss.add(when: 'CONFIG_TCG', if_true: files( ), if_false: files( 'tcg-stub.c', )) +ppc_system_ss.add(when: 'CONFIG_KVM', if_true: files('kvm.c')) =20 ppc_system_ss.add(when: 'TARGET_PPC64', if_true: files( 'compat.c', --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699269300; cv=none; d=zohomail.com; s=zohoarc; b=M0GG/iurUKayYoVtFSeAESy0hPIyKXiShCcriiJctcsQref+evXP3aeAOwWIJ/SdP8yispYc7XUdqmzEa4Mu5yWAUboJ7OOkpgBVeOAlxIXe51HED8QgMe2SR7DA+G2jCPGPrwGna22QKTVnQBC/pel0FTIPWXSTq4KmlhZL9iE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699269300; 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=/8FQLEYTqFB9Ro3y1RtUGoGmFmjKyGG2i99735loRZ8=; b=dmh9C1ZQiT/z3a/ELBj/T63CwpVxBnmGzUh4mx2LXBfA1icUXGwcx2MhZljMOBeZYKVienYTI6M1FKxWHYk5OKP2AwmfK47QOcOj5n9xCKUvHvv6hHtr5AtUw7Ihx0XzzzAtOcxszEEUOXNIkUBroERoSLn6QFO6Uf3h1gQa9XU= 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 1699269300565538.4230756960815; Mon, 6 Nov 2023 03:15:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxSJ-0004Vz-PC; Mon, 06 Nov 2023 06:07:43 -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 1qzxSH-0004SR-NJ for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:07:42 -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 1qzxSG-0004m5-5P for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:07:41 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-408382da7f0so32552115e9.0 for ; Mon, 06 Nov 2023 03:07:39 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id z13-20020a5d4d0d000000b0031ad5fb5a0fsm9131295wrt.58.2023.11.06.03.07.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:07:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268858; x=1699873658; 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=/8FQLEYTqFB9Ro3y1RtUGoGmFmjKyGG2i99735loRZ8=; b=WF6E+sNXVZX/Z+5pGUBibdCMZcz4zUcXLMjWEZE8U35cfkkuvb1O99TDaEPBQh8Rm8 zYfiXeRlni+swHKXl2RYdTVAJShEUu5Ssm+p1LnmAGRywT9b5hP4oi8moHQ0A6lBOCFb VHpypHN/gZbNOUGMxcm7sfQa2GmmGR1SaPBY5wMpGpKSJ+OSmZGh+RFT/HGCEHivRmBX GqXPvktynv1dKAt5Xs4kXbXq8DoT/v1VkuodmY7RE/NWmBg8pHRNKdbeziQ+8ZoFn/FF xqsDgUzojnCJIHirq23Nc55SA9QwqCc8/ClXOvUQNyKT0w7lXtBnnL5ZdC8hm7CfBS1l NXNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268858; x=1699873658; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/8FQLEYTqFB9Ro3y1RtUGoGmFmjKyGG2i99735loRZ8=; b=VyXSo792PtSpZ4IEfNpi2lsSYjUBruJx7hyY4EdTOuaFrvz1ax1QVVsJ+rNTgbw4GH u/gJidMxRcbtYWnXYW/cqH+z9GJMGgZPaJHXvHyOKkqEE2gOVgICoLbcsxfsKtznxTWr GJ2bl1q6JVNWczIY7LCKaTAx62nuglNVer1Oh/xnNSo+g2Ho75Ya+cgj5mJS8AmSibBK dVib2qEX68ZIgzndHaLDs/dIj1mO/NUKrHXcRYIYycGjscQQ3UcUeAaGuxDEfcyPgaKw iydrfhOguUvgGbqecXIs/ZLzCK7GUbQ6fW3kS57vyjvGcYf0oJvOgrcnDKxeYTDzhYeF +WMw== X-Gm-Message-State: AOJu0YwO9KJD0UKKUB3G0NGIoyTfzXFUwmF17Jvtl8RKOLoPz4KKlW4k mTClKx2AbBhVTbBF6B2jRk6lPAFchoXgG1FFS/s= X-Google-Smtp-Source: AGHT+IGSllHpaGQMqKbvX8OyPw5FMMgGznDw9vfBmKkgEXMDizlL7BCd/fkfmOdW9htoRowrrHTYDQ== X-Received: by 2002:a5d:6dae:0:b0:32f:7c01:5376 with SMTP id u14-20020a5d6dae000000b0032f7c015376mr22752718wrs.31.1699268858733; Mon, 06 Nov 2023 03:07:38 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Kevin Wolf , Daniel Henrique Barboza , Nicholas Piggin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Paolo Bonzini Subject: [PULL 35/60] target/ppc: Prohibit target specific KVM prototypes on user emulation Date: Mon, 6 Nov 2023 12:03:07 +0100 Message-ID: <20231106110336.358-36-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699269301524100001 None of these target-specific prototypes should be used by user emulation. Remove their declaration there, so we get a compile failure if ever used (instead of having to deal with linker and its possible optimizations, such dead code removal). Suggested-by: Kevin Wolf Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Daniel Henrique Barboza Message-Id: <20231003070427.69621-5-philmd@linaro.org> --- target/ppc/kvm_ppc.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/ppc/kvm_ppc.h b/target/ppc/kvm_ppc.h index 6a4dd9c560..1975fb5ee6 100644 --- a/target/ppc/kvm_ppc.h +++ b/target/ppc/kvm_ppc.h @@ -13,6 +13,10 @@ #include "exec/hwaddr.h" #include "cpu.h" =20 +#ifdef CONFIG_USER_ONLY +#error Cannot include kvm_ppc.h from user emulation +#endif + #ifdef CONFIG_KVM =20 uint32_t kvmppc_get_tbfreq(void); --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699269753; cv=none; d=zohomail.com; s=zohoarc; b=HuQ/+X6jk6P0MfoOm6nj/8hHsysuQ23+S8cU5M0ezl7umI4RePgDvIppou4UkWq3NWkJ5WHqd6RLeRYU9NnjUa5PR8uWCYRTQcZX+KpS8BX0IlvFCGN335ZjdA9Z7OYOBd/pFfGOZEnJXP99dZPP+vFIzx/gtekJHamRQEDhReU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699269753; 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=95fjXxwoCEM5MPpLzleCUNmgt+EGYy9i69c6BsnNRfk=; b=Xk42TlS4ukSkp2X++g4jigrQhQlV/KqHqHurzbwOYnk6rzg3UE6LgW1bng0X6yhlvmTthf+rR4Wk8/bUE9oEeGwL3H5LVt20rxW6w18qqN5IcRqW274+mRZ//4zji6oIRhvknj4BtcPOnH7aVByDioV8gZ4Vsyuzkb6+03xuP7w= 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 1699269753574321.89939379049156; Mon, 6 Nov 2023 03:22:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxSR-00057Y-B6; Mon, 06 Nov 2023 06:07:51 -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 1qzxSP-00052h-Oz for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:07:49 -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 1qzxSN-0004nh-PK for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:07:49 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-407da05f05aso30531645e9.3 for ; Mon, 06 Nov 2023 03:07:46 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id f20-20020a05600c43d400b003fbe4cecc3bsm11518827wmn.16.2023.11.06.03.07.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:07:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268865; x=1699873665; 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=95fjXxwoCEM5MPpLzleCUNmgt+EGYy9i69c6BsnNRfk=; b=kERgngPfzLr+WVZnHNuV8FB/4VhXK2sIKy6Z1w4OBpLpmkzh6UQjABs2JT4ReH/42a CtozWKHH6GfDCpAZpYyosuV7Y4pcLhDOEvAdiIMRewQ+e6i2DLChWDRzZvRnPpadgVyB RvVrMj6bmDrlH0orddAi0D8MpWBxd6Sv8L8XRAYEjkZDMMYddBx4KT2XmT7qklUKK9hO CUZf5j6furb962uoz/9X/pO3CFOXhSnRhIt7vl2RGqa1ujGYzJs0gZpTYEB0ilMNizfI 4jXAR1+ECfLCz8/6v7g4FLkbdHmUlEiezSRL/P+WRGYVMqspAOrtf/7Pn/eG9F4Y18+a KyDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268865; x=1699873665; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=95fjXxwoCEM5MPpLzleCUNmgt+EGYy9i69c6BsnNRfk=; b=DDAhvGNYaZmKqVfASzm/tZssUU3YGh9l/4Y2c75Kkoyd45yAtEq0vb35Hutx8S/Hk9 mvrPEkSWpagfU+51/uFYw3joR3D/9Mf2RcCLySNXm+8lg0TC65XxCNftJ8T2+EAcSPz0 jw/EslAP+Gf6hfEaUx4ImCyYeD6sDKSLBnG5oQEpumPtOP1MAwl51GC/e0tLurXLBcGM zpH+JKleIv/3W8x3e9LuSYaUDQqrCDTqOBzTmyDXr+z6FkZ5J31YSgqgaWxJ1MBEm7mj eB1XB1DjsTJl8j+tL/NaOxVaO4MNLxf8VOjOoDhaohKVfohcvwxXg0WtuxlNePyx87qm na1A== X-Gm-Message-State: AOJu0Yx/o5PELHv0SHtSyobHyr8MsZhbnx82kGcWDu4hqx43a32qRFr5 TGWXH0zCHILWxEJobKx/azvrdgUojo4u/TBff2s= X-Google-Smtp-Source: AGHT+IFA2chfzU/RG3fUnF9L1zuwbrR/mZ3//aX7n36RLMNo0C4jCT70SUW9S7M0scEuKtQWCV9uyw== X-Received: by 2002:a05:600c:4c9a:b0:409:57ec:9d7e with SMTP id g26-20020a05600c4c9a00b0040957ec9d7emr13786805wmp.21.1699268865155; Mon, 06 Nov 2023 03:07:45 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Chris Wulff , Marek Vasut Subject: [PULL 36/60] target/nios2: Create IRQs *after* accelerator vCPU is realized Date: Mon, 6 Nov 2023 12:03:08 +0100 Message-ID: <20231106110336.358-37-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699269754500100003 Architecture specific hardware doesn't have a particular dependency on the accelerator vCPU (created with cpu_exec_realizefn), and can be initialized *after* the vCPU is realized. Doing so allows further generic API simplification (in few commits). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20230918160257.30127-12-philmd@linaro.org> --- target/nios2/cpu.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/target/nios2/cpu.c b/target/nios2/cpu.c index 15e499f828..a27732bf2b 100644 --- a/target/nios2/cpu.c +++ b/target/nios2/cpu.c @@ -199,14 +199,6 @@ static void nios2_cpu_realizefn(DeviceState *dev, Erro= r **errp) Nios2CPUClass *ncc =3D NIOS2_CPU_GET_CLASS(dev); Error *local_err =3D NULL; =20 -#ifndef CONFIG_USER_ONLY - if (cpu->eic_present) { - qdev_init_gpio_in_named(DEVICE(cpu), eic_set_irq, "EIC", 1); - } else { - qdev_init_gpio_in_named(DEVICE(cpu), iic_set_irq, "IRQ", 32); - } -#endif - cpu_exec_realizefn(cs, &local_err); if (local_err !=3D NULL) { error_propagate(errp, local_err); @@ -220,6 +212,14 @@ static void nios2_cpu_realizefn(DeviceState *dev, Erro= r **errp) /* We have reserved storage for cpuid; might as well use it. */ cpu->env.ctrl[CR_CPUID] =3D cs->cpu_index; =20 +#ifndef CONFIG_USER_ONLY + if (cpu->eic_present) { + qdev_init_gpio_in_named(DEVICE(cpu), eic_set_irq, "EIC", 1); + } else { + qdev_init_gpio_in_named(DEVICE(cpu), iic_set_irq, "IRQ", 32); + } +#endif + ncc->parent_realize(dev, errp); } =20 --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699269858; cv=none; d=zohomail.com; s=zohoarc; b=kfqdGt/p0Pux1o5t6fdSB4M5+x4g9cK4AL/k8CqiDVvFHLWTr5Ot7UFb8UIlqyAk+lkZH9sHoXGUQqiXfiQu/SNJSaIO1EmFozAuJjRlqeZZuktpwIU0iRx8wZ9P1cHj3ow7YxP6/AJCNO7ZXqGzP6NrhqrWRhiHA3vDzyNQJFo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699269858; 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=pDLz44pMnS6BY17PlhPlXPTDOUKf2M5E2FKcksHeUks=; b=KbU+ZdVKjVNkWhrmcZUIEFF3Qz/te2OsK7m6PFaMQVG+fMoFonjd7XMX2/hWpUO4uVfD9qTTqh7QG/7LbB9wtekPqf8DFDwbXBQAJeaqR+/u1Z9aE0kQmEYvDwvVC7dpEQ4DgA6a4EU6J85fv3WiXeA4h2Li38O2Ku2p+KEpOnU= 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 1699269858000165.79770055772212; Mon, 6 Nov 2023 03:24:18 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxSX-0005FO-Fv; Mon, 06 Nov 2023 06:07:57 -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 1qzxSW-0005C0-7u for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:07:56 -0500 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxSU-0004t8-Kw for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:07:55 -0500 Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-507d1cc0538so5745068e87.2 for ; Mon, 06 Nov 2023 03:07:54 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id k18-20020a5d6d52000000b0032da4f70756sm9122296wri.5.2023.11.06.03.07.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:07:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268871; x=1699873671; 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=pDLz44pMnS6BY17PlhPlXPTDOUKf2M5E2FKcksHeUks=; b=kslP9F7ork8t6NxZHid0VrmFSQ9tHMOuZ4zNqElHvUWScGsiOrvcWPtP8uYyvXc8Eb NxeoShDmG94h6fFVHjwt1bdLBU1FEFYQ9ZiGq6K9Af7Za9BnYVnycNvTfjgFHp4kITaU OjyM3Sl72yA2KJFe7Mxegvqhq5Kb2mZlbG+ekmve05pE/PkJzv317OB03ug+Dg8KHk6f 7oTlg2SJCqRBVWQRJtNHdnyzEgn981IkVJjsaceE2mDy9yyKyp1h7b0uuzpwn/Lglf8p hMCDoQzkNHR9xkBGCAuxQW26zhfdUae+IYvkLGK5gn2LunFFo47GFonC0ad5rHIIjKkY tFHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268871; x=1699873671; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pDLz44pMnS6BY17PlhPlXPTDOUKf2M5E2FKcksHeUks=; b=nkgdDkvxLgiReVFUrRMg0gTptCxu9D8wFgUHguHNJxBHyDyQlfdVrujqCM4uJKsY83 tiMyY/nnrMKiwoNyezgBC2CDH2QLpsB8SbaXG0runKt1SRHfR6faBgyrGF8I/SPxrlDC HLfvH22qN0iq4a9hVwNx3cXNJplTEwk+8vZ3dA3ATGSw7IJvMAL9BjAoNW0NWKo+z1xM GRunmDBCTjLFqe9EzdgDlon21Zl4b7+sPic7ltoxniXa0Lz89+o5nZAm96XLuCJRwNA1 d2stqnq1g/aSPx+G9gW8XurR7e4ZMP6mCqaCMUuZQ/U33uDTMovnMcv1PW0sqXrPGZ6B FzzQ== X-Gm-Message-State: AOJu0YzvqUCKu93/MaxITzjdNV6WVmeTh1HA8CYszR6nHjEQ3g3x55eh /kGwrVVMPZQDMBdOleRDFNWEyG6Yfy6WNq1hM9o= X-Google-Smtp-Source: AGHT+IHcdyLqApBzrM1UIl1rL4HV5Kt/MnTQib7GE9Ti6YP9IhDYtQPkYZQNlydR2XL1DbF6EVXSWA== X-Received: by 2002:ac2:44ae:0:b0:503:38f2:6e1 with SMTP id c14-20020ac244ae000000b0050338f206e1mr18200122lfm.5.1699268871711; Mon, 06 Nov 2023 03:07:51 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Gavin Shan Subject: [PULL 37/60] target/alpha: Tidy up alpha_cpu_class_by_name() Date: Mon, 6 Nov 2023 12:03:09 +0100 Message-ID: <20231106110336.358-38-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::131; envelope-from=philmd@linaro.org; helo=mail-lf1-x131.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699269859153100002 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Gavin Shan Message-Id: <20230908112235.75914-2-philmd@linaro.org> --- target/alpha/cpu.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index 51b7d8d1bf..fae2cb6ec7 100644 --- a/target/alpha/cpu.c +++ b/target/alpha/cpu.c @@ -142,13 +142,10 @@ static ObjectClass *alpha_cpu_class_by_name(const cha= r *cpu_model) typename =3D g_strdup_printf(ALPHA_CPU_TYPE_NAME("%s"), cpu_model); oc =3D object_class_by_name(typename); g_free(typename); - if (oc !=3D NULL && object_class_is_abstract(oc)) { - oc =3D NULL; - } =20 /* TODO: remove match everything nonsense */ - /* Default to ev67; no reason not to emulate insns by default. */ - if (!oc) { + if (!oc || object_class_is_abstract(oc)) { + /* Default to ev67; no reason not to emulate insns by default. */ oc =3D object_class_by_name(ALPHA_CPU_TYPE_NAME("ev67")); } =20 --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699269164; cv=none; d=zohomail.com; s=zohoarc; b=CPGnrUTnVBhokoxxJhLLZKySAS/L2CdnkrCb4SJbIvrfpsBw9+MTuWcHVh4uC6uwZ1/wtJSvXUE4waTHE6H/ZWeqMIZwu+PVmWWYee5Y4HfjrTXf7diKhj6k/rGBvQu8q4546YofHlMnv+m4PqDorlOxiOKAKrEgseFsalOx+Mw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699269164; 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=KMjbC2xJWHxNTrhQC1HW/27kz6qe7U3LIUpfEfCgflY=; b=PQxNGhyA4S6lEE+oH7IlWdxTOGzt1xofRMNUAN7gq9TqvcbbG9kVbbGaAxZozdGSI2aJ3ldJF9fallqPdYaJjBbdSTAOMMPdIZ2q/VYcV8XalC0qp+jTuqo3ERLEXdrAw42sXtqa19CsvhC1pa0L49PLblNz+UvHh7z4rD4WKnk= 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 1699269164625256.0496364878911; Mon, 6 Nov 2023 03:12:44 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxSh-0005X4-Tw; Mon, 06 Nov 2023 06:08:07 -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 1qzxSf-0005T4-Sj for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:08:05 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxSd-0004yJ-JH for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:08:05 -0500 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-32f7bd27c2aso3069867f8f.2 for ; Mon, 06 Nov 2023 03:08:02 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id l4-20020a5d5604000000b0032f78feb826sm9106145wrv.104.2023.11.06.03.07.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:07:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268880; x=1699873680; 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=KMjbC2xJWHxNTrhQC1HW/27kz6qe7U3LIUpfEfCgflY=; b=wc/dWq27vCi614hlxzXlIAdHnViZMW4pvLIyjQaA5AWDQn6nIhEqPQ9f3afNAaOr1M 0GxVpNeM6QiCoohTKjln9qlInYsAzllFxlc9Gc8yMPLTF2weH1yh5dbFiswHCxJlcBra 10CEib5FCDxuVO7DeRTcm3RuYq6hQ9BA4dDLkshVQ/ZUt3BHkOJr8EzNKijV5IdgvaGR dHyiumD30iztTAppXRvhZQpXKkU/xzQGEkX84uRR555CVbM6ixZLtMX8bfHkjMPGQrFF eKd+6uyuzDUxWBmXYxjQXyrXIl29ZlnkyczdlMTll/Xt58xQ7J+WnaeEqYimkB6McILj v9Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268880; x=1699873680; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KMjbC2xJWHxNTrhQC1HW/27kz6qe7U3LIUpfEfCgflY=; b=hc/aE5LRulAdb98fJClRfnQfIEo/UXXlxVIPMG2V82stAmtg4t43oI41fkVOnCBHq7 1xuz6zWCC45ftBRI5LB5xTJotbYMf6Ou6c8Ft3ZpiPgvd+48ycByjhm/u//jeR8f2W2m Nlh4hK4f0dVxV8+dhT3wluWyFtF8tkGkgjhBmoGXon+oRGJiSI8gQXQrCk6/6uSzCi7G aEYTwxGjUlKEUir4zT5Pu1r3pOmU9tr9044ZKdphv+4NrMwXE5wFN5hi0CHg4KbHROe2 ELxeTtYp8HyI6CEOjddLSj9MCWBRTtFbr/iIpb8VoIffbSzNmx2NPHbdQw0gGQlfSawZ wQvA== X-Gm-Message-State: AOJu0YyEMlZsU/p8KHA7ZWoIHRsBA6uzLJEIBagxZXHtTGyUuNFB742/ bZ9Gmzt8QVi9kewmXDokRZBCVuj+hyqiSQDKEvM= X-Google-Smtp-Source: AGHT+IH9X2GE3xs55/ZsOwgF8AvUm+DWjmmM+7ejsJtn9NBM/K//H0bsohOzSfHKuAoPE0hD1kKuBQ== X-Received: by 2002:a5d:47a9:0:b0:32f:96c6:8bb with SMTP id 9-20020a5d47a9000000b0032f96c608bbmr13753845wrb.7.1699268879845; Mon, 06 Nov 2023 03:07:59 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang , Peter Maydell , Michael Rolnik , "Edgar E. Iglesias" , Brian Cain , Song Gao , Laurent Vivier , Stafford Horne , Palmer Dabbelt , Alistair Francis , Bin Meng , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Yoshinori Sato , Bastian Koppelmann , Max Filippov Subject: [PULL 38/60] hw/cpu: Call object_class_is_abstract() once in cpu_class_by_name() Date: Mon, 6 Nov 2023 12:03:10 +0100 Message-ID: <20231106110336.358-39-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699269168986100001 Let CPUClass::class_by_name() handlers to return abstract classes, and filter them once in the public cpu_class_by_name() method. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20230908112235.75914-3-philmd@linaro.org> --- include/hw/core/cpu.h | 7 ++++--- hw/core/cpu-common.c | 14 +++++++++++--- target/alpha/cpu.c | 3 +-- target/arm/cpu.c | 3 +-- target/avr/cpu.c | 3 +-- target/cris/cpu.c | 3 +-- target/hexagon/cpu.c | 3 +-- target/loongarch/cpu.c | 3 +-- target/m68k/cpu.c | 3 +-- target/openrisc/cpu.c | 3 +-- target/riscv/cpu.c | 3 +-- target/rx/cpu.c | 6 +----- target/sh4/cpu.c | 3 --- target/tricore/cpu.c | 3 +-- target/xtensa/cpu.c | 3 +-- 15 files changed, 27 insertions(+), 36 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 6373aa4501..5d6f8dca43 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -102,7 +102,7 @@ struct SysemuCPUOps; /** * CPUClass: * @class_by_name: Callback to map -cpu command line model name to an - * instantiatable CPU type. + * instantiatable CPU type. * @parse_features: Callback to parse command line arguments. * @reset_dump_flags: #CPUDumpFlags to use for reset logging. * @has_work: Callback for checking if there is work to do. @@ -772,9 +772,10 @@ void cpu_reset(CPUState *cpu); * @typename: The CPU base type. * @cpu_model: The model string without any parameters. * - * Looks up a CPU #ObjectClass matching name @cpu_model. + * Looks up a concrete CPU #ObjectClass matching name @cpu_model. * - * Returns: A #CPUClass or %NULL if not matching class is found. + * Returns: A concrete #CPUClass or %NULL if no matching class is found + * or if the matching class is abstract. */ ObjectClass *cpu_class_by_name(const char *typename, const char *cpu_model= ); =20 diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index baa6d28b64..d4112b8919 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -146,10 +146,18 @@ static bool cpu_common_has_work(CPUState *cs) =20 ObjectClass *cpu_class_by_name(const char *typename, const char *cpu_model) { - CPUClass *cc =3D CPU_CLASS(object_class_by_name(typename)); + ObjectClass *oc; + CPUClass *cc; =20 - assert(cpu_model && cc->class_by_name); - return cc->class_by_name(cpu_model); + oc =3D object_class_by_name(typename); + cc =3D CPU_CLASS(oc); + assert(cc->class_by_name); + assert(cpu_model); + oc =3D cc->class_by_name(cpu_model); + if (oc =3D=3D NULL || object_class_is_abstract(oc)) { + return NULL; + } + return oc; } =20 static void cpu_common_parse_features(const char *typename, char *features, diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index fae2cb6ec7..39cf841b3e 100644 --- a/target/alpha/cpu.c +++ b/target/alpha/cpu.c @@ -126,8 +126,7 @@ static ObjectClass *alpha_cpu_class_by_name(const char = *cpu_model) int i; =20 oc =3D object_class_by_name(cpu_model); - if (oc !=3D NULL && object_class_dynamic_cast(oc, TYPE_ALPHA_CPU) !=3D= NULL && - !object_class_is_abstract(oc)) { + if (oc !=3D NULL && object_class_dynamic_cast(oc, TYPE_ALPHA_CPU) !=3D= NULL) { return oc; } =20 diff --git a/target/arm/cpu.c b/target/arm/cpu.c index df6496b019..25e9d2ae7b 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -2401,8 +2401,7 @@ static ObjectClass *arm_cpu_class_by_name(const char = *cpu_model) oc =3D object_class_by_name(typename); g_strfreev(cpuname); g_free(typename); - if (!oc || !object_class_dynamic_cast(oc, TYPE_ARM_CPU) || - object_class_is_abstract(oc)) { + if (!oc || !object_class_dynamic_cast(oc, TYPE_ARM_CPU)) { return NULL; } return oc; diff --git a/target/avr/cpu.c b/target/avr/cpu.c index 14d8b9d1f0..44de1e18d1 100644 --- a/target/avr/cpu.c +++ b/target/avr/cpu.c @@ -157,8 +157,7 @@ static ObjectClass *avr_cpu_class_by_name(const char *c= pu_model) ObjectClass *oc; =20 oc =3D object_class_by_name(cpu_model); - if (object_class_dynamic_cast(oc, TYPE_AVR_CPU) =3D=3D NULL || - object_class_is_abstract(oc)) { + if (object_class_dynamic_cast(oc, TYPE_AVR_CPU) =3D=3D NULL) { oc =3D NULL; } return oc; diff --git a/target/cris/cpu.c b/target/cris/cpu.c index be4a44c218..675b73ac04 100644 --- a/target/cris/cpu.c +++ b/target/cris/cpu.c @@ -95,8 +95,7 @@ static ObjectClass *cris_cpu_class_by_name(const char *cp= u_model) typename =3D g_strdup_printf(CRIS_CPU_TYPE_NAME("%s"), cpu_model); oc =3D object_class_by_name(typename); g_free(typename); - if (oc !=3D NULL && (!object_class_dynamic_cast(oc, TYPE_CRIS_CPU) || - object_class_is_abstract(oc))) { + if (oc !=3D NULL && !object_class_dynamic_cast(oc, TYPE_CRIS_CPU)) { oc =3D NULL; } return oc; diff --git a/target/hexagon/cpu.c b/target/hexagon/cpu.c index 1adc11b713..9d1ffc3b4b 100644 --- a/target/hexagon/cpu.c +++ b/target/hexagon/cpu.c @@ -63,8 +63,7 @@ static ObjectClass *hexagon_cpu_class_by_name(const char = *cpu_model) oc =3D object_class_by_name(typename); g_strfreev(cpuname); g_free(typename); - if (!oc || !object_class_dynamic_cast(oc, TYPE_HEXAGON_CPU) || - object_class_is_abstract(oc)) { + if (!oc || !object_class_dynamic_cast(oc, TYPE_HEXAGON_CPU)) { return NULL; } return oc; diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index ef1bf89dac..06d1b9bb95 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -648,8 +648,7 @@ static ObjectClass *loongarch_cpu_class_by_name(const c= har *cpu_model) } } =20 - if (object_class_dynamic_cast(oc, TYPE_LOONGARCH_CPU) - && !object_class_is_abstract(oc)) { + if (object_class_dynamic_cast(oc, TYPE_LOONGARCH_CPU)) { return oc; } return NULL; diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index 538d9473c2..11c7e0a790 100644 --- a/target/m68k/cpu.c +++ b/target/m68k/cpu.c @@ -111,8 +111,7 @@ static ObjectClass *m68k_cpu_class_by_name(const char *= cpu_model) typename =3D g_strdup_printf(M68K_CPU_TYPE_NAME("%s"), cpu_model); oc =3D object_class_by_name(typename); g_free(typename); - if (oc !=3D NULL && (object_class_dynamic_cast(oc, TYPE_M68K_CPU) =3D= =3D NULL || - object_class_is_abstract(oc))) { + if (oc !=3D NULL && object_class_dynamic_cast(oc, TYPE_M68K_CPU) =3D= =3D NULL) { return NULL; } return oc; diff --git a/target/openrisc/cpu.c b/target/openrisc/cpu.c index f5a3d5273b..1173260017 100644 --- a/target/openrisc/cpu.c +++ b/target/openrisc/cpu.c @@ -164,8 +164,7 @@ static ObjectClass *openrisc_cpu_class_by_name(const ch= ar *cpu_model) typename =3D g_strdup_printf(OPENRISC_CPU_TYPE_NAME("%s"), cpu_model); oc =3D object_class_by_name(typename); g_free(typename); - if (oc !=3D NULL && (!object_class_dynamic_cast(oc, TYPE_OPENRISC_CPU)= || - object_class_is_abstract(oc))) { + if (oc !=3D NULL && !object_class_dynamic_cast(oc, TYPE_OPENRISC_CPU))= { return NULL; } return oc; diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index ac4a6c7eec..63624e8b76 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -636,8 +636,7 @@ static ObjectClass *riscv_cpu_class_by_name(const char = *cpu_model) oc =3D object_class_by_name(typename); g_strfreev(cpuname); g_free(typename); - if (!oc || !object_class_dynamic_cast(oc, TYPE_RISCV_CPU) || - object_class_is_abstract(oc)) { + if (!oc || !object_class_dynamic_cast(oc, TYPE_RISCV_CPU)) { return NULL; } return oc; diff --git a/target/rx/cpu.c b/target/rx/cpu.c index 4d0d3a0c8c..9cc9d9d15e 100644 --- a/target/rx/cpu.c +++ b/target/rx/cpu.c @@ -111,16 +111,12 @@ static ObjectClass *rx_cpu_class_by_name(const char *= cpu_model) char *typename; =20 oc =3D object_class_by_name(cpu_model); - if (oc !=3D NULL && object_class_dynamic_cast(oc, TYPE_RX_CPU) !=3D NU= LL && - !object_class_is_abstract(oc)) { + if (oc !=3D NULL && object_class_dynamic_cast(oc, TYPE_RX_CPU) !=3D NU= LL) { return oc; } typename =3D g_strdup_printf(RX_CPU_TYPE_NAME("%s"), cpu_model); oc =3D object_class_by_name(typename); g_free(typename); - if (oc !=3D NULL && object_class_is_abstract(oc)) { - oc =3D NULL; - } =20 return oc; } diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index 788e41fea6..a8ec98b134 100644 --- a/target/sh4/cpu.c +++ b/target/sh4/cpu.c @@ -152,9 +152,6 @@ static ObjectClass *superh_cpu_class_by_name(const char= *cpu_model) =20 typename =3D g_strdup_printf(SUPERH_CPU_TYPE_NAME("%s"), s); oc =3D object_class_by_name(typename); - if (oc !=3D NULL && object_class_is_abstract(oc)) { - oc =3D NULL; - } =20 out: g_free(s); diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c index 5ca666ee12..034e01c189 100644 --- a/target/tricore/cpu.c +++ b/target/tricore/cpu.c @@ -132,8 +132,7 @@ static ObjectClass *tricore_cpu_class_by_name(const cha= r *cpu_model) typename =3D g_strdup_printf(TRICORE_CPU_TYPE_NAME("%s"), cpu_model); oc =3D object_class_by_name(typename); g_free(typename); - if (!oc || !object_class_dynamic_cast(oc, TYPE_TRICORE_CPU) || - object_class_is_abstract(oc)) { + if (!oc || !object_class_dynamic_cast(oc, TYPE_TRICORE_CPU)) { return NULL; } return oc; diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index ea1dae7390..e20fe87bf2 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -141,8 +141,7 @@ static ObjectClass *xtensa_cpu_class_by_name(const char= *cpu_model) typename =3D g_strdup_printf(XTENSA_CPU_TYPE_NAME("%s"), cpu_model); oc =3D object_class_by_name(typename); g_free(typename); - if (oc =3D=3D NULL || !object_class_dynamic_cast(oc, TYPE_XTENSA_CPU) = || - object_class_is_abstract(oc)) { + if (oc =3D=3D NULL || !object_class_dynamic_cast(oc, TYPE_XTENSA_CPU))= { return NULL; } return oc; --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699270904; cv=none; d=zohomail.com; s=zohoarc; b=ejqXMFQeSq08K+gPlb89SnTesWoizl3C1KsIiyhKFft1fqfb7HrGWGN2c4cOmjwm4sBCG3A22yp4HZPFn5EE5aLJofB4OXFdz8J1moUkdQt4wA8cs9IPsQ54BSlIkl9XivO4GWwWDM1nyqw56Ms6BxEsly88VEfxQ70oy4CgW3I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699270904; 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=HIk2D2Zy+mW9KoNQEGhLCqqc6EXwTlAoiLD308KY354=; b=ejxgi2TYDLLogFxZgMJv52MtI9tT2E5UsX7hjukjgHxTxvpQLOejGTt0Mt7UuZET6zTiZ+SSWQC5BnMFQeAKmVOSZ0WBXMIt/ZHj6sStXLvzuoVFizlMr2Rkg288OQhNeiGxLNtsuhlXQHALTpJpm5Kg+IjqbA240owKAfpPwpQ= 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 1699270904472453.969999527699; Mon, 6 Nov 2023 03:41:44 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxSx-0005qZ-Fb; Mon, 06 Nov 2023 06:08:23 -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 1qzxSu-0005mN-JR for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:08:21 -0500 Received: from mail-lj1-x230.google.com ([2a00:1450:4864:20::230]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxSi-00053S-GN for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:08:20 -0500 Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2c6b30aca06so57602421fa.3 for ; Mon, 06 Nov 2023 03:08:07 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id a1-20020a05600c348100b003fe1fe56202sm12104665wmq.33.2023.11.06.03.08.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:08:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268886; x=1699873686; 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=HIk2D2Zy+mW9KoNQEGhLCqqc6EXwTlAoiLD308KY354=; b=RgyfapfMcytcQ+YEAkeayqktvYkCBkNiDgGvVvQv0k3a6qSsIhXak2imbPArQIxSTU iPYEPdFHcDKIopb8dTtranHH21Bt0OjFAycIYZC6vgTuSF13aahax4as7/n8Q8KWP54N jppwKu/wm+HlsBXpFM6UhLkZZ9p9Ppj42CVub/qh7jgAausQj5KeiHuShRyqXLtPMBiG lAcgjYTNdrYZChW5CN7QLNu5KDaGxX+jJ2v5yETEet4zYS7K3uQcEfXh2/WvuxSBZD5h /h1sslupvJTwXaTWGcXMu50RdTaSD8w7SruINj0ZXXDJJ43jIPFU30iVLQHeRC4OfMMh NKBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268886; x=1699873686; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HIk2D2Zy+mW9KoNQEGhLCqqc6EXwTlAoiLD308KY354=; b=KSsABmBWX2XVGzHBjHOn3E0PkkARQM0+OUVYGGhcmauMXz8E/A8FWft8Dk4Jh18cwk ysymHDCzifrnvSbuaW8uVQMf9d2OdLWk8fazPGvdF88C5Qqxq8mjY9/L3xhsWLsne5kh evMi87VUdDfkrFjWwB/tcw3zOtMg8o2CgGuiGKgTD1OdsZS3i6yvtt88GBXCeGvmNcpU EjQtIJllFv4g7g9XojtCuJhu6pbfip2VypcRf1gCpp1G9+8yltkZk7mqiW8IZfA8WIvt iL0XQRWhnE2naHWbNMmGcm794dXRZ8Sd4flq2iqihosOjPYcQ+31APlskzbKaF/BAeJT DBxQ== X-Gm-Message-State: AOJu0YyMmrHq1iEHNhigmdeml42gtW2Fc5R0b7OB+IOW9lKXwzxzBhVt G+Wvt2AtAu+K0vMl1c5/2usp7gKH6L51Qwz1IZ0= X-Google-Smtp-Source: AGHT+IHZzmpQpLISMOVN4u8fENAFmlJt/0w7I/6I45Xn+9+eLmWD1LIrIZlJ/g4SCbq5k1SLfQZs3Q== X-Received: by 2002:a2e:7c15:0:b0:2c5:5926:de52 with SMTP id x21-20020a2e7c15000000b002c55926de52mr22771440ljc.53.1699268886360; Mon, 06 Nov 2023 03:08:06 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Paolo Bonzini , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 39/60] exec/cpu: Have cpu_exec_realize() return a boolean Date: Mon, 6 Nov 2023 12:03:11 +0100 Message-ID: <20231106110336.358-40-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::230; envelope-from=philmd@linaro.org; helo=mail-lj1-x230.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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699270905269100001 Following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), have cpu_exec_realizefn() return a boolean indicating whether an error is set or not. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20230918160257.30127-22-philmd@linaro.org> --- include/hw/core/cpu.h | 2 +- cpu-target.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 5d6f8dca43..eb943efb8f 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -1152,7 +1152,7 @@ G_NORETURN void cpu_abort(CPUState *cpu, const char *= fmt, ...) /* $(top_srcdir)/cpu.c */ void cpu_class_init_props(DeviceClass *dc); void cpu_exec_initfn(CPUState *cpu); -void cpu_exec_realizefn(CPUState *cpu, Error **errp); +bool cpu_exec_realizefn(CPUState *cpu, Error **errp); void cpu_exec_unrealizefn(CPUState *cpu); void cpu_exec_reset_hold(CPUState *cpu); =20 diff --git a/cpu-target.c b/cpu-target.c index 79363ae370..f3e1ad8bcd 100644 --- a/cpu-target.c +++ b/cpu-target.c @@ -131,13 +131,13 @@ const VMStateDescription vmstate_cpu_common =3D { }; #endif =20 -void cpu_exec_realizefn(CPUState *cpu, Error **errp) +bool cpu_exec_realizefn(CPUState *cpu, Error **errp) { /* cache the cpu class for the hotpath */ cpu->cc =3D CPU_GET_CLASS(cpu); =20 if (!accel_cpu_common_realize(cpu, errp)) { - return; + return false; } =20 /* Wait until cpu initialization complete before exposing cpu. */ @@ -159,6 +159,8 @@ void cpu_exec_realizefn(CPUState *cpu, Error **errp) vmstate_register(NULL, cpu->cpu_index, cpu->cc->sysemu_ops->legacy= _vmsd, cpu); } #endif /* CONFIG_USER_ONLY */ + + return true; } =20 void cpu_exec_unrealizefn(CPUState *cpu) --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699270509; cv=none; d=zohomail.com; s=zohoarc; b=mnVESDYpi/++/zdgnPhETIODcmjus0K2vieWlPR1a7LfSU15wuYhftLCdwCLNby40NkIQIuED5JOU86DCsALUCj25uDUGsphpsE6dfud1e7/n9h8QhGd6/jFC/OlVhvGlyjkJUrQHKR1TrngurgudrlGKKBY8HJYyQ6b5DYbfvE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699270509; 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=1c+BV5Tpk9NJdk/9uGPTtpoehyOljryZgDubWA0xkSQ=; b=lyT94oiNq9dWX2ZyVeGaE0vnvPmeJq1QgzHEfKlp8DuB6ijd9kBvMgB3/3tdu4OlyLVSeJorTcVnc4qscxF3/xwdMcEcp1b9UquaIVC42WJ4inrcP8oP3P2m2tzUzsrVLYTH35N9JoMq10ykVTxm+GRDlOp719NsFt67pB1hfYs= 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 169927050959826.311899198979972; Mon, 6 Nov 2023 03:35:09 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxT1-00065c-Kh; Mon, 06 Nov 2023 06:08:27 -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 1qzxT0-0005za-3e for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:08:26 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxSp-000580-36 for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:08:25 -0500 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-32f7abbb8b4so2789448f8f.0 for ; Mon, 06 Nov 2023 03:08:14 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id h16-20020a05600004d000b0032dbf99bf4fsm9290025wri.89.2023.11.06.03.08.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:08:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268893; x=1699873693; 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=1c+BV5Tpk9NJdk/9uGPTtpoehyOljryZgDubWA0xkSQ=; b=zJKWiuj/d1M0jet+WlNAkaoMgWmRdfR3EdQNLZpz+ZCu7OyjePrS191xn3ELHYReJk x1M8XyTdLIWUJ1UIpKBXixFJTwi27Oslz9aVO4so7/T7MecSVzVnOG5cDx/H4LEBLN88 63bmMmXAojejQy7ENg6YiH5tf5RgDafCnzMB7sDI8y81IrgaZaSrX4CnXCQqjUjSgNo5 JwTbeMJkCB2DMY7lAlvIg8zwSXZlauANiMv+ZVZBMs/tQs83nshRKOpbcKaT/8cYMLM8 UDdN3ZgopgNOToTalUSCmGZd58j8YVnAoNuPvWXsUWwqaKjL3+uLolujTAixKdcrqfff W8BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268893; x=1699873693; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1c+BV5Tpk9NJdk/9uGPTtpoehyOljryZgDubWA0xkSQ=; b=I5G8e1BaethDspe5hAb7ELmDqB5r7n95xUFrGdAXWjZy/S5UmTL9O1+Ei9Byw92PIM 9JJpCk/SHaDvOveH6XTgSz6+V4TxD+Q1b5kAvDs9FkU9a7RMl2WEBhJCaKNkMSfW2Pyf vnLG3jXVDrqU4X3MmK2zqW++l0en6jF5eGMBlTYiAQbk0NrtBLaFZSphzQoy4LAGduPy o2DXdHsZ1VmU+P/lp9yQTUkL08sHSVN2bsZ60zj59ji2RUNDtrDfamxNH+GW5U/L8Co/ mpetCvj20bgG+M2qmK9ZIIsyMGuTDnYLwBUxql43DoMLaKarshHAgj3tVVbcr3bKNO5r de6Q== X-Gm-Message-State: AOJu0Yw8+lkFJiKRCGy6y2nflW2ZOB9vBI+P9xHurZBKc30+quHufNMN eiZa0FdSsygbR1V4ALoQzB4+IpSvO+sQMtJOstw= X-Google-Smtp-Source: AGHT+IFUfEPgJeqeBUUqYn0HxWEHowevUtNbHp5ZBZ2R9PkQdeXdrg9oHvMCfdnh5DWjqHW4fF0gbg== X-Received: by 2002:a05:6000:1864:b0:32f:7c4d:8746 with SMTP id d4-20020a056000186400b0032f7c4d8746mr24071431wri.12.1699268893422; Mon, 06 Nov 2023 03:08:13 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Ani Sinha , Richard Henderson , Paolo Bonzini , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang , Laurent Vivier , David Hildenbrand , Thomas Huth , Ilya Leoshkevich Subject: [PULL 40/60] hw/cpu: Clean up global variable shadowing Date: Mon, 6 Nov 2023 12:03:12 +0100 Message-ID: <20231106110336.358-41-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699270510324100003 Fix: hw/core/machine.c:1302:22: error: declaration shadows a variable in the g= lobal scope [-Werror,-Wshadow] const CPUArchId *cpus =3D possible_cpus->cpus; ^ hw/core/numa.c:69:17: error: declaration shadows a variable in the global= scope [-Werror,-Wshadow] uint16List *cpus =3D NULL; ^ hw/acpi/aml-build.c:2005:20: error: declaration shadows a variable in the= global scope [-Werror,-Wshadow] CPUArchIdList *cpus =3D ms->possible_cpus; ^ hw/core/machine-smp.c:77:14: error: declaration shadows a variable in the= global scope [-Werror,-Wshadow] unsigned cpus =3D config->has_cpus ? config->cpus : 0; ^ include/hw/core/cpu.h:589:17: note: previous declaration is here extern CPUTailQ cpus; ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Ani Sinha Message-Id: <20231010115048.11856-2-philmd@linaro.org> --- include/hw/core/cpu.h | 8 ++++---- cpu-common.c | 6 +++--- linux-user/main.c | 2 +- target/s390x/cpu_models.c | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index eb943efb8f..77893d7b81 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -586,13 +586,13 @@ static inline CPUArchState *cpu_env(CPUState *cpu) } =20 typedef QTAILQ_HEAD(CPUTailQ, CPUState) CPUTailQ; -extern CPUTailQ cpus; +extern CPUTailQ cpus_queue; =20 -#define first_cpu QTAILQ_FIRST_RCU(&cpus) +#define first_cpu QTAILQ_FIRST_RCU(&cpus_queue) #define CPU_NEXT(cpu) QTAILQ_NEXT_RCU(cpu, node) -#define CPU_FOREACH(cpu) QTAILQ_FOREACH_RCU(cpu, &cpus, node) +#define CPU_FOREACH(cpu) QTAILQ_FOREACH_RCU(cpu, &cpus_queue, node) #define CPU_FOREACH_SAFE(cpu, next_cpu) \ - QTAILQ_FOREACH_SAFE_RCU(cpu, &cpus, node, next_cpu) + QTAILQ_FOREACH_SAFE_RCU(cpu, &cpus_queue, node, next_cpu) =20 extern __thread CPUState *current_cpu; =20 diff --git a/cpu-common.c b/cpu-common.c index 45c745ecf6..c81fd72d16 100644 --- a/cpu-common.c +++ b/cpu-common.c @@ -73,7 +73,7 @@ static int cpu_get_free_index(void) return max_cpu_index; } =20 -CPUTailQ cpus =3D QTAILQ_HEAD_INITIALIZER(cpus); +CPUTailQ cpus_queue =3D QTAILQ_HEAD_INITIALIZER(cpus_queue); static unsigned int cpu_list_generation_id; =20 unsigned int cpu_list_generation_id_get(void) @@ -90,7 +90,7 @@ void cpu_list_add(CPUState *cpu) } else { assert(!cpu_index_auto_assigned); } - QTAILQ_INSERT_TAIL_RCU(&cpus, cpu, node); + QTAILQ_INSERT_TAIL_RCU(&cpus_queue, cpu, node); cpu_list_generation_id++; } =20 @@ -102,7 +102,7 @@ void cpu_list_remove(CPUState *cpu) return; } =20 - QTAILQ_REMOVE_RCU(&cpus, cpu, node); + QTAILQ_REMOVE_RCU(&cpus_queue, cpu, node); cpu->cpu_index =3D UNASSIGNED_CPU_INDEX; cpu_list_generation_id++; } diff --git a/linux-user/main.c b/linux-user/main.c index 0c23584a96..0cdaf30d34 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -156,7 +156,7 @@ void fork_end(int child) Discard information about the parent threads. */ CPU_FOREACH_SAFE(cpu, next_cpu) { if (cpu !=3D thread_cpu) { - QTAILQ_REMOVE_RCU(&cpus, cpu, node); + QTAILQ_REMOVE_RCU(&cpus_queue, cpu, node); } } qemu_init_cpu_list(); diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index 4dead48650..5c455d00c0 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -757,7 +757,7 @@ void s390_set_qemu_cpu_model(uint16_t type, uint8_t gen= , uint8_t ec_ga, const S390CPUDef *def =3D s390_find_cpu_def(type, gen, ec_ga, NULL); =20 g_assert(def); - g_assert(QTAILQ_EMPTY_RCU(&cpus)); + g_assert(QTAILQ_EMPTY_RCU(&cpus_queue)); =20 /* build the CPU model */ s390_qemu_cpu_model.def =3D def; --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699269260; cv=none; d=zohomail.com; s=zohoarc; b=lcxBlrwuRAyJ3TXeGkB+m9V+LYXezL5TXWkdf9SlJNcpMJtWTXxZAw1WQq7BbfGsj1M4HwqoU7x/oFNjUhtjdrFZFqWjUwZAQJJxowoKdrubtHLWuvLhDPJssDaNDptOK5a6DpsGcfNGR6CmQHjoIVIM7VnBkRlie9DIcGRKd94= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699269260; 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=P0lV2v0Wmf5sVpflPIAh1iXlsF2JSjaFEuoVMwFWbSs=; b=UrEUCzmxyxVKJBUhM/2BQaUvatRYHHmoayNT0aCBwBgnv/9HBplisOlD1t4Z0FlfAlLxqLUNO1v8UJfUvJ4mmrM2Y2DHEPX2vAZ5bYt2OIbAZnIOL5Z80tQJnVjU08Ansyyu2yjbNbwAuBG8xoF3j5IDYxTZ86Mdm2ykyaeEX48= 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 1699269260613415.61470659809834; Mon, 6 Nov 2023 03:14:20 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxT9-0006W9-R4; Mon, 06 Nov 2023 06:08:35 -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 1qzxT7-0006RH-2q for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:08:33 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxSw-00059A-Sp for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:08:32 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4081ccf69dcso31193415e9.0 for ; Mon, 06 Nov 2023 03:08:22 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id j19-20020a05600c1c1300b004060f0a0fd5sm11862251wms.13.2023.11.06.03.08.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:08:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268900; x=1699873700; 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=P0lV2v0Wmf5sVpflPIAh1iXlsF2JSjaFEuoVMwFWbSs=; b=TVa8c+Zf6EpP0EoqMSSudJcZMrtvmV/ODQNhymVioVnUYSCEbknFx8rgmq3AZ2Admz J60BbZs/EzUC9dlo0FGI6xnxpVpEtI+nUFca0+kM5nKkEUYjNchaRm82pMMgKP5g0xYq FkmxLG5f0mCUQU4h+D5Zeq2QeLE7Xp1+ebNaTcwVDj6+c19CKO+4Jq7gDdyTHZXxLWlu Jr1uZbwSdlB+pCgMBS5S3rYC51DWKbBuBYek26DKd1YIP7R7NuT8U5FVS8/ufF8FDZ1n ZDBPpQwx2viWMdPR6iDpMvj/2eHCdN7ucZk0WsBVZIr5lRsg1yqEVksoPOwt3YdPw6mq cDzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268900; x=1699873700; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=P0lV2v0Wmf5sVpflPIAh1iXlsF2JSjaFEuoVMwFWbSs=; b=Mt09HQ3CE3qe6MrcrzAA7JKkLlQ9tZUTfPF1WcOhVxDvEo1+OC0Tz3Zksv0BvD4w9H GMLYoz67UP6V3kMZsfS71Mg12NLUzT6tZrdyoSS4HkJwQah4U0nAm76Jatb48ttSWzHL XweNQRJa+9FTtXW/YMx4/bZGVp6+2drEgvt1A1wyPVcpxyOBU+YihxSiSBTRqmfGwwkB /RbFornSt7Xvgi6i8JSEYmp+ZUVUt/T9bAuFnUhoWGthFLIghgUU4csNsAJ1CcQq+2lo NtU+4rHhOKt4XWKdxWx5iihNhD72lvEfkgkFwmxPFZsg7SHqGNYZddWVY88hP6eV6rXO QLtw== X-Gm-Message-State: AOJu0YxCNzFw/FnobqSumEvrEvEALwwaZTg63u7fGXgMnNISd/CeQqj4 KdcxS3O7C7Xs61qbOT+xx6hvcf12DNnDUAyn/s4= X-Google-Smtp-Source: AGHT+IE5qy7fo5hvbTA76kNpTwyuY8BAliZrJmEatPyDDOojWhCYCUN5LQHLcBtUF5POiIT/JDO9Og== X-Received: by 2002:a05:600c:3205:b0:403:aced:f7f4 with SMTP id r5-20020a05600c320500b00403acedf7f4mr11411925wmp.12.1699268900310; Mon, 06 Nov 2023 03:08:20 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Ani Sinha Subject: [PULL 41/60] hw/loader: Clean up global variable shadowing in rom_add_file() Date: Mon, 6 Nov 2023 12:03:13 +0100 Message-ID: <20231106110336.358-42-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699269261562100006 Fix: hw/core/loader.c:1073:27: error: declaration shadows a variable in the gl= obal scope [-Werror,-Wshadow] bool option_rom, MemoryRegion *mr, ^ include/sysemu/sysemu.h:57:22: note: previous declaration is here extern QEMUOptionRom option_rom[MAX_OPTION_ROMS]; ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Ani Sinha Message-Id: <20231010115048.11856-3-philmd@linaro.org> --- include/hw/loader.h | 2 +- hw/core/loader.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/hw/loader.h b/include/hw/loader.h index c4c14170ea..8685e27334 100644 --- a/include/hw/loader.h +++ b/include/hw/loader.h @@ -272,7 +272,7 @@ void pstrcpy_targphys(const char *name, =20 ssize_t rom_add_file(const char *file, const char *fw_dir, hwaddr addr, int32_t bootindex, - bool option_rom, MemoryRegion *mr, AddressSpace *as); + bool has_option_rom, MemoryRegion *mr, AddressSpace *= as); MemoryRegion *rom_add_blob(const char *name, const void *blob, size_t len, size_t max_len, hwaddr addr, const char *fw_file_name, diff --git a/hw/core/loader.c b/hw/core/loader.c index 4dd5a71fb7..7f0cbfb214 100644 --- a/hw/core/loader.c +++ b/hw/core/loader.c @@ -1070,7 +1070,7 @@ static void *rom_set_mr(Rom *rom, Object *owner, cons= t char *name, bool ro) =20 ssize_t rom_add_file(const char *file, const char *fw_dir, hwaddr addr, int32_t bootindex, - bool option_rom, MemoryRegion *mr, + bool has_option_rom, MemoryRegion *mr, AddressSpace *as) { MachineClass *mc =3D MACHINE_GET_CLASS(qdev_get_machine()); @@ -1139,7 +1139,7 @@ ssize_t rom_add_file(const char *file, const char *fw= _dir, basename); snprintf(devpath, sizeof(devpath), "/rom@%s", fw_file_name); =20 - if ((!option_rom || mc->option_rom_has_mr) && mc->rom_file_has_mr)= { + if ((!has_option_rom || mc->option_rom_has_mr) && mc->rom_file_has= _mr) { data =3D rom_set_mr(rom, OBJECT(fw_cfg), devpath, true); } else { data =3D rom->data; --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699269696; cv=none; d=zohomail.com; s=zohoarc; b=aStyysvU6uTr0QJ3XRLOkcEjeG7HOhE/k22JZ6V6lC2sy5MhmLekYIqDuCqQ0E0jdo6zTU7LTodH6N7mPvGtRouOLXjyXAodFQ6KWi8tGpYywvyNbMoqPJlWs+ZR5ytUVaM3Dfr4iInV8uyX3/FeRLsn3i7f1+AnmCXAZl/XuQo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699269696; 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=bC2TdykjktUVtXbtq0twsr6zjowOcVE1/YbXmtopUl4=; b=KxIo69HMGAAnfiCHJWEOr0phnygIVYYY33bgPtoyNDdqr6fqCJ7T+4g//N+4l21gCAi7kMa+/dFMsCFbSpfUqSbcLJdd0phzZMRmFhLEz2n3zE9iqconIrp1RuliSySzI7qSQj/YR91maSgOWXNcTZyvjJ3+UpBLT4AMAIZo33U= 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 1699269696035811.803811321972; Mon, 6 Nov 2023 03:21:36 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxTB-0006Xg-48; Mon, 06 Nov 2023 06:08:38 -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 1qzxT9-0006W0-MQ for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:08:35 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxT2-0005Ab-S8 for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:08:34 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-32fbf271346so1513617f8f.1 for ; Mon, 06 Nov 2023 03:08:27 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id m1-20020a056000180100b0031980783d78sm9136370wrh.54.2023.11.06.03.08.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:08:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268906; x=1699873706; 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=bC2TdykjktUVtXbtq0twsr6zjowOcVE1/YbXmtopUl4=; b=mHPVzGz0la7J3gPwaYN9JcS8YoNnrPxizKfKyAiyR8FBBwPBFkAK0LqLpL9vxM3x26 skSRMcQv+VlS0LvrGI39tAE7O5SJtdp4myb9vGlTPR0AVpRt7FMUh5yrJFQb9qXccclB x4cfpaNZZuxegEseqrpLTMnHSyLdj3qhPWYVcbaLLNNsBYOE/KEm1VqC8qbTVg2CODwV 4Blut9SNADfSFuiggogXH51r3oJzbq8jUnvVictKW2SbpaymwU79Yt5z3V0bc5uSGqG9 l5HHDyi/ooSVGROYavcrVnHtpgI27YwG6TUcJiW+PIMpOedLp9/P6XVpiX5SWC489O5z xtXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268906; x=1699873706; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bC2TdykjktUVtXbtq0twsr6zjowOcVE1/YbXmtopUl4=; b=Y0F4lxbvF1SE1w8Z63TC/zyn5yQu9mPm98dWTVj6IVjvqUuZZi0DZJE2uqNh0fbXjw HaZQ6+jnaWHT2oxdOAxgNg7qccel6zTpqw5rj5Bx+vcIW0mOyon1oTWku4IgYtaW/69u mqXaCmrtfKWuBrcunP8DPgVDI6Xyb37P7hV4AbbqrJhIgw7q+KytdtcpRS2h5Si0iUIR 9bdMg/Jy3B2w1PcVF4vP3QvFglfgig2/2nUp8z7HK+Jc9iJ/il/lLFB2CLInhnDNewr7 TbIbyhQ/p53brYYbNsqbdF2ACV+6SznqI25cIdlLi6gKcNr4Cax2cGgrk9LrKbqCtf6o MHzQ== X-Gm-Message-State: AOJu0YyuIgbxb2bA4r1cmVdfxwj0IIrCxj13/o472+46lq3/FEfC66d3 KgRZd/o4W/RQw/2P0/q3p+axTMwzAs77segiATs= X-Google-Smtp-Source: AGHT+IHcL9WmfBoUy68GkAigOFElgUltPcHFMGDZ3RNZRT8AFGVHPWLoneY5rupalCL7WjqSCGEKUA== X-Received: by 2002:a5d:62cd:0:b0:32c:c35c:2eea with SMTP id o13-20020a5d62cd000000b0032cc35c2eeamr17839736wrv.6.1699268906698; Mon, 06 Nov 2023 03:08:26 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Bernhard Beschow , Markus Armbruster , Richard Henderson , =?UTF-8?q?Herv=C3=A9=20Poussineau?= Subject: [PULL 42/60] hw/isa/i82378: Propagate error if PC_SPEAKER device creation failed Date: Mon, 6 Nov 2023 12:03:14 +0100 Message-ID: <20231106110336.358-43-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699269698114100003 In commit 40f8214fcd ("hw/audio/pcspk: Inline pcspk_init()") we neglected to give a change to the caller to handle failed device creation cleanly. Respect the caller API contract and propagate the error if creating the PC_SPEAKER device ever failed. This avoid yet another bad API use to be taken as example and copy / pasted all over the code base. Reported-by: Bernhard Beschow Suggested-by: Markus Armbruster Reviewed-by: Richard Henderson Reviewed-by: Bernhard Beschow Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20231020171509.87839-5-philmd@linaro.org> --- hw/isa/i82378.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c index 79ffbb52a0..203b92c264 100644 --- a/hw/isa/i82378.c +++ b/hw/isa/i82378.c @@ -105,7 +105,9 @@ static void i82378_realize(PCIDevice *pci, Error **errp) /* speaker */ pcspk =3D isa_new(TYPE_PC_SPEAKER); object_property_set_link(OBJECT(pcspk), "pit", OBJECT(pit), &error_fat= al); - isa_realize_and_unref(pcspk, isabus, &error_fatal); + if (!isa_realize_and_unref(pcspk, isabus, errp)) { + return; + } =20 /* 2 82C37 (dma) */ isa_create_simple(isabus, "i82374"); --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699269541; cv=none; d=zohomail.com; s=zohoarc; b=jrJdXcWKy4wjrmAkczPjnRzt/yMknYBBJIFkdq69nG2Ye4jTWTOsJ54pKIYmXv2ceOk3JzxFJpU/MfNNTUOw89qN0uLs77ugZqhkX3xkKpuQA6T01a3O1mIMdMBXib8ya5URQleDa5R6WjOSWPjZDA/P6gBEMgHtILI0UZltvHY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699269541; 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=pKMRzxqRYnKl/hVlIV0E2OCjWVD0Ib40S0FzpaLqDMw=; b=D7Iel0FDxDhboirYFkq4gEMTQ/WSnDUK7138XE7Bln0984jxRZjvx615oDECRRqqUPyfZ0dnTeHdKPGx5WHmsDq+irzIvgoqBr2fFWT7i1ke5S9dQ8Blp6M1HMdmnzNlt5DR9wuaVaO3jxkXV08WOa+u/CF+AIIzLvakgBxesk8= 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 1699269541148789.4190780031537; Mon, 6 Nov 2023 03:19:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxTK-0006lW-Nl; Mon, 06 Nov 2023 06:08:46 -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 1qzxTB-0006Y8-GC for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:08:37 -0500 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxT9-0005CT-Dc for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:08:37 -0500 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-507962561adso5645149e87.0 for ; Mon, 06 Nov 2023 03:08:34 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id k8-20020a05600c1c8800b004081a011c0esm11883242wms.12.2023.11.06.03.08.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:08:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268913; x=1699873713; 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=pKMRzxqRYnKl/hVlIV0E2OCjWVD0Ib40S0FzpaLqDMw=; b=NKSYDOvuhkJsddQPlbYAg46fie7ZY7IY5Ht9U/fAf10ILiDj/rBGdwnxqJ+xTGdY3L oA5YZUrKsTEfFCzewum3zugwX7+BujAHKPuZHNDvpSbR1eYrQpxMv3/L8MzY3Jiej9MW tzlsN+BmMUYWjnPeJXDqklmLQq3XgCH4dtqzku8tYhAcucRYv8KhbISavJwuOgID4kyz 1kCWBo3kT4NRdP0uxFxnhyEQtiVpxee/vGYAJwFwVqBTjx/RxQSFVexM1qiLGAH6aiKd apP2Da7X0FQleXSp88WP7pSIn7Fb9zu/VlnqL3EPKiboBVXR6DrfYNUlHN7Ny8i6PnnG v1EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268913; x=1699873713; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pKMRzxqRYnKl/hVlIV0E2OCjWVD0Ib40S0FzpaLqDMw=; b=TX38Wh4AnD1Fjkh97+cSO3PHxhYiSdTh1Zw+1jqA7KXfc42xTKbSy2H0LbWQjApX7D s9ZYJsCu/JsfB5yXkmelaa3ybmW3frZcOQu2oVE96nZGnWulImueIhhzrjGU3XXRU1od BSgRGhuUp+kM58oQjXz2HZDciKR0Vf6OPLU2Qdg2AndMeOeOMMNJCI315vgp0OtOW9V7 cPYh56bHZdFYyzHbBM7yVG6VwRPTr1QwJzje92c0AUnFq67UE2adi6REizOqgrhAa/C+ HfsD6kRTYYQhn0YQvlkV7ywMBWZaA5C/JxCCIdXqghSdXdcSD8sgRaYNE2nF0TUn/6r1 1NWw== X-Gm-Message-State: AOJu0YwqZFMBJsxPn1XULcPyiL+eMMZs1tCcL48sNrZfQs5UVs+bu1VM g2k9C6fXw+0eplWNGLPR92Iteg88hNtY2Vi3R1Q= X-Google-Smtp-Source: AGHT+IGMI9IHWBGUOo6/TSzJ7f5lWu5csZyUwrcaXQuq2CyxKG8+98G9h0M8RSeKlrf4DHh1XI1+uQ== X-Received: by 2002:ac2:5e6d:0:b0:504:4165:54ab with SMTP id a13-20020ac25e6d000000b00504416554abmr19292506lfr.56.1699268913486; Mon, 06 Nov 2023 03:08:33 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yanan Wang , Xiaoyao Li , Babu Moger , Yongwei Ma , "Michael S . Tsirkin" , Marcel Apfelbaum Subject: [PULL 43/60] hw/i386: Fix comment style in topology.h Date: Mon, 6 Nov 2023 12:03:15 +0100 Message-ID: <20231106110336.358-44-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::133; envelope-from=philmd@linaro.org; helo=mail-lf1-x133.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699269542913100007 From: Zhao Liu For function comments in this file, keep the comment style consistent with other files in the directory. Signed-off-by: Zhao Liu Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Yanan Wang Reviewed-by: Xiaoyao Li Reviewed-by: Babu Moger Tested-by: Babu Moger Tested-by: Yongwei Ma Acked-by: Michael S. Tsirkin Message-ID: <20231024090323.1859210-2-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/i386/topology.h | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/include/hw/i386/topology.h b/include/hw/i386/topology.h index 380cb27ded..d4eeb7ab82 100644 --- a/include/hw/i386/topology.h +++ b/include/hw/i386/topology.h @@ -24,7 +24,8 @@ #ifndef HW_I386_TOPOLOGY_H #define HW_I386_TOPOLOGY_H =20 -/* This file implements the APIC-ID-based CPU topology enumeration logic, +/* + * This file implements the APIC-ID-based CPU topology enumeration logic, * documented at the following document: * Intel=C2=AE 64 Architecture Processor Topology Enumeration * http://software.intel.com/en-us/articles/intel-64-architecture-proces= sor-topology-enumeration/ @@ -41,7 +42,8 @@ =20 #include "qemu/bitops.h" =20 -/* APIC IDs can be 32-bit, but beware: APIC IDs > 255 require x2APIC suppo= rt +/* + * APIC IDs can be 32-bit, but beware: APIC IDs > 255 require x2APIC suppo= rt */ typedef uint32_t apic_id_t; =20 @@ -58,8 +60,7 @@ typedef struct X86CPUTopoInfo { unsigned threads_per_core; } X86CPUTopoInfo; =20 -/* Return the bit width needed for 'count' IDs - */ +/* Return the bit width needed for 'count' IDs */ static unsigned apicid_bitwidth_for_count(unsigned count) { g_assert(count >=3D 1); @@ -67,15 +68,13 @@ static unsigned apicid_bitwidth_for_count(unsigned coun= t) return count ? 32 - clz32(count) : 0; } =20 -/* Bit width of the SMT_ID (thread ID) field on the APIC ID - */ +/* Bit width of the SMT_ID (thread ID) field on the APIC ID */ static inline unsigned apicid_smt_width(X86CPUTopoInfo *topo_info) { return apicid_bitwidth_for_count(topo_info->threads_per_core); } =20 -/* Bit width of the Core_ID field - */ +/* Bit width of the Core_ID field */ static inline unsigned apicid_core_width(X86CPUTopoInfo *topo_info) { return apicid_bitwidth_for_count(topo_info->cores_per_die); @@ -87,8 +86,7 @@ static inline unsigned apicid_die_width(X86CPUTopoInfo *t= opo_info) return apicid_bitwidth_for_count(topo_info->dies_per_pkg); } =20 -/* Bit offset of the Core_ID field - */ +/* Bit offset of the Core_ID field */ static inline unsigned apicid_core_offset(X86CPUTopoInfo *topo_info) { return apicid_smt_width(topo_info); @@ -100,14 +98,14 @@ static inline unsigned apicid_die_offset(X86CPUTopoInf= o *topo_info) return apicid_core_offset(topo_info) + apicid_core_width(topo_info); } =20 -/* Bit offset of the Pkg_ID (socket ID) field - */ +/* Bit offset of the Pkg_ID (socket ID) field */ static inline unsigned apicid_pkg_offset(X86CPUTopoInfo *topo_info) { return apicid_die_offset(topo_info) + apicid_die_width(topo_info); } =20 -/* Make APIC ID for the CPU based on Pkg_ID, Core_ID, SMT_ID +/* + * Make APIC ID for the CPU based on Pkg_ID, Core_ID, SMT_ID * * The caller must make sure core_id < nr_cores and smt_id < nr_threads. */ @@ -120,7 +118,8 @@ static inline apic_id_t x86_apicid_from_topo_ids(X86CPU= TopoInfo *topo_info, topo_ids->smt_id; } =20 -/* Calculate thread/core/package IDs for a specific topology, +/* + * Calculate thread/core/package IDs for a specific topology, * based on (contiguous) CPU index */ static inline void x86_topo_ids_from_idx(X86CPUTopoInfo *topo_info, @@ -137,7 +136,8 @@ static inline void x86_topo_ids_from_idx(X86CPUTopoInfo= *topo_info, topo_ids->smt_id =3D cpu_index % nr_threads; } =20 -/* Calculate thread/core/package IDs for a specific topology, +/* + * Calculate thread/core/package IDs for a specific topology, * based on APIC ID */ static inline void x86_topo_ids_from_apicid(apic_id_t apicid, @@ -155,7 +155,8 @@ static inline void x86_topo_ids_from_apicid(apic_id_t a= picid, topo_ids->pkg_id =3D apicid >> apicid_pkg_offset(topo_info); } =20 -/* Make APIC ID for the CPU 'cpu_index' +/* + * Make APIC ID for the CPU 'cpu_index' * * 'cpu_index' is a sequential, contiguous ID for the CPU. */ --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699269028; cv=none; d=zohomail.com; s=zohoarc; b=RwRtoSfKw5aSaukem4QljCY8CaX865AZwQINxs0oZAPe8UfaP5UrWoAOWIZ4HWbeSrXbiOEWjrV1PnvIs3SKXm+QBSMDzaJ+I1aKVZ+4ehfbmt/j52G+tQf55pwypXAe4IipVJ3ps6JpYrFzANt9b6CO8qdjnLfCp6KNOJz1vEo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699269028; 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=Osm9Rqk6Yz1bOcmZt0pCvMMd/TH5Mg1H8su36lKkY04=; b=T8c4hzmTYsnhKXbA52HmHyfZOwcovx8UIpuEJRRSLOJPjniAiTwaACz3TddX748VaQE1m/qKifkWoLjJbhw6icuiyoQJuLE4Jm64GEPDUObJMFCnMmb7oEf8bzDQj6k1bSRFQF4St0QZ8uIvSm9z5MKPZQiTKOZK5wUOlBqwc0w= 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 1699269028248834.2477025376605; Mon, 6 Nov 2023 03:10:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxTS-00079P-V6; Mon, 06 Nov 2023 06:08:55 -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 1qzxTL-0006qm-4S for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:08:48 -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 1qzxTG-0005EC-Np for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:08:46 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-40850b244beso33467785e9.2 for ; Mon, 06 Nov 2023 03:08:41 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id u7-20020a05600c138700b0040836519dd9sm11912962wmf.25.2023.11.06.03.08.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:08:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268920; x=1699873720; 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=Osm9Rqk6Yz1bOcmZt0pCvMMd/TH5Mg1H8su36lKkY04=; b=iGOp2Xdk1tthX06puboF0TV6fXxR9rnvi8beeiJLPhtr7rOhs5S1rlQgj5fk5LWrvu evULh7nUr5c9XrdQTYOl1VO4LDoAXfSXDPvZEKt9pZSL16f3hrNKHE4zmtjyPcNgJXGF bT3TZuTImvCfRrL0vyQUjS93vzZWmzvsphxNky3eY73le2M0k93eFKSvDX60wEbLikQ3 XM/etALwfjwp3i/Vocg7Xa2Tgp3KPWM7IlhRsvUI/f0NtKXD6IPx6+YzJz5JFVYV6TdX qa4bZyuq1nZJKjmZUf5wst00vL6lSDIBTlJE1GXHAGuRF9BC0eBDqSoVLswDP2Id0mtU tMMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268920; x=1699873720; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Osm9Rqk6Yz1bOcmZt0pCvMMd/TH5Mg1H8su36lKkY04=; b=piyEvR+SsEwKuQZShioPSRno7JOrgN/QyjprUivoh0A4wySY7qwaG9CcKIvqsZvxcD HRuCc578NMJ9kY3fkq2FtjpEpnmB6M8t3t3Xt+8skmxYoUKUe/myeJaPiFt1o863g89C Y1q+vWKBL9aEtWcKmNH8oAQhbGrQSELsq87lSC5DlAC4u2V/zlfUyINFm053i6cBF9lB 9czBAG32+KTu+x2nRhu4I7MnGi2RYt9JCuGB7Tqt7M4umhPELm/MnFVZo748lAEy/1NI R7hl/u9csY17UTV83W6bTuN9DihqD8uumzcJPxXwcVuJklExgQI3I3diLriieSLYnnTV FHHg== X-Gm-Message-State: AOJu0YxWyWVxafDU/cFZKTPrMa3NQHY5Q8Z0YPH4eKqvmphKjvYGwtj3 J7oT/2FSmpAYGVDCbftD1cnkDhbiNzsKdBF2Z/A= X-Google-Smtp-Source: AGHT+IHIITTvF4Y+jrJz9D5TuAQ3Knz2Wjt7KmB7cmFWsBNyX7xRA/cGFJD9S7rrHgbBoEXWQAJLpw== X-Received: by 2002:a05:600c:4693:b0:409:5a92:471d with SMTP id p19-20020a05600c469300b004095a92471dmr12443033wmo.22.1699268920324; Mon, 06 Nov 2023 03:08:40 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Babu Moger , Yongwei Ma , "Michael S . Tsirkin" , Thomas Huth , Marcel Apfelbaum Subject: [PULL 44/60] tests/unit: Rename test-x86-cpuid.c to test-x86-topo.c Date: Mon, 6 Nov 2023 12:03:16 +0100 Message-ID: <20231106110336.358-45-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699269030310100001 From: Zhao Liu The tests in this file actually test the APIC ID combinations. Rename to test-x86-topo.c to make its name more in line with its actual content. Signed-off-by: Zhao Liu Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Babu Moger Tested-by: Yongwei Ma Acked-by: Michael S. Tsirkin Reviewed-by: Thomas Huth Message-ID: <20231024090323.1859210-3-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- MAINTAINERS | 2 +- tests/unit/{test-x86-cpuid.c =3D> test-x86-topo.c} | 2 +- tests/unit/meson.build | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) rename tests/unit/{test-x86-cpuid.c =3D> test-x86-topo.c} (99%) diff --git a/MAINTAINERS b/MAINTAINERS index 8e8a7d5be5..126cddd285 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1772,7 +1772,7 @@ F: include/hw/southbridge/ich9.h F: include/hw/southbridge/piix.h F: hw/isa/apm.c F: include/hw/isa/apm.h -F: tests/unit/test-x86-cpuid.c +F: tests/unit/test-x86-topo.c F: tests/qtest/test-x86-cpuid-compat.c =20 PC Chipset diff --git a/tests/unit/test-x86-cpuid.c b/tests/unit/test-x86-topo.c similarity index 99% rename from tests/unit/test-x86-cpuid.c rename to tests/unit/test-x86-topo.c index bfabc0403a..2b104f86d7 100644 --- a/tests/unit/test-x86-cpuid.c +++ b/tests/unit/test-x86-topo.c @@ -1,5 +1,5 @@ /* - * Test code for x86 CPUID and Topology functions + * Test code for x86 APIC ID and Topology functions * * Copyright (c) 2012 Red Hat Inc. * diff --git a/tests/unit/meson.build b/tests/unit/meson.build index f33ae64b8d..0dbe32ba9b 100644 --- a/tests/unit/meson.build +++ b/tests/unit/meson.build @@ -21,8 +21,8 @@ tests =3D { 'test-opts-visitor': [testqapi], 'test-visitor-serialization': [testqapi], 'test-bitmap': [], - # all code tested by test-x86-cpuid is inside topology.h - 'test-x86-cpuid': [], + # all code tested by test-x86-topo is inside topology.h + 'test-x86-topo': [], 'test-cutils': [], 'test-div128': [], 'test-shift128': [], --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699269785; cv=none; d=zohomail.com; s=zohoarc; b=d/SXLX55rbIxVwYF/7B/3V8fWo9KQ4InkJOENWxC9z5XlGTXkRqbpuN8kKVMjFK5UupheD2AO310ZUFhx8jsZhbtz+7Mr1IAtEG3QL8OKu8BMyg4e4OKn6mSClle7h7MLvVRoecL7QdPX7w+xwS2ykYmvqBxwvgskPYMxHkr6lo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699269785; 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=0yFelocR66jYXowauowrhR0mUeB3U99cidSOqtYw+Cg=; b=dYR0y8j3a/iERs/cAYZkijj3pooDmFccjKjFQHG8Uz4BQcnxgeCOhiEnMUwOHfcjZjPlYeh5ZNe3m/2TsEEQf8JKpd4cAqO0BqjBMcunWxfTnqlnN2mCHtaFNT7qSe+vy6RJ7fE3WlJ+DfPrwdEiMQKwqWEgNRdM/LCVxswzzgo= 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 1699269785096729.4943094637584; Mon, 6 Nov 2023 03:23:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxTX-0007Oq-2y; Mon, 06 Nov 2023 06:08: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 1qzxTR-00072m-OK for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:08:53 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxTM-0005FO-M0 for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:08:53 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-32f7abbb8b4so2789749f8f.0 for ; Mon, 06 Nov 2023 03:08:48 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id g8-20020a5d4888000000b0032f7cc56509sm1544640wrq.98.2023.11.06.03.08.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:08:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268927; x=1699873727; 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=0yFelocR66jYXowauowrhR0mUeB3U99cidSOqtYw+Cg=; b=VMAjPMAS6edt0sctsVploARAsqA0Ru+q2aYkZUJg8afRfE8EWtEuWrDGq26/dzGwFz VDUiJtUOoXnBUWlSvPQ87n7RBWM6JiyvZYicIeFVDzkxeC02d+KM6nbmAImbDcPtxW15 C915m5/KkYkYOyKMnM9k0wrwz9e21qKQ2lUZdIXf56+hS4SUXb8dxatM6ba6ts3HIWbt s6Hul5Eg6veHwB0X1UqX3e99NPRxh8W45tTMJS33yp+3NhqUmpe/oY/95Dywhk/FLUct Ci/HqLNYfghAa2H3IE8JlfqTGBfesvG++hT/bmF4YyieHKfi0/Jyq5r6/666FbHjxucx lAsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268927; x=1699873727; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0yFelocR66jYXowauowrhR0mUeB3U99cidSOqtYw+Cg=; b=ri20xWejzXsPNqkK2QgV6jGmGB+I0J8Gl79z1wOwGXuMkflLixzQqvEMAzl64rmofG H9alNNedBuupSA6zdFqMl/mMTkf8jOjBrvKF/KKwfiuJKfZxFHgvs+0CYmO48XwJ2jY+ iQHsDPc+PsatV71oFO8miT4f2lnM2vRSodS0ir5xAIb6R0Lpbxpu23PDl9FurnAPOabk J504SzBnkHDP3fFCPJbEoSoh+ArqXoWkuDjN4LpTu3N7pC24W60YF0wqxFi1/GR9TL3K EJ2Sl4EKlo9eXoSn1a3xpzKxw0T8mWTTk8D45dUgx2bDzWp5FsiW3XFxu1cOmFsVCuJz JCwA== X-Gm-Message-State: AOJu0YzfYa0h4Cm5qrF+H1Rtnj4LVXf0fza004o8Uv+oUOnYlu/QxZXB udSxQR/7acAsPOZiwoQLHGtlzfXW3FESNKN59kk= X-Google-Smtp-Source: AGHT+IGgL0F1g9v6gQaqWqalE046qIpD1vXiY6eu81D5A7cfp1tnEC2cOxrnm8DtADlNcX3GEcp3bw== X-Received: by 2002:a5d:6c6f:0:b0:32f:8085:7411 with SMTP id r15-20020a5d6c6f000000b0032f80857411mr21345810wrz.24.1699268927044; Mon, 06 Nov 2023 03:08:47 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhuocheng Ding , Zhao Liu , Babu Moger , Yongwei Ma , "Michael S . Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Richard Henderson Subject: [PULL 45/60] system/cpus: Fix CPUState.nr_cores' calculation Date: Mon, 6 Nov 2023 12:03:17 +0100 Message-ID: <20231106110336.358-46-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699269786684100001 From: Zhuocheng Ding From CPUState.nr_cores' comment, it represents "number of cores within this CPU package". After 003f230e37d7 ("machine: Tweak the order of topology members in struct CpuTopology"), the meaning of smp.cores changed to "the number of cores in one die", but this commit missed to change CPUState.nr_cores' calculation, so that CPUState.nr_cores became wrong and now it misses to consider numbers of clusters and dies. At present, only i386 is using CPUState.nr_cores. But as for i386, which supports die level, the uses of CPUState.nr_cores are very confusing: Early uses are based on the meaning of "cores per package" (before die is introduced into i386), and later uses are based on "cores per die" (after die's introduction). This difference is due to that commit a94e1428991f ("target/i386: Add CPUID.1F generation support for multi-dies PCMachine") misunderstood that CPUState.nr_cores means "cores per die" when calculated CPUID.1FH.01H:EBX. After that, the changes in i386 all followed this wrong understanding. With the influence of 003f230e37d7 and a94e1428991f, for i386 currently the result of CPUState.nr_cores is "cores per die", thus the original uses of CPUState.cores based on the meaning of "cores per package" are wrong when multiple dies exist: 1. In cpu_x86_cpuid() of target/i386/cpu.c, CPUID.01H:EBX[bits 23:16] is incorrect because it expects "cpus per package" but now the result is "cpus per die". 2. In cpu_x86_cpuid() of target/i386/cpu.c, for all leaves of CPUID.04H: EAX[bits 31:26] is incorrect because they expect "cpus per package" but now the result is "cpus per die". The error not only impacts the EAX calculation in cache_info_passthrough case, but also impacts other cases of setting cache topology for Intel CPU according to cpu topology (specifically, the incoming parameter "num_cores" expects "cores per package" in encode_cache_cpuid4()). 3. In cpu_x86_cpuid() of target/i386/cpu.c, CPUID.0BH.01H:EBX[bits 15:00] is incorrect because the EBX of 0BH.01H (core level) expects "cpus per package", which may be different with 1FH.01H (The reason is 1FH can support more levels. For QEMU, 1FH also supports die, 1FH.01H:EBX[bits 15:00] expects "cpus per die"). 4. In cpu_x86_cpuid() of target/i386/cpu.c, when CPUID.80000001H is calculated, here "cpus per package" is expected to be checked, but in fact, now it checks "cpus per die". Though "cpus per die" also works for this code logic, this isn't consistent with AMD's APM. 5. In cpu_x86_cpuid() of target/i386/cpu.c, CPUID.80000008H:ECX expects "cpus per package" but it obtains "cpus per die". 6. In simulate_rdmsr() of target/i386/hvf/x86_emu.c, in kvm_rdmsr_core_thread_count() of target/i386/kvm/kvm.c, and in helper_rdmsr() of target/i386/tcg/sysemu/misc_helper.c, MSR_CORE_THREAD_COUNT expects "cpus per package" and "cores per package", but in these functions, it obtains "cpus per die" and "cores per die". On the other hand, these uses are correct now (they are added in/after a94e1428991f): 1. In cpu_x86_cpuid() of target/i386/cpu.c, topo_info.cores_per_die meets the actual meaning of CPUState.nr_cores ("cores per die"). 2. In cpu_x86_cpuid() of target/i386/cpu.c, vcpus_per_socket (in CPUID. 04H's calculation) considers number of dies, so it's correct. 3. In cpu_x86_cpuid() of target/i386/cpu.c, CPUID.1FH.01H:EBX[bits 15:00] needs "cpus per die" and it gets the correct result, and CPUID.1FH.02H:EBX[bits 15:00] gets correct "cpus per package". When CPUState.nr_cores is correctly changed to "cores per package" again , the above errors will be fixed without extra work, but the "currently" correct cases will go wrong and need special handling to pass correct "cpus/cores per die" they want. Fix CPUState.nr_cores' calculation to fit the original meaning "cores per package", as well as changing calculation of topo_info.cores_per_die, vcpus_per_socket and CPUID.1FH. Fixes: a94e1428991f ("target/i386: Add CPUID.1F generation support for mult= i-dies PCMachine") Fixes: 003f230e37d7 ("machine: Tweak the order of topology members in struc= t CpuTopology") Signed-off-by: Zhuocheng Ding Co-developed-by: Zhao Liu Signed-off-by: Zhao Liu Tested-by: Babu Moger Tested-by: Yongwei Ma Acked-by: Michael S. Tsirkin Message-ID: <20231024090323.1859210-4-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- system/cpus.c | 2 +- target/i386/cpu.c | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/system/cpus.c b/system/cpus.c index 952f15868c..a444a747f0 100644 --- a/system/cpus.c +++ b/system/cpus.c @@ -631,7 +631,7 @@ void qemu_init_vcpu(CPUState *cpu) { MachineState *ms =3D MACHINE(qdev_get_machine()); =20 - cpu->nr_cores =3D ms->smp.cores; + cpu->nr_cores =3D machine_topo_get_cores_per_socket(ms); cpu->nr_threads =3D ms->smp.threads; cpu->stopped =3D true; cpu->random_seed =3D qemu_guest_random_seed_thread_part1(); diff --git a/target/i386/cpu.c b/target/i386/cpu.c index fc8484cb5e..358d9c0a65 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6019,7 +6019,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, = uint32_t count, X86CPUTopoInfo topo_info; =20 topo_info.dies_per_pkg =3D env->nr_dies; - topo_info.cores_per_die =3D cs->nr_cores; + topo_info.cores_per_die =3D cs->nr_cores / env->nr_dies; topo_info.threads_per_core =3D cs->nr_threads; =20 /* Calculate & apply limits for different index ranges */ @@ -6095,8 +6095,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, = uint32_t count, */ if (*eax & 31) { int host_vcpus_per_cache =3D 1 + ((*eax & 0x3FFC000) >> 14= ); - int vcpus_per_socket =3D env->nr_dies * cs->nr_cores * - cs->nr_threads; + int vcpus_per_socket =3D cs->nr_cores * cs->nr_threads; if (cs->nr_cores > 1) { *eax &=3D ~0xFC000000; *eax |=3D (pow2ceil(cs->nr_cores) - 1) << 26; @@ -6273,12 +6272,12 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index= , uint32_t count, break; case 1: *eax =3D apicid_die_offset(&topo_info); - *ebx =3D cs->nr_cores * cs->nr_threads; + *ebx =3D topo_info.cores_per_die * topo_info.threads_per_core; *ecx |=3D CPUID_TOPOLOGY_LEVEL_CORE; break; case 2: *eax =3D apicid_pkg_offset(&topo_info); - *ebx =3D env->nr_dies * cs->nr_cores * cs->nr_threads; + *ebx =3D cs->nr_cores * cs->nr_threads; *ecx |=3D CPUID_TOPOLOGY_LEVEL_DIE; break; default: --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699269540; cv=none; d=zohomail.com; s=zohoarc; b=VK6CXcNVkIUfhiNqOlE/5Cgi0FbTQ6MHuWAA4WvX0kV3oHmCoHATHHvFi5FtgOXFfW9JRsq0zJ9tvGTWUqeq2hqoRb/vpVFTauCCUrQd5H0eTTEmzAkre0sxJTY8btITt8QnhdQqtxOfsjPbpJhTYBMrhfU9ZzmPHdiqBPTeOJg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699269540; 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=GYvSXfF+xbSSjVZB+VdYev9ZdU+Lgrd51drrmwgB968=; b=Ao26kto7Mv3M3rMugVMHPJRVdYMt5IZuTpTmMgPQ5wJgefO2GPNSIfFYBc0ZbjXokcOiZFP4LD7XN2oEZCBbFycP6VCq1gh5aL4QYpd/viHfnml5hDfDiklz5gXeZ6VmE0ZyYU50sLr0Iv4dj/W9gsZ+G+pD19PLnzavDacVlWk= 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 1699269540263409.78701109385634; Mon, 6 Nov 2023 03:19:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxTh-0007c6-Oc; Mon, 06 Nov 2023 06:09:09 -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 1qzxTf-0007aI-UM for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:09:07 -0500 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxTT-0005HP-KH for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:09:07 -0500 Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2c5b7764016so58453861fa.1 for ; Mon, 06 Nov 2023 03:08:55 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id h15-20020a5d688f000000b0032f9688ea48sm9121553wru.10.2023.11.06.03.08.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:08:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268933; x=1699873733; 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=GYvSXfF+xbSSjVZB+VdYev9ZdU+Lgrd51drrmwgB968=; b=kEqzA5vUbqqNnqb4gtNslxYTXtRtOC+YU6KblT1ik0ESGiq+77dwnmxd193+cZhs6K kQMLqskfhRR9O2elgVWqQj7NYxujnMjjGAV8LtVxUXrDQSJoTEowyx2bsVQ0N6+uxHpa mj6OE6LumGqFDlk3fkL4keuvPfw5YJ2vaRznEpU3Ps6/pXRttzfR1D618CiNGXeaQ/uh mxSTiLaBYAfMyqOL2oj9Jn7VvtKowruwyOuqerbu9GCctULXbK2hEy9imW508+d6Avgm seXvAFh8R5OQu8hmU1FptQVnPcceIs9g6l1LPFehNpT+6lCcRw4ecxgZId9P/t7bnIbR XHig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268933; x=1699873733; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GYvSXfF+xbSSjVZB+VdYev9ZdU+Lgrd51drrmwgB968=; b=rnX5q1pjbYqxUcSvW8Wo4hXLaKUo+XIn2+8H2PygNY5QDuIDFMB6qesOC3rwkXQs2T xKpeEelMNhCIxd0LLyZQn56w2YuPAPBNPgUrpOaVvpABbJnlie9t1cmnH6nrKt8aCPsj FVjXxL56OhbcwLD05VPu3rFbgKREOGlMyhgrnqfDO12tQBBuV7oneXSiIzLeWripfTg0 gc9FNNH553cJkBLNKqBVx5xKP9A2KbZhZfbAO+iOEQD/G6zd7qPBjjXUTCE+L/kn92Bo wMGSRzEoOW9/ZsQ4GT4NMWtTDhVGbeF/G85PVwSgEZwoHrBVX3z9CbdjAKF7KSSUyyFJ v6qg== X-Gm-Message-State: AOJu0Yy4ki70bi/0aEsJf8GbzWr2Dg0MIvtQgf/J24rFGpFkGNJZ6yQR rimK2Q/A9TstAeIvpWH06ajkDJF886/DpOqKHwc= X-Google-Smtp-Source: AGHT+IF/xZcrKq/LJLj9ohahw7rIxBUK2ed8EiXaUmWnZkVh+fy3szTtE+BCuI465Mb1P6JS3uEWwQ== X-Received: by 2002:a2e:7a17:0:b0:2c2:a337:5ea with SMTP id v23-20020a2e7a17000000b002c2a33705eamr22917103ljc.27.1699268933639; Mon, 06 Nov 2023 03:08:53 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Babu Moger , Yongwei Ma , "Michael S . Tsirkin" , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 46/60] hw/cpu: Update the comments of nr_cores and nr_dies Date: Mon, 6 Nov 2023 12:03:18 +0100 Message-ID: <20231106110336.358-47-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::229; envelope-from=philmd@linaro.org; helo=mail-lj1-x229.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699269540853100001 From: Zhao Liu In the nr_threads' comment, specify it represents the number of threads in the "core" to avoid confusion. Also add comment for nr_dies in CPUX86State. Signed-off-by: Zhao Liu Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Babu Moger Tested-by: Yongwei Ma Acked-by: Michael S. Tsirkin Message-ID: <20231024090323.1859210-5-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/core/cpu.h | 2 +- target/i386/cpu.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 77893d7b81..c0c8320413 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -408,7 +408,7 @@ struct qemu_work_item; * See TranslationBlock::TCG CF_CLUSTER_MASK. * @tcg_cflags: Pre-computed cflags for this cpu. * @nr_cores: Number of cores within this CPU package. - * @nr_threads: Number of threads within this CPU. + * @nr_threads: Number of threads within this CPU core. * @running: #true if CPU is currently running (lockless). * @has_waiter: #true if a CPU is currently waiting for the cpu_exec_end; * valid under cpu_list_lock. diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 6c6b066986..b60a417074 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1882,6 +1882,7 @@ typedef struct CPUArchState { =20 TPRAccess tpr_access_type; =20 + /* Number of dies within this CPU package. */ unsigned nr_dies; } CPUX86State; =20 --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699270317; cv=none; d=zohomail.com; s=zohoarc; b=PbEWVM656eWwY8i+rPsZj/1ALbEENRgaxqZY+kwHVkz1vWKJkdhe35yeepHwdhc4ir1hjocarpGYVUqZOxCdBG2G4CsA+ypKYEPsxg/DyBGFSsAgecCNpYXgmigpgO6CbtRu0pM9bIPoQuNIFZhgxGgxY6KZIkqiU14ScWJ6wpc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699270317; 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=l0/vWnFHt+cyNHMvzu2dssx7xYyn6IEpyeIo7MQjzWQ=; b=TyYnAPeYV6/g3jrHygOTpVQNaMF1nrlkddu/Kdl72nCKEs3HynVzFw99MfBOxrSkbKBS6D9OlugyO9PtgkkdzLmFUBbxfYE3jTddSfbW8BKIbVgjjjAyUxNlffLn2iuhRHC08uiQdTxVnj07CAtbria/jL0EXHoGKcDJ9MajD40= 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 1699270317795445.043520390318; Mon, 6 Nov 2023 03: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 1qzxTe-0007Yr-It; Mon, 06 Nov 2023 06:09:06 -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 1qzxTd-0007Wq-2y for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:09:05 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxTZ-0005JB-Rm for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:09:04 -0500 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-32d849cc152so3001776f8f.1 for ; Mon, 06 Nov 2023 03:09:01 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id z18-20020adfec92000000b0032da8fb0d05sm9132494wrn.110.2023.11.06.03.08.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:08:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268940; x=1699873740; 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=l0/vWnFHt+cyNHMvzu2dssx7xYyn6IEpyeIo7MQjzWQ=; b=ATOHgHNsCkKb89JaOnwl8QH72EF8YZw+TFI1xlV8vgO5T92YyWphdlcIsoMHqk8+TU Vc8e/AXE44m4xrOGH8R0XBa4X29NorWbvjte/FwV44YiBOH26UxPjIl3yr+E8fvbhl5T 4TdP6raxusiQSOxyVH4A+XuZgoMWD2bqPV0o0W1KTCAn/bhZX7v6O9rXyB7xkjFlDRt8 iMP5QdazlChzlSDHosx9ur1yL3CVSXshPF/tPiFjLneC3UAax7BGhijhlzeiPx/w8Vmy TtAF6/94PMk1ZnD63cDtm9CLAtAB6p6QaUHEBgmZifi//6pe/lMdnWN0AnO7gJoCMLJi Bhyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268940; x=1699873740; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=l0/vWnFHt+cyNHMvzu2dssx7xYyn6IEpyeIo7MQjzWQ=; b=UTqFyT71i4IJofVvsltHWMsi4PCYPele0UkW8bi8VmR9hkA4k/5pzYIQND/qLSfJQ7 rlYOZEGqsrnM+MUsyrND5aE8UxIAwyA4ZoizGmG4v+Zoc6MHCABZOPIDG28VqnEzjMW7 EYjTW/KwX6AG8Fmdu9mSzuRlWXe6ByFn0rw+gTBQDbTkDaIvQ+U3Xr2PHO71loY4phjL UMKuqBrKRp5mpM24gXUqSuzLth36mUAJLcA1Jq0yBuNUiDS8fJkK/11VBj9r2Ff6SWno vMoLrbSgwe7tYkol1NQ+YXsksGnaJg3KFftYJgiwiVsQ0FCPJ67iHiTXXOMRTNs19eZg Uxkw== X-Gm-Message-State: AOJu0YwLGSbqsl0NSZiAeKpTitj7W6WyJ0qMdPj16dwGcQToJuqMsUd5 c0cnry6cNbzNjA2vQHgd00MPIeEBJgIfhQtBG2A= X-Google-Smtp-Source: AGHT+IFsbitm3bJThRshzHVNkwv0m7bE7yeAZoRxHUIurMBc1Abgxn0QnxImhW8tuDAE+j3RuaAyCQ== X-Received: by 2002:a05:6000:1361:b0:32d:9b80:e2c6 with SMTP id q1-20020a056000136100b0032d9b80e2c6mr22417154wrz.26.1699268940275; Mon, 06 Nov 2023 03:09:00 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Fiona Ebner , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , simon.rowe@nutanix.com, John Snow Subject: [PULL 47/60] hw/ide: reset: cancel async DMA operation before resetting state Date: Mon, 6 Nov 2023 12:03:19 +0100 Message-ID: <20231106110336.358-48-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699270319712100007 From: Fiona Ebner If there is a pending DMA operation during ide_bus_reset(), the fact that the IDEState is already reset before the operation is canceled can be problematic. In particular, ide_dma_cb() might be called and then use the reset IDEState which contains the signature after the reset. When used to construct the IO operation this leads to ide_get_sector() returning 0 and nsector being 1. This is particularly bad, because a write command will thus destroy the first sector which often contains a partition table or similar. Traces showing the unsolicited write happening with IDEState 0x5595af6949d0 being used after reset: > ahci_port_write ahci(0x5595af6923f0)[0]: port write [reg:PxSCTL] @ 0x2c: = 0x00000300 > ahci_reset_port ahci(0x5595af6923f0)[0]: reset port > ide_reset IDEstate 0x5595af6949d0 > ide_reset IDEstate 0x5595af694da8 > ide_bus_reset_aio aio_cancel > dma_aio_cancel dbs=3D0x7f64600089a0 > dma_blk_cb dbs=3D0x7f64600089a0 ret=3D0 > dma_complete dbs=3D0x7f64600089a0 ret=3D0 cb=3D0x5595acd40b30 > ahci_populate_sglist ahci(0x5595af6923f0)[0] > ahci_dma_prepare_buf ahci(0x5595af6923f0)[0]: prepare buf limit=3D512 pre= pared=3D512 > ide_dma_cb IDEState 0x5595af6949d0; sector_num=3D0 n=3D1 cmd=3DDMA WRITE > dma_blk_io dbs=3D0x7f6420802010 bs=3D0x5595ae2c6c30 offset=3D0 to_dev=3D1 > dma_blk_cb dbs=3D0x7f6420802010 ret=3D0 > (gdb) p *qiov > $11 =3D {iov =3D 0x7f647c76d840, niov =3D 1, {{nalloc =3D 1, local_iov = =3D {iov_base =3D 0x0, > iov_len =3D 512}}, {__pad =3D "\001\000\000\000\000\000\000\000\000= \000\000", > size =3D 512}}} > (gdb) bt > #0 blk_aio_pwritev (blk=3D0x5595ae2c6c30, offset=3D0, qiov=3D0x7f6420802= 070, flags=3D0, > cb=3D0x5595ace6f0b0 , opaque=3D0x7f6420802010) > at ../block/block-backend.c:1682 > #1 0x00005595ace6f185 in dma_blk_cb (opaque=3D0x7f6420802010, ret=3D) > at ../softmmu/dma-helpers.c:179 > #2 0x00005595ace6f778 in dma_blk_io (ctx=3D0x5595ae0609f0, > sg=3Dsg@entry=3D0x5595af694d00, offset=3Doffset@entry=3D0, align=3Dal= ign@entry=3D512, > io_func=3Dio_func@entry=3D0x5595ace6ee30 , > io_func_opaque=3Dio_func_opaque@entry=3D0x5595ae2c6c30, > cb=3D0x5595acd40b30 , opaque=3D0x5595af6949d0, > dir=3DDMA_DIRECTION_TO_DEVICE) at ../softmmu/dma-helpers.c:244 > #3 0x00005595ace6f90a in dma_blk_write (blk=3D0x5595ae2c6c30, > sg=3Dsg@entry=3D0x5595af694d00, offset=3Doffset@entry=3D0, align=3Dal= ign@entry=3D512, > cb=3Dcb@entry=3D0x5595acd40b30 , opaque=3Dopaque@entry=3D= 0x5595af6949d0) > at ../softmmu/dma-helpers.c:280 > #4 0x00005595acd40e18 in ide_dma_cb (opaque=3D0x5595af6949d0, ret=3D) > at ../hw/ide/core.c:953 > #5 0x00005595ace6f319 in dma_complete (ret=3D0, dbs=3D0x7f64600089a0) > at ../softmmu/dma-helpers.c:107 > #6 dma_blk_cb (opaque=3D0x7f64600089a0, ret=3D0) at ../softmmu/dma-helpe= rs.c:127 > #7 0x00005595ad12227d in blk_aio_complete (acb=3D0x7f6460005b10) > at ../block/block-backend.c:1527 > #8 blk_aio_complete (acb=3D0x7f6460005b10) at ../block/block-backend.c:1= 524 > #9 blk_aio_write_entry (opaque=3D0x7f6460005b10) at ../block/block-backe= nd.c:1594 > #10 0x00005595ad258cfb in coroutine_trampoline (i0=3D, > i1=3D) at ../util/coroutine-ucontext.c:177 Signed-off-by: Fiona Ebner Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: simon.rowe@nutanix.com Message-ID: <20230906130922.142845-1-f.ebner@proxmox.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/ide/core.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index b5e0dcd29b..63ba665f3d 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -2515,19 +2515,19 @@ static void ide_dummy_transfer_stop(IDEState *s) =20 void ide_bus_reset(IDEBus *bus) { - bus->unit =3D 0; - bus->cmd =3D 0; - ide_reset(&bus->ifs[0]); - ide_reset(&bus->ifs[1]); - ide_clear_hob(bus); - - /* pending async DMA */ + /* pending async DMA - needs the IDEState before it is reset */ if (bus->dma->aiocb) { trace_ide_bus_reset_aio(); blk_aio_cancel(bus->dma->aiocb); bus->dma->aiocb =3D NULL; } =20 + bus->unit =3D 0; + bus->cmd =3D 0; + ide_reset(&bus->ifs[0]); + ide_reset(&bus->ifs[1]); + ide_clear_hob(bus); + /* reset dma provider too */ if (bus->dma->ops->reset) { bus->dma->ops->reset(bus->dma); --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699270396; cv=none; d=zohomail.com; s=zohoarc; b=JVDBpwG8da56taZL07kzQV1Up3G3LgfpUBTPGoBLwNTG3n2+pWKgz7tZvK0iNn+suJTKwp3BZCPQ9DoQl20apdhEQdFqQphxLY50N1mh56ouPt50YWXERBArZDSs3R4HbZzx7Q2qnHj5yEm2Tigv7NFqWpD7P20pIQ+EzkTcZhY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699270396; 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=csVQGgR+Tak3/eKK57JrtNqjD/O4/1GmajzGwSgP8l0=; b=ibS2HTRy8375h7ShntHrTzEWbhtMHCnikzZnG8lB5fem/74nXv32kOxUBVfZcsjEOKlZkQiyQ+Zxc6aUnu1lzRKfzge82qbqL0mmR5/IggFvYyK8ENt76UbI9YxvmLZ4n9NMiXcGS08deGMAfdT/zYf9V+CvGe3ZV3S0RJgKpGA= 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 1699270396678919.5991446673239; Mon, 6 Nov 2023 03:33:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxTl-0007gX-Jk; Mon, 06 Nov 2023 06:09: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 1qzxTj-0007dh-EW for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:09:11 -0500 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxTg-0005L5-KK for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:09:11 -0500 Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-507be298d2aso5511104e87.1 for ; Mon, 06 Nov 2023 03:09:08 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id j19-20020a05600c191300b004090ca6d785sm11949457wmq.2.2023.11.06.03.09.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:09:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268947; x=1699873747; 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=csVQGgR+Tak3/eKK57JrtNqjD/O4/1GmajzGwSgP8l0=; b=DYMW4RZy27l8e4reUPVYHN/4PADcJ/tuebYjcEw0YBCjycdVYGZk2Ty+3iUk2yyPY7 kqmnvtshznWNT7JyuspG4jiW5V+kL0FL/WoB0xR8xM3AT6uCYxsOWPGArObqPA1+JHtX y3rD1Mb4QF/eZvRmaaxxE72B2nfOTTxog/Ge8zFOTbvBp88UPEKBnnGD+vbZIboVaECn XVNwNwOwLZsJT7ZEHyxrBm4mLHbo6LBB3K6kXJh9UEyINpyu42dAQMUX/YB9w4u/iTLn DBKJR8GXG8CeKq6OxUSMY7bWJgyCxbCcN7yuNF4eVwr9XATHS5q4LPAjC59UUGx5kjhq +PYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268947; x=1699873747; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=csVQGgR+Tak3/eKK57JrtNqjD/O4/1GmajzGwSgP8l0=; b=s3f5r37Ys8NpkehNdOMen0yu9JF5rv+lXoiJ3aVmAj1B/2Ck2wk5zT6bYJAysBzzvN K1N1btuvZWnpsXWt+3G78jfiK5io/k+hWqG51MUtOF+KVCLX2IThQYUGinIwIbtoP5WK mZX9cugx59ZDyLlk5TO4X1Q+MiyFxLQ/bhZlyPkPVYMGfA676V23OvXBwdixF2Q87fjn OtPUC0L/25Cu7RVsTH9Isiv8zQpoEXl8pjzHyprTzEGZxrCCawXonLSJO0DiOk0FUv/j +f49bcxjrAaOWOmduyaEJeUhHeG+6vIhmZbH8Vu5C8UnqmAuFHPCy4Gn/Bfx/RSFkCAx pJXA== X-Gm-Message-State: AOJu0YwJQGTo3zS82gf7DOTlPuq9tk7LlSAEeo1ud2+SEVO/Mj295H9G XFefoBmpJ9W1bpVlQJnkWs451mGGkbrBdvizLOw= X-Google-Smtp-Source: AGHT+IF/NpB8HMHP7H/FI9jfuMU1i8ZqGUSvagHUJCDZQ+ivvnwriIb7n7tIOJDMRsdh2YcofDQnWA== X-Received: by 2002:a05:6512:370b:b0:507:a6a5:a87b with SMTP id z11-20020a056512370b00b00507a6a5a87bmr20578908lfr.51.1699268946691; Mon, 06 Nov 2023 03:09:06 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Fiona Ebner , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , John Snow , Thomas Huth , Laurent Vivier , Paolo Bonzini Subject: [PULL 48/60] tests/qtest: ahci-test: add test exposing reset issue with pending callback Date: Mon, 6 Nov 2023 12:03:20 +0100 Message-ID: <20231106110336.358-49-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::136; envelope-from=philmd@linaro.org; helo=mail-lf1-x136.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699270398087100003 From: Fiona Ebner Before commit "hw/ide: reset: cancel async DMA operation before resetting state", this test would fail, because a reset with a pending write operation would lead to an unsolicited write to the first sector of the disk. The test writes a pattern to the beginning of the disk and verifies that it is still intact after a reset with a pending operation. It also checks that the pending operation actually completes correctly. Signed-off-by: Fiona Ebner Message-ID: <20230906130922.142845-2-f.ebner@proxmox.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- tests/qtest/ahci-test.c | 86 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 85 insertions(+), 1 deletion(-) diff --git a/tests/qtest/ahci-test.c b/tests/qtest/ahci-test.c index eea8b5f77b..5a1923f721 100644 --- a/tests/qtest/ahci-test.c +++ b/tests/qtest/ahci-test.c @@ -1424,6 +1424,89 @@ static void test_reset(void) ahci_shutdown(ahci); } =20 +static void test_reset_pending_callback(void) +{ + AHCIQState *ahci; + AHCICommand *cmd; + uint8_t port; + uint64_t ptr1; + uint64_t ptr2; + + int bufsize =3D 4 * 1024; + int speed =3D bufsize + (bufsize / 2); + int offset1 =3D 0; + int offset2 =3D bufsize / AHCI_SECTOR_SIZE; + + g_autofree unsigned char *tx1 =3D g_malloc(bufsize); + g_autofree unsigned char *tx2 =3D g_malloc(bufsize); + g_autofree unsigned char *rx1 =3D g_malloc0(bufsize); + g_autofree unsigned char *rx2 =3D g_malloc0(bufsize); + + /* Uses throttling to make test independent of specific environment. */ + ahci =3D ahci_boot_and_enable("-drive if=3Dnone,id=3Ddrive0,file=3D%s," + "cache=3Dwriteback,format=3D%s," + "throttling.bps-write=3D%d " + "-M q35 " + "-device ide-hd,drive=3Ddrive0 ", + tmp_path, imgfmt, speed); + + port =3D ahci_port_select(ahci); + ahci_port_clear(ahci, port); + + ptr1 =3D ahci_alloc(ahci, bufsize); + ptr2 =3D ahci_alloc(ahci, bufsize); + + g_assert(ptr1 && ptr2); + + /* Need two different patterns. */ + do { + generate_pattern(tx1, bufsize, AHCI_SECTOR_SIZE); + generate_pattern(tx2, bufsize, AHCI_SECTOR_SIZE); + } while (memcmp(tx1, tx2, bufsize) =3D=3D 0); + + qtest_bufwrite(ahci->parent->qts, ptr1, tx1, bufsize); + qtest_bufwrite(ahci->parent->qts, ptr2, tx2, bufsize); + + /* Write to beginning of disk to check it wasn't overwritten later. */ + ahci_guest_io(ahci, port, CMD_WRITE_DMA_EXT, ptr1, bufsize, offset1); + + /* Issue asynchronously to get a pending callback during reset. */ + cmd =3D ahci_command_create(CMD_WRITE_DMA_EXT); + ahci_command_adjust(cmd, offset2, ptr2, bufsize, 0); + ahci_command_commit(ahci, cmd, port); + ahci_command_issue_async(ahci, cmd); + + ahci_set(ahci, AHCI_GHC, AHCI_GHC_HR); + + ahci_command_free(cmd); + + /* Wait for throttled write to finish. */ + sleep(1); + + /* Start again. */ + ahci_clean_mem(ahci); + ahci_pci_enable(ahci); + ahci_hba_enable(ahci); + port =3D ahci_port_select(ahci); + ahci_port_clear(ahci, port); + + /* Read and verify. */ + ahci_guest_io(ahci, port, CMD_READ_DMA_EXT, ptr1, bufsize, offset1); + qtest_bufread(ahci->parent->qts, ptr1, rx1, bufsize); + g_assert_cmphex(memcmp(tx1, rx1, bufsize), =3D=3D, 0); + + ahci_guest_io(ahci, port, CMD_READ_DMA_EXT, ptr2, bufsize, offset2); + qtest_bufread(ahci->parent->qts, ptr2, rx2, bufsize); + g_assert_cmphex(memcmp(tx2, rx2, bufsize), =3D=3D, 0); + + ahci_free(ahci, ptr1); + ahci_free(ahci, ptr2); + + ahci_clean_mem(ahci); + + ahci_shutdown(ahci); +} + static void test_ncq_simple(void) { AHCIQState *ahci; @@ -1945,7 +2028,8 @@ int main(int argc, char **argv) qtest_add_func("/ahci/migrate/dma/halted", test_migrate_halted_dma); =20 qtest_add_func("/ahci/max", test_max); - qtest_add_func("/ahci/reset", test_reset); + qtest_add_func("/ahci/reset/simple", test_reset); + qtest_add_func("/ahci/reset/pending_callback", test_reset_pending_call= back); =20 qtest_add_func("/ahci/io/ncq/simple", test_ncq_simple); qtest_add_func("/ahci/migrate/ncq/simple", test_migrate_ncq); --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699271459; cv=none; d=zohomail.com; s=zohoarc; b=NXJJgER00vG8RDWHTmtY9zhX898+XDHvYWWVvALKpZPmWh7lIga6TEhjh0GIFNpj0gbL5m9GKbwPZbtMRBiqHo1dyQLkRUhenO3yr5GmrEKMKzbFZtP9xY22LpnOgzWFoANpU7p0/AlcOUt9OE/3uLFLf9Lf3JqGla/F/LwGue0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699271459; 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=gh2da5PI+FWVTGRmyCu8rnn16q3Vdl/J/DOzB/U83Dc=; b=H2MMaNu9n5dy175XJ+y1MzYPccwnpXUsB6ZqRnBOK9gfNaPrrKK2RC8rFpb/Kchj7ecrGjSeZ3F9pwqeMGtssNlXiqv5LbjDjEwmd6PnsVl5fzSO/1Usv81WWeQGMENoZP+kGC+HcTrBywID0bEdBu76NFTrKVnZQYxzis4XnQg= 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 1699271459653660.0848177813965; Mon, 6 Nov 2023 03:50:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxTv-0008W0-Ce; Mon, 06 Nov 2023 06:09:23 -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 1qzxTt-0008JW-KL for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:09:21 -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 1qzxTn-0005OF-4G for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:09:21 -0500 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-32fdc5be26dso58881f8f.2 for ; Mon, 06 Nov 2023 03:09:14 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id j17-20020a056000125100b0032db4e660d9sm9181558wrx.56.2023.11.06.03.09.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:09:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268953; x=1699873753; 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=gh2da5PI+FWVTGRmyCu8rnn16q3Vdl/J/DOzB/U83Dc=; b=HIimFuQvk6iTv5qCGB/EnbHhUITjNTjDzAej5T/jYn84/Z60WETbG882sWWeeCuAjp DuJgYu7oFhySdxMvbMzRVMD0+Ac2oO46E1aX3nvJcQWAYGJzha2TMR5tPZX7HgbPc3K6 zkkcm3/ULvpovhbJ5SgyXehOOoh2ODv4QYtyyXDim6MPTv1DfsQ3vCn2M1xnz1pdYDlr NeAgcqb63KmB9tbAI+gHh5gnGpApa8cEj2MyupVqgWo107l/6i/XwVB8NNpNYDcxDq3j GBv91S/KgCAJUXrM7G7WWuu7S/kVp3Y+OTimqlXhK6wYS6eJC6tGwVksLUCghw8ZF/LB 5a9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268953; x=1699873753; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gh2da5PI+FWVTGRmyCu8rnn16q3Vdl/J/DOzB/U83Dc=; b=olp8YmyLjy2Ep6+IPbpIIBtJ1kRvEOkr28AAzU88UTtMNlUyy3t6UhivXUUFyPG5LB iAQlt1ChFOydzvM9w/ofl5ceCLh3o7eM1t4ehbR/NcQuqWTEosEDZbpj6qaC7paTaphu E1630AQvTyDXqVtAwoftxfrHTrM4uNpl1tAUBq5Ka6V/k2UtNilnmwOnhRDrlnnK/jHD zsVP/5kNVmRdcYrYx/OXIZ2vdnUuGKubENaHYjbYRlxH62ECqr8wD0kx1BP1CSSFI77t yukLIE6ihQfpyyVcP+pCqvq1u6PMddCXOE9hLla4pWSD5gZOcctqYYwE0BgjO+ofvExM sxqg== X-Gm-Message-State: AOJu0YyDjB6T3cn3oJLvCV//yKRv3WV3d9xQ/ZAKnyqi1SiUMnSKmgxw YGYBFaq7tLE6HbOa1SqfJW8rZ7XUQdbhkv8+szc= X-Google-Smtp-Source: AGHT+IEhelvYuVMEs34Z0aXzBUC/ehzDXNQDAvKbf9n6MtiLZ1bFBIXsaS/OCjeLNPDbQR8d540Asw== X-Received: by 2002:a5d:5a06:0:b0:32d:a101:689d with SMTP id bq6-20020a5d5a06000000b0032da101689dmr35272735wrb.56.1699268953327; Mon, 06 Nov 2023 03:09:13 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Titus Rwantare , Hao Wu , Corey Minyard , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 49/60] hw/i2c: pmbus add support for block receive Date: Mon, 6 Nov 2023 12:03:21 +0100 Message-ID: <20231106110336.358-50-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699271460565100001 From: Titus Rwantare PMBus devices can send and receive variable length data using the block read and write format, with the first byte in the payload denoting the length. This is mostly used for strings and on-device logs. Devices can respond to a block read with an empty string. Reviewed-by: Hao Wu Acked-by: Corey Minyard Signed-off-by: Titus Rwantare Message-ID: <20231023-staging-pmbus-v3-v4-1-07a8cb7cd20a@google.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/i2c/pmbus_device.h | 7 +++++++ hw/i2c/pmbus_device.c | 30 +++++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/include/hw/i2c/pmbus_device.h b/include/hw/i2c/pmbus_device.h index 93f5d57c9d..7dc00cc4d9 100644 --- a/include/hw/i2c/pmbus_device.h +++ b/include/hw/i2c/pmbus_device.h @@ -501,6 +501,13 @@ void pmbus_send64(PMBusDevice *state, uint64_t data); */ void pmbus_send_string(PMBusDevice *state, const char *data); =20 +/** + * @brief Receive data sent with Block Write. + * @param dest - memory with enough capacity to receive the write + * @param len - the capacity of dest + */ +uint8_t pmbus_receive_block(PMBusDevice *pmdev, uint8_t *dest, size_t len); + /** * @brief Receive data over PMBus * These methods help track how much data is being received over PMBus diff --git a/hw/i2c/pmbus_device.c b/hw/i2c/pmbus_device.c index cef51663d0..ea15490720 100644 --- a/hw/i2c/pmbus_device.c +++ b/hw/i2c/pmbus_device.c @@ -102,7 +102,6 @@ void pmbus_send_string(PMBusDevice *pmdev, const char *= data) } =20 size_t len =3D strlen(data); - g_assert(len > 0); g_assert(len + pmdev->out_buf_len < SMBUS_DATA_MAX_LEN); pmdev->out_buf[len + pmdev->out_buf_len] =3D len; =20 @@ -112,6 +111,35 @@ void pmbus_send_string(PMBusDevice *pmdev, const char = *data) pmdev->out_buf_len +=3D len + 1; } =20 +uint8_t pmbus_receive_block(PMBusDevice *pmdev, uint8_t *dest, size_t len) +{ + /* dest may contain data from previous writes */ + memset(dest, 0, len); + + /* Exclude command code from return value */ + pmdev->in_buf++; + pmdev->in_buf_len--; + + /* The byte after the command code denotes the length */ + uint8_t sent_len =3D pmdev->in_buf[0]; + + if (sent_len !=3D pmdev->in_buf_len - 1) { + qemu_log_mask(LOG_GUEST_ERROR, + "%s: length mismatch. Expected %d bytes, got %d byte= s\n", + __func__, sent_len, pmdev->in_buf_len - 1); + } + + /* exclude length byte */ + pmdev->in_buf++; + pmdev->in_buf_len--; + + if (pmdev->in_buf_len < len) { + len =3D pmdev->in_buf_len; + } + memcpy(dest, pmdev->in_buf, len); + return len; +} + =20 static uint64_t pmbus_receive_uint(PMBusDevice *pmdev) { --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699269620; cv=none; d=zohomail.com; s=zohoarc; b=hI3k7yh92LTS3eTpaQ0IOKngy0wYwQkZr3c4KoHmF+2Epyf0S6Mby85givh2dQiGun7v/ARH0/kEWsK7uHMfz7wbbBvcXk6UtMLLFqOnaEVik1fzcFQ5kQ4ZfcIgwO4+WQVu7bfSCf3CROKyu/Z+fo2TgZDXmiP2+EqMBXBwDUE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699269620; 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=X3TRJ7mvtWFdvHNvT+G6kpqIlBzXe7wSn3LOLdu3gVg=; b=EgyblN1zsdBRUgqOimV61X4wgpHlwWyKY7KZAY8dNvdwjbmS9kzmf6Q4M3zKTD4Wt0S+vBQZTVBHvmGp0R66FofT4ZDJnOrCMtkhaBMVSLT18UdJtPqtlTvp9svRRPV0c8VZq/s/wDA/5rNyjB7149JMcqbJMjSj+c4mbjPWIv0= 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 1699269620240353.4896350206983; Mon, 6 Nov 2023 03:20:20 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxUQ-0002NJ-Tv; Mon, 06 Nov 2023 06:09:54 -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 1qzxUB-0001pT-2W for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:09:39 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxTv-0005Px-RC for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:09:38 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40806e40fccso27278345e9.2 for ; Mon, 06 Nov 2023 03:09:21 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id t14-20020a05600c198e00b00405d9a950a2sm11977070wmq.28.2023.11.06.03.09.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:09:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268960; x=1699873760; 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=X3TRJ7mvtWFdvHNvT+G6kpqIlBzXe7wSn3LOLdu3gVg=; b=SQyhIko2VznGmqP3eJ8bayWLSd/SUGbpV/yedTmrjHaH/iph1e0y/d+iwUrGI81z2X RSrmb2mBx4rEyB0oG1bnLmFoT3SCU26BREhswEUGHgnLu6JCaL1fE40eiENccelZEJL0 VhwgDD1OiLUjxSgQ3S0TA3U+bVuaiE9O6s9uw0XrwuHCBxMxk2ZnzyGomPYGT8997Hqt lWaV1VyhBoehAasHmOhFAG05k6iL6tLYlslQBqVwlK98Gibws5+6i/KmPWHmdHthX97n PlltvpfqtbHIRQYlFiUSVKbvyiDOuMg21PFa4GD8klyJixCLpQxCLeDnsWIRL2VHUUoJ EBNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268960; x=1699873760; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=X3TRJ7mvtWFdvHNvT+G6kpqIlBzXe7wSn3LOLdu3gVg=; b=p5iRZhDKXLCC+HQJjqzCfGxXk0nEVdF9e2fiDVuPTx8b/8h+UbptWRCS3KpOnqIUMC P/CmGGI79PbDnH6aZca2I/M+HGNGrk2QVulXp3YDDGPZpE58vCOtwaGWQD6Vr2WwLz6C NwypFj+qWxytnzEd8UXhQ80bgleFUHrZy3hQYYOnB6xv7AawdHaG0G9SvYuguv82ngIr dkqSVvQnekM+jaGluVE6h0XS2eRr/PEn52OlJQW6Kt71VJBBB3xq0QDGnl/MslTJ/ZRc zrQa2fyClowloc+C5wDqTCm/4BcTOV/v8ia4oh4TS6xYBqpIYFNjKbJmLse39A3L+FC8 tUow== X-Gm-Message-State: AOJu0YziunsA6SRiCtfzyvjAxYSgAO9U9Vw4vJqBMsADAF+s3+2aHCbn FXe0QCmw+GzzSK1Yq+yaQxXUk0MNu5IqlQpArRM= X-Google-Smtp-Source: AGHT+IF/QapXB/IOwC+mPuY/wRqr3XPsG7/5YWOQ5O+CSJmVp0xQfesuPuHXWRl4QaqtoFcKAg5Pqg== X-Received: by 2002:a05:600c:46c8:b0:3ff:233f:2cfb with SMTP id q8-20020a05600c46c800b003ff233f2cfbmr23090503wmo.23.1699268960044; Mon, 06 Nov 2023 03:09:20 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Titus Rwantare , Hao Wu , Corey Minyard , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 50/60] hw/i2c: pmbus: add vout mode bitfields Date: Mon, 6 Nov 2023 12:03:22 +0100 Message-ID: <20231106110336.358-51-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699269621470100007 From: Titus Rwantare The VOUT_MODE command is described in the PMBus Specification, Part II, Ver 1.3 Section 8.3 VOUT_MODE has a three bit mode and 4 bit parameter, the three bit mode determines whether voltages are formatted as uint16, uint16, VID, and Direct modes. VID and Direct modes use the remaining 5 bits to scale the voltage readings. Reviewed-by: Hao Wu Acked-by: Corey Minyard Signed-off-by: Titus Rwantare Message-ID: <20231023-staging-pmbus-v3-v4-2-07a8cb7cd20a@google.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/i2c/pmbus_device.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/hw/i2c/pmbus_device.h b/include/hw/i2c/pmbus_device.h index 7dc00cc4d9..2e95164aa1 100644 --- a/include/hw/i2c/pmbus_device.h +++ b/include/hw/i2c/pmbus_device.h @@ -444,6 +444,14 @@ typedef struct PMBusCoefficients { int32_t R; /* exponent */ } PMBusCoefficients; =20 +/** + * VOUT_Mode bit fields + */ +typedef struct PMBusVoutMode { + uint8_t mode:3; + int8_t exp:5; +} PMBusVoutMode; + /** * Convert sensor values to direct mode format * --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699271194; cv=none; d=zohomail.com; s=zohoarc; b=Q1DvV7jWeaJc/kQmMdJ0JUNNOa9vLHYOimjEYJUi1fdwM3KLJ2uZYzHTnMMtqCiCKNgSfcnAzDu4urFBGA9SkTzybCql5Bd+1jBrbppiN/o8OyuGyaqrzLzHR6bbzR64P2dVjxoxqFJePK5XmZ2F05AFf/RPC1nj+kTpQNvgV+Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699271194; 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=SjHtz+lPcIw6M6S7bcDq7sYVmI6jCo0hvfjVBU4M5Y0=; b=Riihh/fKjhXFWHR9B0BRS4eK5wEP3FJki44SBVqq+8peY7m586IWkt6XPSMclxggr8ez/Exp0SU3F1B0zaTDNX0P0ZIMvdp/jEkBaYQbtUnRRW8qFWepVNgfg1GbsiLFXv4jz783YDHJn6BXLvxGJtlYvkS8fU3AkEjBJBBi9Bk= 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 1699271194570572.9847122109512; Mon, 6 Nov 2023 03:46:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxU7-0001Ph-0j; Mon, 06 Nov 2023 06:09:35 -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 1qzxU5-0001H3-AH for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:09:33 -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 1qzxU0-0005TA-8Q for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:09:33 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-40906fc54fdso33493715e9.0 for ; Mon, 06 Nov 2023 03:09:27 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id j6-20020adfea46000000b0032fc609c118sm6076145wrn.66.2023.11.06.03.09.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:09:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268966; x=1699873766; 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=SjHtz+lPcIw6M6S7bcDq7sYVmI6jCo0hvfjVBU4M5Y0=; b=dxRKLRxS7P6J8gLspT56u4bESTfjapZzmI2cg9bzOES6xxXA+pEfLm9qztx8astJ6/ WTSShcv1g6Jr3JqVOvMeNuO61D6B3tc1QXwRviKDpaymlaGlHtPsKrFQ5/uMv4Hpj+px 75JHL6zjulfDUVziZcJSXU5R0ejX6infaXSYPnmPNhwyhUWgbgdeeoRK39TI3mbzciGl vlmBN1zbCIxAanBwB4VBfEth6Q/pB8Yz/IEd5eLTTRRt2Cu4bd3ooq+L+9rAKC9Yo8LZ XqDtNZMxiBUHretIxwWain1Gam73ixGrMw3Od6uVmMug+NGU6VNzl1ykKB8AQL+ckudi 3MZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268966; x=1699873766; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SjHtz+lPcIw6M6S7bcDq7sYVmI6jCo0hvfjVBU4M5Y0=; b=OxE9XwRqv6NTRkWATjQaLWMbZ1GFHN4aJU5wgbkx5OMcSzx11L4SW4SAalRXg6/R7O +8e12Uvdt53raRjlTiInOA8BlxDqR+mjj+MjSaIfaQ+ubvFHyTjOA7/iqkpIFnQq3g/m YWJhs37nXt0M66Gl44ZDW9ZybkdgUB/AjQMXxDRTFA4/LTzWLnxZ8wu6YysEKz+ojIB3 rzaoh27aWnEKAUys7sJqdHec2Dn7MCAWBa6z0AQ9YuXkfWbM6WxGOQtiGrjekFH0He3y kz+zBT7sgls+wV1OKnyFOk9+r+TMWQvcWSYusdunGkzipd1ATEoKXxxKemaBT//vApSk laDQ== X-Gm-Message-State: AOJu0YwLKm1dCDRov0pguYP2ooazqCKt27cgvyyerIkHRlYewHquw7OA 7h1JUtSMBe7UEd8NVrKo6wse4LdwODVhxeCOUIU= X-Google-Smtp-Source: AGHT+IG8Q4coZ+Ea54w4wY9DsUFuNEg759Mh+b6Z9wAr9dd+6s8Zg0s9ng5tqvrG8ylEYsTfJNq9ow== X-Received: by 2002:a05:600c:4693:b0:409:5a92:472f with SMTP id p19-20020a05600c469300b004095a92472fmr11071290wmo.6.1699268966532; Mon, 06 Nov 2023 03:09:26 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Titus Rwantare , Stephen Longfield , Corey Minyard , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 51/60] hw/i2c: pmbus: add fan support Date: Mon, 6 Nov 2023 12:03:23 +0100 Message-ID: <20231106110336.358-52-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699271196709100003 From: Titus Rwantare PMBus devices may integrate fans whose operation is configurable over PMBus. This commit allows the driver to read and write the fan control registers but does not model the operation of fans. Reviewed-by: Stephen Longfield Acked-by: Corey Minyard Signed-off-by: Titus Rwantare Message-ID: <20231023-staging-pmbus-v3-v4-3-07a8cb7cd20a@google.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/i2c/pmbus_device.h | 1 + hw/i2c/pmbus_device.c | 176 ++++++++++++++++++++++++++++++++++ 2 files changed, 177 insertions(+) diff --git a/include/hw/i2c/pmbus_device.h b/include/hw/i2c/pmbus_device.h index 2e95164aa1..ad431bdc7c 100644 --- a/include/hw/i2c/pmbus_device.h +++ b/include/hw/i2c/pmbus_device.h @@ -258,6 +258,7 @@ OBJECT_DECLARE_TYPE(PMBusDevice, PMBusDeviceClass, #define PB_HAS_TEMP2 BIT_ULL(41) #define PB_HAS_TEMP3 BIT_ULL(42) #define PB_HAS_TEMP_RATING BIT_ULL(43) +#define PB_HAS_FAN BIT_ULL(44) #define PB_HAS_MFR_INFO BIT_ULL(50) #define PB_HAS_STATUS_MFR_SPECIFIC BIT_ULL(51) =20 diff --git a/hw/i2c/pmbus_device.c b/hw/i2c/pmbus_device.c index ea15490720..c1d8c93056 100644 --- a/hw/i2c/pmbus_device.c +++ b/hw/i2c/pmbus_device.c @@ -500,6 +500,54 @@ static uint8_t pmbus_receive_byte(SMBusDevice *smd) } break; =20 + case PMBUS_FAN_CONFIG_1_2: /* R/W byte */ + if (pmdev->pages[index].page_flags & PB_HAS_FAN) { + pmbus_send8(pmdev, pmdev->pages[index].fan_config_1_2); + } else { + goto passthough; + } + break; + + case PMBUS_FAN_COMMAND_1: /* R/W word */ + if (pmdev->pages[index].page_flags & PB_HAS_FAN) { + pmbus_send16(pmdev, pmdev->pages[index].fan_command_1); + } else { + goto passthough; + } + break; + + case PMBUS_FAN_COMMAND_2: /* R/W word */ + if (pmdev->pages[index].page_flags & PB_HAS_FAN) { + pmbus_send16(pmdev, pmdev->pages[index].fan_command_2); + } else { + goto passthough; + } + break; + + case PMBUS_FAN_CONFIG_3_4: /* R/W byte */ + if (pmdev->pages[index].page_flags & PB_HAS_FAN) { + pmbus_send8(pmdev, pmdev->pages[index].fan_config_3_4); + } else { + goto passthough; + } + break; + + case PMBUS_FAN_COMMAND_3: /* R/W word */ + if (pmdev->pages[index].page_flags & PB_HAS_FAN) { + pmbus_send16(pmdev, pmdev->pages[index].fan_command_3); + } else { + goto passthough; + } + break; + + case PMBUS_FAN_COMMAND_4: /* R/W word */ + if (pmdev->pages[index].page_flags & PB_HAS_FAN) { + pmbus_send16(pmdev, pmdev->pages[index].fan_command_4); + } else { + goto passthough; + } + break; + case PMBUS_VOUT_OV_FAULT_LIMIT: /* R/W word */ if (pmdev->pages[index].page_flags & PB_HAS_VOUT) { pmbus_send16(pmdev, pmdev->pages[index].vout_ov_fault_limit); @@ -810,6 +858,22 @@ static uint8_t pmbus_receive_byte(SMBusDevice *smd) pmbus_send8(pmdev, pmdev->pages[index].status_mfr_specific); break; =20 + case PMBUS_STATUS_FANS_1_2: /* R/W byte */ + if (pmdev->pages[index].page_flags & PB_HAS_FAN) { + pmbus_send8(pmdev, pmdev->pages[index].status_fans_1_2); + } else { + goto passthough; + } + break; + + case PMBUS_STATUS_FANS_3_4: /* R/W byte */ + if (pmdev->pages[index].page_flags & PB_HAS_FAN) { + pmbus_send8(pmdev, pmdev->pages[index].status_fans_3_4); + } else { + goto passthough; + } + break; + case PMBUS_READ_EIN: /* Read-Only block 5 bytes */ if (pmdev->pages[index].page_flags & PB_HAS_EIN) { pmbus_send(pmdev, pmdev->pages[index].read_ein, 5); @@ -882,6 +946,54 @@ static uint8_t pmbus_receive_byte(SMBusDevice *smd) } break; =20 + case PMBUS_READ_FAN_SPEED_1: /* Read-Only word */ + if (pmdev->pages[index].page_flags & PB_HAS_FAN) { + pmbus_send16(pmdev, pmdev->pages[index].read_fan_speed_1); + } else { + goto passthough; + } + break; + + case PMBUS_READ_FAN_SPEED_2: /* Read-Only word */ + if (pmdev->pages[index].page_flags & PB_HAS_FAN) { + pmbus_send16(pmdev, pmdev->pages[index].read_fan_speed_2); + } else { + goto passthough; + } + break; + + case PMBUS_READ_FAN_SPEED_3: /* Read-Only word */ + if (pmdev->pages[index].page_flags & PB_HAS_FAN) { + pmbus_send16(pmdev, pmdev->pages[index].read_fan_speed_3); + } else { + goto passthough; + } + break; + + case PMBUS_READ_FAN_SPEED_4: /* Read-Only word */ + if (pmdev->pages[index].page_flags & PB_HAS_FAN) { + pmbus_send16(pmdev, pmdev->pages[index].read_fan_speed_4); + } else { + goto passthough; + } + break; + + case PMBUS_READ_DUTY_CYCLE: /* Read-Only word */ + if (pmdev->pages[index].page_flags & PB_HAS_FAN) { + pmbus_send16(pmdev, pmdev->pages[index].read_duty_cycle); + } else { + goto passthough; + } + break; + + case PMBUS_READ_FREQUENCY: /* Read-Only word */ + if (pmdev->pages[index].page_flags & PB_HAS_FAN) { + pmbus_send16(pmdev, pmdev->pages[index].read_frequency); + } else { + goto passthough; + } + break; + case PMBUS_READ_POUT: /* Read-Only word */ if (pmdev->pages[index].page_flags & PB_HAS_POUT) { pmbus_send16(pmdev, pmdev->pages[index].read_pout); @@ -1305,6 +1417,54 @@ static int pmbus_write_data(SMBusDevice *smd, uint8_= t *buf, uint8_t len) } break; =20 + case PMBUS_FAN_CONFIG_1_2: /* R/W byte */ + if (pmdev->pages[index].page_flags & PB_HAS_FAN) { + pmdev->pages[index].fan_config_1_2 =3D pmbus_receive8(pmdev); + } else { + goto passthrough; + } + break; + + case PMBUS_FAN_COMMAND_1: /* R/W word */ + if (pmdev->pages[index].page_flags & PB_HAS_FAN) { + pmdev->pages[index].fan_command_1 =3D pmbus_receive16(pmdev); + } else { + goto passthrough; + } + break; + + case PMBUS_FAN_COMMAND_2: /* R/W word */ + if (pmdev->pages[index].page_flags & PB_HAS_FAN) { + pmdev->pages[index].fan_command_2 =3D pmbus_receive16(pmdev); + } else { + goto passthrough; + } + break; + + case PMBUS_FAN_CONFIG_3_4: /* R/W byte */ + if (pmdev->pages[index].page_flags & PB_HAS_FAN) { + pmdev->pages[index].fan_config_3_4 =3D pmbus_receive8(pmdev); + } else { + goto passthrough; + } + break; + + case PMBUS_FAN_COMMAND_3: /* R/W word */ + if (pmdev->pages[index].page_flags & PB_HAS_FAN) { + pmdev->pages[index].fan_command_3 =3D pmbus_receive16(pmdev); + } else { + goto passthrough; + } + break; + + case PMBUS_FAN_COMMAND_4: /* R/W word */ + if (pmdev->pages[index].page_flags & PB_HAS_FAN) { + pmdev->pages[index].fan_command_4 =3D pmbus_receive16(pmdev); + } else { + goto passthrough; + } + break; + case PMBUS_VOUT_OV_FAULT_LIMIT: /* R/W word */ if (pmdev->pages[index].page_flags & PB_HAS_VOUT) { pmdev->pages[index].vout_ov_fault_limit =3D pmbus_receive16(pm= dev); @@ -1610,6 +1770,22 @@ static int pmbus_write_data(SMBusDevice *smd, uint8_= t *buf, uint8_t len) pmdev->pages[index].status_mfr_specific =3D pmbus_receive8(pmdev); break; =20 + case PMBUS_STATUS_FANS_1_2: /* R/W byte */ + if (pmdev->pages[index].page_flags & PB_HAS_FAN) { + pmbus_send8(pmdev, pmdev->pages[index].status_fans_1_2); + } else { + goto passthrough; + } + break; + + case PMBUS_STATUS_FANS_3_4: /* R/W byte */ + if (pmdev->pages[index].page_flags & PB_HAS_FAN) { + pmbus_send8(pmdev, pmdev->pages[index].status_fans_3_4); + } else { + goto passthrough; + } + break; + case PMBUS_PAGE_PLUS_READ: /* Block Read-only */ case PMBUS_CAPABILITY: /* Read-Only byte */ case PMBUS_COEFFICIENTS: /* Read-only block 5 bytes */ --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699269259; cv=none; d=zohomail.com; s=zohoarc; b=ZiELnJ8G/EmNkmvKE+8D+QprRqpdATMqAxkQWY8HZyJv1e+BzONOfzaH3HA+inhvQXfPsbOUk2A8ybYgsmYNfPhAvs3t1GOrsBCjlhlnSqktOWokS52Sj9iEqfhhbS8Wisf4uKBue/EzN/V7b+wQPc54il+EauuXnSh6cft9q8c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699269259; 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=3MW0tyH68/nf1rlEHwZAluKpdYAi9tPVuWOS5/QAWBA=; b=VfD1BjuorWIxugSgYIhdPjF4kAxfhYlaRx+Rl3vZ3NKrbLYvZCt7+iGjpLqhmjd1qblyAKmVExfLhrlRsq675E5xqk9yZHM6Nq3ltD86kCmT/+DBM7/wn8Cd3ahJ1r5ICeXNurCbRLjw97CEPGJbZeUsMrTc8c0VXxkgNdJrUTI= 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 1699269259423482.6617353617936; Mon, 6 Nov 2023 03:14:19 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxUN-00028l-VO; Mon, 06 Nov 2023 06:09:52 -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 1qzxUA-0001pH-Q1 for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:09:39 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxU6-0005Xb-MU for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:09:38 -0500 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-32f737deedfso2644297f8f.3 for ; Mon, 06 Nov 2023 03:09:34 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id y8-20020a5d4708000000b0032d2f09d991sm9141944wrq.33.2023.11.06.03.09.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:09:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268973; x=1699873773; 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=3MW0tyH68/nf1rlEHwZAluKpdYAi9tPVuWOS5/QAWBA=; b=I1XktIPOhYqdwG1Y9bMehrpjGF1Bhn/T6ILyWcoDrBvbvgqSRaVGUgXatQ9zhNBS0b cX+5K2AJST/kAOFELuJKUUtAzxjVw4riymyinZrF/DQecr82yB/ujWFnCXg5cKW3IYze 06exFyiqsDs+Ogmnka/MaAxZtVJVCU0OpTmx8ZXALCfA3loaXtR907K7DeWpDVK4pkH0 rnPql9yD/H6GA7NU90vK8/0kDvOiyQezAb4OpZGlEJKuhAKRo+2Oz3WNMtc5hQEjAEpO ckFUzFT705W897fAlZsqmtng7C9Rt+696kkVycSO0A3NoRpX6rVxDadlmrk8CsZ8DQL2 cSTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268973; x=1699873773; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3MW0tyH68/nf1rlEHwZAluKpdYAi9tPVuWOS5/QAWBA=; b=Ma1Yx5/F6s52DE0hqT+jGg2BHwNuPzm1ewRE7QCJYtWt+mCzXJ7FDJPrzRnlRXBPJ8 3v924X8r+5922FKouKnFbii7RfsVikjfmDF4VUMgFyDpwwDbb9h998LRSnwZODheOmiD 3zPJESLEwxPXxNGq0kNZEzkA4Pvgq7bBioOJ/wF3YH7jyOAKKLa7si73x8aNLP3YAUuv Qle72xegC3HzGhs2xKLEiSApv1CKZmkzv49BFYsdWEx9aCQgyMGijkSY/r1sKhOt2HGr XYMaGp7uE8tK2OFeifYsLP+sPl5El0OGV3XZRQ/PhihHNTSqW2/NTlGAh7QqHLTZikmt kjMQ== X-Gm-Message-State: AOJu0YwB5izt1UmBI5tsPnTnvVulVSC4zIz2QRZ7m7oG11089iF5AChd TWV7RmK7w7ijQ9z7d44SPGKP8r+3J90I2xgqzGw= X-Google-Smtp-Source: AGHT+IHCaN+scNB/M2tnE4QgncjJleh2dLiQpvtBfLxKZsjTqp14NEV1WX9EdfcpHqTpyU/QLx/+rg== X-Received: by 2002:a05:6000:2c5:b0:32f:7ae2:4165 with SMTP id o5-20020a05600002c500b0032f7ae24165mr27652837wry.9.1699268972999; Mon, 06 Nov 2023 03:09:32 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Titus Rwantare , Benjamin Streb , Corey Minyard , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 52/60] hw/i2c: pmbus: add VCAP register Date: Mon, 6 Nov 2023 12:03:24 +0100 Message-ID: <20231106110336.358-53-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::435; envelope-from=philmd@linaro.org; helo=mail-wr1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699269261554100005 From: Titus Rwantare VCAP is a register for devices with energy storage capacitors. Reviewed-by: Benjamin Streb Acked-by: Corey Minyard Signed-off-by: Titus Rwantare Message-ID: <20231023-staging-pmbus-v3-v4-4-07a8cb7cd20a@google.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/i2c/pmbus_device.h | 1 + hw/i2c/pmbus_device.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/include/hw/i2c/pmbus_device.h b/include/hw/i2c/pmbus_device.h index ad431bdc7c..f195c11384 100644 --- a/include/hw/i2c/pmbus_device.h +++ b/include/hw/i2c/pmbus_device.h @@ -243,6 +243,7 @@ OBJECT_DECLARE_TYPE(PMBusDevice, PMBusDeviceClass, #define PB_HAS_VIN_RATING BIT_ULL(13) #define PB_HAS_VOUT_RATING BIT_ULL(14) #define PB_HAS_VOUT_MODE BIT_ULL(15) +#define PB_HAS_VCAP BIT_ULL(16) #define PB_HAS_IOUT BIT_ULL(21) #define PB_HAS_IIN BIT_ULL(22) #define PB_HAS_IOUT_RATING BIT_ULL(23) diff --git a/hw/i2c/pmbus_device.c b/hw/i2c/pmbus_device.c index c1d8c93056..3bce39e84e 100644 --- a/hw/i2c/pmbus_device.c +++ b/hw/i2c/pmbus_device.c @@ -906,6 +906,14 @@ static uint8_t pmbus_receive_byte(SMBusDevice *smd) } break; =20 + case PMBUS_READ_VCAP: /* Read-Only word */ + if (pmdev->pages[index].page_flags & PB_HAS_VCAP) { + pmbus_send16(pmdev, pmdev->pages[index].read_vcap); + } else { + goto passthough; + } + break; + case PMBUS_READ_VOUT: /* Read-Only word */ if (pmdev->pages[index].page_flags & PB_HAS_VOUT) { pmbus_send16(pmdev, pmdev->pages[index].read_vout); --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699271183; cv=none; d=zohomail.com; s=zohoarc; b=FSRWFALu28ldDvvpJ73DVeU0Y4V9ASW9kFsYwPhX4GouvUtgQzHL+UjufjC0zGy1KxQWZwOkne4zQpc7HOrQy9GqeUwspS0kbc+5MLHJxFkEorX3fiTjf3k3v+4KpOdPCLHTVEH5z5H6Pq7WuNbG7aB+DBLI5OtURrXV/c2k3rk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699271183; 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=iac5EYIzrukJRvlyPwy92lw3bSASiGn2WGuusjle2eY=; b=fPxcxWI6QLS/utHfmY3HAAYmM0/sCeXdr0my8IlnghiMnyf26hbUEQf3fM5uQx4Jkn/pIoNxvYUFukwVRidcLfCvh7/58WNuA/RC06FaS1DuwSXql9h5MnWo4GmIOfxoaBCz0sUWwhi+J848reZ0sdHcN8InzoIYObZguGsA+/w= 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 1699271183799225.3908835783567; Mon, 6 Nov 2023 03:46:23 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxUs-0002sk-Ll; Mon, 06 Nov 2023 06:10:22 -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 1qzxUJ-000272-J8 for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:09:49 -0500 Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxUD-0005b6-SW for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:09:47 -0500 Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2c6ef6c1ec2so52813691fa.2 for ; Mon, 06 Nov 2023 03:09:41 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id ew3-20020a05600c808300b004054dcbf92asm11515737wmb.20.2023.11.06.03.09.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:09:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268980; x=1699873780; 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=iac5EYIzrukJRvlyPwy92lw3bSASiGn2WGuusjle2eY=; b=koNfP1vgF1T8FoJdQ+nN2oKSBCgmIveJN22m/aryY+F8B+8MLsDwYHXmxFX/R7WkXi XxAzXqC0KbbSO7VR6BSqZUFepP8tIaJoUNheySFbTtS3FdWYWnbaXcNRBzZ4n1FS/Ojt 4M819gkqKkIAQvKSJK1WyeAlo/+RAD1R4Upkq82pHfIRmUqwWTmO0A+VFQ5/PhJim6T/ gYhBEYYdabWtozTxiw1GHFMFXh9blO8V6HtbqZB7H3KYu+VFJz/hKaJ29JeNvLbk6NyU xiWzSu8gCWcJoEnoV1jOJqJLy9mRLs5yNjh2c2XXYbC6izXtL9brMzoOAS7ChyLmQpsi jreg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268980; x=1699873780; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iac5EYIzrukJRvlyPwy92lw3bSASiGn2WGuusjle2eY=; b=Ki3Ep7u/3G+sArx3KeEoJQdI8HLjWWs+2G3ugFOtQpP55lF9NMWUVZCE+kzfnOXyw3 hcqutFjI4OaB+jbgheGzi50lZtVXZLXYwus2QhHUfADLVnRnBRzOu8IdawiFitKw4hYX HLdvlsCUq2tWOaIpz67d4AI2zLeQX/ZuyrCtAD/AA7GAgNOqC6p9nSqKBMxbcOQ/Q4c/ Q2ijPYk5pWH3QYreVtHJKbim78PNkD0aXjz7szw0Ym4PwwXP8syL3Vw0Vr00h1uPBEA3 pQPBP1eglsdBMIFynX2s7GOhpAl9tPUhfsvTgSw1Ji5OMiJNnOONxgjblVcLn82wrjyA rdPA== X-Gm-Message-State: AOJu0Yx99AI+j3VqQgfbX6ckXWCB/45+2y+D3I+LrdFOvdhn4gGJShTf MiR+ukqvj7HMbaRaIJki453t5m8LRMb0jM1dtzY= X-Google-Smtp-Source: AGHT+IGtnXRrMjhzzRV0caLFucBfgjOr7PtrWkTJeCvHRsyO/ZH9DcpMWWGhJ2druMFWhmrbO+CNOw== X-Received: by 2002:a05:651c:11d3:b0:2bc:b75e:b88 with SMTP id z19-20020a05651c11d300b002bcb75e0b88mr23964902ljo.18.1699268979795; Mon, 06 Nov 2023 03:09:39 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Titus Rwantare , Hao Wu , Corey Minyard , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Peter Maydell , Tyrone Ting Subject: [PULL 53/60] hw/sensor: add ADM1266 device model Date: Mon, 6 Nov 2023 12:03:25 +0100 Message-ID: <20231106110336.358-54-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::22c; envelope-from=philmd@linaro.org; helo=mail-lj1-x22c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699271184681100001 From: Titus Rwantare The ADM1266 is a cascadable super sequencer with margin control and fault recording. This commit adds basic support for its PMBus commands and models the identification registers that can be modified in a firmware update. Reviewed-by: Hao Wu Acked-by: Corey Minyard Signed-off-by: Titus Rwantare [PMD: Cover file in MAINTAINERS] Message-ID: <20231023-staging-pmbus-v3-v4-5-07a8cb7cd20a@google.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- MAINTAINERS | 1 + hw/sensor/adm1266.c | 254 ++++++++++++++++++++++++++++++++++++++++++ hw/arm/Kconfig | 1 + hw/sensor/Kconfig | 5 + hw/sensor/meson.build | 1 + 5 files changed, 262 insertions(+) create mode 100644 hw/sensor/adm1266.c diff --git a/MAINTAINERS b/MAINTAINERS index 126cddd285..e6a2f57442 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -859,6 +859,7 @@ M: Hao Wu L: qemu-arm@nongnu.org S: Supported F: hw/*/npcm* +F: hw/sensor/adm1266.c F: include/hw/*/npcm* F: tests/qtest/npcm* F: pc-bios/npcm7xx_bootrom.bin diff --git a/hw/sensor/adm1266.c b/hw/sensor/adm1266.c new file mode 100644 index 0000000000..5ae4f82ba1 --- /dev/null +++ b/hw/sensor/adm1266.c @@ -0,0 +1,254 @@ +/* + * Analog Devices ADM1266 Cascadable Super Sequencer with Margin Control a= nd + * Fault Recording with PMBus + * + * https://www.analog.com/media/en/technical-documentation/data-sheets/adm= 1266.pdf + * + * Copyright 2023 Google LLC + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "hw/i2c/pmbus_device.h" +#include "hw/irq.h" +#include "migration/vmstate.h" +#include "qapi/error.h" +#include "qapi/visitor.h" +#include "qemu/log.h" +#include "qemu/module.h" + +#define TYPE_ADM1266 "adm1266" +OBJECT_DECLARE_SIMPLE_TYPE(ADM1266State, ADM1266) + +#define ADM1266_BLACKBOX_CONFIG 0xD3 +#define ADM1266_PDIO_CONFIG 0xD4 +#define ADM1266_READ_STATE 0xD9 +#define ADM1266_READ_BLACKBOX 0xDE +#define ADM1266_SET_RTC 0xDF +#define ADM1266_GPIO_SYNC_CONFIGURATION 0xE1 +#define ADM1266_BLACKBOX_INFORMATION 0xE6 +#define ADM1266_PDIO_STATUS 0xE9 +#define ADM1266_GPIO_STATUS 0xEA + +/* Defaults */ +#define ADM1266_OPERATION_DEFAULT 0x80 +#define ADM1266_CAPABILITY_DEFAULT 0xA0 +#define ADM1266_CAPABILITY_NO_PEC 0x20 +#define ADM1266_PMBUS_REVISION_DEFAULT 0x22 +#define ADM1266_MFR_ID_DEFAULT "ADI" +#define ADM1266_MFR_ID_DEFAULT_LEN 32 +#define ADM1266_MFR_MODEL_DEFAULT "ADM1266-A1" +#define ADM1266_MFR_MODEL_DEFAULT_LEN 32 +#define ADM1266_MFR_REVISION_DEFAULT "25" +#define ADM1266_MFR_REVISION_DEFAULT_LEN 8 + +#define ADM1266_NUM_PAGES 17 +/** + * PAGE Index + * Page 0 VH1. + * Page 1 VH2. + * Page 2 VH3. + * Page 3 VH4. + * Page 4 VP1. + * Page 5 VP2. + * Page 6 VP3. + * Page 7 VP4. + * Page 8 VP5. + * Page 9 VP6. + * Page 10 VP7. + * Page 11 VP8. + * Page 12 VP9. + * Page 13 VP10. + * Page 14 VP11. + * Page 15 VP12. + * Page 16 VP13. + */ +typedef struct ADM1266State { + PMBusDevice parent; + + char mfr_id[32]; + char mfr_model[32]; + char mfr_rev[8]; +} ADM1266State; + +static const uint8_t adm1266_ic_device_id[] =3D {0x03, 0x41, 0x12, 0x66}; +static const uint8_t adm1266_ic_device_rev[] =3D {0x08, 0x01, 0x08, 0x07, = 0x0, + 0x0, 0x07, 0x41, 0x30}; + +static void adm1266_exit_reset(Object *obj) +{ + ADM1266State *s =3D ADM1266(obj); + PMBusDevice *pmdev =3D PMBUS_DEVICE(obj); + + pmdev->page =3D 0; + pmdev->capability =3D ADM1266_CAPABILITY_NO_PEC; + + for (int i =3D 0; i < ADM1266_NUM_PAGES; i++) { + pmdev->pages[i].operation =3D ADM1266_OPERATION_DEFAULT; + pmdev->pages[i].revision =3D ADM1266_PMBUS_REVISION_DEFAULT; + pmdev->pages[i].vout_mode =3D 0; + pmdev->pages[i].read_vout =3D pmbus_data2linear_mode(12, 0); + pmdev->pages[i].vout_margin_high =3D pmbus_data2linear_mode(15, 0); + pmdev->pages[i].vout_margin_low =3D pmbus_data2linear_mode(3, 0); + pmdev->pages[i].vout_ov_fault_limit =3D pmbus_data2linear_mode(16,= 0); + pmdev->pages[i].revision =3D ADM1266_PMBUS_REVISION_DEFAULT; + } + + strncpy(s->mfr_id, ADM1266_MFR_ID_DEFAULT, 4); + strncpy(s->mfr_model, ADM1266_MFR_MODEL_DEFAULT, 11); + strncpy(s->mfr_rev, ADM1266_MFR_REVISION_DEFAULT, 3); +} + +static uint8_t adm1266_read_byte(PMBusDevice *pmdev) +{ + ADM1266State *s =3D ADM1266(pmdev); + + switch (pmdev->code) { + case PMBUS_MFR_ID: /* R/W block */ + pmbus_send_string(pmdev, s->mfr_id); + break; + + case PMBUS_MFR_MODEL: /* R/W block */ + pmbus_send_string(pmdev, s->mfr_model); + break; + + case PMBUS_MFR_REVISION: /* R/W block */ + pmbus_send_string(pmdev, s->mfr_rev); + break; + + case PMBUS_IC_DEVICE_ID: + pmbus_send(pmdev, adm1266_ic_device_id, sizeof(adm1266_ic_device_i= d)); + break; + + case PMBUS_IC_DEVICE_REV: + pmbus_send(pmdev, adm1266_ic_device_rev, sizeof(adm1266_ic_device_= rev)); + break; + + default: + qemu_log_mask(LOG_UNIMP, + "%s: reading from unimplemented register: 0x%02x\n", + __func__, pmdev->code); + return 0xFF; + } + + return 0; +} + +static int adm1266_write_data(PMBusDevice *pmdev, const uint8_t *buf, + uint8_t len) +{ + ADM1266State *s =3D ADM1266(pmdev); + + switch (pmdev->code) { + case PMBUS_MFR_ID: /* R/W block */ + pmbus_receive_block(pmdev, (uint8_t *)s->mfr_id, sizeof(s->mfr_id)= ); + break; + + case PMBUS_MFR_MODEL: /* R/W block */ + pmbus_receive_block(pmdev, (uint8_t *)s->mfr_model, + sizeof(s->mfr_model)); + break; + + case PMBUS_MFR_REVISION: /* R/W block*/ + pmbus_receive_block(pmdev, (uint8_t *)s->mfr_rev, sizeof(s->mfr_re= v)); + break; + + case ADM1266_SET_RTC: /* do nothing */ + break; + + default: + qemu_log_mask(LOG_UNIMP, + "%s: writing to unimplemented register: 0x%02x\n", + __func__, pmdev->code); + break; + } + return 0; +} + +static void adm1266_get(Object *obj, Visitor *v, const char *name, void *o= paque, + Error **errp) +{ + uint16_t value; + PMBusDevice *pmdev =3D PMBUS_DEVICE(obj); + PMBusVoutMode *mode =3D (PMBusVoutMode *)&pmdev->pages[0].vout_mode; + + if (strcmp(name, "vout") =3D=3D 0) { + value =3D pmbus_linear_mode2data(*(uint16_t *)opaque, mode->exp); + } else { + value =3D *(uint16_t *)opaque; + } + + visit_type_uint16(v, name, &value, errp); +} + +static void adm1266_set(Object *obj, Visitor *v, const char *name, void *o= paque, + Error **errp) +{ + uint16_t *internal =3D opaque; + uint16_t value; + PMBusDevice *pmdev =3D PMBUS_DEVICE(obj); + PMBusVoutMode *mode =3D (PMBusVoutMode *)&pmdev->pages[0].vout_mode; + + if (!visit_type_uint16(v, name, &value, errp)) { + return; + } + + *internal =3D pmbus_data2linear_mode(value, mode->exp); + pmbus_check_limits(pmdev); +} + +static const VMStateDescription vmstate_adm1266 =3D { + .name =3D "ADM1266", + .version_id =3D 0, + .minimum_version_id =3D 0, + .fields =3D (VMStateField[]){ + VMSTATE_PMBUS_DEVICE(parent, ADM1266State), + VMSTATE_END_OF_LIST() + } +}; + +static void adm1266_init(Object *obj) +{ + PMBusDevice *pmdev =3D PMBUS_DEVICE(obj); + uint64_t flags =3D PB_HAS_VOUT_MODE | PB_HAS_VOUT | PB_HAS_VOUT_MARGIN= | + PB_HAS_VOUT_RATING | PB_HAS_STATUS_MFR_SPECIFIC; + + for (int i =3D 0; i < ADM1266_NUM_PAGES; i++) { + pmbus_page_config(pmdev, i, flags); + + object_property_add(obj, "vout[*]", "uint16", + adm1266_get, + adm1266_set, NULL, &pmdev->pages[i].read_vout); + } +} + +static void adm1266_class_init(ObjectClass *klass, void *data) +{ + ResettableClass *rc =3D RESETTABLE_CLASS(klass); + DeviceClass *dc =3D DEVICE_CLASS(klass); + PMBusDeviceClass *k =3D PMBUS_DEVICE_CLASS(klass); + + dc->desc =3D "Analog Devices ADM1266 Hot Swap controller"; + dc->vmsd =3D &vmstate_adm1266; + k->write_data =3D adm1266_write_data; + k->receive_byte =3D adm1266_read_byte; + k->device_num_pages =3D 17; + + rc->phases.exit =3D adm1266_exit_reset; +} + +static const TypeInfo adm1266_info =3D { + .name =3D TYPE_ADM1266, + .parent =3D TYPE_PMBUS_DEVICE, + .instance_size =3D sizeof(ADM1266State), + .instance_init =3D adm1266_init, + .class_init =3D adm1266_class_init, +}; + +static void adm1266_register_types(void) +{ + type_register_static(&adm1266_info); +} + +type_init(adm1266_register_types) diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index e35007ed41..0f22aee24b 100644 --- a/hw/arm/Kconfig +++ b/hw/arm/Kconfig @@ -489,6 +489,7 @@ config NPCM7XX default y depends on TCG && ARM select A9MPCORE + select ADM1266 select ADM1272 select ARM_GIC select SMBUS diff --git a/hw/sensor/Kconfig b/hw/sensor/Kconfig index e03bd09b50..bc6331b4ab 100644 --- a/hw/sensor/Kconfig +++ b/hw/sensor/Kconfig @@ -22,6 +22,11 @@ config ADM1272 bool depends on I2C =20 +config ADM1266 + bool + depends on PMBUS + default y if PMBUS + config MAX34451 bool depends on I2C diff --git a/hw/sensor/meson.build b/hw/sensor/meson.build index 30e20e27b8..420fdc3359 100644 --- a/hw/sensor/meson.build +++ b/hw/sensor/meson.build @@ -2,6 +2,7 @@ system_ss.add(when: 'CONFIG_TMP105', if_true: files('tmp105= .c')) system_ss.add(when: 'CONFIG_TMP421', if_true: files('tmp421.c')) system_ss.add(when: 'CONFIG_DPS310', if_true: files('dps310.c')) system_ss.add(when: 'CONFIG_EMC141X', if_true: files('emc141x.c')) +system_ss.add(when: 'CONFIG_ADM1266', if_true: files('adm1266.c')) system_ss.add(when: 'CONFIG_ADM1272', if_true: files('adm1272.c')) system_ss.add(when: 'CONFIG_MAX34451', if_true: files('max34451.c')) system_ss.add(when: 'CONFIG_LSM303DLHC_MAG', if_true: files('lsm303dlhc_ma= g.c')) --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699269260; cv=none; d=zohomail.com; s=zohoarc; b=PGiY1lCkdo8yMUhaTCOPn7vGIa2rc/DiCwhZXljWGwK1QTx3Io5elBL1vc6CXSf5bqr954Qbi6Db0g3+H6ZX1JFrQsEhOTAvnICnbWnzBc8gRYmEO86kt41s05+GUBGrJvxz1N30be2ew2FXlpK4pPTm74TvpIii/PXymPC0O5E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699269260; 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=41ppFX+7R6F7tVGh9dGaG+2Fh2vMVrU15YTc5GYKvbI=; b=CxxtEbhitA78b4l5aMl74Hjekonr1VSBoemcI00nRT1o5p3TQ1n94bKfFkhSppIyOZaBoqi4AQO+BqUCDcW1Q4UlbDHXxmiNOl3/sS6/N24JAlxm+KHox/jleUrX1rRH3euq5NfY2buI4gJvQlG7XvMvmxvX39SkMyy87EetoE0= 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 1699269260551352.7110257664076; Mon, 6 Nov 2023 03:14:20 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxUT-0002UL-Bn; Mon, 06 Nov 2023 06:09:57 -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 1qzxUN-0002Ah-Hp for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:09:51 -0500 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxUK-0005dN-AY for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:09:51 -0500 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2c6b48cb2b6so61154961fa.2 for ; Mon, 06 Nov 2023 03:09:47 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id l4-20020adfa384000000b0032d2489a399sm9245951wrb.49.2023.11.06.03.09.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:09:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268986; x=1699873786; 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=41ppFX+7R6F7tVGh9dGaG+2Fh2vMVrU15YTc5GYKvbI=; b=SyOnp2tZpsddipCQlZ8zG9BViO2b4Tm/7JtvFdWmxXAl2yjQ9ncLVdB44wpReCpj3k Or6Lxzjlk5vyVwpPLOMYXDCO/Xct39NCycAtNOTJg5CXI5iRMX3wDK0iKiBBihE7Nj7U nf4qoycCrD26gg1rWFIdJvPwvC+so8rgKGoRgxXfAk8bOyIWi6vbOwbiw5e4z/mVpWSa qCdTnzxkd1JpDYDZegppF9oxKTpGAQp29Gx7Oezbix1zOmn7DVcZEc3jkT5svGkDWh91 eBn0PR7t0S6SMsOs3hHUQGm68YYAZVLjly0RYQIrj6xDPJFX78frBWX4WBrBdCdHd8ag WJwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268986; x=1699873786; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=41ppFX+7R6F7tVGh9dGaG+2Fh2vMVrU15YTc5GYKvbI=; b=hfjc/jlaOb9UEgoEvKyNDCEcYoJ0fTKncOp8PHe1PgPHVUleWdzSNjIbFK4tQYktzW lON8q4qGD+vD7Hc4mX+LOMZDCR8xx9xYebPo/vm1F7UJ11Fg2LIYBWezTxgncJqQBCCT 6hdOcOhQe437iGItqgYGXIz/ufYlRnZY6C11yP9oooTi/bksmZaQ+YL9iYfsGxHh8Jk/ rARwlPXF4LgYd6zGS90j8riHRD3FAaiNJfHggIyxxTBtdKL/QxcTycAlPDHps9GkisKA H2/Z8oI8f1ufS1wuf4+NdyZNqfVLI9H2c0JTgXUu7zROUQA9DZSsN7Da2yTc5tbZcZBa vCkQ== X-Gm-Message-State: AOJu0YxwLorSeiGDb3Ll7SrwkiMi8qf6zusUDIy/uAzwLn/6QS9YLlpx cShIxi4agfjAn/sa0cq5IgMnbQK9aXUUhmEyH9g= X-Google-Smtp-Source: AGHT+IGDxDJzV8LF3nVlPJCOzZ9JzcZJLsFS8T/4TpQBPgzwCOrVVhFIKHp0AK1loMGLRLjuvYWbMg== X-Received: by 2002:a05:651c:3dc:b0:2c5:14d3:f295 with SMTP id f28-20020a05651c03dc00b002c514d3f295mr19960731ljp.35.1699268986606; Mon, 06 Nov 2023 03:09:46 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Titus Rwantare , Hao Wu , Corey Minyard , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Tyrone Ting , Thomas Huth , Laurent Vivier , Paolo Bonzini Subject: [PULL 54/60] tests/qtest: add tests for ADM1266 Date: Mon, 6 Nov 2023 12:03:26 +0100 Message-ID: <20231106110336.358-55-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::22b; envelope-from=philmd@linaro.org; helo=mail-lj1-x22b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699269261577100007 From: Titus Rwantare The ADM1266 can have string fields written by the driver, so it's worth specifically testing. Reviewed-by: Hao Wu Acked-by: Corey Minyard Signed-off-by: Titus Rwantare [PMD: Cover file in MAINTAINERS] Message-ID: <20231023-staging-pmbus-v3-v4-6-07a8cb7cd20a@google.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- MAINTAINERS | 1 + tests/qtest/adm1266-test.c | 122 +++++++++++++++++++++++++++++++++++++ tests/qtest/meson.build | 1 + 3 files changed, 124 insertions(+) create mode 100644 tests/qtest/adm1266-test.c diff --git a/MAINTAINERS b/MAINTAINERS index e6a2f57442..c01c2e6ec0 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -862,6 +862,7 @@ F: hw/*/npcm* F: hw/sensor/adm1266.c F: include/hw/*/npcm* F: tests/qtest/npcm* +F: tests/qtest/adm1266-test.c F: pc-bios/npcm7xx_bootrom.bin F: roms/vbootrom F: docs/system/arm/nuvoton.rst diff --git a/tests/qtest/adm1266-test.c b/tests/qtest/adm1266-test.c new file mode 100644 index 0000000000..6c312c499f --- /dev/null +++ b/tests/qtest/adm1266-test.c @@ -0,0 +1,122 @@ +/* + * Analog Devices ADM1266 Cascadable Super Sequencer with Margin Control a= nd + * Fault Recording with PMBus + * + * Copyright 2022 Google LLC + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include +#include "hw/i2c/pmbus_device.h" +#include "libqtest-single.h" +#include "libqos/qgraph.h" +#include "libqos/i2c.h" +#include "qapi/qmp/qdict.h" +#include "qapi/qmp/qnum.h" +#include "qemu/bitops.h" + +#define TEST_ID "adm1266-test" +#define TEST_ADDR (0x12) + +#define ADM1266_BLACKBOX_CONFIG 0xD3 +#define ADM1266_PDIO_CONFIG 0xD4 +#define ADM1266_READ_STATE 0xD9 +#define ADM1266_READ_BLACKBOX 0xDE +#define ADM1266_SET_RTC 0xDF +#define ADM1266_GPIO_SYNC_CONFIGURATION 0xE1 +#define ADM1266_BLACKBOX_INFORMATION 0xE6 +#define ADM1266_PDIO_STATUS 0xE9 +#define ADM1266_GPIO_STATUS 0xEA + +/* Defaults */ +#define ADM1266_OPERATION_DEFAULT 0x80 +#define ADM1266_CAPABILITY_DEFAULT 0xA0 +#define ADM1266_CAPABILITY_NO_PEC 0x20 +#define ADM1266_PMBUS_REVISION_DEFAULT 0x22 +#define ADM1266_MFR_ID_DEFAULT "ADI" +#define ADM1266_MFR_ID_DEFAULT_LEN 32 +#define ADM1266_MFR_MODEL_DEFAULT "ADM1266-A1" +#define ADM1266_MFR_MODEL_DEFAULT_LEN 32 +#define ADM1266_MFR_REVISION_DEFAULT "25" +#define ADM1266_MFR_REVISION_DEFAULT_LEN 8 +#define TEST_STRING_A "a sample" +#define TEST_STRING_B "b sample" +#define TEST_STRING_C "rev c" + +static void compare_string(QI2CDevice *i2cdev, uint8_t reg, + const char *test_str) +{ + uint8_t len =3D i2c_get8(i2cdev, reg); + char i2c_str[SMBUS_DATA_MAX_LEN] =3D {0}; + + i2c_read_block(i2cdev, reg, (uint8_t *)i2c_str, len); + g_assert_cmpstr(i2c_str, =3D=3D, test_str); +} + +static void write_and_compare_string(QI2CDevice *i2cdev, uint8_t reg, + const char *test_str, uint8_t len) +{ + char buf[SMBUS_DATA_MAX_LEN] =3D {0}; + buf[0] =3D len; + strncpy(buf + 1, test_str, len); + i2c_write_block(i2cdev, reg, (uint8_t *)buf, len + 1); + compare_string(i2cdev, reg, test_str); +} + +static void test_defaults(void *obj, void *data, QGuestAllocator *alloc) +{ + uint16_t i2c_value; + QI2CDevice *i2cdev =3D (QI2CDevice *)obj; + + i2c_value =3D i2c_get8(i2cdev, PMBUS_OPERATION); + g_assert_cmphex(i2c_value, =3D=3D, ADM1266_OPERATION_DEFAULT); + + i2c_value =3D i2c_get8(i2cdev, PMBUS_REVISION); + g_assert_cmphex(i2c_value, =3D=3D, ADM1266_PMBUS_REVISION_DEFAULT); + + compare_string(i2cdev, PMBUS_MFR_ID, ADM1266_MFR_ID_DEFAULT); + compare_string(i2cdev, PMBUS_MFR_MODEL, ADM1266_MFR_MODEL_DEFAULT); + compare_string(i2cdev, PMBUS_MFR_REVISION, ADM1266_MFR_REVISION_DEFAUL= T); +} + +/* test r/w registers */ +static void test_rw_regs(void *obj, void *data, QGuestAllocator *alloc) +{ + QI2CDevice *i2cdev =3D (QI2CDevice *)obj; + + /* empty strings */ + i2c_set8(i2cdev, PMBUS_MFR_ID, 0); + compare_string(i2cdev, PMBUS_MFR_ID, ""); + + i2c_set8(i2cdev, PMBUS_MFR_MODEL, 0); + compare_string(i2cdev, PMBUS_MFR_MODEL, ""); + + i2c_set8(i2cdev, PMBUS_MFR_REVISION, 0); + compare_string(i2cdev, PMBUS_MFR_REVISION, ""); + + /* test strings */ + write_and_compare_string(i2cdev, PMBUS_MFR_ID, TEST_STRING_A, + sizeof(TEST_STRING_A)); + write_and_compare_string(i2cdev, PMBUS_MFR_ID, TEST_STRING_B, + sizeof(TEST_STRING_B)); + write_and_compare_string(i2cdev, PMBUS_MFR_ID, TEST_STRING_C, + sizeof(TEST_STRING_C)); +} + +static void adm1266_register_nodes(void) +{ + QOSGraphEdgeOptions opts =3D { + .extra_device_opts =3D "id=3D" TEST_ID ",address=3D0x12" + }; + add_qi2c_address(&opts, &(QI2CAddress) { TEST_ADDR }); + + qos_node_create_driver("adm1266", i2c_device_create); + qos_node_consumes("adm1266", "i2c-bus", &opts); + + qos_add_test("test_defaults", "adm1266", test_defaults, NULL); + qos_add_test("test_rw_regs", "adm1266", test_rw_regs, NULL); +} + +libqos_init(adm1266_register_nodes); diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index c9945e69b1..47dabf91d0 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -241,6 +241,7 @@ qos_test_ss =3D ss.source_set() qos_test_ss.add( 'ac97-test.c', 'adm1272-test.c', + 'adm1266-test.c', 'ds1338-test.c', 'e1000-test.c', 'eepro100-test.c', --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699269447; cv=none; d=zohomail.com; s=zohoarc; b=M1X8ao98rbTJOUDsA0QmjB/9M4YBjcPcY6LTZeKURLXiN1Y5uy30vnzdr4WnKqrc2u5ozvCayArX1TOpRv6YveIOpbbpZmgym8NokTr83GFJ4TdZjMxQdMIdz0WdRi0ZFC6p531dU7WQZi7UO52kCvRoq9xplD+ckHmchB5WHvM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699269447; 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=/UYA9fxIVAJDV/ugwhxZLfTB1YL01/OCPxws1OIhgNw=; b=bnw9sI+3xH+adB4TklSBTHIX359EKhHGHafghCVgFeiwxbzVq7auEY48sJ1dmZWdmmO0lcMnGs7azqHdzxCC+DHxdxHcxTP5CfTAA5fqKm1vt3dFEOmrBbtssh/OZfr/MTF27XkgB4JyAMxyNp2yykEJ85CsSnM21j2ZqM7ENfg= 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 1699269446871956.5665987659822; Mon, 6 Nov 2023 03:17:26 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxUw-000361-Ee; Mon, 06 Nov 2023 06:10:26 -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 1qzxUU-0002Xt-Cd for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:10:03 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxUQ-0005gL-Fy for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:09:58 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-40891d38e3fso30646515e9.1 for ; Mon, 06 Nov 2023 03:09:53 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id f18-20020a5d58f2000000b0032da4c98ab2sm9102932wrd.35.2023.11.06.03.09.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:09:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268993; x=1699873793; 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=/UYA9fxIVAJDV/ugwhxZLfTB1YL01/OCPxws1OIhgNw=; b=twhGE9uHJIOhRvFOenLm90pUF25nxRVTWx0JYDpC+/N8YiAOkdiwraE6+tgn+rYhOE coOC2fFY2iqRogMJcZhYSjiMCWA8M83HXCY92NV/p3e6nLzUuMAuimPw4xsTJzfVzUBO MOsHlH6/QcMqPwAl1pMCvYeGP+7wEGDLaYQSV7Al6owAtRxM1sRVh55//r0qpJ+7A05F qFs4KrMlq5gWxF7YGTxFlGXcrsLKaMOnPdXRB9LwHrE3ZMpDY3jbo0zugd2r7NzvtmHB 9tmCTjrUai7KJQQZL345MrzfOt6YSrx0BTlP3gbDNBjDtoApEV0qTbKrCBlgQLcapnD1 ZKWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268993; x=1699873793; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/UYA9fxIVAJDV/ugwhxZLfTB1YL01/OCPxws1OIhgNw=; b=OKgJCwh0cs9EqGA7IYuNTAteFhAM1mhpxpdcvZPsDrXA/vB5OQi6BUaFPe8xYG+tFt YRAfNYNBi6eLtd+99TZwr3oxCgLlkkt5gMkj1OlKtUKZFBnHKwe69Uv9XSObjK0DE0zX wx2zcGwBYdyexsP7k08nnwm5m18hQ2x/ii0v/YlMWeBQF8mYvlzVLa9BI98O2PmfJdr2 ldqToHMLg/MZMDRIXrm0zk7dC4En7i0ZPX275Y6lIm3vsUDRwAGmcU4tCL1AHCn9ZaYu RIOxKi1O5aGW89tbUcnLZIkRnQujD+4OVnynfYzcyNtgbrmxhSB/zrZOkG28tBuhuT5f 4Hhg== X-Gm-Message-State: AOJu0YzDhy8TtJ67KWFkHCKxdL9481GgEzhxxkXrqOlzkHRkcjEm9sRE Q+qw+KBWN6hS0xzsLU2lSRp6HbcbVxNBH18DhVA= X-Google-Smtp-Source: AGHT+IEJYwaQv9zhCAnw87q6XL1cNQIMVWd4njIJAfgg35jyjWT0oa+xJ0fh+sg8SmmssH1mUhxHcw== X-Received: by 2002:a05:6000:4021:b0:32d:b991:1a71 with SMTP id cp33-20020a056000402100b0032db9911a71mr27821328wrb.0.1699268992895; Mon, 06 Nov 2023 03:09:52 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Titus Rwantare , Patrick Venture , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 55/60] hw/i2c: pmbus: immediately clear faults on request Date: Mon, 6 Nov 2023 12:03:27 +0100 Message-ID: <20231106110336.358-56-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699269448374100001 From: Titus Rwantare The probing process of the generic pmbus driver generates faults to determine if functions are available. These faults were not always cleared resulting in probe failures. Reviewed-by: Patrick Venture Signed-off-by: Titus Rwantare Message-ID: <20231023-staging-pmbus-v3-v4-7-07a8cb7cd20a@google.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/i2c/pmbus_device.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/i2c/pmbus_device.c b/hw/i2c/pmbus_device.c index 3bce39e84e..481e158380 100644 --- a/hw/i2c/pmbus_device.c +++ b/hw/i2c/pmbus_device.c @@ -1244,6 +1244,11 @@ static int pmbus_write_data(SMBusDevice *smd, uint8_= t *buf, uint8_t len) pmdev->in_buf =3D buf; =20 pmdev->code =3D buf[0]; /* PMBus command code */ + + if (pmdev->code =3D=3D PMBUS_CLEAR_FAULTS) { + pmbus_clear_faults(pmdev); + } + if (len =3D=3D 1) { /* Single length writes are command codes only */ return 0; } --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699270396; cv=none; d=zohomail.com; s=zohoarc; b=FFHteA2PqJ0+U7U1FDuIb97VDV6DXKaR4E3rWzVUmXFt4YW+T7NR9OvpFv8dZ8RPTXsMeOYE3v1/bC+cNrJK+WD06AZQad6Z0YjOakQ8I83pTzHlSD8f1427J5QkpsLlgoRkOOsq1NRQKihlDQtLoh9SlkTYgRQkOukbOggn/VE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699270396; 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=MGUqOvUDBSiuVjcJL6HNGd3FosLBI9RMurHd3wgpnc0=; b=Ljb2pPqRga9OrMdMafAdSlhQKId8KiXXnxKuZt4IWoD3wSXUH0QFXQ7OBO9HSQEzHKsJ093ws49YOB/tBqVHWcR1IAiImujtFrCJELbXGiAl2+h/93eN4XgFJXZiYiOQ3/y+3/uapQT0dBcvTkW5s88fdh5S3xQVAMz+Ffgl4zg= 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 1699270396245942.1074767572408; Mon, 6 Nov 2023 03:33:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxV4-0003Da-M0; Mon, 06 Nov 2023 06:10:37 -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 1qzxUc-0002cK-82 for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:10:12 -0500 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxUX-0005iJ-IL for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:10:05 -0500 Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2c6ef6c1ec2so52817151fa.2 for ; Mon, 06 Nov 2023 03:10:00 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id f13-20020a05600c4e8d00b0040596352951sm11684422wmq.5.2023.11.06.03.09.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:09:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268999; x=1699873799; 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=MGUqOvUDBSiuVjcJL6HNGd3FosLBI9RMurHd3wgpnc0=; b=UM/kvCtl5sMb4dU0M0RhM3utLMRVEe44EiQluYmQMRPIJBIeygRHNutW6Axx9RFStf cOyoDiv5mpOZkVW8tQPFhsSoWecJTow03yjIwqaFQ3O41yKBfeWUREylR/kS+wQN2yq9 +UxEuRaRfjekMwmL3YrlkcVnKrOLR+44bAKBi0+W1QZK/uW4ErfSnHP1GvipmlA5U3w2 cf16waTBJyWbLLxRh4GPe8aVWOmInEtyrHdG+9sga/3aIvhTbYHiVM37z8b/dwyeF6T/ vStH1506Pa/tISHjccY+kunBexR+BH+psTEpKMElTFXUi+kRMykgP7KXd1kxVFEd/yjn pjNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268999; x=1699873799; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MGUqOvUDBSiuVjcJL6HNGd3FosLBI9RMurHd3wgpnc0=; b=SwmtC7TXY7ckmmnTcIEjQ6Gz7YRgR5fOFIsufBR6v7yVmjMgURyxKVfc/8lCZZkkvp x6Qq84h8m+ZUDx03M02vC3Al2fRsTKiifEqLrM1UkFNA3cNPzHkkE68Vmzm5lIFWfPUO GjtILRbkpAdu2FF14dXjxuEnlu0WViHhXX1OrXdiJpA9Hhz8yql31qEgQ0++B5BJwFMd XAMVnVAoDSa00zPCfA898J0JpF3OqTtmqHHXj8kTTBMC4FOwB2Uga5asTKgYbuXTmOHo HBnsumDwIoiPAW3I6X0qTu9OEeNdqxDg1JkyWVFXy2irBk6TcrVVg6b8Kd6LJJqD76kp TV6w== X-Gm-Message-State: AOJu0Yxvcbqd//3hp7/lPSYBChdQlSmBh64GKpgdRe7x4ARyRNW1D1jv eEsup1IZ0NND8/Ad6cYd+kVqVoEwgSjW9Uxnvw8= X-Google-Smtp-Source: AGHT+IFzu+WNTNvikEhT3RfrTXgUYqfUsIePLUoFbNzyRmjcJbd74z4iaBvydg4KqQIGnFcZE2qYAg== X-Received: by 2002:a2e:8719:0:b0:2c5:1075:5ec9 with SMTP id m25-20020a2e8719000000b002c510755ec9mr21956567lji.13.1699268999654; Mon, 06 Nov 2023 03:09:59 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Titus Rwantare , Hao Wu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Laurent Vivier , Paolo Bonzini Subject: [PULL 56/60] hw/i2c: pmbus: reset page register for out of range reads Date: Mon, 6 Nov 2023 12:03:28 +0100 Message-ID: <20231106110336.358-57-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::232; envelope-from=philmd@linaro.org; helo=mail-lj1-x232.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699270397934100001 From: Titus Rwantare The linux pmbus driver scans all possible pages and does not reset the current page after the scan, making all future page reads fail as out of ra= nge on devices with a single page. This change resets out of range pages immediately on write. Also added a qtest for simultaneous writes to all pages. Reviewed-by: Hao Wu Signed-off-by: Titus Rwantare Message-ID: <20231023-staging-pmbus-v3-v4-8-07a8cb7cd20a@google.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/i2c/pmbus_device.c | 18 +++++++++--------- tests/qtest/max34451-test.c | 24 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/hw/i2c/pmbus_device.c b/hw/i2c/pmbus_device.c index 481e158380..1b978e588f 100644 --- a/hw/i2c/pmbus_device.c +++ b/hw/i2c/pmbus_device.c @@ -1255,6 +1255,15 @@ static int pmbus_write_data(SMBusDevice *smd, uint8_= t *buf, uint8_t len) =20 if (pmdev->code =3D=3D PMBUS_PAGE) { pmdev->page =3D pmbus_receive8(pmdev); + + if (pmdev->page > pmdev->num_pages - 1 && pmdev->page !=3D PB_ALL_= PAGES) { + qemu_log_mask(LOG_GUEST_ERROR, + "%s: page %u is out of range\n", + __func__, pmdev->page); + pmdev->page =3D 0; /* undefined behaviour - reset to page 0 */ + pmbus_cml_error(pmdev); + return PMBUS_ERR_BYTE; + } return 0; } =20 @@ -1268,15 +1277,6 @@ static int pmbus_write_data(SMBusDevice *smd, uint8_= t *buf, uint8_t len) return 0; } =20 - if (pmdev->page > pmdev->num_pages - 1) { - qemu_log_mask(LOG_GUEST_ERROR, - "%s: page %u is out of range\n", - __func__, pmdev->page); - pmdev->page =3D 0; /* undefined behaviour - reset to page 0 */ - pmbus_cml_error(pmdev); - return PMBUS_ERR_BYTE; - } - index =3D pmdev->page; =20 switch (pmdev->code) { diff --git a/tests/qtest/max34451-test.c b/tests/qtest/max34451-test.c index 0c98d0764c..dbf6ddc829 100644 --- a/tests/qtest/max34451-test.c +++ b/tests/qtest/max34451-test.c @@ -18,6 +18,7 @@ #define TEST_ID "max34451-test" #define TEST_ADDR (0x4e) =20 +#define MAX34451_MFR_MODE 0xD1 #define MAX34451_MFR_VOUT_PEAK 0xD4 #define MAX34451_MFR_IOUT_PEAK 0xD5 #define MAX34451_MFR_TEMPERATURE_PEAK 0xD6 @@ -315,6 +316,28 @@ static void test_ot_faults(void *obj, void *data, QGue= stAllocator *alloc) } } =20 +#define RAND_ON_OFF_CONFIG 0x12 +#define RAND_MFR_MODE 0x3456 + +/* test writes to all pages */ +static void test_all_pages(void *obj, void *data, QGuestAllocator *alloc) +{ + uint16_t i2c_value; + QI2CDevice *i2cdev =3D (QI2CDevice *)obj; + + i2c_set8(i2cdev, PMBUS_PAGE, PB_ALL_PAGES); + i2c_set8(i2cdev, PMBUS_ON_OFF_CONFIG, RAND_ON_OFF_CONFIG); + max34451_i2c_set16(i2cdev, MAX34451_MFR_MODE, RAND_MFR_MODE); + + for (int i =3D 0; i < MAX34451_NUM_TEMP_DEVICES + MAX34451_NUM_PWR_DEV= ICES; + i++) { + i2c_value =3D i2c_get8(i2cdev, PMBUS_ON_OFF_CONFIG); + g_assert_cmphex(i2c_value, =3D=3D, RAND_ON_OFF_CONFIG); + i2c_value =3D max34451_i2c_get16(i2cdev, MAX34451_MFR_MODE); + g_assert_cmphex(i2c_value, =3D=3D, RAND_MFR_MODE); + } +} + static void max34451_register_nodes(void) { QOSGraphEdgeOptions opts =3D { @@ -332,5 +355,6 @@ static void max34451_register_nodes(void) qos_add_test("test_ro_regs", "max34451", test_ro_regs, NULL); qos_add_test("test_ov_faults", "max34451", test_ov_faults, NULL); qos_add_test("test_ot_faults", "max34451", test_ot_faults, NULL); + qos_add_test("test_all_pages", "max34451", test_all_pages, NULL); } libqos_init(max34451_register_nodes); --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699269757; cv=none; d=zohomail.com; s=zohoarc; b=KipCnkLQgh/QtA1m9Htdqo7tOjwXPFjrZ452ON6D+SiaGi1v6NXukf6G1ahSLtBwXPmFNxSOH4z/koWyttgXS79mqS1cN+1AgphqtEDVRqNoPQzBn7812HI1zXBjQQn8dAPtNLdhdzVbUlEhHgM2LLKvkHQhCXzW1kOMjisPS4Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699269757; 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=Ut7p2F8ycBCH0WfVrPlQ2F/inhGj3Q9WVzKOY6zxb1o=; b=N+CyrkVBpT2K+A9krRbILZH6kiFRjEnyUm2rLbmy9n9YXHC8ljYukZptDclLVkIs36r7ZDxeaqUaKa6jv7P7kPRyJKGWtNeUOPUTXq+reZFzlGQZ1haZjHbPLU/NB5DxPKf3rjeexnHGlO+iGKOrr5oWr2R73xj6LvD3J1Qw9A0= 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 1699269757520858.0570138684462; Mon, 6 Nov 2023 03:22:37 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxVG-0003mE-63; Mon, 06 Nov 2023 06:10:46 -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 1qzxUi-0002dz-AI for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:10:17 -0500 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxUe-0005vP-S1 for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:10:11 -0500 Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-507c78d258fso5608150e87.2 for ; Mon, 06 Nov 2023 03:10:07 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id l9-20020adfe589000000b0032f7d7ec4adsm9119404wrm.92.2023.11.06.03.10.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:10:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699269006; x=1699873806; 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=Ut7p2F8ycBCH0WfVrPlQ2F/inhGj3Q9WVzKOY6zxb1o=; b=dZiqZ6SuCWJhRp09kzqGFqJ9zpa1LI1jj7bXZsewcO+Xf1YVLsAPUQz5h6ZPjBLmU7 IPYaodMFu/QrDrvIHxaHme7IRucrgm8ZM108cx4uUawG6445kiU3v9t6obBpkzhpsgdZ q1JWjJOfGccPz0obOS7uMCRX3WIPpiyDCKFfQot17sfm76CHI/co96rgdZvu9fXoZ9Vq kzjk0CwugvWFnRl+EG8ghlS2S4a2fkGpcy2ZKrbo/2Oa//Rnv03xZi+IlM9nH+6dc/03 /K1WEjn/aWiVc7jkhWrjfJFxFKhPGrB70gMhpqDiQQcfzPvOrt3G91Pfargd8iuOKMq1 qSlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699269006; x=1699873806; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ut7p2F8ycBCH0WfVrPlQ2F/inhGj3Q9WVzKOY6zxb1o=; b=WN4ljqyO6hzIhlUYu/i6IImQqNdTEnVEcQw+bUrs0+GDCWg7bpChlihCO2py9xFH8W BEqSWJMkmbxy1igOPxQi7Rlrj9CUskeF0lGWVx/OE7vJXmrm8Pov9fVHZAbRfjs9mDLW /Bs529PFC6mSRvglEf2/Ibc6uFEpff0brAp15PlnMZzCs7ZxARYsyFudimw1AvEoHV6g HXY9cPy3h/TZhwR+LDVX1qKwm6OscZzeT9nZOLR52/dthmzypQWtVlr/gIadJzGDbNEM BuA7AMv+hZvXdVlYbXBCgo/ifWGKmST1LED0m/Oi72h9KI+wXmvbYJ1yIvJGk5IXgb1U uGKA== X-Gm-Message-State: AOJu0YzHzj1pR9AEtguvBVHIkRkq7Kiv1OGu9Rbv7036GenK2mMvsiQK VM/ChMQsAUsEp8dgcg+BvCWine/BVmRzYDi4Fjo= X-Google-Smtp-Source: AGHT+IFV61WUgaftWSmxlAIXL8iGaW0THkIGj/tNK5wYBo9dUSgSqDELMeQc5HMjnGPaXiCVpA73WA== X-Received: by 2002:a05:6512:1599:b0:508:1470:6168 with SMTP id bp25-20020a056512159900b0050814706168mr25813290lfb.57.1699269006155; Mon, 06 Nov 2023 03:10:06 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yoshinori Sato Subject: [PULL 57/60] MAINTAINERS: Add include/hw/timer/tmu012.h to the SH4 R2D section Date: Mon, 6 Nov 2023 12:03:29 +0100 Message-ID: <20231106110336.358-58-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::131; envelope-from=philmd@linaro.org; helo=mail-lf1-x131.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699269758571100009 From: Thomas Huth tmu012.h is the header that belongs to hw/timer/sh_timer.c, so we should list it in the same section as sh_timer.c. Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Yoshinori Sato Message-ID: <20231026080011.156325-1-thuth@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index c01c2e6ec0..3014e768f7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1617,6 +1617,7 @@ F: hw/intc/sh_intc.c F: hw/pci-host/sh_pci.c F: hw/timer/sh_timer.c F: include/hw/sh4/sh_intc.h +F: include/hw/timer/tmu012.h =20 Shix R: Yoshinori Sato --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699270318; cv=none; d=zohomail.com; s=zohoarc; b=YWCnzAGBRsil/BbpDlkBNPJ1jvX0HZZe2akoroKcKS76F6TFAERrutVrrUvj63UB/hrH8D26O9AOgcgd/DdTlS68frNVr5+RjwTcUIQuMd0h0SKIBgJnwfAD+M7Ohs0oD/RqNc3oxNsjpNxw0tTT/Jxb4CPQ8b/REbPFJwGFjKs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699270318; 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=cyEPFd8qKgVauKHH+mzQW+99WSkPGmQyoZYgi3VA9Vc=; b=Qfawpz2fIVSmrg1SgW5rSmw+lrfrZLLc6bQyFObieh6MUEkW+MpcdrdiccnbkPMwi1IV/gyQ68sy1XXCBWYVQC2Sa2vDIdCqKE/D92Exaico7VhuClp+igBYwLZa8dp3v25OEoRsmbI/lYNpSicTATDRSOK0Ofd7qz7odRDq0uE= 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 1699270318090245.94621902904555; Mon, 6 Nov 2023 03:31:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxVH-0003rL-5X; Mon, 06 Nov 2023 06:10:47 -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 1qzxUo-0002i4-8Q for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:10:19 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxUl-0005y2-At for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:10:17 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-32f9268bf8cso2605756f8f.0 for ; Mon, 06 Nov 2023 03:10:13 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id j5-20020adfe505000000b0031fd849e797sm8761303wrm.105.2023.11.06.03.10.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:10:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699269012; x=1699873812; 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=cyEPFd8qKgVauKHH+mzQW+99WSkPGmQyoZYgi3VA9Vc=; b=IyR6jb3K6mdeddZTNYaXFflbf55TmXSJ5Yf9iGwHR+1vSDv2ChfTX7IITAdBOQkCfe wJvDm83oquqMkyeWaV0bXKU+44X+8YdcLk65fVK4qG4+7urbTLF8JxcJJw8DE8S1JbgL 4Hf1dvvFUidty3H/jaslKQXCq/wErslU7c70YQkIqGCRh55zHXbq/Sz2A/5cgBkcAbVX l6Cl+L1ez9Yw46iBGF2HSeqXQ+do7XomwITU8y+dUeSx8BRbObTyJRBIEprgivtyXZ0h Bj2TjH6yitecC1jnaNCIwS+4j0kd5PlCMI357M0n1fl5wgyaMTJ5GnI7QyKeBrchTnXq QHcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699269012; x=1699873812; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cyEPFd8qKgVauKHH+mzQW+99WSkPGmQyoZYgi3VA9Vc=; b=NF5jyjJ4tjK7uhsHp/dJQJ4i8RWVLeWJ8I2BEYItOxkX9HJab5kG+ZPqdVwxMyJbrO xWWUO4d+r0Vt1OiMkRK/dNTDyKQfqcoI1jvwtS8+x4I9vXK9VYsbfq1Bq3PcAhXkPPcL mN2dtFtRYEVmrF+ag9pKQd4bf6Raf5Aow5zlsCMbyYvlp7bfT1/CGnprDfWgj2+yWEgM zWT+5O44f0ie4mn0pHLLQD3LiHmtL5yHqbG+w1WvqMuaKTkueaNlPcnrwCH1OPF9ojuh ENTnIOyLVXdpHP9sUzthSM6Ep92wMUECGjEtH9ZJMujbBfJJWjCEMjoASAyzBj3+dcr6 jT4Q== X-Gm-Message-State: AOJu0YxE1U3BFYvySpjApXy/fi863Qpf9jJ8ShSsdotTGY6nub/yzIsS uJn+MT81cuuIFmhSLBOTlZhETnXXNBpV9RI10T4= X-Google-Smtp-Source: AGHT+IEMIDW7hBBkWZ0URkD2CfnnnPG/ExOR7Okjzu2uwpb1mtEO/NwWscUpM9JIRDLHPNQlRwIx/g== X-Received: by 2002:a05:6000:1842:b0:32f:7b2e:2dd with SMTP id c2-20020a056000184200b0032f7b2e02ddmr23663996wri.45.1699269012416; Mon, 06 Nov 2023 03:10:12 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Thomas Huth , Vikram Garhwal , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pavel Pisa Subject: [PULL 58/60] MAINTAINERS: Add the CAN documentation file to the CAN section Date: Mon, 6 Nov 2023 12:03:30 +0100 Message-ID: <20231106110336.358-59-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699270319634100005 From: Thomas Huth Add can.rst to the corresponding section in MAINTAINERS, so that the maintainers get CC:-ed on corresponding patches. Signed-off-by: Thomas Huth Reviewed-by: Vikram Garhwal Reviewed-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Pavel Pisa Message-ID: <20231027060931.242491-1-thuth@redhat.com> [PMD: Fixed typo in subject] Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 3014e768f7..c57868c94c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2588,6 +2588,7 @@ W: https://canbus.pages.fel.cvut.cz/ F: net/can/* F: hw/net/can/* F: include/net/can_*.h +F: docs/system/devices/can.rst =20 OpenPIC interrupt controller M: Mark Cave-Ayland --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699269470; cv=none; d=zohomail.com; s=zohoarc; b=LBPs6pnulB0F/3E3Mpq6km+6ga97ivdtlU7UriJx/8Q6pl4d0V7JpZz0Jq0FCZZu4nz6o+JyQrnqxRyfQbyIk957WXRQDteo1yJX54J1VF1GBAI4HyQ+SjiLX3yyYmKVjqxmtmp7Oow/0UVVn9VFXou9HBkN88NyetisWXcOM9I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699269470; 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=RacUCXaZM0ryRlMszwI6IYYuk8+9tjRt89OkiSY3LIw=; b=NfSwiB6F44GNAA8Eo2R82BRxPcmtLOv0owqx6onSSzhiFik/HfmC9a3IvYaL3VdRqDngwtYCBD2XL+P8fbm2H37PKv2IqyDINkc2ak6cMwKHFSGqC+EBQ0Z1zcVBOU9eYEjKLYAcIPaoV3PoTItymqyjsc2MkzRT4w6VYhJYOVk= 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 1699269470867168.65510461492943; Mon, 6 Nov 2023 03:17:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxVJ-0004Ez-Oe; Mon, 06 Nov 2023 06:10:49 -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 1qzxV9-0003Py-Ck for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:10:41 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxUq-0005zR-99 for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:10:39 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-40839807e82so26144725e9.0 for ; Mon, 06 Nov 2023 03:10:19 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id c12-20020a05600c0a4c00b0040775501256sm12046304wmq.16.2023.11.06.03.10.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:10:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699269018; x=1699873818; 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=RacUCXaZM0ryRlMszwI6IYYuk8+9tjRt89OkiSY3LIw=; b=EzBOi4PfEALhKkouVWOm7FqjKNqKmlKeZepu8TqeJXEHXCyGnACc/Ig8NxK9QknSTm DaoMLF3KwWg1/5ZKC0DaX4ROo8SyD3VWOXwGnq8XwRzuMfuVg2/Re36ZIeoH3GY2LxnG p3NeINosJAf/FIXd5XKEOR9B2j2XKbHOoMIspZk8A9eIOGLpKmSQXm4Qp3xvJ96SfWdv ltAt4C8MkIvZJJP4glQqbJnuw6RnuHFMCZUVeMUkWkj+V5DdHLkHPviX/VKYd7r3l/b5 OqZbIn2SRLYoA4ba1LhSwkIJGFjhGWTlNvXtQue8WHWzou9Vdwk8SnpzY5JmppPcZp+q u2Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699269018; x=1699873818; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RacUCXaZM0ryRlMszwI6IYYuk8+9tjRt89OkiSY3LIw=; b=c6j969jSGs+nwI0+uyN10bPMMow3EWfT71dOtN6wT2qvM51N6iWcynZlgJ0n/eWo57 NRPGbZdkuWMUA8yryabXVV4GS6sLS0dQQYJtymChO02U1NP/zNvuwoltKhCyUZX2aVNm HrquseR3q3aHX/4Tx/klPlqzvaoMbS8vFqDYDQF751ijOLpgRhbM9ktaLA5yKlC6sIZP TUZKqpT/cMsnvVBh5TKKW0eFUALzkaaGXUMFClT6eS8vNKIl+qF4TsVNQ2EcvmSxT+6i AUvvRbIgDfmZxiH3Lm1IfVQk9vp/iIdyiJrniZ/GXEB2dmKmhPt8n4iX4/w7zh82W5sw l3nw== X-Gm-Message-State: AOJu0YxPT4iuE5b6nXnPO1555F9wRWNnDcFjE2jr5Ms5OJfj8skui7SM h1Ro34gavDChn435tz+69Bp2gvo9vJFcHxQ4EJM= X-Google-Smtp-Source: AGHT+IHCLWJGvQCJQCgk0pcjJbrXFUVevq6ZIuy44lY2uK/9jLH2wD0CdVyKAn01kc68xmugzJzUNg== X-Received: by 2002:a05:600c:4e12:b0:406:51a0:17ea with SMTP id b18-20020a05600c4e1200b0040651a017eamr11538636wmq.10.1699269018513; Mon, 06 Nov 2023 03:10:18 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 59/60] MAINTAINERS: update libvirt devel mailing list address Date: Mon, 6 Nov 2023 12:03:31 +0100 Message-ID: <20231106110336.358-60-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699269472473100001 From: Daniel P. Berrang=C3=A9 Effective immediately, the libvirt project has moved its list off libvir-list@redhat.com, to devel@lists.libvirt.org Signed-off-by: Daniel P. Berrang=C3=A9 Message-ID: <20231027095643.2842382-1-berrange@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index c57868c94c..3582e2a71a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4049,7 +4049,7 @@ F: gitdm.config F: contrib/gitdm/* =20 Incompatible changes -R: libvir-list@redhat.com +R: devel@lists.libvirt.org F: docs/about/deprecated.rst =20 Build System --=20 2.41.0 From nobody Wed Nov 27 09:59:43 2024 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=1699270278; cv=none; d=zohomail.com; s=zohoarc; b=ZITgRPWLOT8I1jXldYt9QJ592mmslrrt35yIWmGyCkj6MyJYlCtjp6LJWMfCYDx3IjJml+vdPYocvDRdoXmo4k6NKBVOud7FPipoaKxBuRJ0jjzrjsSWar0a4HSDosMd7KvvPp8dvbeJVr7rX1S5cpR45A6cfVkq0QccrbayUAE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699270278; 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=xBR3Oh8zClbS1YQ62m6eKxWZ4Ons8qsU0E4Liv4Rvg0=; b=bdCg5F2I6N9XMpeg0EWyj5g8gLkxRqBb49OVz8abZJxwBk8jcTgIi6MwXyqan+i7UyoQRwhKNvbryvq4Txu8wNwEqwb5dExTekcTUQFtjYVH11aeVstey0C9tjD0S3GGxAjwpYm3rMktWZn92nUURtyKxGh/UEKefbxdFl96sQM= 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 1699270278517243.66333428517441; Mon, 6 Nov 2023 03:31:18 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxVL-0004Zx-SX; Mon, 06 Nov 2023 06:10:51 -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 1qzxV4-0003NS-4T for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:10:36 -0500 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxUw-00062J-JA for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:10:33 -0500 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-50797cf5b69so5576452e87.2 for ; Mon, 06 Nov 2023 03:10:26 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id bh7-20020a05600c3d0700b00401b242e2e6sm11965729wmb.47.2023.11.06.03.10.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:10:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699269025; x=1699873825; 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=xBR3Oh8zClbS1YQ62m6eKxWZ4Ons8qsU0E4Liv4Rvg0=; b=zDz4nNo5FL6bSGxz/w7Y1ZzyqgQeZyT8agZ0kj2Ph+LdVGEtqCTaubducvlUccLevD jtCJFJA2bshvH4Mx5bZ8N5KCU/TGyV1YhdkaerZpxZB4pOguv4Qpg3IwTmrVHPhjR3fz INSRywOwGDLfehMVYjMUqUKotgATzDrRRRQu3Bqk9FL0n4gAY5NsMKw1txCTs/euXVH2 36vjXGkUFiNnFtUfIirZlO4yZPnIn0awl1NsS4uy+jQeaWcEt3rJMkog6xw8EsVijplA iNRqXl9dqNYuJBGD7LxBToITK1bfu0h/6iE4e9RP27qlFYv9tRX6c7aVTk9p2XooDgX7 cK0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699269025; x=1699873825; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xBR3Oh8zClbS1YQ62m6eKxWZ4Ons8qsU0E4Liv4Rvg0=; b=fbfev3DlKRbsFTD6mx6/jf7pBSvwOzHYaZQLqtAkSj2UN+h8uj61wcQCZyVi+/B6Ia zBcRC6m9pmV7FnyLjz7G0ISCho0jimFwPn/K67DLimTD6bvD0cva/gPczcl7/b+cuGIa ZYlbntmUvIrhnNNns/zJ1J2tgFWQLHcXQYqpDEBB30Q+uRcXurIEHh8IwBy8NtuOPNG0 mbILnz60iwye9EVsFVsAnpw4sDNi1zk3U1bkGA/QuKaGxBdIOD89sMGAXlWqW3duQZSZ SQOtknYiEa5a7bV9WF1+LKweo5JM70lS9vT5zHk+OCeikuYDl52+oX4TG3Wz+mfz3y99 oM/A== X-Gm-Message-State: AOJu0YyH9bWlgqa0N93B7zzmw4kx24WbYBip3/7lNp3wUdq/KoJROC7h ywQ0CBt0lt6g1qOTYO1nEo5Q7Pvtvb30mKYeCT8= X-Google-Smtp-Source: AGHT+IFMIKgYKaG2x26tSZ+5foWBGqKNS7CQHWd9OLbklpXVybTTE5AVAduGsFeWircKlsRiiuVWlA== X-Received: by 2002:a05:6512:318f:b0:509:45ed:1083 with SMTP id i15-20020a056512318f00b0050945ed1083mr12662290lfe.40.1699269024745; Mon, 06 Nov 2023 03:10:24 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Adrian Wowk , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann Subject: [PULL 60/60] ui/sdl2: use correct key names in win title on mac Date: Mon, 6 Nov 2023 12:03:32 +0100 Message-ID: <20231106110336.358-61-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-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::12f; envelope-from=philmd@linaro.org; helo=mail-lf1-x12f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699270279530100001 From: Adrian Wowk Previously, when using the SDL2 UI on MacOS, the title bar uses incorrect key names (such as Ctrl and Alt instead of the standard MacOS key symbols like =E2=8C=83 and =E2=8C=A5). This commit changes sdl_update_caption in ui= /sdl2.c to use the correct symbols when compiling for MacOS (CONFIG_DARWIN is defined). Unfortunately, standard Mac keyboards do not include a "Right-Ctrl" key, so in the case that the SDL grab mode is set to HOT_KEY_MOD_RCTRL, the default text is still used. Signed-off-by: Adrian Wowk Acked-by: Marc-Andr=C3=A9 Lureau Tested-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231030024119.28342-1-dev@adrianwowk.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- ui/sdl2.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ui/sdl2.c b/ui/sdl2.c index fbfdb64e90..4971963f00 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -172,11 +172,19 @@ static void sdl_update_caption(struct sdl2_console *s= con) status =3D " [Stopped]"; } else if (gui_grab) { if (alt_grab) { +#ifdef CONFIG_DARWIN + status =3D " - Press =E2=8C=83=E2=8C=A5=E2=87=A7G to exit grab= "; +#else status =3D " - Press Ctrl-Alt-Shift-G to exit grab"; +#endif } else if (ctrl_grab) { status =3D " - Press Right-Ctrl-G to exit grab"; } else { +#ifdef CONFIG_DARWIN + status =3D " - Press =E2=8C=83=E2=8C=A5G to exit grab"; +#else status =3D " - Press Ctrl-Alt-G to exit grab"; +#endif } } =20 --=20 2.41.0