From patchwork Thu Aug 17 06:03:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ganapatrao Kulkarni X-Patchwork-Id: 13355988 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 580E5C2FC04 for ; Thu, 17 Aug 2023 06:04:15 +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: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:In-Reply-To:References: List-Owner; bh=WyQn+DrxGK7eb1nq1CIELSch6a7zDAricEM/92WiQfw=; b=3cVnDLZvU3dapt YqcDyHiBISwDUvl87e/7C/n15MihUUOj6Pgjj6cYpfXVtyZuJBU3Jda5kJAEhSCu/ZrCfbpAcMMmK pP1cbOGlD7qUMmEGFrnAN2N842jKmkk8nPFqWZYtaT6aCSEu4imUMV3XnNgUGJI1O2PqhTLhRSv9H J6IcwiGVUAVpwrpzYkVW6FFZhbdCQYsbVWWHPXRA24i2nRZJc8aDVCg+v3OTJiyfdOxMFEQjpcCL2 iRfGiWz0me7ZmnFc60A74ORIrmtmTCYcOLUp5b9yuJ+T/ZQc6Mb7zgxy2UHzsQTRNeQJByEZ4k1QK we/5HPVSj2PwsuxCxfJw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qWW6p-005cbt-1F; Thu, 17 Aug 2023 06:03:51 +0000 Received: from mail-mw2nam12on20725.outbound.protection.outlook.com ([2a01:111:f400:fe5a::725] helo=NAM12-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qWW6h-005caD-1O for linux-arm-kernel@lists.infradead.org; Thu, 17 Aug 2023 06:03:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lOJb02Kgm5LBHBDpiaV1qvqBebceHYXhisr+NZ0Lpx05P7pEyhwRcGp1vZcSSt3P+Vwo9WFDRwF3u7qLR367HRh3GTLo+vAyzfO+s/S1YnsfPYO0QT9TTLGCpUmglN9F/3y832KGPwVsy9fNd1r5/ft12serWy0O7d30zx9TCwZVy2c9uH8CRxSXkwEcjNLICZZYFUgx9qtJ6B3DFP0nn6l1TNwtBUbf4PK+X0j5dFs2AcTDRvSlCcDt/R0jIwQ42DD32BvR9j0rioJpK+68dTpvLrcUEYJW0MEyBAz4i2Qhxfppe2iH9VMwuVz6wogedHJ/+lE57gKJUjBoFCnrLA== 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=x+9C6B7WScMrstTmoeb0PyKUYfP8W/AiqHCbUQglK6E=; b=a1QugVaeINtjaSgoNMcgnFaLhnZStzAt8eqaIN+UCAOhiZHN1R6/nYXqmxnh1KSYBsOiCoIng0tCg5BB6KDJfpyeoMJIRKERP092Gjx4cw/Tw7i+ro3DQpdUZSU3T51c/mOlHBidVHQL/Pooh83cKgTkD2u35sHt1uh01IFeCbMRsGP3L6SS2FDeVKbxY7g+Iw+ljMshRl1FX0qZEuDzrTX28ff2AgKYuksKPRuula5Ubb3O2vrLRfnlu8kZrU49k3uQkBJelh4aqQ9fIGzy3Hui9hYevqHfoqN8WIpTQ2RX/uI+M1fht+IKSa8SSgvspQElMxnxYWq2SHDb2BMz5Q== 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=x+9C6B7WScMrstTmoeb0PyKUYfP8W/AiqHCbUQglK6E=; b=rQpYtsIC2q5S5v6IR+k9s+t9Tu0xkNy/2Uc/bi2KSqaPh+Nnm3nEjCVkK1vGoKTgzCR2IV6hpRw+7gMnnkGfoR/USqW7auzyFaP1D8vONPWeem2cnGFlI5ZEWY04+ToCezOZ25HUGwHmDEcBE5vmjNjWuujcb7Xzxjd3gzksaQo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from DM8PR01MB6824.prod.exchangelabs.com (2603:10b6:8:23::24) by SA1PR01MB6592.prod.exchangelabs.com (2603:10b6:806:185::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.31; Thu, 17 Aug 2023 06:03:34 +0000 Received: from DM8PR01MB6824.prod.exchangelabs.com ([fe80::d62f:d774:15b0:4a40]) by DM8PR01MB6824.prod.exchangelabs.com ([fe80::d62f:d774:15b0:4a40%4]) with mapi id 15.20.6678.029; Thu, 17 Aug 2023 06:03:34 +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@linaro.org, eauger@redhat.com, miguel.luis@oracle.com, darren@os.amperecomputing.com, scott@os.amperecomputing.com, gankulkarni@os.amperecomputing.com Subject: [PATCH 0/2] Avoid spurious ptimer interrupts for non-zero cntpoff Date: Wed, 16 Aug 2023 23:03:12 -0700 Message-Id: <20230817060314.535987-1-gankulkarni@os.amperecomputing.com> X-Mailer: git-send-email 2.38.1 X-ClientProxiedBy: CH2PR03CA0018.namprd03.prod.outlook.com (2603:10b6:610:59::28) To DM8PR01MB6824.prod.exchangelabs.com (2603:10b6:8:23::24) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM8PR01MB6824:EE_|SA1PR01MB6592:EE_ X-MS-Office365-Filtering-Correlation-Id: 5819036a-63ac-4d33-ec95-08db9ee7b083 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EDyuNEdqeAhyG+hlsWdB0qP3ZSOjkXrnzxg4ppubMxuQ25IRMBOGrvq4FYSWh78iFVJ8ostL78W3BZFHiBnPrhrVok/FvZPky43OsnT1zppwm6B0xx7XW6yFvZ+0xM3r7FEz0UmCNhvPJy8ARmnVczSzOZ52QgLkLYzismEawDAtaXcuHVmJdF2Tjo1AbxkSYJSmcrqIEGhlA4Sd1wnkuGOKd3P2sEgSYYRC6e0eAyiETT0d3mM2nO+xXSkmd3Pq6BOsgfdrL63y6BefNa35kBJtkI/ZbP5FX/r3Jbb9ErdWDyk4m7PCFBGsA2lhoCLT503Zu+wWIfVnGJUWp4w+Mo/UmB5sSngXRUQGzvTAI5xsAutmFoy2U6hxHbjinCVuNO9yNTNVZJ6Is0jPxgoxnaqStMqklyRq251lnix0fisVaypqBNOLwsk0UiRmTwGcUUMkmCax5LfEdhAtjtR1k4K2+EJLGrKS5uJDu4+Q32YP8vJm1vUX94dpWVc0HPDX0bwCyz2Z7DeFshGWNZOO2FkHlXdQilkAu4nMDnyPLWhadeTH9nwhwtoSU0y+k9e0MC92mQrtyRqzvvq/Mp+enxyumxzUC5xMseYCOf93jXwMVCQYmp84fE9iJXqcyEK6+1Rf6kkmL9p1NGqk/UUgLA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM8PR01MB6824.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230031)(366004)(376002)(39850400004)(136003)(396003)(346002)(1800799009)(186009)(451199024)(83380400001)(2906002)(478600001)(66946007)(66556008)(66476007)(6666004)(6506007)(6486002)(52116002)(316002)(966005)(107886003)(2616005)(5660300002)(26005)(1076003)(6512007)(4326008)(8936002)(8676002)(41300700001)(86362001)(38100700002)(38350700002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WrYAYCeFehmBglJQAHEn71kOnA8ZezQGdLMtpo3NR4Va5OJZjSyRb4n/2z4ke7UY0rN1ULowTdkN5+6Qi31H96GD2m02zYmJojpkwMYL5O5nh/7KG0gJMxrZ2lZ2SYPREjnW6hJtixVMOQYg36ILh4Q4+H0Da8W38cwdsnBXdDlRPnrkOB6NwWOGEtfSeSsxGQgURQcVO6dhByi2ZOVPVuVLuIsU9IULq2GgyJuM6F4DRXEmH4JA7ZkA2foksfkuiYyyCIMJ5wEBBBO2MuJXFCbWKwK1ZwIZ4+J8yIamDQR4xUku29pKHlkpvJHrXHGFKxs0kqaAeHJ3q3zNc55g1xt4MC0jdQ9Gr46ApZIjo31ocO7IQVZgP+J9yEyYuZpKwULk20+cIwSySq7WiqKRK+8lz/W3Qe9DshZNhMaRxuWKB3sxbHmCalI4hpoAkn97Ao6NItAPjztpLE+FXwGmzrh6AIDYbvRfzgpAXuPCAS7hXj4uIf7fDen/11DbHfTo3Wh9kq5RkvTrODbiJrlxRvn/3HgLWPKI9odJ8Va92IljT79x7aqj3LAK73ZkW01r9x1F2DMEMwCAUZ+DkUSz8OxMgKX69oXD3KDQuH2tuiqQ5omGnZx/8Fl8J4yYAIk9mmnfz4IH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-Exchange-CrossTenant-AuthSource: DM8PR01MB6824.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Aug 2023 06:03:34.2119 (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: BGmcPChOjVIwlVQkHLw+vFYQLIa8lieK0Kg2nhH+A16BWzUSZdqv/odfqkbIxXtbfuEmjTtPXUuEBJXIFmj676uiD8MaQLU65G5XeIwLTvznTtnd9VkaWJwa7aKC/k3V X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR01MB6592 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230816_230343_471555_84AB3ED1 X-CRM114-Status: UNSURE ( 9.29 ) X-CRM114-Notice: Please train this message. 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 Guest-Hypervisor(NV use-case) uses ptimer as an arch_timer. While running Guest-Hypervisor from a VHE host on a platform which supports FEAT_ECV/CNTPOFF_EL2, burst of spurious ptimer interrupts were generated for a non-zero offset, causing the boot to hang. The issue is due to the value of CNTPOFF_EL2 is treated as zero while on VHE host. This patch fixes the issue by adjusting the CVAL of a loaded ptimer across the entry and exit of a guest. This patchset is rebased on NV-V10[1][2] [1] https://lore.kernel.org/linux-arm-kernel/19c775ad-9573-b4d4-886d-c631b468856f@redhat.com/T/ [2] https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/log/?h=kvm-arm64/nv-6.5-WIP-6.4 Ganapatrao Kulkarni (2): KVM: arm64: timers: Move helper has_cntpoff to a header file KVM: arm64: timers: Adjust CVAL of a ptimer across guest entry and exits arch/arm64/include/asm/virt.h | 5 +++++ arch/arm64/kvm/arch_timer.c | 37 ++++++++++++++++++++++++++++----- arch/arm64/kvm/hyp/vhe/switch.c | 13 ++++++++++++ include/kvm/arm_arch_timer.h | 1 + 4 files changed, 51 insertions(+), 5 deletions(-)