From patchwork Mon Sep 4 11:42:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ganapatrao Kulkarni X-Patchwork-Id: 13373712 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 96D58C83F2C for ; Mon, 4 Sep 2023 11:43:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xE4FZ3T2LrKKtyCekrkAblWMCXgNK+JAItAA5D7nBXI=; b=ct1qI1SFN5XF9o z+IXtbPOG39NHhDJa+1N8aFYLsq96fYjKgmejU78QgoDLoavkh0H7GDoSK3m5Z6uaVBiZQj2bLUSt E8w5bKogStzZi9a3y3LjPjC4K51TiPev4cTeGpkBrbwYqBEVB6Sbcby3cjZUwccTfQ/RRNHAsWpUU nn9xjyg9i1iQtoUqIHmMSsTESnSik18aqLAoAHlnDc+tc1iVdEdMlDTcrcP4aDD/bW4imXewMWxoa 28uCogRxN2idiRmR+jATLDUY+H4k3MLRS0h3jm9NabbhDGKEjtfUBPk8tMXxKoWGCaHdE56jgWIYi y7LNyOnP1qBITxUxry0A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qd7yy-0040yY-1e; Mon, 04 Sep 2023 11:43:04 +0000 Received: from mail-bn8nam12on20726.outbound.protection.outlook.com ([2a01:111:f400:fe5b::726] helo=NAM12-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qd7yw-0040xZ-02 for linux-arm-kernel@lists.infradead.org; Mon, 04 Sep 2023 11:43:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CP3eWLZ0swM1YzZwW4iir+cWtG2/rLZA/TB0tQrqJnbSGtYkBlrXKQZ89Dc0w/ktKuNGFmPQCcMH7d7DpYrROSqUClFmIXJVxBuot7zLeQtnYT8NaTuBmEHKjMHHRsOcDKB9k1s5G0d4A4JZmIbinoelAOVYYJwavxmIhZ9LVR+c8EEdtMRU4cEsYi99V+JnhxPEY8bq5B8ON/39Gy/nr39VXpV7uIcvGw3YSfL9uztOhlfKpVd7EOQ1uZBTuVOaLZE8FXK1aWVNx1H1ud19oTIURfcISS/f9OA60HNk3LctvjJ+OhZ+p/VO/tPhvxaMaZ3iXQKF4zYzoZdvleXBnw== 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=cOZw2EURdLDxgbCFLA4cIfp5eTLsDkKifig5lfBXwNI=; b=UhUH6oIRwC+qPezgYpj2lmRnCDRMwhu0UEvFQ31ODjt28JiSJ49DsE0h78SMyFexMSoe+S0ZfOm1mI452kYYDzTgL/0iNNaB6lFon/+F6qenbLA+YKZPqn1z2oC6btSa3Nf6DU6ikEwT6PxozS4xmvZzXIuHlfeKMtV3gyRh55HD5ZMyho4Trv0CftHyS67cGoiEzsMVJt+zYv2pNZ1X7oITwnpWcxNkS4qfT1NcQL19r8NcPrY4ABJnWN7WdSvsRaIGVE24CzU8sPnqMec01Gf64kq01zuN4KAypAbJ+6kh3k5lH+cZtRUhEz5KsRwdOMoA8jwWL7Bh1FLA+nSK2Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cOZw2EURdLDxgbCFLA4cIfp5eTLsDkKifig5lfBXwNI=; b=NnHbTFD0yHDfOkqEnZsFzY/ETzajCjUoe/DYEFyoapGQAdGt6ZE+kG+xJfwX/cB/MftchnsKj7tTq0W9nOZi6EixTnjUhTdmt+kSpwGbrc19jRMKlvhID6FflE2pFqrpaXN0RSddaho6/XLFnHQeLwPeJHb8zDVnT3z7ks/EizA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from SJ2PR01MB8101.prod.exchangelabs.com (2603:10b6:a03:4f6::10) by SJ2PR01MB8008.prod.exchangelabs.com (2603:10b6:a03:4cb::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.30; Mon, 4 Sep 2023 11:42:44 +0000 Received: from SJ2PR01MB8101.prod.exchangelabs.com ([fe80::460c:bded:60ff:3254]) by SJ2PR01MB8101.prod.exchangelabs.com ([fe80::460c:bded:60ff:3254%7]) with mapi id 15.20.6745.030; Mon, 4 Sep 2023 11:42:44 +0000 From: Ganapatrao Kulkarni To: linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, maz@kernel.org Cc: Christoffer.Dall@arm.com, eauger@redhat.com, miguel.luis@oracle.com, darren@os.amperecomputing.com, scott@os.amperecomputing.com, gankulkarni@os.amperecomputing.com Subject: [PATCH v2 1/2] KVM: arm64: timers: Move helper has_cntpoff to a header file Date: Mon, 4 Sep 2023 04:42:17 -0700 Message-Id: <20230904114218.590304-2-gankulkarni@os.amperecomputing.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230904114218.590304-1-gankulkarni@os.amperecomputing.com> References: <20230904114218.590304-1-gankulkarni@os.amperecomputing.com> X-ClientProxiedBy: CH2PR16CA0024.namprd16.prod.outlook.com (2603:10b6:610:50::34) To SJ2PR01MB8101.prod.exchangelabs.com (2603:10b6:a03:4f6::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR01MB8101:EE_|SJ2PR01MB8008:EE_ X-MS-Office365-Filtering-Correlation-Id: a27c115c-908c-47cc-012f-08dbad3c0d89 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ttxdubhvqoP9NLwt4Z0t9hzhbIkdhQzGgC3OsdMujJ/S2St1MxCXt0N99ljjDC5KDS82KcdMwfRF4YJT4volmICXDqD8bauPsfBn4ZC/rjLf/8tawgm6yUv6/MfucjJlzUqBiqg3I62EFghMfGJR5zhD245WeyyY4bIDrv+GbqmNvwvqWEIECaZkaV1/QbHT0iKdlGLdKQK7YwY3GYnwJQQwEo5TTAeKTSl3OBAuJyYtNTvP1aTGMg/3padwwrfB8u9bHmi1ar1wZgQl6YCQIjIxA9Mz+NWfUW2I+qjxA+Y0yjOOpnZdhO8JMY92qq7emEe7Go3DjzQVuNpQdKpod5R360Wq02OIYhS2rBah+41+ZPrAe45Ujjzb4h49PUJFuY9y4JXZcjHtKNkJ/AMLOl+MOJhdcNX5eidhxI3/nLCk5b/GbzSWK75FuEaYjHJ3twppFLH7/lYCRZfHJRqdOGWJacEsZEXxtT/6HiKpNbnhttwtin2BL6iulSjY+mtpkTafVdE2LT22bUR9CeH0Qs9zMFGcRZbZHbBbkl/zQlG99zSkbAc71Pi2dna0gLqiTWwLs/zj+JPYVpXxYnasX0BPNyaCNAA7C6lwbGYtEnrYQCyLiPoxRBsd29uUWkGO X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ2PR01MB8101.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(366004)(346002)(136003)(39850400004)(396003)(451199024)(186009)(1800799009)(38100700002)(38350700002)(41300700001)(5660300002)(86362001)(83380400001)(66476007)(66556008)(66946007)(26005)(1076003)(107886003)(2616005)(478600001)(6666004)(8676002)(4326008)(316002)(8936002)(6512007)(52116002)(6486002)(2906002)(6506007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RXhN7n3wVIDFlOhlav8qxqDXuNvft7HP0eYHr5iULnhnq8/T5DTBRcWkVoBVzvWSuhFl6JJ24dAu8u/BFskQjso2B6lwcqaqESOo838DBxxCCfW40WQN/AeNQJOk04/3g7IXbXjHccMZGb6N5cL8Yvdk0htggsFwr/vWXtjDiO8aM8S0fcEjJFHJPgWJre7VK1ClQJos2BrCD8VrmA5KF66hdH14vfbxNhm+DECbisAJuh32ksepsSJOWAiFEjBxcaPNJNT60WBpg22Zptyswhc+2vuisEursm+v2p3FB6Q08YGQTG1hfmF5ndBX/4bMmq7Q28rMjb3eKwACS+mJ5iUrDNpReR2TWCsJGy87zCDy9tBaOQ4/iqvmE2PN8p+3Z/MUD/J6nHE+A4alSZHvX4izuJzcfjo/QO2SRrMG6RoXs7wYHkoN94rszjKsq4RNQnLARHedJjxMx+7UpY/tHV/ILak+8L+yyF8dnKGfLG4peGadMRcB62RiCZ+6aPI04raZ76jxYY0ROdxZ+/4kM9I24brHh2Wo0YfHFIZNtuIA0aW9SVaxUkIjt4ndcSkVk4837KQfONLXn6dj4fev6UH1QxHEPF8GGe5ss2+QB4lt6V6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-Id: a27c115c-908c-47cc-012f-08dbad3c0d89 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR01MB8101.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2023 11:42:44.2048 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: SsWXhrIj6mr1oU7fUWC0cdIxMsAjuGyeYrDi3nNC3a6tg0jg2xi535/GXhEggQF6b2jKnBSrvQ5eY4HW+MoBLEFH1yCIoj2dl7MNR8S6XzN65aNkOF8v234O2HaVVvRd X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR01MB8008 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230904_044302_050154_93A85EEB X-CRM114-Status: GOOD ( 11.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Move helper function has_cntpoff() to header file as an inline function to make it available to other functions as well. Signed-off-by: Ganapatrao Kulkarni --- arch/arm64/include/asm/virt.h | 5 +++++ arch/arm64/kvm/arch_timer.c | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm64/include/asm/virt.h b/arch/arm64/include/asm/virt.h index 4eb601e7de50..f22cc733efb1 100644 --- a/arch/arm64/include/asm/virt.h +++ b/arch/arm64/include/asm/virt.h @@ -132,6 +132,11 @@ static __always_inline bool has_vhe(void) return cpus_have_final_cap(ARM64_HAS_VIRT_HOST_EXTN); } +static __always_inline bool has_cntpoff(void) +{ + return (has_vhe() && cpus_have_final_cap(ARM64_HAS_ECV_CNTPOFF)); +} + static __always_inline bool is_protected_kvm_enabled(void) { if (is_vhe_hyp_code()) diff --git a/arch/arm64/kvm/arch_timer.c b/arch/arm64/kvm/arch_timer.c index 75bddab3224f..98b0e8ac02ae 100644 --- a/arch/arm64/kvm/arch_timer.c +++ b/arch/arm64/kvm/arch_timer.c @@ -55,11 +55,6 @@ static struct irq_ops arch_timer_irq_ops = { .get_input_level = kvm_arch_timer_get_input_level, }; -static bool has_cntpoff(void) -{ - return (has_vhe() && cpus_have_final_cap(ARM64_HAS_ECV_CNTPOFF)); -} - static int nr_timers(struct kvm_vcpu *vcpu) { if (!vcpu_has_nv(vcpu))