From nobody Mon Nov 25 11:00:08 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=flygoat.com ARC-Seal: i=1; a=rsa-sha256; t=1715459263; cv=none; d=zohomail.com; s=zohoarc; b=Ynab6/qlj7pdkNQRkmZqUjoOf7nDnRtGLoiA7DRMxi49DxBFU82S43KZVZThYzdW+mK9dWps0fWZA+6FVh+si5TY3DGHmATdZZeVZtHeX09yS8yrfeprtUVmieeVjRY6xpGzgKKtlyRFIdW5v42bZhBA8J419snfPXYQ4EKe0KI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715459263; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=gQKPojefqIVdr5JNAd4NOG05AsiCaQAwxbfiM2/Wk/k=; b=YdctgBGUinsVC6EUjjzQJl+K0RF/Y1dAUrz2RWrJ1kdt2Xp33MhsQ2gqrh9EImC3x5TJIZi+1xaaZOdYn/M1dgjvJxqio70CpJUJdQLLGH1X4dvzORpEQRgqCzsTlYygQ8ae7008RCfEwZHWvMr5xAlW+Zi0h1v7jUKhm3Tvqxw= 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 171545926352879.001596629922; Sat, 11 May 2024 13:27:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s5tIv-0007tg-KQ; Sat, 11 May 2024 16:26:49 -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 1s5tIu-0007tL-Ie for qemu-devel@nongnu.org; Sat, 11 May 2024 16:26:48 -0400 Received: from wfout4-smtp.messagingengine.com ([64.147.123.147]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s5tIs-0001pY-IE for qemu-devel@nongnu.org; Sat, 11 May 2024 16:26:48 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfout.west.internal (Postfix) with ESMTP id 336D81C00096; Sat, 11 May 2024 16:26:43 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sat, 11 May 2024 16:26:43 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 11 May 2024 16:26:41 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:message-id:mime-version:reply-to :subject:subject:to:to; s=fm1; t=1715459202; x=1715545602; bh=gQ KPojefqIVdr5JNAd4NOG05AsiCaQAwxbfiM2/Wk/k=; b=TNGaTca/4li7kYadib yyvyRwTf9uT+hn8brW58dc3DgwGRnJJFKKjVu5BboCCq2SVIKru4t64N7nklB4eE rlpBuPSY7iObODG5EUip+s3YBYplc+xQZoe02su9QLgIch6xXRjCUpcJ52fFDIP1 u8twejNmLOJJfYzTXn3EoCiE6umrUL768Tt6tR8UAHu6KFVnD2AahcuPsd/DzzD/ GlTz7LYft0qeuTdgkwpcZc1puySWuZzuAHNMRCrkSJ9JgDHIm9zAvNNjZdAt7WEV BIYLaSJLLViDDZxHfgZRQo2nAwRZww9bQiOhYECjEDpn2p0stAXlROIKLycOJuEL q85w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:message-id:mime-version:reply-to:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1715459202; x=1715545602; bh=gQKPojefqIVdr 5JNAd4NOG05AsiCaQAwxbfiM2/Wk/k=; b=QQRg9dJK+mgKRgU73FV5nv1eFafrB 3umGZWwgTwsim6X8ZH639eybruHuVnm0z/0vl41BUqR9WxpQt1g//MKr/wlDm9qw qyMhyKyy+5f+/SpR6HOjnEdsZOWuLY9yD6alLUdBcR1tOFhryM4BhMMALTaFEgyF I1y7BsHlKqRWoyqWTkJLDG2MiKE3X4M+LKujTJRyVjLodHgxUl1FTqkd61UZlD5V 7jgP56nrNDTiHSF2Sb/xH4PpIuWRaLNu8ZwwbKuXzZSVsX85fqoQHEMQZjtVHFzZ d3GTapm4l+OnnKsrJFjs03JPQOo1b5osJaI7AldZSg5oII5gFbqyQ1m5A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdegtddgudegkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhfffugggtgffkvfevofesthejredtredtjeenucfhrhhomheplfhirgig uhhnucgjrghnghcuoehjihgrgihunhdrhigrnhhgsehflhihghhorghtrdgtohhmqeenuc ggtffrrghtthgvrhhnpeffteeugeektdfgjeevuedvgffhgedtvdfghedugefhgeehteeu udehudevjeethfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehjihgrgihunhdrhigrnhhgsehflhihghhorghtrdgtohhm X-ME-Proxy: Feedback-ID: ifd894703:Fastmail From: Jiaxun Yang Date: Sat, 11 May 2024 21:26:35 +0100 Subject: [PATCH] mips64el-softmmu: Enable MTTCG MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240511-mips_mttcg-v1-1-1b71d9b85234@flygoat.com> X-B4-Tracking: v=1; b=H4sIAHrUP2YC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDIxMDU0ND3dzMguL43JKS5HRdE/NEsyRDSwNzkyRjJaCGgqLUtMwKsGHRsbW 1AIaoWSdcAAAA To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jiaxun Yang X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2652; i=jiaxun.yang@flygoat.com; h=from:subject:message-id; bh=dQbwlpBpzTP6I6Mh3Lfo9FcvSurXB4/+FmQzeaP8ZP4=; b=owGbwMvMwCHmXMhTe71c8zDjabUkhjT7K81bee342az0ArifFsR0iSeH3Ju6rvSlauapRPFjy SG35uzsKGVhEONgkBVTZAkRUOrb0HhxwfUHWX9g5rAygQxh4OIUgInMOMfIcKEwTKpMXehyfIJq +vmLDI2CQY7vzRw4WQvsTkxiZz51kZHh4qvLmmxyNmEK9xbtYKz4Zb9lz5ymeg/3vHOT5lSJhN3 nAAA= X-Developer-Key: i=jiaxun.yang@flygoat.com; a=openpgp; fpr=980379BEFEBFBF477EA04EF9C111949073FC0F67 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=64.147.123.147; envelope-from=jiaxun.yang@flygoat.com; helo=wfout4-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_PASS=-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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @flygoat.com) X-ZM-MESSAGEID: 1715459265825100003 MTTCG was disabled in a092a9554771 ("configure: disable MTTCG for MIPS guests") due to test case instability. I was able to reproduce this issue with in latest QEMU and look into reason behind that. What actually happend is kernel's CP0 timer synchronisation mechanism assumed a consistent latency in memory access between cores, which TCG can't guarantee. Thus there is a huge drift in count value between cores, and in early kernel versions CP0 timer is always used as sched_clock. sched_clock drift back on some cores triggered RCU watchdog in some extreme cases. This can be resolved by setting clocksource to MIPS, which allows clocksource to drift together with sched_clock. However this will leed to other problems after boot. Another option would beupdating kernel to later version, which will use GIC as sched_clock. In non-MTTCG build, the execution is slow enough so kernel won't observe back drifts. Test results: With clocksource=3DMIPS ``` ~/tmp/retry/retry.py -n 100 -c -- ./qemu-system-mips64el \ -display none -vga none -serial mon:stdio \ -machine malta -kernel ./vmlinux-4.7.0-rc1.I6400 \ -cpu I6400 -smp 8 -vga std \ -append "printk.time=3D0 clocksource=3DMIPS console=3Dtty0 console=3Dtt= yS0 panic=3D-1" \ --no-reboot 100, 0, PASS, 5.258126, 100, 100, - Results summary: 0: 100 times (100.00%), avg time 6.508 (55.53 varience/7.45 deviation) Ran command 100 times, 100 passes ``` With linux-next: ``` ~/tmp/retry/retry.py -n 100 -c -- ./qemu-system-mips64el \ -display none -vga none -serial mon:stdio \ -machine malta -kernel ~/linux-next/vmlinux \ -cpu I6400 -smp 8 -vga std \ -append "printk.time=3D0 console=3Dtty0 console=3DttyS0 panic=3D-1" \ --no-reboot 100, 0, PASS, 4.507921, 100, 100, - Results summary: 0: 100 times (100.00%), avg time 4.233 (0.04 varience/0.21 deviation) Ran command 100 times, 100 passes ``` Signed-off-by: Jiaxun Yang Reviewed-by: Pierrick Bouvier --- I'll leave the test case alone as it's already marked as QEMU_TEST_FLAKY_TE= STS --- configs/targets/mips64el-softmmu.mak | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/targets/mips64el-softmmu.mak b/configs/targets/mips64e= l-softmmu.mak index 8d9ab3ddc4b1..199b1d909a7d 100644 --- a/configs/targets/mips64el-softmmu.mak +++ b/configs/targets/mips64el-softmmu.mak @@ -1,3 +1,4 @@ TARGET_ARCH=3Dmips64 TARGET_BASE_ARCH=3Dmips +TARGET_SUPPORTS_MTTCG=3Dy TARGET_NEED_FDT=3Dy --- base-commit: 248f6f62df073a3b4158fd0093863ab885feabb5 change-id: 20240511-mips_mttcg-47a6b19074b3 Best regards, --=20 Jiaxun Yang