From patchwork Thu Feb 1 01:04:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Hilber X-Patchwork-Id: 195115 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:106:209c:c626 with SMTP id mn5csp131434dyc; Wed, 31 Jan 2024 17:08:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IFbNNls8e3K+Md1J66oR4G9gRxw94yDspsEQH/XExVlep7o2cccBwquLmZ1vrk++DK8w40D X-Received: by 2002:a05:620a:8008:b0:783:24c1:dd7c with SMTP id ee8-20020a05620a800800b0078324c1dd7cmr1529077qkb.1.1706749685576; Wed, 31 Jan 2024 17:08:05 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW9BlDz9Is2gbPwa+I+f5Hk49YUm/btO12iJptTTcNuLnQNOVW9BjWI1e8MM3FgeWUlixmZp8OqCTsk4Zlo/IzS2Cz4PA== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id h26-20020a05620a21da00b00783fc517e95si8105890qka.413.2024.01.31.17.08.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 17:08:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47464-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@opensynergy.com header.s=TM-DKIM-20210503141657 header.b=sS06fzok; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-47464-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47464-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=opensynergy.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 60A791C2319A for ; Thu, 1 Feb 2024 01:08:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 316272B9D0; Thu, 1 Feb 2024 01:06:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=opensynergy.com header.i=@opensynergy.com header.b="sS06fzok" Received: from refb01.tmes.trendmicro.eu (refb01.tmes.trendmicro.eu [18.185.115.53]) (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 067DA5691 for ; Thu, 1 Feb 2024 01:06:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=18.185.115.53 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706749600; cv=fail; b=Z836VD9k1v9me7amGP6Kb+Q4iwOFsV/ftKLzsZ6NsFuNPP09rV6CVQM9vxIeJnoOYo10r57g/sN6BIIW2UGGPK2iIEt6hW35iX8jJJKko8bSmkc6cJ6lUgZolY3+5nYkzuck625AtVmyxrAYVo5/ri9q1QsPkwIKERoMDoJzewc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706749600; c=relaxed/simple; bh=3qmW4ch/00o/icZapJifBzjs2SmWsMrktxdkuqgknh0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=XnqsVW7kQIzhAPUHXzhJfk1xMvu3+PNlzuqAuEnxGqay2Zw1Pioe1nFG6zxQMx2XS5aVdJ/qzAFOD+G/DIVzy97W2IgnIbEbzLj/56cU3ubNymIgUC4JMy/7cgNt/5RDUNew9sb4m5rQ37louk1jWKaHJ9IqF3V/L+xgabqYDgs= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensynergy.com; spf=pass smtp.mailfrom=opensynergy.com; dkim=pass (2048-bit key) header.d=opensynergy.com header.i=@opensynergy.com header.b=sS06fzok; arc=fail smtp.client-ip=18.185.115.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensynergy.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=opensynergy.com Received: from 104.47.7.168_.trendmicro.com (unknown [172.21.10.233]) by refb01.tmes.trendmicro.eu (Postfix) with ESMTPS id 3DB1410D3A1FE for ; Thu, 1 Feb 2024 01:06:31 +0000 (UTC) Received: from 104.47.7.168_.trendmicro.com (unknown [172.21.176.220]) by repost01.tmes.trendmicro.eu (Postfix) with SMTP id A7EF110000D7A; Thu, 1 Feb 2024 01:06:24 +0000 (UTC) X-TM-MAIL-RECEIVED-TIME: 1706749544.790000 X-TM-MAIL-UUID: ccd98ebb-389f-453f-be31-8a2a190383a1 Received: from DEU01-BE0-obe.outbound.protection.outlook.com (unknown [104.47.7.168]) by repre01.tmes.trendmicro.eu (Trend Micro Email Security) with ESMTPS id C0F8D1000030C; Thu, 1 Feb 2024 01:05:44 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iH6ue0QNC7S8Ot1ZAo7rlHg7OjT925Jfz4JKBf4RGDkiI32gw7euIhri8kG/vysZjWTgAsu43rjNyPVTqzp6N66jk1Q35rOvoZiIBoT1EuBv8GsHAM60wCIloAhNaMtLo3h3C3XF1HFTfA/rYMH+viAW2EAwuPyEQbrqT22jf9uenBdwXrUJJMIyBYfyDY9N0Lwc7qhCTeb2KeFgDDWP0NccG+wzapjsiK7Xuz3YcTfQG6Uc8YzTvTlTtVWrFvN2EPN4ck4yOHKkLah/xjwsFOi5HkrwUOjqaqqQacZ34DvPWju8iTtAIy0c+3DO2J67/ZRO3IWAUKVEAiQVvBtoNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3+25KA7yyDsyn9T3uP3coyDz2T9StWj4s1Hs48TRiwg=; b=bCuI1W73Ek70wEqPQm0edjG67n0xO59E40e9eZoLC7KANgahiqiA1ZjhtI+dALIvWUG6Ol4kjoRmBbocU7D6sl3jmSbXfG4MDn8CEEAeonv8GuA10KFAF5LTEkTWkr9G4Hv56FG7euvqsHE3lYlnGHEXgJRUAa7apM6Xl048QayXHuXxs0+4uqZgUyPTq/cD+4WSW45n5E+IZkjGyruItD9jiAPLeMYnWyigltklR4LVjlwG12iV1nvQR/DyCGFHiQvlwJoP57zcPj6bgr9Hns/2YQjG9E1zyH6TCEo8ASEKFlWW807BhTdjaSzR/vm0Igo6GxKd7haT/sHo1c0NHw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 217.66.60.4) smtp.rcpttodomain=alien8.de smtp.mailfrom=opensynergy.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=opensynergy.com; dkim=none (message not signed); arc=none (0) X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 217.66.60.4) smtp.mailfrom=opensynergy.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=opensynergy.com; Received-SPF: Pass (protection.outlook.com: domain of opensynergy.com designates 217.66.60.4 as permitted sender) receiver=protection.outlook.com; client-ip=217.66.60.4; helo=SR-MAIL-03.open-synergy.com; pr=C From: Peter Hilber To: linux-kernel@vger.kernel.org Cc: Peter Hilber , Simon Horman , "D, Lakshmi Sowjanya" , Thomas Gleixner , jstultz@google.com, giometti@enneenne.com, corbet@lwn.net, "Dong, Eddie" , "Hall, Christopher S" , Andy Shevchenko , x86@kernel.org, Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" Subject: [PATCH v3 1/8] x86/tsc: Fix major kernel-doc warnings for tsc.c Date: Thu, 1 Feb 2024 02:04:46 +0100 Message-Id: <20240201010453.2212371-2-peter.hilber@opensynergy.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240201010453.2212371-1-peter.hilber@opensynergy.com> References: <20240201010453.2212371-1-peter.hilber@opensynergy.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB8EUR05FT054:EE_|BE1P281MB1938:EE_ X-MS-Office365-Filtering-Correlation-Id: c3e10fa9-3529-4452-f0f0-08dc22c1e9dd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ALedq3XAOa7o6Yu+I7E4Aj8itoE0l9ShSeu3aX3/9x73TZ56j/tk0L4hf89RfYInmiyOZioMg/JDHU5VHRlCSBzrip1HZUNbc/6cu0FzUWwxIVPgxBv24wjisX9YZQCovGat5YVAVOHahR4QejpYvFKQGhxOQKhz5XlCVsVkV5b/u3AxvSDlYUakgLiDFK8GcN1OzCwaUkcYGUfP8g1Hu53z4V8C8wY4d+07L6tBxjpbalrz1ax05w7jZjPCO1cug3Qw7P18vN3V0afZqijhySCCcwMoG6LHSRsVGLWzQm7L3OFJ6hbxGrdMePf9E2WBv9oFiZf2kAsyde8YbvCUa9B9bpdMq2ToTKH4qTBpJTM8A3h+y00jE4UhZjSUCP6nQmbSLVRmRyqFVR6li4fKew56MqjardB0ryJ/I0vWZIRN8ddapwUz+/nC3MJQuC0O+8B6RB2zaUOlS9Sqb7bP/TLztPShBP5gCjGCy34sIPBxAKQw1mpSOksOnZ9cJtb6hfFpENw2u2uYOgdlhDHKaywQyYPNWDGBOLtXL3lPbE2WdwBQkm49ggNY8C6y2lMXliVYVFPNXKH2TEUgdyV9S6CXRnZqzW6rEZZ3e8XBmHYYL1NzgNx1Q/u/v7hlhgvA9l+6Tl8xGP4BWhgjmaXN+G6/Q6K6L4Rf5ZbVFLaRg25ff++ucafnxAmHFLCGNCBsSuzlai34RoVxAhKMjnwAgPKO+mscAdqTZc4SGLqIcbIYqdq7/KrGos7AdupIy7V5f13ul78jSbskE2NaBdZG1Q== X-Forefront-Antispam-Report: CIP:217.66.60.4;CTRY:DE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SR-MAIL-03.open-synergy.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(396003)(136003)(376002)(346002)(39840400004)(230922051799003)(230273577357003)(230173577357003)(451199024)(64100799003)(1800799012)(82310400011)(186009)(46966006)(36840700001)(41300700001)(5660300002)(2906002)(36756003)(7416002)(70206006)(70586007)(54906003)(40480700001)(83380400001)(6916009)(316002)(2616005)(86362001)(42186006)(1076003)(336012)(478600001)(44832011)(26005)(47076005)(36860700001)(8936002)(8676002)(81166007)(4326008)(36900700001);DIR:OUT;SFP:1102; X-OriginatorOrg: opensynergy.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2024 01:05:42.6186 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c3e10fa9-3529-4452-f0f0-08dc22c1e9dd X-MS-Exchange-CrossTenant-Id: 800fae25-9b1b-4edc-993d-c939c4e84a64 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=800fae25-9b1b-4edc-993d-c939c4e84a64;Ip=[217.66.60.4];Helo=[SR-MAIL-03.open-synergy.com] X-MS-Exchange-CrossTenant-AuthSource: DB8EUR05FT054.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BE1P281MB1938 X-TM-AS-ERS: 104.47.7.168-0.0.0.0 X-TMASE-Version: StarCloud-1.3-9.1.1015-28152.007 X-TMASE-Result: 10--0.724300-4.000000 X-TMASE-MatchedRID: tODJ1S9VJLP7dTmnXTe0M4Rvl6HHLe8O3V8nMuq8B6I+0J9ZTAkB2IkL KIflgvPFUeXkR4pTjoi80ms4ryCxPix/9VNkbVRzOEwpPzUVSKGpgIbqBDAjJaIysjVZlzq7Y2F KywUpURrm9Tc/GgfFJwFtWueZlMH0t5KZ74QYwoxIFdnsppreL3J8bM38R9gpJsfJJdVp3fqvng kjHjojpH2fbnp7T2HmiXG+DOC9634tUBe4IrvOVzsAVzN+Ov/s/MQPB64FKJ8fhSOSaTT7AYYsZ niTf/ZFNq3SlTCFL/QE2a65+FO8yA== X-TMASE-XGENCLOUD: b1ab1aa9-55ae-4443-80d4-d4ad44aa60f2-0-0-200-0 X-TM-Deliver-Signature: 6F471DD760A4A03862D64D4F3DB1263C X-TM-Addin-Auth: /8pxCs0ZOznQGWCbyrHIVkL+15CpH+IUpLHwiVMbeuP1se92o/9KUoVanM4 Iu2mFZnMRZFozBQqU3ssNjfVbKKyyZiNUA0e0h32ZTwUurSFuV0mSkIUm3qKHeKhw0G70kBkwQ2 csYSukE6JHQwYlkCeQTHcsMEWCgTcuqGDGfWumJCc04zQYo9q5rZVbZsDEKtxHyCQfNY9yZl7fR /Z15mzD4MGFj8cvcHqcv6nERT3bL31hbBeGyqMiwt4kFfb63xa01GXfy5voi3kXkfooGPZx0bW8 LyrINyG5TmFy8pn7A4sSpfSfTHh38b1u89eo.zz+SeWS6mzZI2SDhZn3u5DcmkUQXgRtDAq36S4 va6QgchydxtOe3qFl04kNq0Zq2FZgjDAFrtcGTlG97sl0z+AqWdEZ1URTt8Rl0XGlQyZJ0MXXu3 umNOe56DaYC5tVHALfNKPqspS7JpHejCoPv5zlZZGLrw/kolQ9VGfQK/3oUNEOXUNbntClAYcCe 1g753JNrnT8RMEGzMh4PcfEBKL90b6vwSGoEB1SGznOVxCh5B6SkLLTaK2+arQdBAtrxDIYNxBZ C9tRwD4o34tmjMLm2QbTCczozxPHTj90vjT/9kVJRclFdUsfgjiowz8SXo2GtbJXpLcggUJ7/qK xmwQ== X-TM-Addin-ProductCode: EMS DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=opensynergy.com; s=TM-DKIM-20210503141657; t=1706749584; bh=3qmW4ch/00o/icZapJifBzjs2SmWsMrktxdkuqgknh0=; l=2266; h=From:To:Date; b=sS06fzokf2OjAXGWa8oa2dvMxKVtkPyeQ0V2Au8+eZJNC8PLmMaqOynyrHRSkZ0Pk 4KF097nPK5/xg0dq35cUdBQOY736VpjqcAp0ogoi8g8/BNLk236kkvqIcNw1a2Huzt ylpONsagIFr/I9pgc7aGzTKxkwC+SyJ7rmxXwgSSuqHCib2xLPPDVTPTHsB1gRoVJd tdeIPP0e0MCOJfXjVNp6UnyGYrHo/j5Z0UhqVt8NxZohlw815Dr8T4TUsxNQh/q/7Q 2fgMCIIxPNbmq/V3wHKLeuqNYTEDAAZFfEf5dwdMY/E/PVjTPyA0dWhc8SiAPAIIh3 4kurYbMBQX8Ew== X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789656758245929959 X-GMAIL-MSGID: 1789656758245929959 Fix the kernel-doc warnings which show up with default arguments for tsc.c: $ ./scripts/kernel-doc arch/x86/kernel/tsc.c >/dev/null arch/x86/kernel/tsc.c:1339: warning: Excess function parameter 'cycles' description in 'convert_art_ns_to_tsc' arch/x86/kernel/tsc.c:1339: warning: Excess function parameter 'cs' description in 'convert_art_ns_to_tsc' arch/x86/kernel/tsc.c:1373: warning: Function parameter or struct member 'work' not described in 'tsc_refine_calibration_work' The first two warnings stem from members of the convert_art_ns_to_tsc() return type (struct system_counterval_t). For convert_art_ns_to_tsc(), the return type members are documented like parameters. Since these members are already documented with the struct system_counterval_t definition, remove the redundant documentation for convert_art_ns_to_tsc(). This resolves the first two warnings. Fix the third warning by appending a ':' instead of a '-' to the '@work' documentation parameter. Suggested-by: Simon Horman Signed-off-by: Peter Hilber --- Notes: v3: Added on suggestion of Simon Horman. arch/x86/kernel/tsc.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index d45084c6a15e..42328f9653c1 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c @@ -1329,10 +1329,6 @@ EXPORT_SYMBOL(convert_art_to_tsc); * Return: * struct system_counterval_t - system counter value with the pointer to the * corresponding clocksource - * @cycles: System counter value - * @cs: Clocksource corresponding to system counter value. Used - * by timekeeping code to verify comparability of two cycle - * values. */ struct system_counterval_t convert_art_ns_to_tsc(u64 art_ns) @@ -1357,7 +1353,7 @@ static void tsc_refine_calibration_work(struct work_struct *work); static DECLARE_DELAYED_WORK(tsc_irqwork, tsc_refine_calibration_work); /** * tsc_refine_calibration_work - Further refine tsc freq calibration - * @work - ignored. + * @work: ignored. * * This functions uses delayed work over a period of a * second to further refine the TSC freq value. Since this is From patchwork Thu Feb 1 01:04:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Hilber X-Patchwork-Id: 195114 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:106:209c:c626 with SMTP id mn5csp131421dyc; Wed, 31 Jan 2024 17:08:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IFH4hUXr99fLxkykyvqt8Ox51KQlwmHrihPVwfFNGEgjLWTdgI5zJuZDMNQWj3mxT90tDEm X-Received: by 2002:a67:c90a:0:b0:46b:e03:2e9f with SMTP id w10-20020a67c90a000000b0046b0e032e9fmr2933611vsk.4.1706749684227; Wed, 31 Jan 2024 17:08:04 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUXhvW9MRenB8+BbjkV7U6fZJsqmKx0FOjn83uTafieDCM71f277EDXIaqdYEkmYf0VOfi1lPXGZp7A949CGwtQU/HKVQ== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id q14-20020ad45cae000000b006856936bc99si13633349qvh.48.2024.01.31.17.08.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 17:08:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47463-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@opensynergy.com header.s=TM-DKIM-20210503141657 header.b=yVBUe2Sq; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-47463-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47463-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=opensynergy.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id F073E1C22B81 for ; Thu, 1 Feb 2024 01:08:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 170562943B; Thu, 1 Feb 2024 01:06:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=opensynergy.com header.i=@opensynergy.com header.b="yVBUe2Sq" Received: from refb01.tmes.trendmicro.eu (refb01.tmes.trendmicro.eu [18.185.115.53]) (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 068B55C80 for ; Thu, 1 Feb 2024 01:06:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=18.185.115.53 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706749600; cv=fail; b=d/xCfuAZtIOpeSuGwoz4wcfqwvbrVOU+f1aMja/E0khUjDyYGi4CH8YRj8iMxKAHyO13OQQ57Op/0lICzeYvzjRh/C6Qnt9B6m4aEYQ21AwHRMEu/2zF3aJikMSJyfECHUSrH3UO6WW/4X7cVU6tLja7pjmdomaSG5Wx/WCs26A= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706749600; c=relaxed/simple; bh=VEEICBI9hb85ucOIjDdO+txOgLqKBI+xAIKrGkmsBbI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=EIKINwnkM9wx8oInn2IGhCV6sBNowAS3R0/JsatpEvFFbkrGSQcKhVal28NoVxjWHfoDY57BneYgVx9esPsL8VD7Z55eJe5QviEyPN8u0vTVxW05Z4abbPoiNuqJwAyKoZFswoat46shBx2hUeeONZ83tlZIpYIYuYsukm7zvq0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensynergy.com; spf=pass smtp.mailfrom=opensynergy.com; dkim=pass (2048-bit key) header.d=opensynergy.com header.i=@opensynergy.com header.b=yVBUe2Sq; arc=fail smtp.client-ip=18.185.115.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensynergy.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=opensynergy.com Received: from 104.47.7.168_.trendmicro.com (unknown [172.21.9.43]) by refb01.tmes.trendmicro.eu (Postfix) with ESMTPS id 5FFF710D3A204; Thu, 1 Feb 2024 01:06:31 +0000 (UTC) Received: from 104.47.7.168_.trendmicro.com (unknown [172.21.165.80]) by repost01.tmes.trendmicro.eu (Postfix) with SMTP id B3A7C1000007B; Thu, 1 Feb 2024 01:06:23 +0000 (UTC) X-TM-MAIL-RECEIVED-TIME: 1706749546.249000 X-TM-MAIL-UUID: 83e2df86-fe60-4be2-bc0a-13be3f96a655 Received: from DEU01-BE0-obe.outbound.protection.outlook.com (unknown [104.47.7.168]) by repre01.tmes.trendmicro.eu (Trend Micro Email Security) with ESMTPS id 3D02010004D81; Thu, 1 Feb 2024 01:05:46 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SMez3rGaMDRxG9JWPC/MtVIt4NdDRUvVdAec/6GUE8vsV+g868BfoKNYc30VJEsmvAUtSdgiiz1YYo0QCv1wGderMKe5JgfySakd1X1wL/B3zIIwC30LQZ5DPSZiQM2OMLCw/nmXKnladAA3Myuk7IpiCtKl0bGiOd4+y0B7dx2hU80jblPF5hb2GWa07+wyALhIgLLpneLT903PFfyOIVkEUy2aE/QHQ8s3U6JBZOA18tHqGvcoVYhdydrvHvanJ9T9kT2oDYEXKztZY87ZFe56OloktevPJWaES9nO+OnsyRRmaVxB4khQuzblgfvh/wCP2ajGpKykXijazE6YcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=P80BaWCtwU961ML0qd6PJqYYAAwoo7QXKC2rGxLdToo=; b=VNcdtBwsaDa7BrEExG/HoZe0b0cqrbo3TsfnWa2SdW2COkkD52oMFB72SH7wvTxFxHb/YJ5EjcdwIICoI3ASo6vtmF5v0VV3u3prM6aN2QUAxpZm5eFD93my0L9JQDrX/2L3k0ZoyXmEYmhxg/uNP+IMBujP7/7EEVi/rBTbNms7cJS+ayRdGvs+wkxoKlS0ZdqEhCWgzY53Xd3v7UOiHoqjJJSS47ZeHUEuU924kQLeOcuvQtE5JWrXAOnY3S5PoBBI9/4uPTTjRzgNeLq9n3r5NKge9oWBZotrLx8Wlak/td2W5dOaMn+0Qwnh4eRtXvArFJ1CRNTEIjNDcj2DjA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 217.66.60.4) smtp.rcpttodomain=alien8.de smtp.mailfrom=opensynergy.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=opensynergy.com; dkim=none (message not signed); arc=none (0) X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 217.66.60.4) smtp.mailfrom=opensynergy.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=opensynergy.com; Received-SPF: Pass (protection.outlook.com: domain of opensynergy.com designates 217.66.60.4 as permitted sender) receiver=protection.outlook.com; client-ip=217.66.60.4; helo=SR-MAIL-03.open-synergy.com; pr=C From: Peter Hilber To: linux-kernel@vger.kernel.org Cc: Peter Hilber , "D, Lakshmi Sowjanya" , Thomas Gleixner , jstultz@google.com, giometti@enneenne.com, corbet@lwn.net, "Dong, Eddie" , "Hall, Christopher S" , Simon Horman , Andy Shevchenko , Marc Zyngier , linux-arm-kernel@lists.infradead.org, Sean Christopherson , Paolo Bonzini , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Wanpeng Li , Vitaly Kuznetsov , Mark Rutland , Daniel Lezcano , Richard Cochran , kvm@vger.kernel.org, netdev@vger.kernel.org, Stephen Boyd Subject: [PATCH v3 2/8] timekeeping: Add clocksource ID to struct system_counterval_t Date: Thu, 1 Feb 2024 02:04:47 +0100 Message-Id: <20240201010453.2212371-3-peter.hilber@opensynergy.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240201010453.2212371-1-peter.hilber@opensynergy.com> References: <20240201010453.2212371-1-peter.hilber@opensynergy.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB8EUR05FT021:EE_|FRYP281MB0032:EE_ X-MS-Office365-Filtering-Correlation-Id: 1cfb6228-dfca-482c-2d12-08dc22c1ea60 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UJ+33MOJqXy1BUIqjzZao42U6FTXpc6uM6q0Y5jYgacj1BxAR1Ku6fejhtVn89fRbMecP/IR8UWyIq55mQTb7ypblIhJjtbY1udN3Pa4qz38SJMJL3tJhMlOewyPwE5Q/hwAWzU9TF1Rvmx2OCj0CTadCjvdb0jWMdcJTzXkBkAOkL3FsjuAElPL6fFXp2G3eLQa2Gsf/bSVUrLzte03VBsdD+IMarOxtptrdHdhDYTPHA0RNgO3tdD6O1ntverq7fMQ7pQSq9xcIkfduXbwWXutg5YG5+S0hDhF6B60E3LQmpLxuX/ZxUpNJC6bUzST+FYA9JTS/3RP5ZYa3a65ve5f7kC/Y4tpvGenZkiTgvpMDkgi9kDNkMxqkNFIUnxWsv6UUK016EzRQElFOcUvLWAv+ICBogmlepUMIJnKUvZNsUTqAz9zM5EmEEJKyfJuByyaJ7wDdkXOC3xdYd2SyWBMpR1w741Q/h3JclXcX/O/SRuS8JAy+eOUDEgClYNJGU8WVruo43kNn4vJVujycQKoCjYugzcYjHi7zaghhkjxFmpkP7zKXZsTxcSP+PtFwBC4FIFvRa754kIj0IWLQWXIBH1dYvbyZrhYP0PEX7EcxUU/XbdOtSYZkI9x4nizoU7/TDi+RsO1c1nFuOL0EyFZEs/HbwThIJpUYy4SYK1zX5peJlwuUHJbBv8qLWJtCjsH6TXXViuyPbilXm2vIux2ZKnMGgHg76vT9b2GsjM= X-Forefront-Antispam-Report: CIP:217.66.60.4;CTRY:DE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SR-MAIL-03.open-synergy.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(136003)(346002)(376002)(396003)(39840400004)(230922051799003)(451199024)(186009)(1800799012)(64100799003)(82310400011)(46966006)(36840700001)(41300700001)(54906003)(36756003)(47076005)(36860700001)(316002)(1076003)(2616005)(70586007)(70206006)(6916009)(42186006)(966005)(5660300002)(478600001)(7416002)(86362001)(2906002)(8676002)(83380400001)(26005)(8936002)(336012)(4326008)(44832011)(40480700001)(81166007)(36900700001);DIR:OUT;SFP:1102; X-OriginatorOrg: opensynergy.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2024 01:05:43.4878 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1cfb6228-dfca-482c-2d12-08dc22c1ea60 X-MS-Exchange-CrossTenant-Id: 800fae25-9b1b-4edc-993d-c939c4e84a64 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=800fae25-9b1b-4edc-993d-c939c4e84a64;Ip=[217.66.60.4];Helo=[SR-MAIL-03.open-synergy.com] X-MS-Exchange-CrossTenant-AuthSource: DB8EUR05FT021.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: FRYP281MB0032 X-TM-AS-ERS: 104.47.7.168-0.0.0.0 X-TMASE-Version: StarCloud-1.3-9.1.1015-28152.007 X-TMASE-Result: 10--1.225700-4.000000 X-TMASE-MatchedRID: I6rpFm0lrcMEZ1mm50iAbgs6eGQ6Ral9EkUS8Erng9pzi8z2Fvgo+kp9 UxJnBl3FHDf9l7U5F7SnyNbHJWoNRbkeKW6KfnZEiu6u4shZ+fHcHWFKCmADc2shUDcgZ8ILoMQ NBr66IpTrLAe8bL+cp6EWqZPwachiifyRQLERY0pCPQBD3xA/3aODSWu0oxbK6gfKtA7Yhlrtmy EvxwC5ZF4L45p2p0pV3+6k97GsyDgqZdHEYvGr9R+AJsLlsQNEJEWB6QUw47pwgry9e+z6K02xv NT0DEAe X-TMASE-XGENCLOUD: 5b6ea32b-704b-42a3-a7c3-7ea9119431c2-0-0-200-0 X-TM-Deliver-Signature: 31549B26C2C12E238FE761D6A9ABD8F8 X-TM-Addin-Auth: ySrecwAZ6T0lqY5ygKpJic7UH9JZ0ONTg5B4LEUWxWxmxrX+NxzTqbuy9T/ B1YOtZV39v3RabXTypwHnahUBDDHv+VX35DBWxkf24fZB6OyGUUSw/PxMvOEAvy8Lv9e8M+ZKDO jBpsIskkODLgPyD+kxnxbAkpqXZGRK8cXaKG7PBFJJcgwgVNTNO1gHkIwShrHK4jNuGCJL5CVgx pRIPNLW4gp6wYLaovr+TFdELhcEfa3rIL/MdnxOnxdAHgtWR47GQgwhOwc0/J8Kdfmh6vsNuVWu qBmXceFOihjAAs2U/tqCUdSL6mv/9Vc/MReA.KDDjpmL4E1kvs5qcC+MdSieM0sfsL3FwnH/oBD tVaCHFlDpgX0PSjZUwqIx6XdLnB60NJRAbT/YOa0CS2Fuooel4jWkh32+eVuvsbQl7YYGMwNneh +7pVeUj28tCQm0KwxQm2KQQQvu3yfLAEthSRVBI5RvkzECC7XqT9EOeZj1iR0u2xGo/rRq9rMUc A9Jg0LkFCAbHtLzmUsfeKO6kgvDhUFS7QCz+TzH5pAe6Xpj8ER8e0tqQYj18N+ahwTvF6bU3KQb 8DopGyCYin6DICZfAOATZzqaP1PX/ZRdRy/fAB/r7TMs/EkydQ9r2tz7YhiHqdUwZh7IS309KcH bjyQ== X-TM-Addin-ProductCode: EMS DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=opensynergy.com; s=TM-DKIM-20210503141657; t=1706749583; bh=VEEICBI9hb85ucOIjDdO+txOgLqKBI+xAIKrGkmsBbI=; l=1732; h=From:To:Date; b=yVBUe2SqPjElDv94s/Rg71vp8wnuw5LF6WDKlMqqCdt+hab6nWGOcT57byD6WKNP1 cWzGJ9G+2IndCT+lUuxAIEtch5gOfm/lZ/uXCQ6sfBgwlq/jCcqHGGQa1nQtTd5eEx o6T3AJd0ryAMy3rwx1y9bDx5he3rtYypPkZtd1hIUwIMvy2Piomov1896bcbD0Fl13 WZ66wqj1nAubKgueqMkq+BG84pt0XDA6DXd+cIlk7B9wHnyv39APn/RJFYOPe0StJI 8PWq2IlR8E1qDKxn9Wt3YJkpQX4B0C3OdlQ8DppPzYVAfhQ5XI9Ih53GedqlTNA+8U S0b+mMa053b5w== X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789656756707628713 X-GMAIL-MSGID: 1789656756707628713 Clocksource pointers can be problematic to obtain for drivers which are not clocksource drivers themselves. In particular, the RFC virtio_rtc driver [1] would require a new helper function to obtain a pointer to the Arm Generic Timer clocksource. The ptp_kvm driver also required a similar workaround. Add a clocksource ID member to struct system_counterval_t, which in the future shall identify the clocksource, and which shall replace the struct clocksource * member. By this, get_device_system_crosststamp() callers (such as virtio_rtc and ptp_kvm) will be able to supply easily accessible clocksource ids instead of clocksource pointers. [1] https://lore.kernel.org/lkml/20231218073849.35294-1-peter.hilber@opensynergy.com/ Signed-off-by: Peter Hilber --- Notes: v2: - Refer to clocksource IDs as such in comments (Thomas Gleixner). include/linux/timekeeping.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h index 7c43e98cf211..ca234fa4cc04 100644 --- a/include/linux/timekeeping.h +++ b/include/linux/timekeeping.h @@ -273,10 +273,15 @@ struct system_device_crosststamp { * @cycles: System counter value * @cs: Clocksource corresponding to system counter value. Used by * timekeeping code to verify comparibility of two cycle values + * @cs_id: Clocksource ID corresponding to system counter value. To be + * used instead of cs in the future. + * The default ID, CSID_GENERIC, does not identify a specific + * clocksource. */ struct system_counterval_t { u64 cycles; struct clocksource *cs; + enum clocksource_ids cs_id; }; /* From patchwork Thu Feb 1 01:04:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Hilber X-Patchwork-Id: 195117 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:106:209c:c626 with SMTP id mn5csp131760dyc; Wed, 31 Jan 2024 17:09:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IGDOU5yehyo53cfLIqRApAAoHI5AjkQRjS9IMuzyRn/VfJoo4lz7Dyt+Oo4ua2HJMnVzMiO X-Received: by 2002:a67:e40d:0:b0:46a:fa04:6bd4 with SMTP id d13-20020a67e40d000000b0046afa046bd4mr3411273vsf.10.1706749740336; Wed, 31 Jan 2024 17:09:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVbA59PEs6x1HiKDTQ+rc4/qIBL81XDRmiDNjxFZhJVXS7khCSB0Fil45SznkE3Tm8Qr/NrK56zxf6t3IFsy8/uPohLcg== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id pv17-20020ad45491000000b0068c6cc81ba8si953563qvb.392.2024.01.31.17.09.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 17:09:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47467-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@opensynergy.com header.s=TM-DKIM-20210503141657 header.b=W1lqbVer; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-47467-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47467-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=opensynergy.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 140FC1C22E9E for ; Thu, 1 Feb 2024 01:09:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0F209C8FD; Thu, 1 Feb 2024 01:07:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=opensynergy.com header.i=@opensynergy.com header.b="W1lqbVer" Received: from refb02.tmes.trendmicro.eu (refb02.tmes.trendmicro.eu [18.185.115.60]) (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 B0553468C for ; Thu, 1 Feb 2024 01:07:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=18.185.115.60 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706749661; cv=fail; b=SQbPIDemu7NayNsx1jkiPwoy3BR7erqznLq/jqqkWCHkaFu+NdmICmiRAgquDqwU734XIQ5reIm6zi38XH9jcww2dJLuATWlMrO59CKRtPkErTQUcWU83Q/2PoAX/9Vy9ykP54B5ClXFzmpRx5UiMvu+Ev6MCyZQNEV267Nymtk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706749661; c=relaxed/simple; bh=kph/GZbUL8v7Z7FSL2xEtj/zUnB/iHPuTCylgtGC1wc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=qy2iroUkp3L3xhY1xffcgB/Ql/MUSUA+wfcnXY19jVpzkTZ5JKo3ODfLN+YdrEB6ui1/W6W3s1peesqBeizONTsPw91av8Eo56GnHMyQilE3aoMtXUGqCqrbw7EUoxdYxHad5J/5Dt6Vm4KI4sammcI8nLj7m83zuqIC1P/79bA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensynergy.com; spf=pass smtp.mailfrom=opensynergy.com; dkim=pass (2048-bit key) header.d=opensynergy.com header.i=@opensynergy.com header.b=W1lqbVer; arc=fail smtp.client-ip=18.185.115.60 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensynergy.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=opensynergy.com Received: from 104.47.11.168_.trendmicro.com (unknown [172.21.10.52]) by refb02.tmes.trendmicro.eu (Postfix) with ESMTPS id 743B310A7E637; Thu, 1 Feb 2024 01:07:37 +0000 (UTC) Received: from 104.47.11.168_.trendmicro.com (unknown [172.21.199.136]) by repost01.tmes.trendmicro.eu (Postfix) with SMTP id B23011000045E; Thu, 1 Feb 2024 01:07:29 +0000 (UTC) X-TM-MAIL-RECEIVED-TIME: 1706749545.895000 X-TM-MAIL-UUID: 3c71908f-6059-4723-b1c6-9309dd182ff3 Received: from DEU01-FR2-obe.outbound.protection.outlook.com (unknown [104.47.11.168]) by repre01.tmes.trendmicro.eu (Trend Micro Email Security) with ESMTPS id DAA3010006A5E; Thu, 1 Feb 2024 01:05:45 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Eda9osc6SezHsGjdXbSKIH1/GE6+71QDoSKcu3jBUTIdL+urdgCLPH9XM3hSg+8/oyfZMFo0EccgfrmwsO5lZ5b2eZSYrXjgyDa5z/wF6+46Xl6F52JeykdV5Wc+JlGCHmcxRAkbB3Qnb2wLk6Q8uAk2LYJcZWYSILfacj7pYYTZq7QqWhsIMFJycGXZkXQfmQsPTIvptf+RzGWIrSXZSr2U6mygCuu107gmP6AEeLj+hMw+GalKMiFMZxICK8EgEQRimAkNgDQgkzFzWdl3qz/BKarXU2TB+KvxyEhJBsnLCgYUxC60zosbp725e7+I5vxpOUQ62oMAEm2J0tICzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9qi5SeCGD4c/KlJEua7rmHMG+XxuwLmKXWOyIksFBo8=; b=iJJRu87tJ0gH0pHtZddl5c2dSvMNxSK9Ig1iJyisfEHaemdWj2HsCtOjss6VC3WxvOpV4dWoh+uiStFAek/XI3YQOfnBTqs7FJSZCZwAgD4zODUsWrfWfeBfhsQvw5wr7QJj6VnXfaye+83advL+exjRs8WQHrkM29gxLblgKjsH+RNPVhmsg/cmZHJidpEylvf1sC1a+/Czy+28+LBxLyGFhCmzrLf7ZtSCYmG4U51uCNBEMO1ZVDdkukwBtTvBhjxzG8TkcU3PMp5HFF+pDXpXyl1LdAlDV8AW/QfsznvcG744xWNwz1eGkK5E+1Wbg0TKUXXsVkB8bkIKV4g9wg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 217.66.60.4) smtp.rcpttodomain=alien8.de smtp.mailfrom=opensynergy.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=opensynergy.com; dkim=none (message not signed); arc=none (0) X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 217.66.60.4) smtp.mailfrom=opensynergy.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=opensynergy.com; Received-SPF: Pass (protection.outlook.com: domain of opensynergy.com designates 217.66.60.4 as permitted sender) receiver=protection.outlook.com; client-ip=217.66.60.4; helo=SR-MAIL-03.open-synergy.com; pr=C From: Peter Hilber To: linux-kernel@vger.kernel.org Cc: Peter Hilber , "D, Lakshmi Sowjanya" , Thomas Gleixner , jstultz@google.com, giometti@enneenne.com, corbet@lwn.net, "Dong, Eddie" , "Hall, Christopher S" , Simon Horman , Andy Shevchenko , Sean Christopherson , Paolo Bonzini , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Wanpeng Li , Vitaly Kuznetsov , Mark Rutland , Marc Zyngier , Daniel Lezcano , Richard Cochran , kvm@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v3 3/8] x86/tsc: Add clocksource ID, set system_counterval_t.cs_id Date: Thu, 1 Feb 2024 02:04:48 +0100 Message-Id: <20240201010453.2212371-4-peter.hilber@opensynergy.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240201010453.2212371-1-peter.hilber@opensynergy.com> References: <20240201010453.2212371-1-peter.hilber@opensynergy.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB8EUR05FT010:EE_|FRYP281MB0093:EE_ X-MS-Office365-Filtering-Correlation-Id: cf5fb289-d164-4722-b051-08dc22c1eae7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Q6wV8Ma0AfooY2vBodUQE+9VGdTUFvLwXC/WTekIONIEqZJ6EbLV6J1RC5YMBLRbtkRnmL3rf9YOetjV4nPDg4G2glkyxA3Uqljef16/DGPEATVw6xWo8kN9+KX+1TXXl0VD+gzSrJmqS+6jMFwHLTeytLIzR7V1pz4GPfrTjSHFf/Ax6/PVkd5NCpd7ahspxRCBg2G5X6gRL4gLmLreEA2cTFyxVwhKYtxUEYBYVmesTwCqusDAn+aI2xGj9AOuQ4/Hpf8ewasRuwYOnNYxddqGCWiALWN7O82HOn6zXC3PJp4FTwED+aTDgxU7AWsjC1gEJ+JmF063pVwZN+EtQWQ9aMuL7iu6jJUkKmu2xis/b8bcLhR2IpRlhzqVNUDknsRunloTUXU+TBrvlTwqtkvrLMKKgfgb3CHt07IkvLGu8qRplZT015kqB15k23pBUeCsdGDhz/T6NtEZIwxXbheWQU+DCpvqQ9gEImp6BpzZFY0zLQYbo7e3QZkTIlhUlulikJLUOm3wb19DaETFH6BcNvjeFfjHcMUo49J1AyjZ9lhv3Zs/1buaOXiIwjISZwOosZs0TAAmNV0v6cOkmGRaGcCxP5TdH0krI4VF6B5lP2aYcV1VCYgFHOiM3Bj1SZHJ7sKGJ/tsviVTRpHTePIn3X85b1z9In6WPVppW1Tw13YEfCBq3POyA9ZIWrBmX4fxvqVZe262L+GaLIAooHEoUqI0UMKmx6m+OXOBU8RCSEZCPYNv9qYb6Dx+xNn2+tMNcTwtM9p0suQUCKcm+bPvnGOJJYks9Grk5vZq0a0= X-Forefront-Antispam-Report: CIP:217.66.60.4;CTRY:DE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SR-MAIL-03.open-synergy.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(346002)(376002)(39840400004)(396003)(136003)(230173577357003)(230273577357003)(230922051799003)(451199024)(82310400011)(1800799012)(64100799003)(186009)(46966006)(36840700001)(8676002)(4326008)(8936002)(83380400001)(2616005)(1076003)(70206006)(26005)(70586007)(336012)(41300700001)(86362001)(42186006)(478600001)(6916009)(54906003)(316002)(47076005)(7416002)(5660300002)(44832011)(36756003)(36860700001)(81166007)(2906002)(40480700001)(36900700001);DIR:OUT;SFP:1102; X-OriginatorOrg: opensynergy.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2024 01:05:44.3759 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cf5fb289-d164-4722-b051-08dc22c1eae7 X-MS-Exchange-CrossTenant-Id: 800fae25-9b1b-4edc-993d-c939c4e84a64 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=800fae25-9b1b-4edc-993d-c939c4e84a64;Ip=[217.66.60.4];Helo=[SR-MAIL-03.open-synergy.com] X-MS-Exchange-CrossTenant-AuthSource: DB8EUR05FT010.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: FRYP281MB0093 X-TM-AS-ERS: 104.47.11.168-0.0.0.0 X-TMASE-Version: StarCloud-1.3-9.1.1015-28152.007 X-TMASE-Result: 10--14.335400-4.000000 X-TMASE-MatchedRID: DIEPoA0d9jzJ+P2VFrJmrKwODSO9Fuc1zmG9pmg8ncKJFoX8AKzcA1om CW9DDtQZ4hVD9eCRkSzqUb9emYLkvriZvMg1M8zIiu6u4shZ+fGRRM7IbBAoRyhxkKIUBctf+JL cWYHtZNEObBW6/DqoDOUTedInjF4ziRz4gknBIqB0CtK0DggAXqeeBvX7bSdNqWgfIMWloSygxg zwH3l2wulvQEurXogbqQMn/UStEoOovD0wMSGqkmwEEr52PwDFaRrjP4hMuEYY5lMhYxPBYrdG6 qoYZcgziQXeVzaEgj/rEDQC9rvecA+bXnHKG3yVfHZ4iVAbWwx8LgjA4u/K5wLgOGUBLTt6Wjsa YI4lh3XIx3Icp6zuW7dCjoZl+x6LClEFFkJvh3LF0CStGX+q3SX3GjGd8V5p X-TMASE-XGENCLOUD: 8c0870c6-cf32-4942-8371-e6ebefe45c43-0-0-200-0 X-TM-Deliver-Signature: 457A051C3E60FB81FFFA52480F7077B2 X-TM-Addin-Auth: g0H8j/tgeWZt7f3c1doJXElz7fTzMIbUDtS7WFcH9pbnHdsVxqGfKdGaXZy L4lmAWdUeo9oDkEkf0XVKMDlEAR4pstyw4BIvoZiGqOoiDIoV/su5AjUIZzOBA3FKTFrwURhkFS 9Q8yVZ0/Jg9TgwAip0dtGcH0P9PeHGMFfklc/cdvUdMDivvlZfUMbeYL+Gwdr00S5L0Myc4LL+V GwwOs2AXqMlWSuzjVVZVmi2hoHdlySvf05knPxQYOFtYdMNkmb9a41tzJARk/QqLb20kMCr0GzG Pg+D+JJOPXIaWBaRTHEBH5gTTqWg+fbnERLP.oUND6oWJmlwibje0Xwjsx7X5kSfjjAZUXsS293 zutkbiLrdLW2T2/1d7z8gWCY+R+MxSGJe6ujcEWY2t5l9Ex3CLiWpFw4zVz14NVyNe5rHCgEc1D Q0bm0Evd6JYz07IcRL3+irrf2hDggFUgvbE2mfnJqbLSmWYgL7NtpVPss9TZUVo3wu31B4pRlk7 jwDzyIWXufL9T4EU/RiVN7S9QGCfIIr6bgFEtp+i1EgD5Pq7TMrg3DzkpuZ7bQ/555vn4GnIWL+ xL0XD4ImaYDad52moUzFZyqsdvB2Y3xiTAhwcfvT9q5YdAre7a/6LG9bZyg7NqKq6R1HNks+gRP DxYQ== X-TM-Addin-ProductCode: EMS DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=opensynergy.com; s=TM-DKIM-20210503141657; t=1706749649; bh=kph/GZbUL8v7Z7FSL2xEtj/zUnB/iHPuTCylgtGC1wc=; l=4864; h=From:To:Date; b=W1lqbVerDfdnojQVcYq+RUuqiyM8t+YiciIAngWFY9ARIl+XxAKxP9LLu85CchGw/ Gk/3Xg3h45xNYsmACzKrRxjLc+C62wtNTAhwkhWRRCuhdpfi93bVy7lwz94xQsrzYc 7R681xx1Oyh6QEjfsIPm8UH5pHR3b07Sda9b5hZtNZP6OAGyU8HZllX5y972pYM02P nNWt+GYmmjS2+O4oJjVUyQIoqL7qnRC0509wmrORww4WYSN23/jXwlsAVUwQOkfYG5 GdGygZTo5wOVOxCpuwwerejb5iOSSUZm9T0ERrVN1CJjq0JNL+b/3WvhazL4ITkwDv YZZC67DuBfkxw== X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789656815550886314 X-GMAIL-MSGID: 1789656815550886314 Add a clocksource ID for TSC and a distinct one for the early TSC. Use distinct IDs for TSC and early TSC, since those also have distinct clocksource structs. This should help to keep existing semantics when comparing clocksources. Also, set the recently added struct system_counterval_t member cs_id to the TSC ID in the cases where the clocksource member is being set to the TSC clocksource. In the future, get_device_system_crosststamp() will compare the clocksource ID in struct system_counterval_t, rather than the clocksource. For the x86 ART related code, system_counterval_t.cs == NULL corresponds to system_counterval_t.cs_id == CSID_GENERIC (0). Signed-off-by: Peter Hilber --- Notes: v3: - Omit redundant clocksource_ids.h include (Andy Shevchenko). - Omit struct system_counterval_t member documentation, to resolve kernel-doc warning pointed out by Simon Horman. v2: - Name clock id according to Thomas Gleixner's mockup. - Refer to clocksource IDs as such in comments (Thomas Gleixner). - Update comments which were still referring to clocksource pointers. arch/x86/kernel/tsc.c | 27 ++++++++++++++++++++------- include/linux/clocksource_ids.h | 2 ++ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index 42328f9653c1..9f164aad5e94 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c @@ -54,6 +54,7 @@ static u32 art_to_tsc_numerator; static u32 art_to_tsc_denominator; static u64 art_to_tsc_offset; static struct clocksource *art_related_clocksource; +static bool have_art; struct cyc2ns { struct cyc2ns_data data[2]; /* 0 + 2*16 = 32 */ @@ -1168,6 +1169,7 @@ static struct clocksource clocksource_tsc_early = { .mask = CLOCKSOURCE_MASK(64), .flags = CLOCK_SOURCE_IS_CONTINUOUS | CLOCK_SOURCE_MUST_VERIFY, + .id = CSID_X86_TSC_EARLY, .vdso_clock_mode = VDSO_CLOCKMODE_TSC, .enable = tsc_cs_enable, .resume = tsc_resume, @@ -1190,6 +1192,7 @@ static struct clocksource clocksource_tsc = { CLOCK_SOURCE_VALID_FOR_HRES | CLOCK_SOURCE_MUST_VERIFY | CLOCK_SOURCE_VERIFY_PERCPU, + .id = CSID_X86_TSC, .vdso_clock_mode = VDSO_CLOCKMODE_TSC, .enable = tsc_cs_enable, .resume = tsc_resume, @@ -1309,8 +1312,11 @@ struct system_counterval_t convert_art_to_tsc(u64 art) do_div(tmp, art_to_tsc_denominator); res += tmp + art_to_tsc_offset; - return (struct system_counterval_t) {.cs = art_related_clocksource, - .cycles = res}; + return (struct system_counterval_t) { + .cs = art_related_clocksource, + .cs_id = have_art ? CSID_X86_TSC : CSID_GENERIC, + .cycles = res + }; } EXPORT_SYMBOL(convert_art_to_tsc); @@ -1327,7 +1333,7 @@ EXPORT_SYMBOL(convert_art_to_tsc); * that this flag is set before conversion to TSC is attempted. * * Return: - * struct system_counterval_t - system counter value with the pointer to the + * struct system_counterval_t - system counter value with the ID of the * corresponding clocksource */ @@ -1343,8 +1349,11 @@ struct system_counterval_t convert_art_ns_to_tsc(u64 art_ns) do_div(tmp, USEC_PER_SEC); res += tmp; - return (struct system_counterval_t) { .cs = art_related_clocksource, - .cycles = res}; + return (struct system_counterval_t) { + .cs = art_related_clocksource, + .cs_id = have_art ? CSID_X86_TSC : CSID_GENERIC, + .cycles = res + }; } EXPORT_SYMBOL(convert_art_ns_to_tsc); @@ -1450,8 +1459,10 @@ static void tsc_refine_calibration_work(struct work_struct *work) if (tsc_unstable) goto unreg; - if (boot_cpu_has(X86_FEATURE_ART)) + if (boot_cpu_has(X86_FEATURE_ART)) { art_related_clocksource = &clocksource_tsc; + have_art = true; + } clocksource_register_khz(&clocksource_tsc, tsc_khz); unreg: clocksource_unregister(&clocksource_tsc_early); @@ -1476,8 +1487,10 @@ static int __init init_tsc_clocksource(void) * the refined calibration and directly register it as a clocksource. */ if (boot_cpu_has(X86_FEATURE_TSC_KNOWN_FREQ)) { - if (boot_cpu_has(X86_FEATURE_ART)) + if (boot_cpu_has(X86_FEATURE_ART)) { art_related_clocksource = &clocksource_tsc; + have_art = true; + } clocksource_register_khz(&clocksource_tsc, tsc_khz); clocksource_unregister(&clocksource_tsc_early); diff --git a/include/linux/clocksource_ids.h b/include/linux/clocksource_ids.h index 16775d7d8f8d..f8467946e9ee 100644 --- a/include/linux/clocksource_ids.h +++ b/include/linux/clocksource_ids.h @@ -6,6 +6,8 @@ enum clocksource_ids { CSID_GENERIC = 0, CSID_ARM_ARCH_COUNTER, + CSID_X86_TSC_EARLY, + CSID_X86_TSC, CSID_MAX, }; From patchwork Thu Feb 1 01:04:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Hilber X-Patchwork-Id: 195113 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:106:209c:c626 with SMTP id mn5csp131095dyc; Wed, 31 Jan 2024 17:07:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IFK1tFGJT/fC8pQezy7+/DxJWQ5xD8nhxzBOBDhC5sMmxWq1mL85mBdHcg3odoZRQXMwWKb X-Received: by 2002:a05:620a:2112:b0:783:b35e:4b8e with SMTP id l18-20020a05620a211200b00783b35e4b8emr1276934qkl.34.1706749637364; Wed, 31 Jan 2024 17:07:17 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV+LV2JgJtGnMHqIWMO5J6lU1Ax+Z81kcPyPwun4RF2tQrqDVbJYQsHKCgN3x0JfcHt6kKENaxc9w5Ea0dVWLDiecf9qQ== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id h26-20020a05620a21da00b00783fc517e95si8105890qka.413.2024.01.31.17.07.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 17:07:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47462-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@opensynergy.com header.s=TM-DKIM-20210503141657 header.b=V9n3kxsb; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-47462-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47462-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=opensynergy.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 4F1241C23704 for ; Thu, 1 Feb 2024 01:07:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 982216ADE; Thu, 1 Feb 2024 01:06:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=opensynergy.com header.i=@opensynergy.com header.b="V9n3kxsb" Received: from refb01.tmes.trendmicro.eu (refb01.tmes.trendmicro.eu [18.185.115.53]) (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 7925C3FFE for ; Thu, 1 Feb 2024 01:06:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=18.185.115.53 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706749595; cv=fail; b=eDkwQx+BXheQwK1D3x1zOTZJgerlfbG8feZAJNZ5IbFx3tJeEW+YWW+wwxiwCBFptAtSjfgk/DyhRyXkaGzbfEH/K9mYCVjR+rsoahJGVslQUWoJ4zJj+gsqk2pured5cjzrRVu6Spg5BF84vKP/KWLEbzG7Tnk2+ZzoY8CTKyw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706749595; c=relaxed/simple; bh=5YtK4a4nifkYy7D9GImx5YWZNY7r7bQKqO6G1y6uwu4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=WFzwP7xAd0I4JwdgwBGIRc4/e3SaXzKgK8XlDynyk08C9U8Q8/hnwdS7w6mxhnV/+4jSSAO8M+uBOxUxP6FholHshV5sHMegTe6M+qy5K02mxx47DCLxOnPD5ARpDSXtKK5ns8hc7HmUFDYEhXg8pIZozWLkNdqYs3hqIM5nBx8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensynergy.com; spf=pass smtp.mailfrom=opensynergy.com; dkim=pass (2048-bit key) header.d=opensynergy.com header.i=@opensynergy.com header.b=V9n3kxsb; arc=fail smtp.client-ip=18.185.115.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensynergy.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=opensynergy.com Received: from 104.47.11.169_.trendmicro.com (unknown [172.21.19.72]) by refb01.tmes.trendmicro.eu (Postfix) with ESMTPS id 3A1AB10D3A1F7 for ; Thu, 1 Feb 2024 01:06:31 +0000 (UTC) Received: from 104.47.11.169_.trendmicro.com (unknown [172.21.176.220]) by repost01.tmes.trendmicro.eu (Postfix) with SMTP id CD5F2100004E7; Thu, 1 Feb 2024 01:06:23 +0000 (UTC) X-TM-MAIL-RECEIVED-TIME: 1706749547.193000 X-TM-MAIL-UUID: b05bbf6d-8b4b-42d1-8a10-3a4eb6c9942b Received: from DEU01-FR2-obe.outbound.protection.outlook.com (unknown [104.47.11.169]) by repre01.tmes.trendmicro.eu (Trend Micro Email Security) with ESMTPS id 2F5651000030C; Thu, 1 Feb 2024 01:05:47 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DxAE+zjcXonRvxWcg2KKBiAorb5Ekhpw7TzXJC0ymiBcNT6oQXKU0rKS666Y2qE/h0X6ZKNKQYsNvxkvyvQSkzlXIhaampPoDUgGflZfc2WUacX8g9HhWq7qzE4KFsyX+ApRT2ChQmWntBRdtOSDe4wTturGKlVy2uAlNeeCYmKZ3ECzGB8w/mDViikiY+C5TLxabhG6Fy7Om1crN4KYtq4F+ZgqfxvGVmKqWUnqUHe7/oHWR9tk0m2paXVmXlEnb4UWNlMjWBuM2AggHyY7aa2Ter7Ih0wXYGA1AZxv/6d8Jkcsl0iUp0nLROn1t2O69cJxaG3A+efFcYECdpYhIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5KYjWDpJ4m6ElafzQDPfs1wFjYeCwnJ/3eTVK+O6LPg=; b=FitptyKP4tdsDRVInPq3X4mqJSjchbb8jbZ1d8Sz5ovqFlM1EZElcrruVMHReiFu7l4SFxW1D+aYMR4rgjjbjc8/qISV9Qzy2Wgkl1GbGSqI4LLXZyA/e5XWP4M+2U2UsOd5MXm/I+B+hyWeS72MgJkVznDtj0Nsn0RMdWY6LeRbGKGxF21A7XTaNuVCJJO5SAjutMz8y38VGyzMbRbLCprT0pYUiaBIt+st9tiIz5DFZynaaJgedf1zIUBQ77JF59QTmlHfsouBAKXLj461aJ9db15BGKvejpUN5oxsdF12tyKaDduxbcQbENKvaXVPkSt0uechKCpwdlOwCk8TSQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 217.66.60.4) smtp.rcpttodomain=alien8.de smtp.mailfrom=opensynergy.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=opensynergy.com; dkim=none (message not signed); arc=none (0) X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 217.66.60.4) smtp.mailfrom=opensynergy.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=opensynergy.com; Received-SPF: Pass (protection.outlook.com: domain of opensynergy.com designates 217.66.60.4 as permitted sender) receiver=protection.outlook.com; client-ip=217.66.60.4; helo=SR-MAIL-03.open-synergy.com; pr=C From: Peter Hilber To: linux-kernel@vger.kernel.org Cc: Peter Hilber , "D, Lakshmi Sowjanya" , Thomas Gleixner , jstultz@google.com, giometti@enneenne.com, corbet@lwn.net, "Dong, Eddie" , "Hall, Christopher S" , Simon Horman , Andy Shevchenko , Marc Zyngier , linux-arm-kernel@lists.infradead.org, Sean Christopherson , Paolo Bonzini , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Wanpeng Li , Vitaly Kuznetsov , Mark Rutland , Daniel Lezcano , Richard Cochran , kvm@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v3 4/8] x86/kvm, ptp/kvm: Add clocksource ID, set system_counterval_t.cs_id Date: Thu, 1 Feb 2024 02:04:49 +0100 Message-Id: <20240201010453.2212371-5-peter.hilber@opensynergy.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240201010453.2212371-1-peter.hilber@opensynergy.com> References: <20240201010453.2212371-1-peter.hilber@opensynergy.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1EUR05FT057:EE_|FR6P281MB3654:EE_ X-MS-Office365-Filtering-Correlation-Id: 06b4cafd-189f-4843-05c1-08dc22c1eb45 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CGH93QONNpnotSd5ir1KXFLAKLHO0g6xDMneH3QMhTOtvmUM9U8+75fe0QclloegLnh36K2b0+9GkMh218dHEPwTOlqej7nK1FHgLgkgMydmNpwGzhrvNxLdQLZ1Nn6Z5vwSc5WVowHQ0KT5fQj6QpRmqypHPVrZjyJiwpGh29tSmpwM6KIVX7gwALP8L8iOtfO75362Xa2csMgNu/2/cui8toeX7TFQMrPOuqpgiYYXUBgPIUqxxL+oeXzwXgt6aArK+AG9fCGHG/qXLJ6BH3L/F+cnXcjcvhw0lYyD31/hiH0daSN5nyuMie5eQ1aPKOQYHZc82Owf/+FzddyOW90O3lQ6KfgsY8sjYyBpAvtD8WxZogHSUWHUWzKkaldW1w/Tyj43nHS22QGEmSOAfssVZVUpS0ZcY7lq7dn3JNQ8ONkqwRgnrMNV7ja5U5h2zcx4hPoH+PhWNPNRFTrJkcuB4an+n5ZQ0wk+/irFNrC/pA3RJYOIOj3cZy5CqBJMVADTx6O7upVM1wE5JBoJiBkshVjGqu78Ldmb9dloJBIOCWfy3p8UdvErYIDOPghTHMxU0MELt/N8LOD9ZZ0N5j0aFFrekL1wYeVXkMAAjGf5/RaPByeAklp1dHC/zRBFxTFneYrimBqIwJ5I4HvgBL1ICrkAl/HzQjbXEChmI+cCmr4rpyCiJISprnrYy/jGRyhbOkK3tNIRni2jzsb4QKPHnjiKs26B7aBlmdn+J04cMLIExMRVJ7hiW9XACKL1 X-Forefront-Antispam-Report: CIP:217.66.60.4;CTRY:DE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SR-MAIL-03.open-synergy.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(396003)(136003)(346002)(39840400004)(376002)(230922051799003)(1800799012)(64100799003)(451199024)(82310400011)(186009)(36840700001)(46966006)(336012)(5660300002)(86362001)(41300700001)(36756003)(36860700001)(47076005)(81166007)(316002)(42186006)(8676002)(54906003)(4326008)(70206006)(83380400001)(44832011)(26005)(1076003)(70586007)(8936002)(2616005)(6916009)(478600001)(2906002)(7416002)(40480700001)(36900700001);DIR:OUT;SFP:1102; X-OriginatorOrg: opensynergy.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2024 01:05:45.0032 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 06b4cafd-189f-4843-05c1-08dc22c1eb45 X-MS-Exchange-CrossTenant-Id: 800fae25-9b1b-4edc-993d-c939c4e84a64 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=800fae25-9b1b-4edc-993d-c939c4e84a64;Ip=[217.66.60.4];Helo=[SR-MAIL-03.open-synergy.com] X-MS-Exchange-CrossTenant-AuthSource: VI1EUR05FT057.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: FR6P281MB3654 X-TM-AS-ERS: 104.47.11.169-0.0.0.0 X-TMASE-Version: StarCloud-1.3-9.1.1015-28152.007 X-TMASE-Result: 10--1.472000-4.000000 X-TMASE-MatchedRID: SzbEz7SZt2vJ+P2VFrJmrN/Z7q+hZQVeET56SaIP1M+3UJJ8+n/4RSVv z26lmBXMFRlFiUGUwEmxjL2S8+j0lhfJ8eNjkTqdiu6u4shZ+fGDPlWYpnzHzmshUDcgZ8ILoMQ NBr66IpR/Gj7DAMEZmgMX/QeBIae0ez0KPZoFPyh4ZqfDdG89LitlpTPi5tO8MHiMmW0ZUNss3n AY9fdM9dh5c4TN8zbZ7PVkFWMnCn8N5Rk4kJccyL/a0nd+hIFCI/NGWt0UYPCKAhAjcFxLY7vRD AstQV9xnkz5OiQq1jJyAc4P1/IUE6iCvOFGVAUC X-TMASE-XGENCLOUD: 3bef6c72-1ea3-4c1e-8ab3-531d12416ba7-0-0-200-0 X-TM-Deliver-Signature: 5ABE237ED0DAA6C42DFD5D7901FB2AE6 X-TM-Addin-Auth: huWxA5dvdJK+KqvepDjR7IiEWLwW4lQK9IP9AgwcLnrCsaiYx4kbtEyM7wy i8lvS2sosGbZTMJc8ieC8Uy8FPJq16GO82Rq3GAqNqxQZ0I68KFqRe2OQBp1V6xVWBwukPEM3AV Ef3S5GqZ8EZI17/Wu4yNE2dmvCVLAfLL2OygIrHMcf+rWTKav4AJd12GtX7xM0AM2LQNQ13LVSA ldeqaFiVOhP8fvcRwKtYZDYqP8nji9/RyCu8CfaN2zgZXMPEvNflR+KvybAXGfCzybHLUl5joEr VsOv8qJG/cAFm9CgJLJQF6HzgK14h9fLzh5D.nUEaiXUYV3LXvv8D13L4zaL2ak37HWTRFbaP5H Xon0z/ZVS+oIlGFsTpOAlLXImfzg+mJ10khzOHr8wmR0ro5+1qEtgx5BNTZQ1zLlqRQjX5wu103 bajCMyp2q1oIonqd0T3pvLMDnGmaxHIqyck6MrCePjlTZeOntY4xpSDsu9djzuiA2mOUi5yP45J LawTUxWfPvODDOhlhYxZPwoDwyyDWp3qs+vgsg9kvV988PUkMZLIa7ZXqi42KtIkc1zY2F+yhtt pwu6ItBTzByfSeascdwKcSMrFDexJY2YLiY2ulPlRyzc+3Qp+8CM38xX58P/Pvh7po+zyLSnghF LHXA== X-TM-Addin-ProductCode: EMS DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=opensynergy.com; s=TM-DKIM-20210503141657; t=1706749583; bh=5YtK4a4nifkYy7D9GImx5YWZNY7r7bQKqO6G1y6uwu4=; l=2271; h=From:To:Date; b=V9n3kxsbJbVA2nqHpwcOsdkmRaoBWe18noGWcY36Li4sjYA1hWj2vt4imy7oy2Z3m Zxbufu3tJC5nFbhRtCyVJEkuOb+lFQf1cDY/R1iQXD8PLfcF2FivwJMdtWx5Sx+Snm 7MNLDGhImuhCH24fXpyyFeyBoXtKXG9toTDQgiiMTzQGOxxskgyt2p/j+pZY1t9YHA l/xFvynl8ylj2XIMWMp1SZGlP/Gf64IHJVnOi9x4XL2LT3pgKJ1t+YzmeSqjWEPJJ9 CHAUuY+zv6PpgDpTPC1lTg8LobLpXanwxYC0ADwVTWgU7RT2U1KX70R161d2qiRMTV GRaMfusW7cvcg== X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789656707595307490 X-GMAIL-MSGID: 1789656707595307490 Add a clocksource ID for the x86 kvmclock. Also, for ptp_kvm, set the recently added struct system_counterval_t member cs_id to the clocksource ID (x86 kvmclock or Arm Generic Timer). In the future, get_device_system_crosststamp() will compare the clocksource ID in struct system_counterval_t, rather than the clocksource. For now, to avoid touching too many subsystems at once, extract the clocksource ID from the clocksource. The clocksource dereference will be removed in the following. Signed-off-by: Peter Hilber --- Notes: v3: - Omit redundant clocksource_ids.h include (Andy Shevchenko). v2: - Name clock id according to Thomas Gleixner's mockup. arch/x86/kernel/kvmclock.c | 1 + drivers/ptp/ptp_kvm_common.c | 2 ++ include/linux/clocksource_ids.h | 1 + 3 files changed, 4 insertions(+) diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c index 5bb395551c44..2f1bbf730f45 100644 --- a/arch/x86/kernel/kvmclock.c +++ b/arch/x86/kernel/kvmclock.c @@ -160,6 +160,7 @@ struct clocksource kvm_clock = { .rating = 400, .mask = CLOCKSOURCE_MASK(64), .flags = CLOCK_SOURCE_IS_CONTINUOUS, + .id = CSID_X86_KVM_CLK, .enable = kvm_cs_enable, }; EXPORT_SYMBOL_GPL(kvm_clock); diff --git a/drivers/ptp/ptp_kvm_common.c b/drivers/ptp/ptp_kvm_common.c index 2418977989be..b0b36f135347 100644 --- a/drivers/ptp/ptp_kvm_common.c +++ b/drivers/ptp/ptp_kvm_common.c @@ -4,6 +4,7 @@ * * Copyright (C) 2017 Red Hat Inc. */ +#include #include #include #include @@ -47,6 +48,7 @@ static int ptp_kvm_get_time_fn(ktime_t *device_time, system_counter->cycles = cycle; system_counter->cs = cs; + system_counter->cs_id = cs->id; *device_time = timespec64_to_ktime(tspec); diff --git a/include/linux/clocksource_ids.h b/include/linux/clocksource_ids.h index f8467946e9ee..a4fa3436940c 100644 --- a/include/linux/clocksource_ids.h +++ b/include/linux/clocksource_ids.h @@ -8,6 +8,7 @@ enum clocksource_ids { CSID_ARM_ARCH_COUNTER, CSID_X86_TSC_EARLY, CSID_X86_TSC, + CSID_X86_KVM_CLK, CSID_MAX, }; From patchwork Thu Feb 1 01:04:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Hilber X-Patchwork-Id: 195116 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:106:209c:c626 with SMTP id mn5csp131508dyc; Wed, 31 Jan 2024 17:08:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IHpyL88BrP3T7M7QB4QjPJ2w/A4w89yTaBrSEgqQnTpMVDO2cpyBGcHxTXJh/ooooMGa03Z X-Received: by 2002:a05:6214:21ad:b0:68c:48f5:31da with SMTP id t13-20020a05621421ad00b0068c48f531damr3455877qvc.34.1706749698207; Wed, 31 Jan 2024 17:08:18 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUACdcasiwHYw69F2N5xxzBVZ9LdIRc0oyWyGLdwKnr9Ef5y3m8Ryr59mjY7RWsWTlXVO/NnYhRUTUGjWsGKarGc8OAdA== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 14-20020a056214202e00b0068c38f2dbcasi8212324qvf.300.2024.01.31.17.08.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 17:08:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47465-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@opensynergy.com header.s=TM-DKIM-20210503141657 header.b=AkFHexsJ; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-47465-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47465-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=opensynergy.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id E95B21C23178 for ; Thu, 1 Feb 2024 01:08:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E1636364A8; Thu, 1 Feb 2024 01:06:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=opensynergy.com header.i=@opensynergy.com header.b="AkFHexsJ" Received: from refb01.tmes.trendmicro.eu (refb01.tmes.trendmicro.eu [18.185.115.53]) (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 C2DDA6121 for ; Thu, 1 Feb 2024 01:06:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=18.185.115.53 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706749601; cv=fail; b=Hnh3dAqA+zdhTvboVOVxSvk7bbKZlBlBFHl+tZCVmH5S/Fmjp5nbjKzMlXFzHCfVr36p7Q4kR+A+sCgMPsW/HukUldHiNS3HO4ypa29iyqrga26pUpLQ+1O38x5I/TN7yxn3kPc40RJXV/pUwVb98YcmEMlo/Ab3Ou5EVxNYDIc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706749601; c=relaxed/simple; bh=D57pOeABfamN98NGLpRroVr6iGToMt3H85oc0X/wUSE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=IBFCTnYzmP06ZJG121pz7A77vafQPvQ9pyhwkWi2p0UzHNCkd5wyWLxeTgk3ktkBPsw9xPHWw57UCMlXJad6LNK1nTnVwnaFyXq6ErsRHAgiby51NAAaYqM2PFECLpHsHyyhylcMcCrSrhvbjrYlViz777fMNzl+C2liyoFVhWs= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensynergy.com; spf=pass smtp.mailfrom=opensynergy.com; dkim=pass (2048-bit key) header.d=opensynergy.com header.i=@opensynergy.com header.b=AkFHexsJ; arc=fail smtp.client-ip=18.185.115.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensynergy.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=opensynergy.com Received: from 104.47.11.169_.trendmicro.com (unknown [172.21.19.72]) by refb01.tmes.trendmicro.eu (Postfix) with ESMTPS id 6DC5210D3A1F7; Thu, 1 Feb 2024 01:06:37 +0000 (UTC) Received: from 104.47.11.169_.trendmicro.com (unknown [172.21.176.220]) by repost01.tmes.trendmicro.eu (Postfix) with SMTP id AE869100004D3; Thu, 1 Feb 2024 01:06:29 +0000 (UTC) X-TM-MAIL-RECEIVED-TIME: 1706749547.736000 X-TM-MAIL-UUID: 5c9397da-eb9e-42f7-9e74-f7ce1151010d Received: from DEU01-FR2-obe.outbound.protection.outlook.com (unknown [104.47.11.169]) by repre01.tmes.trendmicro.eu (Trend Micro Email Security) with ESMTPS id B3E8F10006A5E; Thu, 1 Feb 2024 01:05:47 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CBQb9aXSmWIXZ5e3sAVvBwCaEuWpTiBSxy5zKGOn/TXCGahXbUijIOvoJ6FLkApl4W6WxN4PglFmo5hpdG6cKbAPa1Bs+NgDnP6Gg07GJ3t7o6PMEhLlwYMGVb3FMBQpZqE9zvnOqC1BDPB3F/kNGXCcyhEs4Uy/krRqZbtvMaQDuBiLEXYhL6ZlRk8RYXA3m+a/PSfxt9d2l1jEEhngf7nQc3DSF3hOF1O0ILvfP/lIGo8IOj8EX73a+WqFc8E9TiqclCt1e/9ZNejAaVULIQvme+upk7VxSu5csHljZaklgfpQj48rEX34b2ky6hEQNqt7U+zT35uHF0XVEok34w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JhgN1hN5nDXN/Fou+ALZ0OcVA9vQ13ILRQYwQOvZUNw=; b=HB7O83FYqcEKRkcKv520CrrzYKjD5vPAZx4SyZe+RlWTafIhsfjhSkqidNHzfU6kd0bCYV5e3NigoNzfiQDXTMBglrJe9DaR5F1NKB1j0hQ7OH8yNK73hGxmYSBMMxy1W0fTLNEmM+uwW8O1m2Kq73QttWm5DzugYqdv4v82SfaiiW2sOgB09LAZRRpaXLm9p4BUrbzosZe4yfWT+7f2DFF5zIVV/eeBtc+rhdcctEaekJKzXjsUNA3oYTDomQqg0E4An3h/zXCvM6+6lXDun1vmj3V7W8cthW293jkO8h7NJg/WiNTsrzpBQch4XKJnh2CLQem2JTLIlU5ZMkVMZA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 217.66.60.4) smtp.rcpttodomain=alien8.de smtp.mailfrom=opensynergy.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=opensynergy.com; dkim=none (message not signed); arc=none (0) X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 217.66.60.4) smtp.mailfrom=opensynergy.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=opensynergy.com; Received-SPF: Pass (protection.outlook.com: domain of opensynergy.com designates 217.66.60.4 as permitted sender) receiver=protection.outlook.com; client-ip=217.66.60.4; helo=SR-MAIL-03.open-synergy.com; pr=C From: Peter Hilber To: linux-kernel@vger.kernel.org Cc: Peter Hilber , "D, Lakshmi Sowjanya" , Thomas Gleixner , jstultz@google.com, giometti@enneenne.com, corbet@lwn.net, "Dong, Eddie" , "Hall, Christopher S" , Simon Horman , Andy Shevchenko , Marc Zyngier , linux-arm-kernel@lists.infradead.org, Sean Christopherson , Paolo Bonzini , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Wanpeng Li , Vitaly Kuznetsov , Mark Rutland , Daniel Lezcano , Richard Cochran , kvm@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v3 5/8] ptp/kvm, arm_arch_timer: Set system_counterval_t.cs_id to constant Date: Thu, 1 Feb 2024 02:04:50 +0100 Message-Id: <20240201010453.2212371-6-peter.hilber@opensynergy.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240201010453.2212371-1-peter.hilber@opensynergy.com> References: <20240201010453.2212371-1-peter.hilber@opensynergy.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB8EUR05FT029:EE_|FR2P281MB0107:EE_ X-MS-Office365-Filtering-Correlation-Id: dd7e9af6-3249-4a0e-c64b-08dc22c1ebd6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: j//xz2/FI7LgQ7uhT1Y84nILqDRR6bYPSjAlv+0eWOzFVSi8tDilxUVImkG4ngHcgS/s+DJ7TJzTy8506LUOJWM1btQVxp6UTzSPEUL4U0UUVKiA8jhCBzNwlwqLa0cCJ+3S+yCwdKIRJ3NdOeI2A+Nd+K+loO0tup5dm5NpzRzEtXgf98N3hVPmDDvIZEJkyb4H6qwsdMWb/d5fcVtiBjK4RhIOjV2OW5XkDHZ5+GgdgrBP+lGxu+BQp0klpIDJV+T4xQJwyvwvA5M7bJ20omQY9zKZM7kwIuljfuKhcJOr/HjNjlEcbnV2Yq+kEQGUTrrT68dZexreikRhM7bc9dDl5sLphWvxGcmSRfKEdL7NodVOkzAscDmx53Glje0S4zCnwKnpaDZJTJIErsyj9cxiRSXsPXK08AhvpOvNf054HUQdNxM2ENKvOQqO+fL195s0noEexBmqA3GrLCDbCFX1mUti2RaxXvHA38h5edCDIex7VBbdLWubTNArj3BdTLSq9ODOm+0dAISChUxjmjeWZ30gBu2v/TngOH0LwWKKP1ZDKMSK3wqWWnVCCX8YJRMAaIHQoIu616GP1b48Zt/bgigVqKoHXvUY00WOMBWdbXjnx7p9RFQMIYcX13RJDE94eUJGHdfaKfZhXk7sWi+yy4w4sfhsipXNrOuneVhUOqUClyyyHZk1AreNIP+TptFlfMRWxKfXN9wRkk20M0+HJwyHliRs6mFdTUHPDBC5xd502r1Cg1/LHvRwL+0F X-Forefront-Antispam-Report: CIP:217.66.60.4;CTRY:DE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SR-MAIL-03.open-synergy.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(396003)(376002)(136003)(39840400004)(346002)(230922051799003)(1800799012)(64100799003)(82310400011)(186009)(451199024)(46966006)(36840700001)(40480700001)(83380400001)(41300700001)(86362001)(36756003)(81166007)(36860700001)(47076005)(336012)(2616005)(26005)(1076003)(2906002)(478600001)(6916009)(70586007)(70206006)(316002)(54906003)(42186006)(44832011)(5660300002)(7416002)(8676002)(8936002)(4326008)(36900700001);DIR:OUT;SFP:1102; X-OriginatorOrg: opensynergy.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2024 01:05:45.9427 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dd7e9af6-3249-4a0e-c64b-08dc22c1ebd6 X-MS-Exchange-CrossTenant-Id: 800fae25-9b1b-4edc-993d-c939c4e84a64 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=800fae25-9b1b-4edc-993d-c939c4e84a64;Ip=[217.66.60.4];Helo=[SR-MAIL-03.open-synergy.com] X-MS-Exchange-CrossTenant-AuthSource: DB8EUR05FT029.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: FR2P281MB0107 X-TM-AS-ERS: 104.47.11.169-0.0.0.0 X-TMASE-Version: StarCloud-1.3-9.1.1015-28152.007 X-TMASE-Result: 10-1.458100-4.000000 X-TMASE-MatchedRID: bjwz5Y9VyUDCCiFlDvprp7r2u0KWqQKNSDS3MUO7D/TIRhEhdkLWEovP iBq/iW91MpPx8OFzfY0wNyuTxfRm8ShARHtTtMpxhi2C7dlNKWrn0oaU6WM++5zYnFsPfA8XUMf 79vayL5ANuimYslhyE2tNUNGl1uzREfinJ3N6jMzFTQGAKRxj5No+48giqZwnEgg3cwDHl/0S3W M79W3o4ma3xca03R6M/utaD2GffWo0zI7+eiZZ8F5CD/hq6siqFEqAM28vQO1Q6z0JFJrmFnhEE wH9X4REQE1Xqh2tz4E= X-TMASE-XGENCLOUD: 94638120-ac67-4978-93c3-0cd2902ecd73-0-0-200-0 X-TM-Deliver-Signature: B373ADE2DED4ADB7679BF271BCAA9316 X-TM-Addin-Auth: 8XTTJSTfCuDKwe9AtHmgxezWSnJkKdKsUymwIVnx6WSdfhq4RiAhPIVgF7B HjuXLGJUfaidfVcwF0dz9meo/dg7OzUGLqfndiWAP6lunKNHVjmPkSVhkyvj8iE44qJOVGHMuZG ruTUQm5PM/dJLRv06dV3tnoEODN+V98FUDIC447mOOkIL3ofFGuh9qCO2i6BYK7Yhfu6oBRRVIM Sm2f3jt5i+nZQnH8OrQZiaj+sv5h8WaiLuV1iWvsNZ1yQBuD0sq/dASCpdLZ96dJoHUbovZjGOY DDHzqHVo+/pemfGlvsM46A5Id6L4t/WIozEu.pxOrUYIredW6WK5u3i8RWDdo9ZxGzitekXngfs 5S4rjzOn6m5a/K3VJXYh/5f7gK8kD6Aq5WBbexVChp6M4SjVKyXdH/WpB7upkSSFgY1MydhpzZf GhNqrptC1Z6/5FarD4U1AP6QqP0Ou0vg1loJPZihrFsJYgd5XfkE8rv4bc0ayXWly5vix5c/83h t4spgTpvm8QC/g8jWpS1g51T7x70ROQOLg9qXyG/tWcaInkZb0z8+j+ABbAdbui0lh/QT2h3DFr 0Bk9NplUry5QbI3/nunLmy0R+knYJwwh3s4/l1RPe0uFX04zaubvyfWmKX/b3w1fhYPD6QcHMyP xQ6w== X-TM-Addin-ProductCode: EMS DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=opensynergy.com; s=TM-DKIM-20210503141657; t=1706749589; bh=D57pOeABfamN98NGLpRroVr6iGToMt3H85oc0X/wUSE=; l=4724; h=From:To:Date; b=AkFHexsJyiiioD/6hJQl8fT+d4yVX/CIpU2UIXVNhWItDjjxfsIG/HITheyeh8U+8 psOofcEjsvIC9UnnhLYWuY1ARPzvlhT3wShy3GWUYLbTTUjWaBUOiZtObIPosDv1Xc EJda/tp4lkxTTLdjSD1OEF353i9ZQ71V+RjnIKiqtiz4logvUH1p5WbFBINeTRXl/h ucoFLm6nYrDgQbOcZX9KY/TnW3BOPTepIIFhEmMhfeVPTKVK680zBnVvlwc8cGqZZN Fgjral0NWJHmp29GjNconaUokkSB5f9m38sheEpzvB6mWhKm8B6k4wtC+xazH/yKrL Rxf+80P5uBEpw== X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789656771787455009 X-GMAIL-MSGID: 1789656771787455009 Identify the clocksources used by ptp_kvm by setting clocksource ID enum constants. This avoids dereferencing struct clocksource. Once the system_counterval_t.cs member will be removed, this will also avoid the need to obtain clocksource pointers from kvm_arch_ptp_get_crosststamp(). The clocksource IDs are associated to timestamps requested from the KVM hypervisor, so the proper clocksource ID is known at the ptp_kvm request site. While at it, also rectify the ptp_kvm_get_time_fn() ret type. Signed-off-by: Peter Hilber --- Notes: v2: Added in v2. drivers/clocksource/arm_arch_timer.c | 5 ++++- drivers/ptp/ptp_kvm_arm.c | 2 +- drivers/ptp/ptp_kvm_common.c | 10 +++++----- drivers/ptp/ptp_kvm_x86.c | 4 +++- include/linux/ptp_kvm.h | 4 +++- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c index e054de92de91..45a02872669e 100644 --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c @@ -1807,7 +1807,8 @@ TIMER_ACPI_DECLARE(arch_timer, ACPI_SIG_GTDT, arch_timer_acpi_init); #endif int kvm_arch_ptp_get_crosststamp(u64 *cycle, struct timespec64 *ts, - struct clocksource **cs) + struct clocksource **cs, + enum clocksource_ids *cs_id) { struct arm_smccc_res hvc_res; u32 ptp_counter; @@ -1833,6 +1834,8 @@ int kvm_arch_ptp_get_crosststamp(u64 *cycle, struct timespec64 *ts, *cycle = (u64)hvc_res.a2 << 32 | hvc_res.a3; if (cs) *cs = &clocksource_counter; + if (cs_id) + *cs_id = CSID_ARM_ARCH_COUNTER; return 0; } diff --git a/drivers/ptp/ptp_kvm_arm.c b/drivers/ptp/ptp_kvm_arm.c index e68e6943167b..017bb5f03b14 100644 --- a/drivers/ptp/ptp_kvm_arm.c +++ b/drivers/ptp/ptp_kvm_arm.c @@ -28,5 +28,5 @@ void kvm_arch_ptp_exit(void) int kvm_arch_ptp_get_clock(struct timespec64 *ts) { - return kvm_arch_ptp_get_crosststamp(NULL, ts, NULL); + return kvm_arch_ptp_get_crosststamp(NULL, ts, NULL, NULL); } diff --git a/drivers/ptp/ptp_kvm_common.c b/drivers/ptp/ptp_kvm_common.c index b0b36f135347..f6683ba0ab3c 100644 --- a/drivers/ptp/ptp_kvm_common.c +++ b/drivers/ptp/ptp_kvm_common.c @@ -4,7 +4,6 @@ * * Copyright (C) 2017 Red Hat Inc. */ -#include #include #include #include @@ -29,15 +28,16 @@ static int ptp_kvm_get_time_fn(ktime_t *device_time, struct system_counterval_t *system_counter, void *ctx) { - long ret; - u64 cycle; + enum clocksource_ids cs_id; struct timespec64 tspec; struct clocksource *cs; + u64 cycle; + int ret; spin_lock(&kvm_ptp_lock); preempt_disable_notrace(); - ret = kvm_arch_ptp_get_crosststamp(&cycle, &tspec, &cs); + ret = kvm_arch_ptp_get_crosststamp(&cycle, &tspec, &cs, &cs_id); if (ret) { spin_unlock(&kvm_ptp_lock); preempt_enable_notrace(); @@ -48,7 +48,7 @@ static int ptp_kvm_get_time_fn(ktime_t *device_time, system_counter->cycles = cycle; system_counter->cs = cs; - system_counter->cs_id = cs->id; + system_counter->cs_id = cs_id; *device_time = timespec64_to_ktime(tspec); diff --git a/drivers/ptp/ptp_kvm_x86.c b/drivers/ptp/ptp_kvm_x86.c index 902844cc1a17..2782442922cb 100644 --- a/drivers/ptp/ptp_kvm_x86.c +++ b/drivers/ptp/ptp_kvm_x86.c @@ -93,7 +93,8 @@ int kvm_arch_ptp_get_clock(struct timespec64 *ts) } int kvm_arch_ptp_get_crosststamp(u64 *cycle, struct timespec64 *tspec, - struct clocksource **cs) + struct clocksource **cs, + enum clocksource_ids *cs_id) { struct pvclock_vcpu_time_info *src; unsigned int version; @@ -124,6 +125,7 @@ int kvm_arch_ptp_get_crosststamp(u64 *cycle, struct timespec64 *tspec, } while (pvclock_read_retry(src, version)); *cs = &kvm_clock; + *cs_id = CSID_X86_KVM_CLK; return 0; } diff --git a/include/linux/ptp_kvm.h b/include/linux/ptp_kvm.h index 746fd67c3480..95b3d4d0d7dd 100644 --- a/include/linux/ptp_kvm.h +++ b/include/linux/ptp_kvm.h @@ -8,6 +8,7 @@ #ifndef _PTP_KVM_H_ #define _PTP_KVM_H_ +#include #include struct timespec64; @@ -17,6 +18,7 @@ int kvm_arch_ptp_init(void); void kvm_arch_ptp_exit(void); int kvm_arch_ptp_get_clock(struct timespec64 *ts); int kvm_arch_ptp_get_crosststamp(u64 *cycle, - struct timespec64 *tspec, struct clocksource **cs); + struct timespec64 *tspec, struct clocksource **cs, + enum clocksource_ids *cs_id); #endif /* _PTP_KVM_H_ */ From patchwork Thu Feb 1 01:04:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Hilber X-Patchwork-Id: 195118 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:106:209c:c626 with SMTP id mn5csp135522dyc; Wed, 31 Jan 2024 17:17:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IGkXZGU4XZOpz4GgaYrsGimhLp0mMhJALhVKP4eGO9H3HtIjo1p7R3D52xsLabqc4ZejgzJ X-Received: by 2002:a17:902:ab83:b0:1d8:f129:a0bc with SMTP id f3-20020a170902ab8300b001d8f129a0bcmr2975270plr.13.1706750278092; Wed, 31 Jan 2024 17:17:58 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUIvAbCR75cl/0GOLlojAoK7HDW0yK+OH7jO2CHCukBdX4WAt/YixY1EKCx++Pe2jJ4SxgUV/hp+ZnyUQqdXdO0A+uadQ== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id a4-20020a1709027d8400b001d730061829si10527902plm.324.2024.01.31.17.17.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 17:17:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47482-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@opensynergy.com header.s=TM-DKIM-20210503141657 header.b=Rd+6oYlw; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-47482-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47482-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=opensynergy.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id DB4CB294EFD for ; Thu, 1 Feb 2024 01:13:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 70BC339FF7; Thu, 1 Feb 2024 01:11:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=opensynergy.com header.i=@opensynergy.com header.b="Rd+6oYlw" Received: from refb02.tmes.trendmicro.eu (refb02.tmes.trendmicro.eu [18.185.115.58]) (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 2EADD364D5 for ; Thu, 1 Feb 2024 01:11:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=18.185.115.58 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706749909; cv=fail; b=tsOMEbRp76OwVrbV8PfAZcZB0WRznv2Nw3c15Eakex3tnroXJUKmTf1QyitLNOMMr/amEH6cz9osWOxsdCE0bkeBVDp3/sWf0mH3F5vq5yF/KbS7c2DHtOmFbgO09JORWVTzWknZwBB+GOCTwomSRu28IiVtlR764BFHJHzu5Mc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706749909; c=relaxed/simple; bh=GD3Um5Fk9KYt8CWRDZT+Iu5Qq0xNhOzbOrimElkMX08=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=TAZOqAEKQefwNOUFy5Qfn1IMy3thXSDO0RqAz0vy2VcMX7gul/vEx72FSN4M4sJImyECMhUS9Vi/SIdt7y502eq6A9GX573Bpvs4VHWpCIM0RxVnSTOQwXY403EkCBKVdLgMpjg9sbSkY1DV5Qg6StPoWek+BvIOgqUAf7R3gXk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensynergy.com; spf=pass smtp.mailfrom=opensynergy.com; dkim=pass (2048-bit key) header.d=opensynergy.com header.i=@opensynergy.com header.b=Rd+6oYlw; arc=fail smtp.client-ip=18.185.115.58 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensynergy.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=opensynergy.com Received: from 104.47.7.169_.trendmicro.com (unknown [172.21.9.50]) by refb02.tmes.trendmicro.eu (Postfix) with ESMTPS id 6D78810A7E2D0; Thu, 1 Feb 2024 01:06:25 +0000 (UTC) Received: from 104.47.7.169_.trendmicro.com (unknown [172.21.176.220]) by repost01.tmes.trendmicro.eu (Postfix) with SMTP id 9666E10000E36; Thu, 1 Feb 2024 01:06:17 +0000 (UTC) X-TM-MAIL-RECEIVED-TIME: 1706749549.127000 X-TM-MAIL-UUID: 709e3cc4-757f-4404-9af5-e56d9b0a6509 Received: from DEU01-BE0-obe.outbound.protection.outlook.com (unknown [104.47.7.169]) by repre01.tmes.trendmicro.eu (Trend Micro Email Security) with ESMTPS id 1F23C10000E27; Thu, 1 Feb 2024 01:05:49 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Zknp6agk+5MT2WVkC1kU8vBXclZZnhsjEAdXme5JAuPR+tkvaWwisgw8R1Iv3liuFMbCTaNqtqAz5HTs+S9/XC0oMgzzBHIJVpkP1G12UR2E395ArK4lIm5RKb9Ws7MjLUy7eT8IdfcA99t1SubH8sLpd46X8vrUvaJBmY+oA6SdWym+9UeH4ak3L4agMVTD6kcORjA3Jox+E9o2g53SJ9HTFWr7JRy+Cy/9R1HBsiWprVoAndEynM9P5DrcKiK6kvNpGPIPaoiNQ8ITwuIh+KN7hesKr+eqm166rNdBLOQRI/kQpBocq/lp7J3gOYUefkFxligxX8JNoofDdX70Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=19V5f5v4K31vf5r1k2uGbWqScSaz2MU+qssn/Nacn4w=; b=b9yZ6yK75RQUi/YqMqz9i4Aee9bK5CqkjYQq5kylpZGU+Fo9Sk7sqEiglON3vlN0Nu1s4nMC0ynQO1+Tqy2hORkgVlthzdexTWNLXZI5t4A/Fgk/hFgyca/VbWY2mEnbICFPKJ+ZEmUppl0FYp+UORJ94F6LkPeQeDL7hlbo2P7L1h6exfoM8nd2scqEVU5FQd8KkaiEz/VKYxat6WiikbEp36nNxkyp55zIRrCLSa21sxSyNVxfrEaUUv7HiMJIhU9DtkOE/gpZkgdMgwiNMtia+nv0ym8IjvcqdJys1vvVttdrjx7aH/2rLpNy6wBAsnMqd1PDBP40VRfXjgr7Yg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 217.66.60.4) smtp.rcpttodomain=alien8.de smtp.mailfrom=opensynergy.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=opensynergy.com; dkim=none (message not signed); arc=none (0) X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 217.66.60.4) smtp.mailfrom=opensynergy.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=opensynergy.com; Received-SPF: Pass (protection.outlook.com: domain of opensynergy.com designates 217.66.60.4 as permitted sender) receiver=protection.outlook.com; client-ip=217.66.60.4; helo=SR-MAIL-03.open-synergy.com; pr=C From: Peter Hilber To: linux-kernel@vger.kernel.org Cc: Peter Hilber , "D, Lakshmi Sowjanya" , Thomas Gleixner , jstultz@google.com, giometti@enneenne.com, corbet@lwn.net, "Dong, Eddie" , "Hall, Christopher S" , Simon Horman , Andy Shevchenko , Marc Zyngier , linux-arm-kernel@lists.infradead.org, Sean Christopherson , Paolo Bonzini , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Wanpeng Li , Vitaly Kuznetsov , Mark Rutland , Daniel Lezcano , Richard Cochran , kvm@vger.kernel.org, netdev@vger.kernel.org, Stephen Boyd Subject: [PATCH v3 6/8] timekeeping: Evaluate system_counterval_t.cs_id instead of .cs Date: Thu, 1 Feb 2024 02:04:51 +0100 Message-Id: <20240201010453.2212371-7-peter.hilber@opensynergy.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240201010453.2212371-1-peter.hilber@opensynergy.com> References: <20240201010453.2212371-1-peter.hilber@opensynergy.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB8EUR05FT053:EE_|BEVP281MB3522:EE_ X-MS-Office365-Filtering-Correlation-Id: 68e8df3a-ccf8-4dc0-f8de-08dc22c1ec77 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SMPn4YTEVAuru0q6PEGjScR9cb4/cXYPn25yAmfn1n2RnNTtLvMDwXPiToRJ82YnOhnlYYm1DlLzCMZuXSsOBzxh1i0zrW3CvHARxfYejvUkMZ56alcVtS8Aj1Iuj+zpXG7uHRYi/u9cnRIndVovAO1KWo2yu53PAAJ024q6dZAwyt1rXdi35nkx+A9lyIHeAlU7WZmAdZXTBacP1PbcXG/1Zm8yUuwc00KsDSE/aiWzZHHNq86Oy2Kewph4zn3taHLDx+Ws00PDXEvPWMMwnCKqY3oz8VEmXgpy9rnbMVyEO6lvDcXYo5cLus+RhYTH3fce2aIUeK98aqhsWe/D0UvsBt1toW7zFgb4EjFicwwXtJDeiw9B5MTuOYajxbMDg09N+IxZGP0hYll4GzBuHHPmpEv3MEI15nBds1b8BOSRyryo29kHm2Kjyy4TSZemQilz+04L75tdjyR2gWpNB6X55BTsd/4zSBGAy2TA9wo9pKeti25RV81KF5WNWLMTGcCzzph5/UUnbrqAcAsVLJIS7UhoD0Q8qJ2OBN+8FB0juwuF/IgOE/Ix2Me7Il1uSmxlu4yzk7y+eApzyDpFXRTBuyz5piMgCc6/xbgZee7Gg8N9YpoQDT4wxswW/11iDf00pjqHaevZ97B1q+MUIxuq2uH2UixjTnS5lN7q8Z/41yBzLvRveplJgs4GB4rWQAFg6v0u6kDXC8pHCtKhuea5bxW8oXAqtwnKrHsMtVHDxZAcYJ+DKw58gtRw4Xgj X-Forefront-Antispam-Report: CIP:217.66.60.4;CTRY:DE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SR-MAIL-03.open-synergy.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(136003)(39840400004)(346002)(376002)(396003)(230922051799003)(451199024)(1800799012)(82310400011)(186009)(64100799003)(36840700001)(46966006)(41300700001)(83380400001)(47076005)(1076003)(2616005)(336012)(26005)(81166007)(36860700001)(4326008)(44832011)(8676002)(8936002)(5660300002)(7416002)(2906002)(478600001)(966005)(42186006)(54906003)(70586007)(70206006)(6916009)(316002)(86362001)(36756003)(40480700001)(142923001)(36900700001);DIR:OUT;SFP:1102; X-OriginatorOrg: opensynergy.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2024 01:05:46.9992 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 68e8df3a-ccf8-4dc0-f8de-08dc22c1ec77 X-MS-Exchange-CrossTenant-Id: 800fae25-9b1b-4edc-993d-c939c4e84a64 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=800fae25-9b1b-4edc-993d-c939c4e84a64;Ip=[217.66.60.4];Helo=[SR-MAIL-03.open-synergy.com] X-MS-Exchange-CrossTenant-AuthSource: DB8EUR05FT053.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BEVP281MB3522 X-TM-AS-ERS: 104.47.7.169-0.0.0.0 X-TMASE-Version: StarCloud-1.3-9.1.1015-28152.007 X-TMASE-Result: 10--4.043200-4.000000 X-TMASE-MatchedRID: xPvPRJicGCRt/9ulvM0QMd/Z7q+hZQVe6wJlKkXfZVkJ5yiKyAQmigHW HoYGrPh+C2QDPheido9iBl6ePEpdZVlsdSBrk49aju2XlcEx9HRelLFkoMPMWOI/qZVAgf06Vif 9o7rSV9vm9Tc/GgfFJwFtWueZlMH0t5KZ74QYwoxVSWOKG8Va/NVTzaAe7ACyygHdGJDPWm8TJ/ T+Ssc4ZVqoLahcwH4L6xA0Ava73nAPm15xyht8lXx2eIlQG1sMfC4IwOLvyucC4DhlAS07elo7G mCOJYd1+Tf0tcxKuLqp1o3scZXZMKi/idDT83QQLnekw6JLry5x/K7fMpYywQ== X-TMASE-XGENCLOUD: bd19414a-342d-4838-91df-7f66a485cb9a-0-0-200-0 X-TM-Deliver-Signature: 2BA278FB04BECBAC442E7F811F5E5EF9 X-TM-Addin-Auth: KNGNGy7t/AMGYYoPNJK33ihSH7nZOlcO1ENE9vIJullXy940AcoaOTWa2EH CaJ6tWJPN/O3nktQf4U8z82TJnXEPnNin+3JoCVAHtJJS52G5DRKQm5kOdWRlMM5E+RLfJXjcMs PSSGY8C6UENKzGxp/+F69UGZoV1GwNw3+rxSV9eQ5WwxvJLauAlgDfZYcRwtUivqlPJf3SLVzQ9 GnFCoAa692daYx/wOu86WSacyFs8K5UWgW07fnOgzh9mt8wMHLfWeVzUkBLPZuHZoR22RZps4xR T2JwLeXP3oHXap5LIrWC5xK3X/e4m8oenkz4.dzBdD0ueEzIDCZ2p1juT/CU3dycpZ3O8MSXgnj e/cu5MlnrLULYa7fhzKgDw2NBlrFuvRXSE7OPgyhF6XTPbcNlYa+H30FOzK0YJBymT9ZuQ7LVaw rOMdn/QKgcJgIjXx1AjjZGjsalneCBHi7+U73LyV2AE/ouKwcMBBhJeCmPE4z17kxgOKmr4DBWZ GL0HmtJXfBLWR304+8BqiXl/BMdGsmFx167jGXMXOJl6le/59k6hnjC5xMiI7JeK8vlTi+4y64L MlwAIzSmOh3HxyBr2mWFIQ8XT48PUxwz0S3CQzZ4zzQQ/GDfkN6LQ9qSD3PChPWr9rVU2Dd4qb4 3yWg== X-TM-Addin-ProductCode: EMS DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=opensynergy.com; s=TM-DKIM-20210503141657; t=1706749577; bh=GD3Um5Fk9KYt8CWRDZT+Iu5Qq0xNhOzbOrimElkMX08=; l=3419; h=From:To:Date; b=Rd+6oYlw0e5i5m/oaOaELqxRPwIeG1mlIQovq3Yvw72ixqAZDaxVS9qRblcqx1kdv XkCyQ5QbF3iMch+YLL2ARfcEB9RTh4IXINOZDGOKAxRIsBP94wTNfGKZt7f9X2x3tq JXH/pICCc7AfoXB/vAaG1V9gf5r64hmQ5oGwNLtRgeosCAXiBRb4BbqggKzBtPzB8e wBw37E42Uce7SUy+17En+9gBVtHgogYStStsLKosCVDryexFvyqfrjgM20s/f2S8Rr ZiTTg7HKGDtAI1PoIuLKbGVJLZ/e/bNkh9PZaRW1AHX8/JxtcFsDFUJ4wWuyOGLbQ9 +3BagxUPjpgCA== X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789657379616895751 X-GMAIL-MSGID: 1789657379616895751 Clocksource pointers can be problematic to obtain for drivers which are not clocksource drivers themselves. In particular, the RFC virtio_rtc driver [1] would require a new helper function to obtain a pointer to the Arm Generic Timer clocksource. The ptp_kvm driver also required a similar workaround. Address this by evaluating the clocksource ID, rather than the clocksource pointer, of struct system_counterval_t. By this, setting the clocksource pointer becomes unneeded, and it will be dropped from struct system_counterval_t in the future. By this, get_device_system_crosststamp() callers (such as virtio_rtc and ptp_kvm) will no longer need to supply clocksource pointers. This change should not alter any behavior, as the struct system_counterval_t clocksource ID is already being set wherever the clocksource pointer is set. get_device_system_crosststamp() will now fail if the clocksource has ID CSID_GENERIC, but all currently relevant clocksources have a custom clocksource ID. [1] https://lore.kernel.org/lkml/20231218073849.35294-1-peter.hilber@opensynergy.com/ Signed-off-by: Peter Hilber --- Notes: v2: - Refer to clocksource IDs as such in comments (Thomas Gleixner). - Update comments which were still referring to clocksource pointers. include/linux/timekeeping.h | 10 +++++----- kernel/time/timekeeping.c | 9 +++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h index ca234fa4cc04..3538c5bdf9ee 100644 --- a/include/linux/timekeeping.h +++ b/include/linux/timekeeping.h @@ -268,13 +268,13 @@ struct system_device_crosststamp { }; /** - * struct system_counterval_t - system counter value with the pointer to the + * struct system_counterval_t - system counter value with the ID of the * corresponding clocksource * @cycles: System counter value - * @cs: Clocksource corresponding to system counter value. Used by - * timekeeping code to verify comparibility of two cycle values - * @cs_id: Clocksource ID corresponding to system counter value. To be - * used instead of cs in the future. + * @cs: Clocksource corresponding to system counter value. Timekeeping + * code now evaluates cs_id instead. + * @cs_id: Clocksource ID corresponding to system counter value. Used by + * timekeeping code to verify comparability of two cycle values. * The default ID, CSID_GENERIC, does not identify a specific * clocksource. */ diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 266d02809dbb..0ff065c5d25b 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -1232,11 +1232,12 @@ int get_device_system_crosststamp(int (*get_time_fn) return ret; /* - * Verify that the clocksource associated with the captured - * system counter value is the same as the currently installed - * timekeeper clocksource + * Verify that the clocksource ID associated with the captured + * system counter value is the same as for the currently + * installed timekeeper clocksource */ - if (tk->tkr_mono.clock != system_counterval.cs) + if (system_counterval.cs_id == CSID_GENERIC || + tk->tkr_mono.clock->id != system_counterval.cs_id) return -ENODEV; cycles = system_counterval.cycles; From patchwork Thu Feb 1 01:04:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Hilber X-Patchwork-Id: 195125 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:106:209c:c626 with SMTP id mn5csp145318dyc; Wed, 31 Jan 2024 17:44:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IH04+Bt5tAMA1Ngj2XoUvYVsvx63HY3FlspvvGQMIyEKzCRQKyIWescorz43a0V+H2WWm1f X-Received: by 2002:a05:6a20:42a5:b0:19e:3cbf:1055 with SMTP id o37-20020a056a2042a500b0019e3cbf1055mr1914895pzj.8.1706751873897; Wed, 31 Jan 2024 17:44:33 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV/y7zwjuc4iU059i/9Drcp4jybqAhtcq/OXhak8AMhuTmGWpT3X4Es1pcXM+ETk9x7j1iG34u29mrjBJ281ZFKgAso0g== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id f5-20020a056a00228500b006dbe42bbfdasi11213778pfe.377.2024.01.31.17.44.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 17:44:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47466-ouuuleilei=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=@opensynergy.com header.s=TM-DKIM-20210503141657 header.b=XWj5mJP3; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-47466-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47466-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=opensynergy.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 565D6B255AD for ; Thu, 1 Feb 2024 01:08:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A4DAFC2CA; Thu, 1 Feb 2024 01:06:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=opensynergy.com header.i=@opensynergy.com header.b="XWj5mJP3" Received: from refb01.tmes.trendmicro.eu (refb01.tmes.trendmicro.eu [18.185.115.54]) (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 2AB1963A0 for ; Thu, 1 Feb 2024 01:06:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=18.185.115.54 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706749601; cv=fail; b=RI5bcr6PsamyPtetK56KEJN289VdUbdiOuWRD25nzDPQ4/UqlzbrPl7z5HiLKwZSFUlsVEt0FYynnACjLCNfW91dp5GChWLRm872n2RMrjiGFr0iMZM38SDT+XKbrjE6EohQGOS06rRT71JZYNLajM/qcPLnVwCOVQkSbq/cJyQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706749601; c=relaxed/simple; bh=j3ZK0LDs+hrr9tdazQ5dmRy2Y1/jm40trOZjBU8ltrU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=cFINPC9Oj4zGojfvU9I2svtyLNwb/zj5pEGos9vAF+fDxxXCFqHQiOXL8F5m8sBPk9h8C8CQ4DeNqqs6Df5M1ocRpdEEaaL2f2sDT2lYQdXZLcpUNQesRmNTQl/q63M6Xk7e7gC9PCg6wfF2dfI5QfhBrvNUoKtuLr6TSnwwIRg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensynergy.com; spf=pass smtp.mailfrom=opensynergy.com; dkim=pass (2048-bit key) header.d=opensynergy.com header.i=@opensynergy.com header.b=XWj5mJP3; arc=fail smtp.client-ip=18.185.115.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensynergy.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=opensynergy.com Received: from 104.47.7.168_.trendmicro.com (unknown [172.21.19.202]) by refb01.tmes.trendmicro.eu (Postfix) with ESMTPS id A572710D3A205; Thu, 1 Feb 2024 01:06:32 +0000 (UTC) Received: from 104.47.7.168_.trendmicro.com (unknown [172.21.176.220]) by repost01.tmes.trendmicro.eu (Postfix) with SMTP id 8AFDB100004D0; Thu, 1 Feb 2024 01:06:25 +0000 (UTC) X-TM-MAIL-RECEIVED-TIME: 1706749549.349000 X-TM-MAIL-UUID: 57a7349a-401c-46dd-a091-502461c475aa Received: from DEU01-BE0-obe.outbound.protection.outlook.com (unknown [104.47.7.168]) by repre01.tmes.trendmicro.eu (Trend Micro Email Security) with ESMTPS id 5580710006A5E; Thu, 1 Feb 2024 01:05:49 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GKhyu1JIeZwB9nOdO9yB4NN5zgsl1eKp2kxic9vkp1DOl3zR2PLwPFLOeLTDfdN24qjaorlw0uvUj+lJhmGrm8C9Wpj1jp9qgOIBH0X+QiOIvImLOgvZgry00ly7RS389iUSXp4o5//uY1LW8xRogIyUgQCGR5vaXsS6q6lBz3SPgQhjfwf/ojUa+VWVGK7VS/i0OrcJ4sFFh2qd90DN7K5gl/77hRVkmv4BA/CEVAIAQng2r+2WAqPFj3VJIn8ak7MxLb1ASixnIeA4aNY9zJCcctZ8BvOCsMR6lt+/VdyuBoR6YzWQTWKfNn36PQfFGGECY6qtZLVO3n1SXIZPfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LsyIsJZULVmOyBWJOur/9/jVP+yb1X6rnbgwdmk3TFE=; b=KRGUgomn33oerqrVwRfUHTGUzle56lVaaDZfDYUTwY2sgPMzqXO6/KA/Njz7GFyrgOSA1yvC5B/rGA2Fhaa6n7kxpvZCC0FFVqvvotQFE0rLLmAYIw7Uo9ZtTSSLM6G8gLR+l3NcXcRWfXVircIF/tERHyjdzAjqPTh51nnqxmZnEqqCycGEqK66+iiXRRVOQ7Hxr5/wBRny8glvjlyZUE/sOateCWr5HsTBXn2xkucUom7Wi4iqTu+NaygyGz2+4MdvZxJOHYZQdgoPv3SCrgqEw3XZFxb5pT5WK8VWwWxcJQvOphJEXe8nLDqqBCl8NuNxCKVcH6I+/4L/MmCZzw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 217.66.60.4) smtp.rcpttodomain=alien8.de smtp.mailfrom=opensynergy.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=opensynergy.com; dkim=none (message not signed); arc=none (0) X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 217.66.60.4) smtp.mailfrom=opensynergy.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=opensynergy.com; Received-SPF: Pass (protection.outlook.com: domain of opensynergy.com designates 217.66.60.4 as permitted sender) receiver=protection.outlook.com; client-ip=217.66.60.4; helo=SR-MAIL-03.open-synergy.com; pr=C From: Peter Hilber To: linux-kernel@vger.kernel.org Cc: Peter Hilber , "D, Lakshmi Sowjanya" , Thomas Gleixner , jstultz@google.com, giometti@enneenne.com, corbet@lwn.net, "Dong, Eddie" , "Hall, Christopher S" , Simon Horman , Andy Shevchenko , Marc Zyngier , linux-arm-kernel@lists.infradead.org, Sean Christopherson , Paolo Bonzini , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Wanpeng Li , Vitaly Kuznetsov , Mark Rutland , Daniel Lezcano , Richard Cochran , kvm@vger.kernel.org, netdev@vger.kernel.org, Stephen Boyd Subject: [PATCH v3 7/8] treewide: Remove system_counterval_t.cs, which is never read Date: Thu, 1 Feb 2024 02:04:52 +0100 Message-Id: <20240201010453.2212371-8-peter.hilber@opensynergy.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240201010453.2212371-1-peter.hilber@opensynergy.com> References: <20240201010453.2212371-1-peter.hilber@opensynergy.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1EUR05FT008:EE_|FRYP281MB0272:EE_ X-MS-Office365-Filtering-Correlation-Id: 81d7bb6c-a1ec-4d74-9208-08dc22c1ecfe X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: s5p/bEfW1RcHnaUVG/vPSD45EAcSRtlIOej782H1Qr4bexPXN78iDHu2/3sLAOKBHi119bqIVep+/rMO5VyE8j2xgSiuVZBPhiHrLO+ahZ6FV47rCbjbi0hMdnXX4e80HKVeeMspKZ5zgByY9ll03N2BshqGdXtoDXfc7N/hAprTJAMacD3NluZJfLFl/FuujB6B/HXNcpsWMSajjDsQ1+tcC4V2yFTqandyCqeVJ2cyKlUvmRSPKdk9EhUswVRVtpJR+stEiAaRbrFnjrf2mVT5tFIEk+hH4Az6zG1T7SNK/2zBIldYuZTvfqoniTt4uKmhS+1Xi7f0uLgzKK2znsUgbpgE+wZ+yMFhjuvnXUPwucyF8L1UInGpTYeAyeBYlUD6fMD2z+wJd23N6auQyJ2zyjM44R9VJVa0Bt6n8mEpjEztB545+vZVqJ+Y2iLJr5a85PGyxmWmOd5InNlMJ/h/Ayfp6dPHaLwb5ICeWepqgo3kAESx08OQKPB5CeUlSvGpNCK1YeAWgNOLbVn9Fp111sFCrR4UpwuYTfWvcU36exn9QG2j96UhZjP9w8UV3VLb+dalqliYE0dif9uv/RZ0MA2XX20IyhqTfs0FieJUuUc0RnnwKqJ7+8Oq2pEMZKxkYybBxTrL1los1W/z3MoWLeTyeXlR9D/a9hccfZvsP/lJYYhwPwdJeCwW6xV97upuTGDxwYxyNKWRP7c7KVyUYrnxXQ+WbmhXX8CE7jhTLzYLIqzZTsJyALjjUtr2 X-Forefront-Antispam-Report: CIP:217.66.60.4;CTRY:DE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SR-MAIL-03.open-synergy.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(39840400004)(346002)(376002)(136003)(396003)(230922051799003)(1800799012)(82310400011)(186009)(451199024)(64100799003)(36840700001)(46966006)(316002)(47076005)(70206006)(70586007)(42186006)(6916009)(54906003)(36756003)(7416002)(36860700001)(8936002)(4326008)(44832011)(8676002)(86362001)(5660300002)(41300700001)(81166007)(2616005)(40480700001)(336012)(1076003)(478600001)(26005)(2906002)(83380400001)(36900700001);DIR:OUT;SFP:1102; X-OriginatorOrg: opensynergy.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2024 01:05:47.8969 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 81d7bb6c-a1ec-4d74-9208-08dc22c1ecfe X-MS-Exchange-CrossTenant-Id: 800fae25-9b1b-4edc-993d-c939c4e84a64 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=800fae25-9b1b-4edc-993d-c939c4e84a64;Ip=[217.66.60.4];Helo=[SR-MAIL-03.open-synergy.com] X-MS-Exchange-CrossTenant-AuthSource: VI1EUR05FT008.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: FRYP281MB0272 X-TM-AS-ERS: 104.47.7.168-0.0.0.0 X-TMASE-Version: StarCloud-1.3-9.1.1015-28152.007 X-TMASE-Result: 10-0.836900-4.000000 X-TMASE-MatchedRID: 2GwetqJOyZxrxBLbo6y0d4ruruLIWfnxgz5VmKZ8x85rIVA3IGfCC6DE DQa+uiKUfxo+wwDBGZpKfWS2EzGP5o/GIRjw2D78dArStA4IAF4SRRLwSueD2tEOKD7Vsunkj6Q WX061FFJ3hNro2zkthd9gyvNyzxXy0bKbAkjZTQt4lyF1lyvUrTUfXwpl5znYB/H9q/pEjfECt0 I5Tjuo2dlhzrOwI51bKRbMLPl3awjb3dppi+rLrXzV+KRRiDItcnxszfxH2Ckmx8kl1Wnd+q+eC SMeOiOkfZ9uentPYeaJcb4M4L3rfi1QF7giu85XOwBXM346/+wUiV4IE4MuxRTbXVdulhu/g7hE xeK2mZMPR11w2j/xz8m6mrJkmFv1 X-TMASE-XGENCLOUD: 5c2e2e76-2709-4d52-874d-66c1ac854c9f-0-0-200-0 X-TM-Deliver-Signature: AA2270AE4D693477B76D0B655674B1B2 X-TM-Addin-Auth: 0Q/emdNT/sNhsg4VmkEqA2bu2nwRc6yHrwfyDG7IMJ+dbBHMyMPaixZ8R0s 1wC8mhCCB/0wymKGMmNx4IT3OCTtdT7hnm6lTJv7lcK9G9hJ5spUPD3r10QrlYYdgFEYN6EvIjx Lr+Tsxz4GRDIGFCvs9woZNEVmzBWfZc5RBSd8ThjUYM/W8iFS6enWL0K62k+3l5GYHkccduG6/d //yHM5obD7hm34tudjbXV8RTxcodJRXRE2Bb13sHMl4Z7nWvgH01QT3Kt9/IOGJQyB8pxeCgepL ljKkzZfq83uwBuCFyA5Imyvj1VmqfVYh3n02.JPyoV/T2r1tAEv1U2pH2m/h5Kz2zbcSCHDbYHT XxvHJK7bu8RSaskkqGRoRWblNYdOGwapk478mbCBWwHFs+qRIkG9JO5xEPCTG+lqkIlB9BuOMd9 X1mVvf/iDTJASysGBQbHn9jd+SwCdNSgg+nuGvDBrTAlH9n7vrpbDalc/HMxm3sJUcfFVXnCShI 0MITdgDSFqtUdrGpefVMRv+b97DTpRxpITAw6fFbR+knLuvFp1s12x5aSjlhs9ORt80AyrJck+b G4gs2L4Yt7Tqc3szU3dC4/sLGqJCZvwJGLvihk52vxB2MnyhBxZ109ISF5BLO4N0UyQOzHa6Ln8 BS6w== X-TM-Addin-ProductCode: EMS DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=opensynergy.com; s=TM-DKIM-20210503141657; t=1706749585; bh=j3ZK0LDs+hrr9tdazQ5dmRy2Y1/jm40trOZjBU8ltrU=; l=6724; h=From:To:Date; b=XWj5mJP31O4E221jcObYKFA0r/yq0fZlOLcoTqw2C0JCSLwZJy7RN+GMHteSyjY86 skqvyIe0/+D1muE+/Z0lOqRrxzWOM3xPs2/PZEmLoYqE06uO+lyP0VIayPFJq28/2M zxpXlUOjkjJYCa0V/d3NBBfgTIOGbdURsQTaBMCfRlX2bx9J/7FNrsQOTM2TD4TvLM OOKPZk6Ofi5cm6Ny3tTVofh3bB//FGmLuYKQ+ZRFL8Qafbw1xEBh2L9MvCjpfabOuo EBrovfjDD9vNPsg3xG8/VCGGji6LIuM0JnuzE99bRNJHfUfbfTdG0WJRBhahR8ADxp CHnoSMuKwURTw== X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789659052871306376 X-GMAIL-MSGID: 1789659052871306376 The clocksource pointer in struct system_counterval_t is not evaluated any more. Remove the code setting the member, and the member itself. Signed-off-by: Peter Hilber --- arch/x86/kernel/tsc.c | 11 ++--------- drivers/clocksource/arm_arch_timer.c | 3 --- drivers/ptp/ptp_kvm_arm.c | 2 +- drivers/ptp/ptp_kvm_common.c | 4 +--- drivers/ptp/ptp_kvm_x86.c | 2 -- include/linux/ptp_kvm.h | 4 +--- include/linux/timekeeping.h | 3 --- 7 files changed, 5 insertions(+), 24 deletions(-) diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index 9f164aad5e94..693148adca22 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c @@ -53,7 +53,6 @@ static int __read_mostly tsc_force_recalibrate; static u32 art_to_tsc_numerator; static u32 art_to_tsc_denominator; static u64 art_to_tsc_offset; -static struct clocksource *art_related_clocksource; static bool have_art; struct cyc2ns { @@ -1313,7 +1312,6 @@ struct system_counterval_t convert_art_to_tsc(u64 art) res += tmp + art_to_tsc_offset; return (struct system_counterval_t) { - .cs = art_related_clocksource, .cs_id = have_art ? CSID_X86_TSC : CSID_GENERIC, .cycles = res }; @@ -1350,7 +1348,6 @@ struct system_counterval_t convert_art_ns_to_tsc(u64 art_ns) res += tmp; return (struct system_counterval_t) { - .cs = art_related_clocksource, .cs_id = have_art ? CSID_X86_TSC : CSID_GENERIC, .cycles = res }; @@ -1459,10 +1456,8 @@ static void tsc_refine_calibration_work(struct work_struct *work) if (tsc_unstable) goto unreg; - if (boot_cpu_has(X86_FEATURE_ART)) { - art_related_clocksource = &clocksource_tsc; + if (boot_cpu_has(X86_FEATURE_ART)) have_art = true; - } clocksource_register_khz(&clocksource_tsc, tsc_khz); unreg: clocksource_unregister(&clocksource_tsc_early); @@ -1487,10 +1482,8 @@ static int __init init_tsc_clocksource(void) * the refined calibration and directly register it as a clocksource. */ if (boot_cpu_has(X86_FEATURE_TSC_KNOWN_FREQ)) { - if (boot_cpu_has(X86_FEATURE_ART)) { - art_related_clocksource = &clocksource_tsc; + if (boot_cpu_has(X86_FEATURE_ART)) have_art = true; - } clocksource_register_khz(&clocksource_tsc, tsc_khz); clocksource_unregister(&clocksource_tsc_early); diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c index 45a02872669e..8d4a52056684 100644 --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c @@ -1807,7 +1807,6 @@ TIMER_ACPI_DECLARE(arch_timer, ACPI_SIG_GTDT, arch_timer_acpi_init); #endif int kvm_arch_ptp_get_crosststamp(u64 *cycle, struct timespec64 *ts, - struct clocksource **cs, enum clocksource_ids *cs_id) { struct arm_smccc_res hvc_res; @@ -1832,8 +1831,6 @@ int kvm_arch_ptp_get_crosststamp(u64 *cycle, struct timespec64 *ts, *ts = ktime_to_timespec64(ktime); if (cycle) *cycle = (u64)hvc_res.a2 << 32 | hvc_res.a3; - if (cs) - *cs = &clocksource_counter; if (cs_id) *cs_id = CSID_ARM_ARCH_COUNTER; diff --git a/drivers/ptp/ptp_kvm_arm.c b/drivers/ptp/ptp_kvm_arm.c index 017bb5f03b14..e68e6943167b 100644 --- a/drivers/ptp/ptp_kvm_arm.c +++ b/drivers/ptp/ptp_kvm_arm.c @@ -28,5 +28,5 @@ void kvm_arch_ptp_exit(void) int kvm_arch_ptp_get_clock(struct timespec64 *ts) { - return kvm_arch_ptp_get_crosststamp(NULL, ts, NULL, NULL); + return kvm_arch_ptp_get_crosststamp(NULL, ts, NULL); } diff --git a/drivers/ptp/ptp_kvm_common.c b/drivers/ptp/ptp_kvm_common.c index f6683ba0ab3c..15ccb7dd2ed0 100644 --- a/drivers/ptp/ptp_kvm_common.c +++ b/drivers/ptp/ptp_kvm_common.c @@ -30,14 +30,13 @@ static int ptp_kvm_get_time_fn(ktime_t *device_time, { enum clocksource_ids cs_id; struct timespec64 tspec; - struct clocksource *cs; u64 cycle; int ret; spin_lock(&kvm_ptp_lock); preempt_disable_notrace(); - ret = kvm_arch_ptp_get_crosststamp(&cycle, &tspec, &cs, &cs_id); + ret = kvm_arch_ptp_get_crosststamp(&cycle, &tspec, &cs_id); if (ret) { spin_unlock(&kvm_ptp_lock); preempt_enable_notrace(); @@ -47,7 +46,6 @@ static int ptp_kvm_get_time_fn(ktime_t *device_time, preempt_enable_notrace(); system_counter->cycles = cycle; - system_counter->cs = cs; system_counter->cs_id = cs_id; *device_time = timespec64_to_ktime(tspec); diff --git a/drivers/ptp/ptp_kvm_x86.c b/drivers/ptp/ptp_kvm_x86.c index 2782442922cb..617c8d6706d3 100644 --- a/drivers/ptp/ptp_kvm_x86.c +++ b/drivers/ptp/ptp_kvm_x86.c @@ -93,7 +93,6 @@ int kvm_arch_ptp_get_clock(struct timespec64 *ts) } int kvm_arch_ptp_get_crosststamp(u64 *cycle, struct timespec64 *tspec, - struct clocksource **cs, enum clocksource_ids *cs_id) { struct pvclock_vcpu_time_info *src; @@ -124,7 +123,6 @@ int kvm_arch_ptp_get_crosststamp(u64 *cycle, struct timespec64 *tspec, *cycle = __pvclock_read_cycles(src, clock_pair->tsc); } while (pvclock_read_retry(src, version)); - *cs = &kvm_clock; *cs_id = CSID_X86_KVM_CLK; return 0; diff --git a/include/linux/ptp_kvm.h b/include/linux/ptp_kvm.h index 95b3d4d0d7dd..e8c74fa3f455 100644 --- a/include/linux/ptp_kvm.h +++ b/include/linux/ptp_kvm.h @@ -12,13 +12,11 @@ #include struct timespec64; -struct clocksource; int kvm_arch_ptp_init(void); void kvm_arch_ptp_exit(void); int kvm_arch_ptp_get_clock(struct timespec64 *ts); int kvm_arch_ptp_get_crosststamp(u64 *cycle, - struct timespec64 *tspec, struct clocksource **cs, - enum clocksource_ids *cs_id); + struct timespec64 *tspec, enum clocksource_ids *cs_id); #endif /* _PTP_KVM_H_ */ diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h index 3538c5bdf9ee..7e50cbd97f86 100644 --- a/include/linux/timekeeping.h +++ b/include/linux/timekeeping.h @@ -271,8 +271,6 @@ struct system_device_crosststamp { * struct system_counterval_t - system counter value with the ID of the * corresponding clocksource * @cycles: System counter value - * @cs: Clocksource corresponding to system counter value. Timekeeping - * code now evaluates cs_id instead. * @cs_id: Clocksource ID corresponding to system counter value. Used by * timekeeping code to verify comparability of two cycle values. * The default ID, CSID_GENERIC, does not identify a specific @@ -280,7 +278,6 @@ struct system_device_crosststamp { */ struct system_counterval_t { u64 cycles; - struct clocksource *cs; enum clocksource_ids cs_id; }; From patchwork Thu Feb 1 01:04:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Hilber X-Patchwork-Id: 195120 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:106:209c:c626 with SMTP id mn5csp139921dyc; Wed, 31 Jan 2024 17:30:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IEdwjsmGsTRv42MpbR9QRFeQMf5liiAcc2YTsMf0prd4QMdAbq/uHvVUXTRFWrs9TAEB70u X-Received: by 2002:a05:620a:2092:b0:783:902:bcad with SMTP id e18-20020a05620a209200b007830902bcadmr957037qka.56.1706751001730; Wed, 31 Jan 2024 17:30:01 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVTXNYMgLRTJOlt1ts+wsg9EshVNP45PQeOtJGZtit+nhSgnS6q3geMG9eql0osbJ+p1vIIox9++CVPtGQat4fWrmF2NQ== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id z18-20020a05620a08d200b00783f0325d1csi10230692qkz.131.2024.01.31.17.30.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 17:30:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47498-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@opensynergy.com header.s=TM-DKIM-20210503141657 header.b=S2xv7JtR; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-47498-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47498-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=opensynergy.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 6AFF81C2AC25 for ; Thu, 1 Feb 2024 01:30:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CA8FF5CAF; Thu, 1 Feb 2024 01:29:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=opensynergy.com header.i=@opensynergy.com header.b="S2xv7JtR" Received: from refb02.tmes.trendmicro.eu (refb02.tmes.trendmicro.eu [18.185.115.60]) (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 DC364442D for ; Thu, 1 Feb 2024 01:29:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=18.185.115.60 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706750972; cv=fail; b=f27JLVdAmBNZuT0OpPNIjXlpB2/8YBCy+omuE0OL+saiSBk8ahZlFgBOgifh8SZoD4bhBv6zYtQNA8qVkLKRD1zzAxJbV5yVRAPf/c+9y8Cb+8yd38KohdGsA7jUiILwPtUkRcZZMYn7l0aSnx9IDHKlH/XD/Bsv5NqCXoFQBbw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706750972; c=relaxed/simple; bh=zk85uvIQqp/ot0OdT5DejcghRs82+xu4izURtMvuhQE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=gxQl2obVxP9uwnehzZbC/Ge1GJXhSJR4Xvt2FjV5TvkmERzGEgFYcR4tg++rTnryOQi70r1aCRzju6WuF+d4P/jSc+BSFuHtdu1xciG/U1E517Jx1t6xMZnBBhXkNwRU0Q/2SsIfh2ou6xoeZLfIDLTshRB9pjILSyDO+R5P5uo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensynergy.com; spf=pass smtp.mailfrom=opensynergy.com; dkim=pass (2048-bit key) header.d=opensynergy.com header.i=@opensynergy.com header.b=S2xv7JtR; arc=fail smtp.client-ip=18.185.115.60 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensynergy.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=opensynergy.com Received: from 104.47.11.169_.trendmicro.com (unknown [172.21.10.202]) by refb02.tmes.trendmicro.eu (Postfix) with ESMTPS id 5DD3010A7E2DE; Thu, 1 Feb 2024 01:06:31 +0000 (UTC) Received: from 104.47.11.169_.trendmicro.com (unknown [172.21.181.221]) by repost01.tmes.trendmicro.eu (Postfix) with SMTP id 5F0CD10000467; Thu, 1 Feb 2024 01:06:24 +0000 (UTC) X-TM-MAIL-RECEIVED-TIME: 1706749551.393000 X-TM-MAIL-UUID: c251587e-0784-4822-aaaa-ce694d2446bc Received: from DEU01-FR2-obe.outbound.protection.outlook.com (unknown [104.47.11.169]) by repre01.tmes.trendmicro.eu (Trend Micro Email Security) with ESMTPS id 601041000006C; Thu, 1 Feb 2024 01:05:51 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VMAXjbBwdTirr7a8YVsKo/UCwcvyFH6AW6aW5ynzOXvHCA8O0CwXwj06tAU7KlrqyIJ89+bKCjdkYrZ7spjBHce4VdNn3QCrimq69a3GYIWGIcebQl5V1ZSFcq6EepnIV+/mSFZ11izRzWUWO6enGJC6p6aJicUbLMo0DA6CjkUph5HrO2xmkhX0RH+j2+naiuD1sjpFFDFZJILQLyTiDggcSl3Hom44XOj7+jqLOIsbwSLmS1gheiLBCWIa0RKJeAHayfy6wbOycLnaA9NkMl9liz5grU4lJhEz1kHtQ5bVtO7atMe7DYmWU+4cP+nd4oRpMIaAAB18/8DLYtJYeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=68UszWC6u1kb+YBX2FtVzcNWjvSlFHvLWP68hbFsEfk=; b=cP1HvY+x1Ecki6ol0Cq5gvttjDeDOahAaGdCMaPzqPv1vAqCzmdKf5cbbgiyGseUAZV4aFkBV0KbbmDHhXRRdofigspsQbv1OlWyN5yEZiHx4TWvSnpJ2K/MsKy338iWknjtim1EFpz+heq5XYtcpFL/2E51fgq78FRzN/x+7AuQVd9t9BG9HnNNkPZXUBc6qEadmJCAN190/KC34Qnx+eLACdGe75FkxuPe238N1QBcLvYvWHSWbLVWvQSzSF3+298P27iv5ULUUKxRQHsev6kC7kQo+hkM7fGWwsOuay/lxlaEkXHftfWg42Rq8DUUSiEMZPc9XncCuZjsA5Zv3A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 217.66.60.4) smtp.rcpttodomain=alien8.de smtp.mailfrom=opensynergy.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=opensynergy.com; dkim=none (message not signed); arc=none (0) X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 217.66.60.4) smtp.mailfrom=opensynergy.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=opensynergy.com; Received-SPF: Pass (protection.outlook.com: domain of opensynergy.com designates 217.66.60.4 as permitted sender) receiver=protection.outlook.com; client-ip=217.66.60.4; helo=SR-MAIL-03.open-synergy.com; pr=C From: Peter Hilber To: linux-kernel@vger.kernel.org Cc: Peter Hilber , "D, Lakshmi Sowjanya" , Thomas Gleixner , jstultz@google.com, giometti@enneenne.com, corbet@lwn.net, "Dong, Eddie" , "Hall, Christopher S" , Simon Horman , Andy Shevchenko , Sean Christopherson , Paolo Bonzini , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Wanpeng Li , Vitaly Kuznetsov , Mark Rutland , Marc Zyngier , Daniel Lezcano , Richard Cochran , kvm@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v3 8/8] kvmclock: Unexport kvmclock clocksource Date: Thu, 1 Feb 2024 02:04:53 +0100 Message-Id: <20240201010453.2212371-9-peter.hilber@opensynergy.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240201010453.2212371-1-peter.hilber@opensynergy.com> References: <20240201010453.2212371-1-peter.hilber@opensynergy.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB8EUR05FT032:EE_|FR0P281MB1772:EE_ X-MS-Office365-Filtering-Correlation-Id: c14f677c-f065-4500-e808-08dc22c1ed98 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pEBVQBoI7ER14sO37xJWJ1AOU6PqRSWdL5pil9aOxK4Ii4WV90SPDMcI5loyElujHD6B1CuDnhgTgWPRWZB0Blru+VeWrHkkRmVVqQzEKAOvqBBAWCceMZ6RovcjqrYzNGOITFZeS43mXI3yS1HPbD6qocDM7uCkcYutShu2hUJ2O6kHo/6jchbhyWQ7M+nnsFxU0B3IGHMa+CTFUt8hE6E3BLaAEtNDrjvaHWMEtyXrtMAE/wpuPMMkgyRzGdFub+BtNBSq/2+2k6mQPFSjFAKmZIQpgbvzbgMGVIhmKLYlswufmbibbzPIDXYMrW/ZlVrRzLDy1i8xn1cS3rMw0P3CleoifZcOUOcSYMZp0wOewLQSIaiZWAOX5ANlrt+r3ordhi6+X4iRzxxEiqhujCE40VQLirsdRWTynt3gZQHxsTVJ2f1Oa6K0nHj9RIvhBvqcVfG2kx9oYs6IleU2Dvq9dp0yoLduvAan3e8REDvuIbFZejZP8HiR+vFe4ZtsKlLEmyhntgszMHl/xor0rjUgAFJe5R9hJWqOels0xmx/aRzCtjEGa578NMY8pXi8m1vxthXGe6KJkyda8bGxnkcWL+gqDJpyKzA3hEzxqI3904LP/0i3agQut6Qp3NXZE6RgjDHCpveHvuzQZfnXW82FOQBEkHnzqBKeqh4lkckh7uU67JcXWFH/hcWDAmVa9XaYmgIOezPgcfK0llXWQiyGqwzMrcnyrBmPOmr0to1W+wdvqJR4mcZh12usu5DR X-Forefront-Antispam-Report: CIP:217.66.60.4;CTRY:DE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SR-MAIL-03.open-synergy.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(39850400004)(396003)(346002)(136003)(376002)(230922051799003)(1800799012)(186009)(64100799003)(451199024)(82310400011)(36840700001)(46966006)(478600001)(70586007)(2616005)(82740400003)(5660300002)(7416002)(44832011)(81166007)(41300700001)(2906002)(54906003)(336012)(36860700001)(1076003)(86362001)(8676002)(4326008)(83380400001)(36756003)(8936002)(6916009)(26005)(47076005)(70206006)(42186006)(316002)(40480700001)(36900700001);DIR:OUT;SFP:1102; X-OriginatorOrg: opensynergy.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2024 01:05:48.8771 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c14f677c-f065-4500-e808-08dc22c1ed98 X-MS-Exchange-CrossTenant-Id: 800fae25-9b1b-4edc-993d-c939c4e84a64 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=800fae25-9b1b-4edc-993d-c939c4e84a64;Ip=[217.66.60.4];Helo=[SR-MAIL-03.open-synergy.com] X-MS-Exchange-CrossTenant-AuthSource: DB8EUR05FT032.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: FR0P281MB1772 X-TM-AS-ERS: 104.47.11.169-0.0.0.0 X-TMASE-Version: StarCloud-1.3-9.1.1015-28152.007 X-TMASE-Result: 10--1.575700-4.000000 X-TMASE-MatchedRID: BoYRaA2j95x5JK6VZ/y/JZIdC0Q5JDAc3O2+pOfl+vcwLJ9PZUBQhdqK Kei3fK/BwLkzWLqYXGIPTxis+8SzNY5D3dtciD32DnyoB5C0LDMhB2S/EqeA6zB4jJltGVDbLN5 wGPX3TPXYeXOEzfM22ez1ZBVjJwp/DeUZOJCXHMgCZpI9UgJMHqJYuGaIjh0/fiAqrjYtFiT3az xU5+I+Ep2+6DCWmW4Hr44iRWuVPqIG9pdpHgJL8H7cGd19dSFd X-TMASE-XGENCLOUD: eea5c0c0-86de-44e7-8521-2a9364c6a452-0-0-200-0 X-TM-Deliver-Signature: D157937CD86D805F530F564B2F0A321C X-TM-Addin-Auth: Vaa7inNIa4Kf4UMh99Ebri8D1i4dm2eKOqZvseVqXrsbZRwjQtOM6PzGMjy 5TzBaknLnNz2cEimtzDRWvv+xmBLR7CIQxUum61DMqJjBKpCxGcGedulQR4ZQN92yynXa1fij0k vocD1ZklCfanlgFUWZoGujN7kM9xxIMcHITRdpIeXWaJ+0IGXdBa40PLZrApm7SJm3027CvkRLw daHR9vhYEjL7bQPfpAAgBuFOkRDsCp1FHNdj6IrfheLVrgJcJN2Q3oCTSZjoU6xVgOgxRnuZ95e ZGeuH+QD/J3r8YfCPDiblMMps/PTTTKuxE6J.xsND+Adgvd/qzlxtk+lr0WvcLsnJnV9xKdIYB4 UODIVl5rF+BU3zHE1zlQGJ4AUrqv7+PoYYZCF24E8WXB8VDiqDT7p5pqj2V2fzz4OQbNyGOShai UV1UqTeE37GWz8iQyvF519L9EOQRtX0m3pMj7iA7cRN4sjgULtSYUkfDzqYaJEvseeq62BPBNIp l4CJ5IgbN0zYQh6SV6ouGdvpHCMBu4o0EwQkgXPSQ+pfseli4u6yaSY9sCu/r4c2HDY+tZDvFcH WIqurLcLuVUY1PpGuZe5lA/bCy9LZYW+rhbBy4nAQZQMzVVffABSLRKCJ6k6nWoEMoR/nWVszgj BOUQ== X-TM-Addin-ProductCode: EMS DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=opensynergy.com; s=TM-DKIM-20210503141657; t=1706749584; bh=zk85uvIQqp/ot0OdT5DejcghRs82+xu4izURtMvuhQE=; l=1545; h=From:To:Date; b=S2xv7JtRyCjSV3LgQnsvmudC0BquLZmiEPO1HPmtnQDWiQ8e5yaPb6n4GKpLGAZ9e b80FpCZ0mAmkA4H7kSCEYB+mhcC9X+SRs25BpFkUpisgSfGojMoci2akybUQp5O9VV g2m1Fndfe+mtWJ5sjFnnvO227iR/4XnBW5nMO3QEEeYELLlQLKG5XmMGwDCUjmTOCP gHNvUg6pnjOpufemFLgnhk354vpF9cVCwGV/rF/UAKNO6zdc++dKrVHAZYY4bGRyqF qSXXExP/Q5MQDPkYp3s/xKcR6KnZsv1gEd/tgFbVAZPohrOgdMtoGwRgQ3qE3YDRfK hjVuuMFshAZ4A== X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789658138415749652 X-GMAIL-MSGID: 1789658138415749652 The KVM PTP driver now refers to the clocksource ID CSID_X86_KVM_CLK, not to the clocksource itself any more. There are no remaining users of the clocksource export. Therefore, make the clocksource static again. Signed-off-by: Peter Hilber --- Notes: v2: Added in v2. arch/x86/include/asm/kvmclock.h | 2 -- arch/x86/kernel/kvmclock.c | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/x86/include/asm/kvmclock.h b/arch/x86/include/asm/kvmclock.h index 511b35069187..f163176d6f7f 100644 --- a/arch/x86/include/asm/kvmclock.h +++ b/arch/x86/include/asm/kvmclock.h @@ -4,8 +4,6 @@ #include -extern struct clocksource kvm_clock; - DECLARE_PER_CPU(struct pvclock_vsyscall_time_info *, hv_clock_per_cpu); static __always_inline struct pvclock_vcpu_time_info *this_cpu_pvti(void) diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c index 2f1bbf730f45..5b2c15214a6b 100644 --- a/arch/x86/kernel/kvmclock.c +++ b/arch/x86/kernel/kvmclock.c @@ -154,7 +154,7 @@ static int kvm_cs_enable(struct clocksource *cs) return 0; } -struct clocksource kvm_clock = { +static struct clocksource kvm_clock = { .name = "kvm-clock", .read = kvm_clock_get_cycles, .rating = 400, @@ -163,7 +163,6 @@ struct clocksource kvm_clock = { .id = CSID_X86_KVM_CLK, .enable = kvm_cs_enable, }; -EXPORT_SYMBOL_GPL(kvm_clock); static void kvm_register_clock(char *txt) {