From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5AF452D1F44 for ; Sat, 8 Aug 2026 08:58:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.71 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786179513; cv=none; b=R1vMQWBAe0w8krJzFMWEhItfwgfd1RmvqV4NFSsv1D6Typ9VRUscOrcPnuRjb1jTL1i32oEBmqq0/A+c4mYFdeowMsDJX4vwbFp4/NjfRDioCFXojlhw9vLlbwx0bdTxOdT9//bLxsTFp+lRB/hZAqpZeerIJRd8ocYOlF2MGPs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786179513; c=relaxed/simple; bh=MBM6i0g97jlAhoj4jbNygjX4IQIv6AnWMC/+/U+xaJE=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=mDRoyYgPWP2XKO21SKg2bursifNoaldZkv8hqB3zWYSVjXcM1tQL/9V04KC9VbZx7pWkFtsj6g9YLtHyxew5U44jWqfoS8bXL6lwL2V6XMzTDZxVDINWvGLikXoamGbxBMnkrhZCE6CI4Gq17Y2+DHM/u84QGk0E/oLqSU1r02Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--smostafa.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=dvGuwcYa; arc=none smtp.client-ip=209.85.218.71 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--smostafa.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="dvGuwcYa" Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-c15fed5653eso17421166b.2 for ; Sat, 08 Aug 2026 01:58:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1786179511; x=1786784311; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:mime-version:date:from :to:cc:subject:date:message-id:reply-to:content-type; bh=FrZdKcH2ruwKtKo5KlReOpSBpXMc1Hr8DvI2W2K/qho=; b=dvGuwcYa+SLn90LVfr+diNzshRyz5ZtyLlmyfaWSd2GirPPskFnmrkL8ie6ZLumaRO 2OQdk07RB2Qc+5v/ZeN0kbgHRlc8mq9Hcvmd8lOAyCKFNXOqKgfO/CA7I8whoUxhTqf1 opuPfUXWC1w/trNaQ3ogLRlXBOA44PuZ9uvoJrJS4w7OE52di2skRLRwvDwFhXgEaQNR aoZ5gnZOjRxBGJCnjUVYa+O078ESYLVXakEnSLsTheZv2rObhObA1pOa1URQJ6GHv1yd fM09tu0U5Z1x8qPd//ovYRje3FPvoul4ETRQCS+g0/weayF3UELu4MEPqddDPof50Den PgKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786179511; x=1786784311; h=content-type:cc:to:from:subject:message-id:mime-version:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=FrZdKcH2ruwKtKo5KlReOpSBpXMc1Hr8DvI2W2K/qho=; b=VyqvIlpM17iICkA3rPam2KYmSD3yCeYf9NGlwTqvGuiUNeLZv0woWRKUp2rDN0xSYc jRL6TmJalpgCfTdoTVjLSu/yei0p7eYJHMmlx0gQo4xELUKj3pqNSlSXqPeZBFpX5AHl 7BFUXnl2Po0z/zxFHZcsNohxlGa1eS7B+yYMpLjoWWDWzv2tHsVWRCqMEtMm3vf9TO/4 or2fK7NNtyjYW0AFXugTcPIHBVPLSi8i9PWeCsnMgxgDMnNCN4Tk3mRmiK6aH/bad4Zo kOWS46hzZz0/QiVmJd8lGG0tvXQuPlPSmZMdLCmcNBz96Ius3zuD0wWAHsdtSY1Z4Z5Y tIJg== X-Gm-Message-State: AOJu0YwUYqhUlWRhEKvCsPwpBo0bcsVtS3VLN6hcauUOVK/BU6NSBDEX CFcTX94pja97kDdCFxc9ixvyoT5BUUVfcNKrbgp4/y6JHJpQPeiJZKT6tcPvnOm9BVD6IC6hd+A 5OedHQcY5XpkgZ00D+cAZcYg8+30DyCP0oLPvkRYfjShyz6mR7a67mDu3AxWmHVsp0s9sHzx+eG hXHNs3RWHMiaoCfc0LbjCKlMSje/485Xj9Aw9qD5WQKw6rCe5aGF3qWz0= X-Received: from edwt14.prod.google.com ([2002:a05:6402:3ce:b0:69f:274a:c867]) (user=smostafa job=prod-delivery.src-stubby-dispatcher) by 2002:a17:907:c04:b0:c1d:fb83:9394 with SMTP id a640c23a62f3a-c207339a850mr702312666b.24.1786179510049; Sat, 08 Aug 2026 01:58:30 -0700 (PDT) Date: Sat, 8 Aug 2026 08:58:21 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.55.0.654.g21b8a5bc05-goog Message-ID: <20260808085824.732659-1-smostafa@google.com> Subject: [PATCH v2 0/3] KVM: arm64: Fixes for timers and pKVM From: Mostafa Saleh To: linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org Cc: maz@kernel.org, oupton@kernel.org, seiden@linux.ibm.com, joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, vdonnefort@google.com, tabba@google.com, sebastianene@google.com, keirf@google.com, yaoyuan@linux.alibaba.com, Mostafa Saleh Content-Type: text/plain; charset="UTF-8" What started as a small patch ended up as a 3 patch series thanks to Sashiko. First patch from Marc to consolidate the offset calculation, follow up patches fix issues with non-protected VM and timer offset and protected VM running with broken CNTVOFF_EL2. The patches have all the information so I will keep this short. v1: https://lore.kernel.org/all/20260806150105.4010701-1-smostafa@google.com/ Main changes: - Add comment based on Fuad review - Add prefix patches that also fix the non-protected hang properly. Marc Zyngier (1): KVM: arm64: Make timer_get_offset() work in all contexts Mostafa Saleh (2): KVM: arm64: Fix timer offsets for non-protected VMs KVM: arm64: Fix hvhe and broken CNTVOFF_EL2 arch/arm64/kvm/hyp/include/hyp/switch.h | 15 +---------- arch/arm64/kvm/hyp/nvhe/pkvm.c | 14 ++++++++++ arch/arm64/kvm/hyp/nvhe/timer-sr.c | 10 ++++---- include/kvm/arm_arch_timer.h | 34 +++++++++++++++---------- 4 files changed, 41 insertions(+), 32 deletions(-) -- 2.55.0.654.g21b8a5bc05-goog