Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7766515rdb; Thu, 4 Jan 2024 07:08:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IGRO3pD16yR6DKmcxyRCHNPoDcuIG1ARg5n4d2IBSn1/sRfaDM4f5/sF+HFfFVMkjJUfazr X-Received: by 2002:a17:903:41c4:b0:1d3:a0b8:c4dd with SMTP id u4-20020a17090341c400b001d3a0b8c4ddmr580545ple.118.1704380901261; Thu, 04 Jan 2024 07:08:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704380901; cv=none; d=google.com; s=arc-20160816; b=YDYZOlwhVeT0MycLc1czCfn0hnm1gzLmgT0Jxh7fq9tpnxyZgVTKKkH0DwmHGyZ0xN O8TWV7MYBzIJvvAHoP1fQ8/G4hzS14l4O5zlvpQCuLOx18MmP4+he2NG6S9upySjcC/F EYQQEGsDpMgCiW5Lu+FmvDGFCvUddxWmmytnWSwv9ihFJTHR/o5zZ581IX2PgUembtAs bXYpgf3dkV8oCKalDD7gbXjz5rFfECwcFHmDy/Ge2Z8Z5arvkz0piK/62meMshuom7Wf sP7QRIpgCT+c6khpoUjRaUopeSDqW9kSMNQf31YGY1f0nVHAWUjpcBEHaV/MMSOHTFye eOvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=vai5tT4DVQbAnnthhi4cpQBlZ3tN3Sn+Cl5TA2ff5Vo=; fh=JbuLUTHpwiZe2IyGLNpwsKNkHM6EOIk9H0+M/mrZ5xc=; b=E/vYf0zxm2o8AZj/x1XSofSqz3VFPEhEfL5QAuy3x0apkiAIs/0BP1Xj3CpgnyT21j bmKn+EMpFpsHKOa6ccdvb7hSGGFYu7lQMxMe5AHUQoVdDMCxhOqOCgzNguxn47Fcqkgo cJhBACBrZXnUW94QmBiYe05MQijyGRQtFdJOEGp+Z8nnIe+/32rpaL1zKPjZuYLlNcsZ ESPc78YsJ9fJjic2fGxKtCxxcytki6cr4W1sxD+kdXSTI/mXFpcLsRj4SeYpz9mNkeZS 1LuZCXSqEKq/ptei/24DN4jVssxYVKOlUlkwCav0QIxpICFJS3v33HkuM8/cKtGZyYKr 4yrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MFl2+x7Q; spf=pass (google.com: domain of linux-kernel+bounces-16834-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16834-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 m17-20020a170902db1100b001d4cbf7880esi3930647plx.477.2024.01.04.07.08.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 07:08:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-16834-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=@intel.com header.s=Intel header.b=MFl2+x7Q; spf=pass (google.com: domain of linux-kernel+bounces-16834-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16834-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 E7728282F37 for ; Thu, 4 Jan 2024 15:08:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D451724A0C; Thu, 4 Jan 2024 15:05:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="MFl2+x7Q" X-Original-To: linux-kernel@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) (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 8F89F23758 for ; Thu, 4 Jan 2024 15:05:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1704380749; x=1735916749; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=jTNWC7v3qXqODsfpzwcE3CQHUSZdjh7Vh3v7ScwF4/k=; b=MFl2+x7QUSR2RvUrn7XUORnrLdHCwH/1gbtFjGRaBpaB+7tt4GpfDqdX 12t3OOFrK9inWkp0hnk/5kL2q71/BEpBnxQW1Sn3kU6h9nemPBSCZFiy7 nxn9lX9g8YU2JB9FRoo/G2ioiF8kNAbI6mUq+aIN/LFpW7EpMNKrRExQY RTrFzuzpls52umFhD6QKmV2UZLIQf3J8B4T9zGxPDBDjQTWyZ+V5NLX0H /V7iZ8v+C+mlxgNaaxZpscgTQixmlfgfb0k9F1sUXqPQXbeSdaWX2lsxK PrhxBYdvWPuGeKSZ5mDgVRZJukq8I2+BQ8VEQqN9l3UGaCmalka3uC2KI g==; X-IronPort-AV: E=McAfee;i="6600,9927,10943"; a="428428932" X-IronPort-AV: E=Sophos;i="6.04,331,1695711600"; d="scan'208";a="428428932" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2024 07:05:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10943"; a="1111783591" X-IronPort-AV: E=Sophos;i="6.04,331,1695711600"; d="scan'208";a="1111783591" Received: from dekblom-mobl1.ger.corp.intel.com (HELO box.shutemov.name) ([10.249.36.199]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2024 07:05:28 -0800 Received: by box.shutemov.name (Postfix, from userid 1000) id 8AC2A10A57B; Thu, 4 Jan 2024 18:05:26 +0300 (+03) Date: Thu, 4 Jan 2024 18:05:26 +0300 From: "Kirill A. Shutemov" To: Sean Christopherson 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 Subject: Re: [PATCHv4 05/14] x86/kvm: Do not try to disable kvmclock if it was not enabled Message-ID: <20240104150526.52vbu4gownp7jm3i@box.shutemov.name> References: <20231205004510.27164-1-kirill.shutemov@linux.intel.com> <20231205004510.27164-6-kirill.shutemov@linux.intel.com> <20231211231035.743cesujphsp5eve@box.shutemov.name> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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? -- Kiryl Shutsemau / Kirill A. Shutemov