Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp308386lqp; Wed, 12 Jun 2024 02:09:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWrdQuIwdGvwyRazlGfRI+57gqQ+qDmel0t3aJJgRGkvoLKwL2ekcoO7dCvHRrSoyqcfwnllp1JBrWs66GvP+fBdQXdslFr1+UotTyPlg== X-Google-Smtp-Source: AGHT+IESwqfLwB0uwyqc6AmtacRc9dRuEB+P0oy31lzrjHx5Y/MJDbVmn1el7c/sj5Mc3VgauudO X-Received: by 2002:a05:6808:150f:b0:3d2:28a9:475b with SMTP id 5614622812f47-3d23dfb09eamr1256609b6e.7.1718183343926; Wed, 12 Jun 2024 02:09:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718183343; cv=pass; d=google.com; s=arc-20160816; b=DXpWZojmcwsQiIo/P+DVB3Lyjslv+jMiMNCye2crQBjmq6/fhe6CZkzx2UGHY26ex/ /I8x7kUD0G0wFJUiiB6+UQLuZ9TNms6cENloIheQR58GukOSS/bHTIvlIHU+KXYa01zS c2adZOsn5nTAZ0zoyh4ApjsSoAlzwb6LaNgYLIIrNMeUOCkTJeWujgQCa1o4LaJbNbkE IjhH4QU1WWn+pj0t4SMkkoEP//k8SIZt47gLo8kywtJoHVo2ddMUJpN23+odJ38RD16H +6A7eI59rFagGKXZv5ibEmksjPD6/nu9GZrljZI8yHZplxeb2VPu8U0Z55DDk/A8hcJU GE0A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:feedback-id:dkim-signature:dkim-signature; bh=JpX0NbJWnoQWVz/bJ4pYn1KJiy0U4HxA2hdsnqEDJEY=; fh=EvY7dV+FIhCf/zpeIQvcugX4A/nQlQmuap7Xn+akpwY=; b=0Y4tslGLInDtchehh7uWWxhmsKkw0glatNJLVsVxfYbuvxSsGpXz/9D/ZZ75eerf5v WZ5uXIN3T9RZ+yidcb4STzGPQnwGqeh0Cx1D4b5iVwJbJwXT9rvgNEujJ7YQEHDm7V26 2ra/6ZuyH14qQfo1rNEA5MnBdeD6Crkqrjb56tjsGzxO7UMw4Rhd2HVCtdSoeJMrFpia ilN7ecW7xoqtVVtNLQJ7UfmCuvhGLaB5L6V2QZjUKktQj2RvI0C6j5XBuMgaRw40rUIC 4MGY3L4R6K5Wp9ciQK6hvQZbPp1UrTVPm1CKrgeB+f5qev72N7XQBLiqIzHaHlAYTL7x t3Zg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm2 header.b=qLdo1kbK; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=eEDqldI7; arc=pass (i=1 spf=pass spfdomain=flygoat.com dkim=pass dkdomain=flygoat.com dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=flygoat.com); spf=pass (google.com: domain of linux-kernel+bounces-211215-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211215-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d2e1a72fcca58-705be07843bsi925538b3a.262.2024.06.12.02.09.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 02:09:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-211215-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm2 header.b=qLdo1kbK; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=eEDqldI7; arc=pass (i=1 spf=pass spfdomain=flygoat.com dkim=pass dkdomain=flygoat.com dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=flygoat.com); spf=pass (google.com: domain of linux-kernel+bounces-211215-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211215-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id BF95FB26BC1 for ; Wed, 12 Jun 2024 08:55:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B77CD16D9AD; Wed, 12 Jun 2024 08:54:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=flygoat.com header.i=@flygoat.com header.b="qLdo1kbK"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="eEDqldI7" Received: from fout5-smtp.messagingengine.com (fout5-smtp.messagingengine.com [103.168.172.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B81F816DEAE; Wed, 12 Jun 2024 08:54:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.148 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718182478; cv=none; b=NqtLNy2oaMPB+/JWvoepoigbB7ZWYTE1+uWcoGiYoxZ0fmMlF5Zoum6Ing4kC5tfrbMUhRHm0W3aFUEmlEZdZAbp3z4nZm0fqSFrgK/WpDStaCQgf8ncsNhs4SyJOQRob251qtvMTY4+rCQ2b3y+OXQqq/KCQLj/MvRlH/kEFSI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718182478; c=relaxed/simple; bh=1l2iw9HXUPl+0KsXVVzTlbq6pkrETw2qb2aFtEiqaXk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pEOeKSBjZCfVB+WIxh2+flefb0sl46n78e8CFLnAT/1SLaXkmYymAexLtYkVMtc+LW9BEdHUsXhR2rx8C/NZvZtP6IblIV/wUbl89nrvM0/vtPO+2nO/7j5nKpFXdOEZh+K1c973x9QGJuYDzGL/IUriBfBmy6zBrHCyp45Blkk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=flygoat.com; spf=pass smtp.mailfrom=flygoat.com; dkim=pass (2048-bit key) header.d=flygoat.com header.i=@flygoat.com header.b=qLdo1kbK; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=eEDqldI7; arc=none smtp.client-ip=103.168.172.148 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=flygoat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flygoat.com Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfout.nyi.internal (Postfix) with ESMTP id C7ED513800D3; Wed, 12 Jun 2024 04:54:35 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Wed, 12 Jun 2024 04:54:35 -0400 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:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1718182475; x=1718268875; bh=JpX0NbJWnoQWVz/bJ4pYn1KJiy0U4HxA2hdsnqEDJEY=; b= qLdo1kbK+BrW8tZSCaj4/UdBulXlwHk/71ET/jwA732hFPevrlHGGWln0KxVQIMg Ed6togkVvUWrEtf9pdoC/j2u66+G+SI9GBSDR5ykbOlQgM2DRqjtVxlMbmz2p0lK +DyEQ+kylALrs8ybrgJ0ZoWybL94WXaPsC8VRrPBmipqeIIEtciDm3wSWqQhmrHD 5Nv0tjNYBBibgfqL4L/LVt+ltcmuzDJxwCN2dK12NHVXvXXwoQEmrD/UipvX9iIT J7WhjomMkcuetqOKao0mETrPdfjZGFFKfuyOud3I8+dKADlJhSp7kOOqHRI5qrHI EmGG6uCmJSS1FPvUhgREPA== 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:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1718182475; x= 1718268875; bh=JpX0NbJWnoQWVz/bJ4pYn1KJiy0U4HxA2hdsnqEDJEY=; b=e EDqldI7FcaoqjJn4dhZuqklR1po//AxLhYQlLt7a2W64LX3erq/USlubjFpgzj3g WjjJE+N4J+Q5K40nTPS53eCLZTWPjPzywbz3pKv6Q8EkM5OUtW5PSa9F0pitjV+a u3aXWJCTPJx4ifAcySSaE9/AN6L1MoG2wpCi7IpgwDDBjPSPZJnE9Nab2Bf6WGCZ /KwGpQ9/MrKVE3gf1mnq+AJ7AGJeZNlfV4ATivcm1daJ/PpG73PHeegH1j5IRhvO yca1QlEVJYcFH0F6Qa4zSRbZPyN2YrzAqDRI4rpegEuEnKAe2Qc9PY91unqJI73N Nw4KI7oymL961Bc7SHSZA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfedugedgtdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdejnecuhfhrohhmpeflihgr gihunhcujggrnhhguceojhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomheqne cuggftrfgrthhtvghrnhepvdekiefhfeevkeeuveetfeelffekgedugefhtdduudeghfeu veegffegudekjeelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomh X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 12 Jun 2024 04:54:34 -0400 (EDT) From: Jiaxun Yang Date: Wed, 12 Jun 2024 09:54:29 +0100 Subject: [PATCH v2 2/7] MIPS: csrc-r4k: Apply verification clocksource flags Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240612-mips-clks-v2-2-a57e6f49f3db@flygoat.com> References: <20240612-mips-clks-v2-0-a57e6f49f3db@flygoat.com> In-Reply-To: <20240612-mips-clks-v2-0-a57e6f49f3db@flygoat.com> To: Thomas Bogendoerfer , Serge Semin , Daniel Lezcano , Thomas Gleixner Cc: "Maciej W. Rozycki" , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Jiaxun Yang X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=920; i=jiaxun.yang@flygoat.com; h=from:subject:message-id; bh=1l2iw9HXUPl+0KsXVVzTlbq6pkrETw2qb2aFtEiqaXk=; b=owGbwMvMwCXmXMhTe71c8zDjabUkhrTMJPcDkbs4Jj35dGebfstlaykn8Wv/olI0M87deFIy+ XBN/seZHaUsDGJcDLJiiiwhAkp9GxovLrj+IOsPzBxWJpAhDFycAjCRzIcM/zOerOPZ8/QxQ1Bd W0Hupz3PlZpfb5/LtznY/vJ5kd36D5kZGeYwNk194Fg/91bgZtEdDr7amSkesxdekms79cLhwvJ JvEwA X-Developer-Key: i=jiaxun.yang@flygoat.com; a=openpgp; fpr=980379BEFEBFBF477EA04EF9C111949073FC0F67 CP0 counter suffers from various problems like SMP sync, behaviour on wait. Set CLOCK_SOURCE_MUST_VERIFY and CLOCK_SOURCE_VERIFY_PERCPU, as what x86 did to TSC, to let kernel test it before use. Signed-off-by: Jiaxun Yang --- arch/mips/kernel/csrc-r4k.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/mips/kernel/csrc-r4k.c b/arch/mips/kernel/csrc-r4k.c index f02ae333f4f9..055747a7417d 100644 --- a/arch/mips/kernel/csrc-r4k.c +++ b/arch/mips/kernel/csrc-r4k.c @@ -21,7 +21,9 @@ static struct clocksource clocksource_mips = { .name = "MIPS", .read = c0_hpt_read, .mask = CLOCKSOURCE_MASK(32), - .flags = CLOCK_SOURCE_IS_CONTINUOUS, + .flags = CLOCK_SOURCE_IS_CONTINUOUS | + CLOCK_SOURCE_MUST_VERIFY | + CLOCK_SOURCE_VERIFY_PERCPU, }; static u64 __maybe_unused notrace r4k_read_sched_clock(void) -- 2.43.0