Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp374762rdd; Tue, 9 Jan 2024 06:59:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IETr3epf3yxyDMO9sMGFiZf9FYcZipCuZYnZ4IrJ430v4fZ5OB3hvVGwS7lOXV7C5cl5Kwl X-Received: by 2002:a17:903:486:b0:1d4:6484:f179 with SMTP id jj6-20020a170903048600b001d46484f179mr2500476plb.137.1704812367858; Tue, 09 Jan 2024 06:59:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704812367; cv=none; d=google.com; s=arc-20160816; b=G0LVxnM6gU3iFnvXo1Fy/u75p228l44ioYvbd3ZZyHmlgtzwPLZfmaC23cACBgXlXw lTK7sDZJ0p2rMQUUIBHWAVpSpY76nI6sIfmVUM7DQPtkE/fwcLtSxiXkkF4fX0SPrn8K Obv0VQBZK5IUI/hEKeK+T+5iQWQsygPjhsNKVGbLa+QbhT3NX4eSAM3sAFDEIU4lXwOG YYSVm6sDzv4b7tHppJkZTC3TglPClRJ2X8aq0yA/7JzY+M6BDby60c2pglwGQsnTOvXP yTOydk1iBY07MxWh75Qo9Ju86zwxn13hQQ+nWNJbQuxLiePFr12tqzF0cPBW4y3E31XY Dt0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :dkim-signature; bh=qRUOJmFKmeM5oqO379Ob7Dp8PcHF+ZNO7Gp6RMyYig4=; fh=VzAEdswdqDgC3pDazoW4gZZ+EKnw8RNB9qTc7W097lw=; b=KSvNdopbgMA4ad4hPCkVN2kvCkHHxpp+JQIz9g3IzV7rYQOPGcEkD5f10Oc0Nwq9Nh HHlLRNq7ZBHnVP+dcimwuXAK+PXHwaT/o63Cv26pPHC1c/OO0nqVPrtkYK6bChZeB+y3 6A5Ndq4acm7GZab1cDCIy212YG+yd2MZA14e6XAL3zNtpBLhxIuvr4F/gJpOsJB7iPQo kJevN6JPh0gp4vk8kwVSqjyuLFEB+eapxCX+6wLk05cBTYuvDwk0dYDuMcjkM+4wu0p6 +E4d+EN5OEefzvKbG1Q60bs+7b1RrtBp4cm9Wyu7rUlluckiG4u0wnQdrwYXcRIAqjD3 Kf2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=NoQ4QOsq; spf=pass (google.com: domain of linux-kernel+bounces-21018-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21018-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id c7-20020a170902b68700b001d3ad3ec005si1542849pls.311.2024.01.09.06.59.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 06:59:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-21018-linux.lists.archive=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=@google.com header.s=20230601 header.b=NoQ4QOsq; spf=pass (google.com: domain of linux-kernel+bounces-21018-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21018-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 846C02876D2 for ; Tue, 9 Jan 2024 14:59:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8B2DB39AF8; Tue, 9 Jan 2024 14:59:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="NoQ4QOsq" Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) (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 6D91F39ADF for ; Tue, 9 Jan 2024 14:59:19 +0000 (UTC) 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--seanjc.bounces.google.com Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-dbe9e10c4fcso3979104276.3 for ; Tue, 09 Jan 2024 06:59:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1704812358; x=1705417158; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=qRUOJmFKmeM5oqO379Ob7Dp8PcHF+ZNO7Gp6RMyYig4=; b=NoQ4QOsq77NdszXUu262mskJPcGFEHtksoPSZnFmZAB9x+lkyeNlVXszbnXUMpq7Eu LmzABx0xrN1mzQINZYG7tA4k6GrkX74K3LqSy4T3aXfXtU6AGqF01oMPlMMOue31ErTS LX2+ONw/eNSEJihA9xTK94OhY/30V5d8AcEICBH7BLIzaqyrwXWLJkD+WRY3ev4ud4rC wtzlEpd8I+kXk7PHVvbVwRb4FwXaCtfCkLlOxVFS85r7e4Fa+KNVdJiMPy8NNy1bP0Jr nmlLRph0Y7+J5TWD4dtx34p9JmX+LsovUGT0wCAk7iL3qKaYpx94P67G+cZq2jtfE0GM WT+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704812358; x=1705417158; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qRUOJmFKmeM5oqO379Ob7Dp8PcHF+ZNO7Gp6RMyYig4=; b=QbE238U4hlzS6eGtmLvW00TEM0tAxccpyiO6s6dVWeskOD6rXDonqrFEGC+KHOjLXc aVFZDM2Cd1A09tTZ7X4NoLQLXBK/MpeLNekn6lB9GnuniXc/JKYLeF0y/dC8qs/fMYDZ 7IWdeXl4FWOf1lR7oiWWjbOkXCMwwiKIOdejyYoPs2wxvnvdJbzVEgV4kV03WY6On1Ft NVwmTXzx0zaEuEWXs2GgOY4dZhTlzosbiQSk3gO3FFV3tQYCKnZ9B0iMz/JkFt2pbnK1 EGCsoxKJVdQXMptLQTxcc0C807x/P2zUXrd4FZ61QKe4yrNKClHhjKqPszhQjQxdKYZA 3vZA== X-Gm-Message-State: AOJu0YxQ1HtKvF1I7KN7TDvmgZWY05jOfH3xCwXyCsrV9CCjba3oV3JI hCCM9Th29lF3XYFoYzObexEMpTNmumn2W0ZvJg== X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:6902:548:b0:db5:3676:74dd with SMTP id z8-20020a056902054800b00db5367674ddmr2055224ybs.3.1704812358274; Tue, 09 Jan 2024 06:59:18 -0800 (PST) Date: Tue, 9 Jan 2024 06:59:16 -0800 In-Reply-To: <20240104150526.52vbu4gownp7jm3i@box.shutemov.name> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20231205004510.27164-1-kirill.shutemov@linux.intel.com> <20231205004510.27164-6-kirill.shutemov@linux.intel.com> <20231211231035.743cesujphsp5eve@box.shutemov.name> <20240104150526.52vbu4gownp7jm3i@box.shutemov.name> Message-ID: Subject: Re: [PATCHv4 05/14] x86/kvm: Do not try to disable kvmclock if it was not enabled From: Sean Christopherson To: "Kirill A. Shutemov" Cc: Paolo Bonzini , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "Rafael J. Wysocki" , Peter Zijlstra , Adrian Hunter , Kuppuswamy Sathyanarayanan , Elena Reshetova , Jun Nakajima , Rick Edgecombe , Tom Lendacky , Ashish Kalra , Kai Huang , Baoquan He , kexec@lists.infradead.org, linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org, Vitaly Kuznetsov , Wanpeng Li Content-Type: text/plain; charset="us-ascii" On Thu, Jan 04, 2024, Kirill A. Shutemov wrote: > On Wed, Dec 13, 2023 at 09:22:34AM -0800, Sean Christopherson wrote: > > On Tue, Dec 12, 2023, Kirill A. Shutemov wrote: > > > On Tue, Dec 05, 2023 at 03:45:01AM +0300, Kirill A. Shutemov wrote: > > > > kvm_guest_cpu_offline() tries to disable kvmclock regardless if it is > > > > present in the VM. It leads to write to a MSR that doesn't exist on some > > > > configurations, namely in TDX guest: > > > > > > > > unchecked MSR access error: WRMSR to 0x12 (tried to write 0x0000000000000000) > > > > at rIP: 0xffffffff8110687c (kvmclock_disable+0x1c/0x30) > > > > > > > > kvmclock enabling is gated by CLOCKSOURCE and CLOCKSOURCE2 KVM paravirt > > > > features. > > > > > > > > Do not disable kvmclock if it was not enabled. > > > > > > > > Signed-off-by: Kirill A. Shutemov > > > > Fixes: c02027b5742b ("x86/kvm: Disable kvmclock on all CPUs on shutdown") > > > > Reviewed-by: Sean Christopherson > > > > Reviewed-by: Vitaly Kuznetsov > > > > Cc: Paolo Bonzini > > > > Cc: Wanpeng Li > > > > > > Paolo, Sean, any chance you can get it in through KVM tree while the rest > > > of kexec patchset is pending? The problem is visible on normal reboot too. > > > > Paolo is going to grab this (possibly for 6.7-rc?). I'll keep this tagged on my > > end in case that doesn't happen "soon". > > Sean, any update on this? 'Tis now in kvm/next, commit 1c6d984f523f ("x86/kvm: Do not try to disable kvmclock if it was not enabled"). The one time procrastinating on responding actually worked. ;-)