From patchwork Sun Mar 31 07:33:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13611816 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 55A9BCD1284 for ; Sun, 31 Mar 2024 07:35:52 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rqphm-0002g0-3b; Sun, 31 Mar 2024 03:34:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rqphl-0002c6-0t; Sun, 31 Mar 2024 03:34:13 -0400 Received: from mail-oi1-x231.google.com ([2607:f8b0: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 1rqphj-00026N-FN; Sun, 31 Mar 2024 03:34:12 -0400 Received: by mail-oi1-x231.google.com with SMTP id 5614622812f47-3bbbc6b4ed1so2168180b6e.2; Sun, 31 Mar 2024 00:34:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711870449; x=1712475249; 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=I6z5Y0v6eGC54OE+cts/dJAT+Yj1Pwc4rTiSVsRg9/I=; b=QLKDn2gonyZWB0ydXmbk1c/Sks3aQj4QBsOkjOmkGwrg4sgbJ8J/9MzxHFLgcZ+RI/ AnXAvBLCN/ehUkjW5DmEQAfwcn+LojgrEVR2bAczcxFJpk1L+DECS9vyPOu9+DTpQJ4Z 4lsCUIEzYkE6S3Pfj7fYpEllpuPon1IEKXWrEOcUk93Gz45QPdKzuIt1znCOuY+me86K zO1BcXy1k0NijAKaFqJvdJ2jFjOFJAyoXJ+3hx+KxUSzXTl7Cr1gCXYjAcvJxEUcF8kK 16gBTsYFrUbTnD1/jg9uG+3u5C1LYJ0cWJu5JFsPP4n5MoqAS2zVREnjVEgGqKGUz3z3 u0cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711870449; x=1712475249; 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=I6z5Y0v6eGC54OE+cts/dJAT+Yj1Pwc4rTiSVsRg9/I=; b=AaKjJ4LXMeEgl1RVwr+jQrBAvfniZFgRKzBepmO5bxy2c3eLoHXLzBtnrpPOgx+MGb 0VGRqzy1kggkRiL54tKGqpl0qRRHZp7NpEm9pzW6eMZlEepz8BzqJC/tP2kQulpq+2nm UAJYkSJeLpjw3GxGGzSn2PRDIeefsvxfOG8srzGMSc0hBNRAvP9ey+3hRvWNw+ti6Qln rJlaYidc0FPF3p705qK6HNKY+MTvh9jE0k3WN9hNWCtb1IS+mcSvVmb/5k+Yad/gHuJY 59b/5XvteQODfhN2zHqpuhJ94VZ7DqR1ITzZDw4cLkn5RgUYrRq2ExfGPVDaVJAi9b7k qvbA== X-Forwarded-Encrypted: i=1; AJvYcCX2JpIpfyovjiTj0fALQZv3NQrjItIbLXQF3q3bdWYNuB5EgGmSZdCnPmhCW1+3mfqFh5qE2xYxhk0N19rWTXfvtk3o X-Gm-Message-State: AOJu0Yw0XNCcr6ucEQj5239Ur83f4MHiejiZd8NQmQgzE3zwhP6blne6 ZaCofXRtnlLoZVMV6K2kMgMn1l6CITc9t5vJmQU64wwtWSbY+3MZNjxTIM2Ghr0= X-Google-Smtp-Source: AGHT+IHq9O/DJ0jpTKHGMUBv9wQEiR4ErXQmOFwgBgEUHUkhFEmlFtwxvOlq2ZkgqOTT3hIolomU8w== X-Received: by 2002:a05:6808:2198:b0:3c3:c9cd:8c42 with SMTP id be24-20020a056808219800b003c3c9cd8c42mr8386400oib.36.1711870449354; Sun, 31 Mar 2024 00:34:09 -0700 (PDT) Received: from wheely.local0.net ([118.210.97.62]) by smtp.gmail.com with ESMTPSA id k9-20020aa78209000000b006eabe72ce84sm5822411pfi.16.2024.03.31.00.34.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Mar 2024 00:34:09 -0700 (PDT) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-ppc@nongnu.org, Harsh Prateek Bora , Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PULL 1/8] spapr: nested: use bitwise NOT operator for flags check Date: Sun, 31 Mar 2024 17:33:38 +1000 Message-ID: <20240331073349.88324-2-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240331073349.88324-1-npiggin@gmail.com> References: <20240331073349.88324-1-npiggin@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::231; envelope-from=npiggin@gmail.com; helo=mail-oi1-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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Harsh Prateek Bora Check for flag bit in H_GUEST_GETSET_STATE_FLAG_GUEST_WIDE need to use bitwise NOT operator to ensure no other flag bits are set. Resolves: Coverity CID 1540008 Resolves: Coverity CID 1540009 Reported-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Signed-off by: Harsh Prateek Bora Signed-off-by: Nicholas Piggin --- hw/ppc/spapr_nested.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/spapr_nested.c b/hw/ppc/spapr_nested.c index 936659b4c0..c02785756c 100644 --- a/hw/ppc/spapr_nested.c +++ b/hw/ppc/spapr_nested.c @@ -1511,7 +1511,7 @@ static target_ulong h_guest_getset_state(PowerPCCPU *cpu, if (flags & H_GUEST_GETSET_STATE_FLAG_GUEST_WIDE) { gsr.flags |= GUEST_STATE_REQUEST_GUEST_WIDE; } - if (flags & !H_GUEST_GETSET_STATE_FLAG_GUEST_WIDE) { + if (flags & ~H_GUEST_GETSET_STATE_FLAG_GUEST_WIDE) { return H_PARAMETER; /* flag not supported yet */ } From patchwork Sun Mar 31 07:33:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13611814 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7737BCD1284 for ; Sun, 31 Mar 2024 07:35:21 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rqphp-0002qP-Dm; Sun, 31 Mar 2024 03:34:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rqphn-0002o2-OI; Sun, 31 Mar 2024 03:34:15 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rqphm-00026v-8H; Sun, 31 Mar 2024 03:34:15 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-6e74aa08d15so2535956b3a.1; Sun, 31 Mar 2024 00:34:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711870452; x=1712475252; 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=xF5OBXNYP6ZI81AmsCFRz0Xuc8TKtQnpsKPSIbYJa3o=; b=Ao5r3aEuc4c3pgVdMww6B6LEzLVBuNlWIafyzQdnzKZj1P6exgpy9a0CJoApROUfTt GiUoDMfR73M+SeXuu06R4jYBYDp3eMbYldWDaRi2fkDZnlw3xWYm5IMIsLf/XvsOguf7 ObBmLn3er7UA+aV5uZy3aWMT4IJjCQRsLv3Us4vMC1lkUi3wi4I5BCWmu6l5iinST/ro nUA0MXGwq1QDkFw1J8bf/npUByM8HTLGwYd+UhoaCrSFF1r3Ok5d4KVDdLe0zWv/JBL1 wY6zUYhqDC2zTD8d+y0XP4blt57bPz9xAVX8qImGKELvFwKUpXtl7Xlv+RN5jWUIApzK 98SQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711870452; x=1712475252; 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=xF5OBXNYP6ZI81AmsCFRz0Xuc8TKtQnpsKPSIbYJa3o=; b=O5DsBTM/4q8Xmo8uI2rOs+UKHZAa/o/chmQAu3uwFzIuTehJa4FtcsEEMivn3oH7ak pUq0Vs2+sdZ52R6UM3B/Tp7Xb33/oZJ15PIVwIrJx+uWLOFjF2RVfZPsnM+KHfkk50rM 0c2Ij0+WOqXK+cI7Zxw86skGfba5sgmd7GK3YZ+e4vIGZL3rta4W6fE3TtJYjbI95NJp 8K16/8+fCTNiPqaNOUaBLpmVMq0h5aCxxYrBpY8KHEZXS0c6zXjapB4Hw0VSb0wI8ksU pD0ryNUctJ+4kq7tW+HCXW4Ed9qeXeayR8itxomkeMXQy8bHv11QypW9P7ZpiX4QDeHO TT2A== X-Forwarded-Encrypted: i=1; AJvYcCUi/300MKPTqUM3U0yesNk5IUvzBhQ1lSWE9mlSKO1VJqxEzALhOdBskpIT7SeTZpAHqDmuczeLZsb99KPjs28PhYSI X-Gm-Message-State: AOJu0Yw/wxe0+jPL1E6eH69/ZUe0QAESmromL9S/7U0LsRXqn0G0Y5xW dLAwwkZlIQxitjaDhU9mqWT9sybojtOOGHiJ+CgW3fllOIXNTWb9B3gv0Ldny3k= X-Google-Smtp-Source: AGHT+IETTOw2Vn+VyN+Rls/DoBmIk8j2yt9iBvJ3c/qB/ud1ToNEatvTOz5tmvmpoU2miRCkh3J+Bw== X-Received: by 2002:a05:6a00:1992:b0:6ea:e2ec:9622 with SMTP id d18-20020a056a00199200b006eae2ec9622mr8610538pfl.20.1711870452321; Sun, 31 Mar 2024 00:34:12 -0700 (PDT) Received: from wheely.local0.net ([118.210.97.62]) by smtp.gmail.com with ESMTPSA id k9-20020aa78209000000b006eabe72ce84sm5822411pfi.16.2024.03.31.00.34.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Mar 2024 00:34:12 -0700 (PDT) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-ppc@nongnu.org, =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= , Harsh Prateek Bora Subject: [PULL 2/8] hw/ppc/spapr: Include missing 'sysemu/tcg.h' header Date: Sun, 31 Mar 2024 17:33:39 +1000 Message-ID: <20240331073349.88324-3-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240331073349.88324-1-npiggin@gmail.com> References: <20240331073349.88324-1-npiggin@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=npiggin@gmail.com; helo=mail-pf1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Philippe Mathieu-Daudé "sysemu/tcg.h" declares tcg_enabled(), and is implicitly included. Include it explicitly to avoid the following error when refactoring headers: hw/ppc/spapr.c:2612:9: error: call to undeclared function 'tcg_enabled'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] if (tcg_enabled()) { ^ Reviewed-by: Harsh Prateek Bora Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Nicholas Piggin --- hw/ppc/spapr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index c417f9dd52..e9bc97fee0 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -35,6 +35,7 @@ #include "sysemu/sysemu.h" #include "sysemu/hostmem.h" #include "sysemu/numa.h" +#include "sysemu/tcg.h" #include "sysemu/qtest.h" #include "sysemu/reset.h" #include "sysemu/runstate.h" From patchwork Sun Mar 31 07:33:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13611812 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C5573CD1288 for ; Sun, 31 Mar 2024 07:35:02 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rqphs-0002s9-W1; Sun, 31 Mar 2024 03:34:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rqphq-0002qm-S0; Sun, 31 Mar 2024 03:34:18 -0400 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rqphp-00027g-FK; Sun, 31 Mar 2024 03:34:18 -0400 Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-29df3333d30so2288529a91.1; Sun, 31 Mar 2024 00:34:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711870455; x=1712475255; 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=sw/t58NlNMsiEYbm8tj58VRibhqWk2l7GIj5tEOLJ6o=; b=nbUSEDztFat5z78KChmuvB8bz3JwhM6fpZUAXAsWex7k1Ho7vkvEdt2sxWYvROfTaG 6YFVevXrpBd8AFvJjJzZPwy8VV+VjditGqySV1/ylEmU5CTUn3q+A8D9BqUYcOOmpGOy U4/J3ADpd5ua8NkrngmW+jHiUwwFhZ7NPIF40KRKJy3BClxPHtKasKErlF77tZZ7xE7t DjKLeRk9zPkjvtl3R174HgRdaE/Vis8YBljwbVsuE03wrdkqD+CUdiXRLpeUS/JwfB2f ASv910hBoDYCKGy6zFgEadqT0stOt/a/L27ghr1WMJCSkpknhuYZUEwfOBHjG6pTanB+ EusQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711870455; x=1712475255; 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=sw/t58NlNMsiEYbm8tj58VRibhqWk2l7GIj5tEOLJ6o=; b=S9dnux55j79xTO+KGmhG+y28O//FRHZqttkKUiBGJ/YO+F7z3vmvURP/IHFtal1g5H 2C14xWd2cmzDIQiwkhhOjE+B2ND000Vd4RasneHq9wJkQHO/VxkR0E8REkdRIHwLj5Qt 1a7mLsMF7XfxbQuu5OOQ7ySuXJpbj65c3stTYuvIT/IIynH/SlgZJ0Ebw68ES+musXln 6o49Ivy19gRKNJAOugGteQgjk/CM7H13xt46buz8CYPxF7oo9rQKgHBYqrPg1KX8FM0R r9e/k92KW/5duuWrTasbU1Cyvzms3i3t3mjkJ5T7z3Xac7agdZmv7L0u4KAfALmimZZr 1AFA== X-Forwarded-Encrypted: i=1; AJvYcCULoUfucdRJ4y8jijJ94Lpbtg5Kgcrr3bshZkPpXMJQ278uF9X12UUZpCcsZlE0s3hAOZM1fJNqBtZylbOW5oTx+8Ru X-Gm-Message-State: AOJu0YyG19Q+fX6HHDhD967crxakyrzcHZV0ToMSJ8vvqxLkHvD2LC// wFzT1cSAMMXZygBcHpVJdTUY64mtT3VZpeQ0nwgM7Naxq3TauxSEITy7vVBOnMY= X-Google-Smtp-Source: AGHT+IEVgDm9mZUTEpcLKMZ2d99YeKbCAA+ReIoPEOr6RDmphF39S2X/24uwv/15OPloSsyFU9HNqg== X-Received: by 2002:a05:6a00:2196:b0:6ea:f7e2:49b8 with SMTP id h22-20020a056a00219600b006eaf7e249b8mr2978098pfi.3.1711870454960; Sun, 31 Mar 2024 00:34:14 -0700 (PDT) Received: from wheely.local0.net ([118.210.97.62]) by smtp.gmail.com with ESMTPSA id k9-20020aa78209000000b006eabe72ce84sm5822411pfi.16.2024.03.31.00.34.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Mar 2024 00:34:14 -0700 (PDT) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-ppc@nongnu.org, =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= Subject: [PULL 3/8] target/ppc/mmu-radix64: Use correct string format in walk_tree() Date: Sun, 31 Mar 2024 17:33:40 +1000 Message-ID: <20240331073349.88324-4-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240331073349.88324-1-npiggin@gmail.com> References: <20240331073349.88324-1-npiggin@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=npiggin@gmail.com; helo=mail-pj1-x102f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Philippe Mathieu-Daudé 'mask', 'nlb' and 'base_addr' are all uin64_t types. Use the corresponding PRIx64 format. Fixes: d2066bc50d ("target/ppc: Check page dir/table base alignment") Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Nicholas Piggin --- target/ppc/mmu-radix64.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/ppc/mmu-radix64.c b/target/ppc/mmu-radix64.c index 5823e039e6..690dff7a49 100644 --- a/target/ppc/mmu-radix64.c +++ b/target/ppc/mmu-radix64.c @@ -300,8 +300,8 @@ static int ppc_radix64_next_level(AddressSpace *as, vaddr eaddr, if (nlb & mask) { qemu_log_mask(LOG_GUEST_ERROR, - "%s: misaligned page dir/table base: 0x"TARGET_FMT_lx - " page dir size: 0x"TARGET_FMT_lx"\n", + "%s: misaligned page dir/table base: 0x%" PRIx64 + " page dir size: 0x%" PRIx64 "\n", __func__, nlb, mask + 1); nlb &= ~mask; } @@ -324,8 +324,8 @@ static int ppc_radix64_walk_tree(AddressSpace *as, vaddr eaddr, if (base_addr & mask) { qemu_log_mask(LOG_GUEST_ERROR, - "%s: misaligned page dir base: 0x"TARGET_FMT_lx - " page dir size: 0x"TARGET_FMT_lx"\n", + "%s: misaligned page dir base: 0x%" PRIx64 + " page dir size: 0x%" PRIx64 "\n", __func__, base_addr, mask + 1); base_addr &= ~mask; } From patchwork Sun Mar 31 07:33:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13611818 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6AA5DCD1284 for ; Sun, 31 Mar 2024 07:35:55 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rqphu-0002si-HF; Sun, 31 Mar 2024 03:34:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rqpht-0002sD-8Z; Sun, 31 Mar 2024 03:34:21 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0: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 1rqphr-0002Ak-Q2; Sun, 31 Mar 2024 03:34:21 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-6e88e4c8500so2493971b3a.2; Sun, 31 Mar 2024 00:34:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711870458; x=1712475258; 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=99NXL3dTZGdgRT6sIcLJ+0pMc+4T2LlgrASZ20/p80E=; b=SzidvXBqQALpRvt0chUbGDe6rq+vOCUvzn7GRW5O+PV+d8mifdSvtQzkb+AOa+9WW0 mpskyK6wJh+izn3T/H8XhqVke/6DwJiFqunAFaQOtPjh5R8LX62zh+M3Bz8rIOqvrlVy z8k04dVCZvjrl+Qb0sYSnLbx0vmIiL64lyljbM1UPkHYDBEKrevbTF3rwnLeUjJbCyio KBplMpQxe3o2pHiBZj9E54VveL5TTpqU9XBW7Dq8mzdT1CgLRtMYjj9WNglabseetjp4 aoFUczTUXOWhIZu9NmGoiuSXA4XWcoxRa6FqaJoVLtJ3N2dBri50sXNFm8HLA9+mv9Oi LKBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711870458; x=1712475258; 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=99NXL3dTZGdgRT6sIcLJ+0pMc+4T2LlgrASZ20/p80E=; b=A45m+vTVCQsr5lnfBKI8JfObQocM2HGWwdQ+3F7/ntRIlNSDcP7DdsX1lKwQwAEuqd rq4DB0eMC38jokLtoZxf1qOrt9DObuWgsW1vAdVMeB89NR6vJ+hySxyLWLsZpQq6RfvG 8d5DTaFee3GohsSchRZYuvbxOdXcp3zpkQES/hMUlz15PnSWkDW1uti2qauXy8tGAKsG gUX3kyTn1R9kkAwFsg/7YwNJ1IgLHzmo8NHfUrW9i8rFdluT5A8cmetT6SknHbuxcxmz 8D9edTRVW83jVuvu9GgzFlNcUk+OhpuBby8Z+kzQVA7XvB7oZNE4dc3vyuYdx/qh4aLD SU9Q== X-Forwarded-Encrypted: i=1; AJvYcCWWtKUCr35eR6HGDDV1+XeSu29FU9xgIM74wb+gSRrbM9U/fL2bKRQuGAq0sFVwkdCty+9TxDlhvvowtBDxDVypP7XO X-Gm-Message-State: AOJu0YxfHUrNohFZ8CcYxHd7BPLmFu6InSSFQUHiw4SxEzosQhLQCOzR wPYVYAi2IzTQeftYvSeMrqTKsmyyEHlT0D2FB4Z+u/MrUpxjDTCIP2DTkhpHelY= X-Google-Smtp-Source: AGHT+IHecu38bkXj3ZPpQ1hXMU9MmuN2FuavIqbLNa7kNPrBpwUYI33Nn8b5jKp/FwNeA5fep/Qa7Q== X-Received: by 2002:a05:6a00:3cc4:b0:6ea:acbe:5188 with SMTP id ln4-20020a056a003cc400b006eaacbe5188mr6891189pfb.32.1711870457625; Sun, 31 Mar 2024 00:34:17 -0700 (PDT) Received: from wheely.local0.net ([118.210.97.62]) by smtp.gmail.com with ESMTPSA id k9-20020aa78209000000b006eabe72ce84sm5822411pfi.16.2024.03.31.00.34.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Mar 2024 00:34:17 -0700 (PDT) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-ppc@nongnu.org, Benjamin Gray Subject: [PULL 4/8] target/ppc: Restore [H]DEXCR to 64-bits Date: Sun, 31 Mar 2024 17:33:41 +1000 Message-ID: <20240331073349.88324-5-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240331073349.88324-1-npiggin@gmail.com> References: <20240331073349.88324-1-npiggin@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=npiggin@gmail.com; helo=mail-pf1-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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Benjamin Gray The DEXCR emulation was recently changed to a 32-bit register, possibly because it does have a 32-bit read-only view. It is a full 64-bit SPR though, so use the corresponding 64-bit write functions. Fixes: fbda88f7abdee ("target/ppc: Fix width of some 32-bit SPRs") Reviewed-by: Nicholas Piggin Signed-off-by: Benjamin Gray Signed-off-by: Nicholas Piggin --- target/ppc/cpu_init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index 7e65f08147..22fdea093b 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -5820,7 +5820,7 @@ static void register_power10_dexcr_sprs(CPUPPCState *env) { spr_register(env, SPR_DEXCR, "DEXCR", SPR_NOACCESS, SPR_NOACCESS, - &spr_read_generic, &spr_write_generic32, + &spr_read_generic, &spr_write_generic, 0); spr_register(env, SPR_UDEXCR, "UDEXCR", @@ -5831,7 +5831,7 @@ static void register_power10_dexcr_sprs(CPUPPCState *env) spr_register_hv(env, SPR_HDEXCR, "HDEXCR", SPR_NOACCESS, SPR_NOACCESS, SPR_NOACCESS, SPR_NOACCESS, - &spr_read_generic, &spr_write_generic32, + &spr_read_generic, &spr_write_generic, 0); spr_register(env, SPR_UHDEXCR, "UHDEXCR", From patchwork Sun Mar 31 07:33:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13611819 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4FC33CD1288 for ; Sun, 31 Mar 2024 07:36:00 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rqphx-0002tO-Kv; Sun, 31 Mar 2024 03:34:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rqphv-0002t4-RJ; Sun, 31 Mar 2024 03:34:23 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0: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 1rqphu-0002CL-9H; Sun, 31 Mar 2024 03:34:23 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-6e6ee9e3cffso2111904b3a.1; Sun, 31 Mar 2024 00:34:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711870460; x=1712475260; 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=+9G/bE2e1fCaBb8no691midYL4f9HZ61fZW8qbGYtK4=; b=FaUFHwUsXCUdW5cC/qli4Km1V+4JUxba0kqrybrOmPWc82pQTFYxudAexKz+eW+SLa 7IvUAVvju/nxf3Gc+wlg4Iwr9C8CtwfFQRmKOGVwYOmT7SjcvkkZ1X5pTlpcvoSIIwan 7GkgMFjN9hKzYiUoZJWUGZ3PM1BJeXFTy3+FUNFXFE/innKK+zSIGvwnBIumvArbkeAL 8cm5gWcNnn2X+B+Sxv1o7JdArZxmHrkg7t3Rq2nDH8gfVQ+beXqqOk/pnPkagCkfkmDO I8UoAQoB9ZN4vPviS5H34WOMOlQJV7ac35rxHqDNhYP0If5DYsc+PBJAaQDT4zUwsxdZ xTSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711870460; x=1712475260; 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=+9G/bE2e1fCaBb8no691midYL4f9HZ61fZW8qbGYtK4=; b=sDo7prh76pwuy8rQho0VN0aAqxwHT6B2kySFWGZWKmdwP78tUDbJ8qPsnMA1QlLwur 5nC9DPbYq8+593tdXSQfc1G0jauhMJKKIDVh9mz4JGSMNYa8B6HAaJshBxUMH3Byn7e8 uP0iWYILMFXCmmHwaOlpfFjPMp5tjDdQSp3CJXBtj+ylFQLMlfWV40Vnb73ZpiQysd+G ITCWpHmB/0UlhFXT+iHiaEZkK/gpYcYN/KeiaNMYn70jnslf55x82GePv63JT0SRoAoK qrWgitEdg61Ve8E7SvrIj2Tbd7fv5rXRZBFDimgsrKvNZFlUXke2ECR9BPtEyIJad7JL yhig== X-Forwarded-Encrypted: i=1; AJvYcCV/BOvKOPb3J8XTkBPMrZxVeohHnUzXOHxF8aq5YpavBxKGZXltqVrB9sJqwzhlusLlEDC/EBtLLmtofRJeDVMVGnWm X-Gm-Message-State: AOJu0YztuN2ksgAMTXR3kRVMzJ5GfD2dVHbbXnJ+BQcYRd74B1H4oiqO W75c/knJwnb0408qvMGoVpOGPMQBFOS8sOUS1wnpeUEmy6D6hM13xCsHJtLuNhA= X-Google-Smtp-Source: AGHT+IFyJwjEuW4V9nOwNF0ZLnKXHmEN0ZfPZ7rd6qV+3uFsNhjZy7mGxaijQGbuGtt3OKh/a5bYtg== X-Received: by 2002:a05:6a00:890:b0:6ea:f05c:5c16 with SMTP id q16-20020a056a00089000b006eaf05c5c16mr6320969pfj.5.1711870460303; Sun, 31 Mar 2024 00:34:20 -0700 (PDT) Received: from wheely.local0.net ([118.210.97.62]) by smtp.gmail.com with ESMTPSA id k9-20020aa78209000000b006eabe72ce84sm5822411pfi.16.2024.03.31.00.34.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Mar 2024 00:34:20 -0700 (PDT) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-ppc@nongnu.org, Benjamin Gray Subject: [PULL 5/8] target/ppc: Fix GDB register indexing on secondary CPUs Date: Sun, 31 Mar 2024 17:33:42 +1000 Message-ID: <20240331073349.88324-6-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240331073349.88324-1-npiggin@gmail.com> References: <20240331073349.88324-1-npiggin@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=npiggin@gmail.com; helo=mail-pf1-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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Benjamin Gray The GDB server protocol assigns an arbitrary numbering of the SPRs. We track this correspondence on each SPR with gdb_id, using it to resolve any SPR requests GDB makes. Early on we generate an XML representation of the SPRs to give GDB, including this numbering. However the XML is cached globally, and we skip setting the SPR gdb_id values on subsequent threads if we detect it is cached. This causes QEMU to fail to resolve SPR requests against secondary CPUs because it cannot find the matching gdb_id value on that thread's SPRs. This is a minimal fix to first assign the gdb_id values, then return early if the XML is cached. Otherwise we generate the XML using the now already initialised gdb_id values. Fixes: 1b53948ff8f7 ("target/ppc: Use GDBFeature for dynamic XML") Reviewed-by: Nicholas Piggin Signed-off-by: Benjamin Gray Signed-off-by: Nicholas Piggin --- target/ppc/gdbstub.c | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/target/ppc/gdbstub.c b/target/ppc/gdbstub.c index 3f1e61bdb7..3b28d4e21c 100644 --- a/target/ppc/gdbstub.c +++ b/target/ppc/gdbstub.c @@ -305,14 +305,6 @@ static void gdb_gen_spr_feature(CPUState *cs) unsigned int num_regs = 0; int i; - if (pcc->gdb_spr.xml) { - return; - } - - gdb_feature_builder_init(&builder, &pcc->gdb_spr, - "org.qemu.power.spr", "power-spr.xml", - cs->gdb_num_regs); - for (i = 0; i < ARRAY_SIZE(env->spr_cb); i++) { ppc_spr_t *spr = &env->spr_cb[i]; @@ -320,9 +312,6 @@ static void gdb_gen_spr_feature(CPUState *cs) continue; } - gdb_feature_builder_append_reg(&builder, g_ascii_strdown(spr->name, -1), - TARGET_LONG_BITS, num_regs, - "int", "spr"); /* * GDB identifies registers based on the order they are * presented in the XML. These ids will not match QEMU's @@ -335,6 +324,26 @@ static void gdb_gen_spr_feature(CPUState *cs) num_regs++; } + if (pcc->gdb_spr.xml) { + return; + } + + gdb_feature_builder_init(&builder, &pcc->gdb_spr, + "org.qemu.power.spr", "power-spr.xml", + cs->gdb_num_regs); + + for (i = 0; i < ARRAY_SIZE(env->spr_cb); i++) { + ppc_spr_t *spr = &env->spr_cb[i]; + + if (!spr->name) { + continue; + } + + gdb_feature_builder_append_reg(&builder, g_ascii_strdown(spr->name, -1), + TARGET_LONG_BITS, spr->gdb_id, + "int", "spr"); + } + gdb_feature_builder_end(&builder); } #endif From patchwork Sun Mar 31 07:33:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13611813 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 93F0CCD1288 for ; Sun, 31 Mar 2024 07:35:21 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rqpi0-0002yM-9B; Sun, 31 Mar 2024 03:34:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rqphy-0002x0-Pq; Sun, 31 Mar 2024 03:34:26 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0: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 1rqphx-0002FK-0u; Sun, 31 Mar 2024 03:34:26 -0400 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-6e6b6f86975so2090779b3a.1; Sun, 31 Mar 2024 00:34:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711870463; x=1712475263; 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=mYXhV2tdfrK37fGeW/EVruixzcxS6jD0MeBRq3dZyY0=; b=V0yGoDh/L4RDA5hKBxpTZb/4Rwpb8nQZkP/2uOPjHJ8a0LkfPgk4eg7N38dX9j1rz8 LMPGi78tX+V/Si5OhsD4JHXtNYJ/YDD3vj5eV0J+/rAWCmbxzLu6+coHzLmvqDj2/rcs Byu8WDoSaQdlERNfbqkARJ/O9xnLta3uKp2ObTmBiZEK02+sscH5iDoh4r5HyFl/TuA/ 9MT7FxhoMPgVkAwT+KlhW11jxehyed1rO3NzkBfsZdqbl/xglPmbuRRbhFQBnGooFe4J KyqkWEe1HpEq0TMsAfRyQSgnuW/LmwuqDa/OKtBaRFjuHn9mZ3LEZut1kZi/ZLAdGWIp P2tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711870463; x=1712475263; 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=mYXhV2tdfrK37fGeW/EVruixzcxS6jD0MeBRq3dZyY0=; b=BM8E7Ptg7diyy8K7EIgyQZsTzX+bRiqs1zNsxrg4v5F7Qxg30CK8DeeAFlGsD+ijN8 HkKg3yi3M4neAo7ACrAgyxneZUaRlaDMXt1buQ5NWOa6Kvw87pyGc594aeCLQiloXmIQ wBbkSZ7HGc/ES/dQ1x83hZ8IBip8LcUXeg2qMLTYPRGSWyZsQuw0eZ3Febfkgk1Bk29t BO2MP29ONkwTPHc4881sBbZajy0gO/LifDVs6+obJjKCjiK0NcaeRLcAjaDc6hwwtWx0 m07/qTZVOvkh1/gvazVi8VcD7VnDsaBiWYw1wXifqpTz+xoUa3gZADgPKPjpmR3qby3R UfRg== X-Forwarded-Encrypted: i=1; AJvYcCWGnzIm5EXpa3go7gbaqtUPXKna9B2Y+h8zturvWsQDFjuDc/NVeuCmuigEPmWK0+DwFDc4oNpgpdlQr4opiIqFgT7X X-Gm-Message-State: AOJu0YwXV5tRCWtMmVfJRaZjzzidxXG/OyeE5F/6evHMXUnNQ8beS6Uw fgx2lVnAyIaFOdU98zuHIBs4L8rH55flU/IkaGYbFPlTYwcHnJI2cbeGj7OA2tY= X-Google-Smtp-Source: AGHT+IGYCaa9jKETcIxs3FJpEFekUjX8IY1krLhvPXCEDvoTnXYxHb48Pw31nGlsAY6BNQiwHvNWOw== X-Received: by 2002:a05:6a00:234b:b0:6ea:f369:f20f with SMTP id j11-20020a056a00234b00b006eaf369f20fmr5096673pfj.1.1711870462993; Sun, 31 Mar 2024 00:34:22 -0700 (PDT) Received: from wheely.local0.net ([118.210.97.62]) by smtp.gmail.com with ESMTPSA id k9-20020aa78209000000b006eabe72ce84sm5822411pfi.16.2024.03.31.00.34.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Mar 2024 00:34:22 -0700 (PDT) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-ppc@nongnu.org, Harsh Prateek Bora Subject: [PULL 6/8] target/ppc: Do not clear MSR[ME] on MCE interrupts to supervisor Date: Sun, 31 Mar 2024 17:33:43 +1000 Message-ID: <20240331073349.88324-7-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240331073349.88324-1-npiggin@gmail.com> References: <20240331073349.88324-1-npiggin@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=npiggin@gmail.com; helo=mail-pf1-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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Hardware clears the MSR[ME] bit when delivering a machine check interrupt, so that is what QEMU does. The spapr environment runs in supervisor mode though, and receives machine check interrupts after they are processed by the hypervisor, and MSR[ME] must always be enabled in supervisor mode (otherwise it could checkstop the system). So MSR[ME] must not be cleared when delivering machine checks to the supervisor. The fix to prevent supervisor mode from modifying MSR[ME] also prevented it from re-enabling the incorrectly cleared MSR[ME] bit when returning from handling the interrupt. Before that fix, the problem was not very noticable with well-behaved code. So the Fixes tag is not strictly correct, but practically they go together. Found by kvm-unit-tests machine check tests (not yet upstream). Fixes: 678b6f1af75ef ("target/ppc: Prevent supervisor from modifying MSR[ME]") Reviewed-by: Harsh Prateek Bora Signed-off-by: Nicholas Piggin --- target/ppc/excp_helper.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 80f584f933..674c05a2ce 100644 --- a/target/ppc/excp_helper.c +++ b/target/ppc/excp_helper.c @@ -1345,9 +1345,10 @@ static void powerpc_excp_books(PowerPCCPU *cpu, int excp) * clear (e.g., see FWNMI in PAPR). */ new_msr |= (target_ulong)MSR_HVB; + + /* HV machine check exceptions don't have ME set */ + new_msr &= ~((target_ulong)1 << MSR_ME); } - /* machine check exceptions don't have ME set */ - new_msr &= ~((target_ulong)1 << MSR_ME); msr |= env->error_code; break; From patchwork Sun Mar 31 07:33:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13611815 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 40470CD1288 for ; Sun, 31 Mar 2024 07:35:31 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rqpi2-0002zW-5d; Sun, 31 Mar 2024 03:34:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rqpi1-0002z7-07; Sun, 31 Mar 2024 03:34:29 -0400 Received: from mail-ot1-x32b.google.com ([2607:f8b0: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 1rqphz-0002GP-Ey; Sun, 31 Mar 2024 03:34:28 -0400 Received: by mail-ot1-x32b.google.com with SMTP id 46e09a7af769-6e8918d29deso361401a34.1; Sun, 31 Mar 2024 00:34:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711870465; x=1712475265; 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=dZL1L08WWNCihv0YHYd8rN2H0Y3QSivHfttFd+0jXus=; b=O2oGMQCjyVjOmywvLKhprfpxfVzYyjUuKHOjw8RAwtT5a7CAYTgsqmAZdDfMpB9sKk 0UscWs5PeOKfnSoZfoFl1yXLaEnToFoWHD9G8c3/Ry0dpDGGVRSGWqb9gxlr67Ys1WMn XDdT7xzQltPqEgSS+plvtNSGfkgitVR+AkwwmEDI3CJB/ZZjq+SGM4AYw5nNK7qJVXUD UB4e1Guhhatc7bES6GqX12tkkSHGlWFuJ1713RjaVu4uSOoPbPBim/axu3sO5pU01HTI IGZjZDxQnxHBhmfEDaweG5rWUaBTIxu36R+1KqZcAD6117jlyFOibz12a62IJKYSymUb xYmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711870465; x=1712475265; 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=dZL1L08WWNCihv0YHYd8rN2H0Y3QSivHfttFd+0jXus=; b=jse2mZNvJPrm+DD+aosZCMYSbW9SxILE3MVO2CNX+010fcKENRIaVY05gkZdM+1z7X D3gczjGcOUR+qIOIknC4PMl0FtgbwI3tr221MekpNb7Ft7AMLdNX/4OEQV0aDm0cK4WM AZbbPkUG7ZKpQlLVuMGPKA2SULYkiV1MqdCK2D982cVx0wxMwrk+A+sq8Xu49eZ+wD1/ 3rlL+9FIjTq/51OGl3t9MTXrBLU5HN3yCofAGBvexVf7YwEAlbu8SagJ/ThQsXRQ3qsH neMUwl+R/tVCzYbdCEsdsKyFOHYTiJ0PgNQJLL6y9A+iP27qp2zJ+iI3B2sbTPC1s3AG tGhQ== X-Forwarded-Encrypted: i=1; AJvYcCVhdpsIEvqk23bUQhuBXPDmvJJUWzXjIhhS5/AH2gRrwqeRzdziBSvamyjGO7yB4T53gOByNIOYDgaR5WP9v+LK/5KV X-Gm-Message-State: AOJu0YxDrcmKuYIbG6W6Bqpq+KRvX973cBGNA+oRD8/Ooykh0sg3KYkE wR9B+4iMKHKJkAdvMCrhZeLF5nF+1lwXr54Lycy8Fs9cqb4ly38DICRq3ZXK4o4= X-Google-Smtp-Source: AGHT+IGzoaWFh2ho0wfRfk3HYKSBF0hywllvqkOhnNHdoufUN2O4R1MUuKPYdcZVaUJwZkIcQOz68A== X-Received: by 2002:a05:6870:8093:b0:222:63e2:aba3 with SMTP id q19-20020a056870809300b0022263e2aba3mr7125090oab.8.1711870465336; Sun, 31 Mar 2024 00:34:25 -0700 (PDT) Received: from wheely.local0.net ([118.210.97.62]) by smtp.gmail.com with ESMTPSA id k9-20020aa78209000000b006eabe72ce84sm5822411pfi.16.2024.03.31.00.34.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Mar 2024 00:34:25 -0700 (PDT) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-ppc@nongnu.org Subject: [PULL 7/8] tests/avocado: Fix ppc_hv_tests.py xorriso dependency guard Date: Sun, 31 Mar 2024 17:33:44 +1000 Message-ID: <20240331073349.88324-8-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240331073349.88324-1-npiggin@gmail.com> References: <20240331073349.88324-1-npiggin@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::32b; envelope-from=npiggin@gmail.com; helo=mail-ot1-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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org For some reason the skipIf missing_deps() check fails to skip the test if it comes after the skipUnless lines, causing an error running on systems without xorriso. Avocado implements skipUnless is just an inverted skipIf, so it's not clear what the bug is or why this fixes it. For now it's enough to get things working. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2246 Fixes: c9cb496710758 ("tests/avocado: ppc add hypervisor tests") Signed-off-by: Nicholas Piggin --- tests/avocado/ppc_hv_tests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/avocado/ppc_hv_tests.py b/tests/avocado/ppc_hv_tests.py index 5080358e25..2c8ddd9257 100644 --- a/tests/avocado/ppc_hv_tests.py +++ b/tests/avocado/ppc_hv_tests.py @@ -42,10 +42,11 @@ def missing_deps(): # QEMU packages are downloaded and installed on each test. That's not a # large download, but it may be more polite to create qcow2 image with # QEMU already installed and use that. +# XXX: The order of these tests seems to matter, see git blame. +@skipIf(missing_deps(), 'dependencies (%s) not installed' % ','.join(deps)) @skipUnless(os.getenv('QEMU_TEST_FLAKY_TESTS'), 'Test sometimes gets stuck due to console handling problem') @skipUnless(os.getenv('AVOCADO_ALLOW_LARGE_STORAGE'), 'storage limited') @skipUnless(os.getenv('SPEED') == 'slow', 'runtime limited') -@skipIf(missing_deps(), 'dependencies (%s) not installed' % ','.join(deps)) class HypervisorTest(QemuSystemTest): timeout = 1000 From patchwork Sun Mar 31 07:33:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13611817 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E73FBCD1288 for ; Sun, 31 Mar 2024 07:35:53 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rqpi5-00032N-4l; Sun, 31 Mar 2024 03:34:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rqpi3-000301-2S; Sun, 31 Mar 2024 03:34:31 -0400 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rqpi1-0002Jb-Ku; Sun, 31 Mar 2024 03:34:30 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-6ea9a605ca7so2212987b3a.0; Sun, 31 Mar 2024 00:34:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711870468; x=1712475268; 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=XNe5dOzqOeierXs9KtggpyMYBczM9maytA5+1Uk3r58=; b=XnhLq2BnHSSj0vxToZR+C/RXURCpzL3s2LeHQ29uZhLjuxWJGqj9sBio9cQ8qEbCsT ofAByzNBzoqKRSjbjRGh9PNPMqV2UXaio97kugLBhsGp+gz9hbkoJ4CI9aFh2gpWd7OG 9ZxkVWgAV5cTPmiX0sPaH3ebfSV7r20NUm5sSUq6LnTMLiPOnUVRJ4z+klxFy1Q8ZJIL fD8y8EbmiAZeBmDFlmqUc6Pnnh5QybVKNkEIL8dgBs+Gy86N1Q6VBoT9RuNWjkqgW8Zd MBom5Y0BvfzHOQ8p+CT9bmzdyvYEr6A8qEYjLQWwzdahOxggI101GEtDEsEq7VrA+QqC 2eHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711870468; x=1712475268; 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=XNe5dOzqOeierXs9KtggpyMYBczM9maytA5+1Uk3r58=; b=nXfyGNC9Cb2DN35jahUnToeaemsQ1NbExhfkdSWawOs7t6Ic6bLVjtqI1I/RlO7UJr r8u9agTH6yIc12G1ur/63vQC/1jUQqamF5k5GAX7w/sfBuPht6fvr6cAGqaxrMcC7v7J 0IgQjvG8G07nCN4sYaqTf8mj0qC6y/ab73sVAIv5Y/OTaaEjcgZXIJaK3g+q5bcLUcBk sOdNLZDyDUKw+hVFR5M7WN6ebErpnhb3w0Oe9XExgTfqP32vlphBdXNT/pSRD8lmekoG xGB/8pleoiWyPX3UxCHFsD2q7czgRBNJ+f8RMvFiy7ZYjKdtRtICpZfRoxRwe82b54bX 7fhA== X-Forwarded-Encrypted: i=1; AJvYcCVOHyHdqxM8BaDTPKsaucBVkyZYEbHVwq7IR+/Qqc6owQJ23Vrsj0/cPCIhsJ86gWdQf0aDdouCvgSrslCv7gC/5jD2 X-Gm-Message-State: AOJu0Ywm7q+Xq9LeCR2tVLsUgDY471ndqbvvwIPyWgQos90D/eTuLW1s 8LXLXNHsqL0L7+IPNPZ5k6LHmjr1cKQyHFRHrHOhgE7+JIsQDgEZL4oieeC4a5Q= X-Google-Smtp-Source: AGHT+IGOSzte/modj7JZksb7ZDiiiXJEXTZBZionLWBAORlBDO8GB9MrtlKvxNxO+cpLuzT9XMINIw== X-Received: by 2002:a05:6a00:181b:b0:6e7:6bc4:ef8c with SMTP id y27-20020a056a00181b00b006e76bc4ef8cmr13846300pfa.3.1711870467662; Sun, 31 Mar 2024 00:34:27 -0700 (PDT) Received: from wheely.local0.net ([118.210.97.62]) by smtp.gmail.com with ESMTPSA id k9-20020aa78209000000b006eabe72ce84sm5822411pfi.16.2024.03.31.00.34.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Mar 2024 00:34:27 -0700 (PDT) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-ppc@nongnu.org Subject: [PULL 8/8] tests/avocado: ppc_hv_tests.py set alpine time before setup-alpine Date: Sun, 31 Mar 2024 17:33:45 +1000 Message-ID: <20240331073349.88324-9-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240331073349.88324-1-npiggin@gmail.com> References: <20240331073349.88324-1-npiggin@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=npiggin@gmail.com; helo=mail-pf1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org If the time is wrong, setup-alpine SSL certificate checks can fail. setup-alpine is used to bring up the network, but it doesn't seem to to set NTP time before the failing SSL checks. This test has recently started failing presumably because the default time has now fallen too far behind. Fix this by setting time from the host time before running setup-alpine. Fixes: c9cb496710758 ("tests/avocado: ppc add hypervisor tests") Signed-off-by: Nicholas Piggin --- tests/avocado/ppc_hv_tests.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/avocado/ppc_hv_tests.py b/tests/avocado/ppc_hv_tests.py index 2c8ddd9257..bf8822bb97 100644 --- a/tests/avocado/ppc_hv_tests.py +++ b/tests/avocado/ppc_hv_tests.py @@ -14,6 +14,7 @@ import os import time import subprocess +from datetime import datetime deps = ["xorriso"] # dependent tools needed in the test setup/box. @@ -107,6 +108,8 @@ def do_start_alpine(self): exec_command(self, 'root') wait_for_console_pattern(self, 'localhost login:') wait_for_console_pattern(self, 'You may change this message by editing /etc/motd.') + # If the time is wrong, SSL certificates can fail. + exec_command(self, 'date -s "' + datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S' + '"')) exec_command(self, 'setup-alpine -qe') wait_for_console_pattern(self, 'Updating repository indexes... done.')