Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4296553rdb; Mon, 11 Dec 2023 15:11:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IG5l4RRHhTrzWwHCumx90ml2JSSleADeqfZ4IY5PrNEJB0+qsGus319RwecV9wcxNHotVsf X-Received: by 2002:a05:6a20:6a05:b0:190:1d60:8d0b with SMTP id p5-20020a056a206a0500b001901d608d0bmr2906362pzk.61.1702336271724; Mon, 11 Dec 2023 15:11:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702336271; cv=none; d=google.com; s=arc-20160816; b=wS5S0K7e6JK0RVr9XP7ptsITSvHSnc+GP9qDlAuz6IdecrpJUIyRwnU6sYMGrEdxfN dB1pw5juE4OApKhzWch2vnv7I8Fzej7Nt/ye1Fchd2zHZybnNaexwfZnNHV7kVS8gFsV D69e57+x1QHLStj2ab2er6yA8A6kLfplQN5Ieip9d1k/NeK/RAcgL6GoUP5FKAvsLM0c PJ2Z0my2pX7TrHkVJlvjHiVa6lYg7Xbb/MWYXIdLzeSUX0ZRn4Cs9X0Z+KzBCVp37cZY D68vKscum0qSNMOTnyK1aJcsq1M6LLRZEJA9nMBY3urY/4g9rCONFqM9Bw6hqM7UHx3x 7EPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=4QxUWQZhunOcr155jFKqw9AhXeUcyBxxWaiJy5AdSgk=; fh=2QUARe1+cOtIan4TMdDJS+mq3pksRhBSp8UF7KVKkkw=; b=Qv1ln/kFY3zg+74yUQAdkyyMxluuJW6g+tAKzWKwnMpTIuXG0leNGS1xDay0tzugD8 /pRgMul1Bgrsjm6KNiws1K9BK2I5f5nL4RMGfoRx7Ycqsm6E0F4LUKaDZsjfzXW8JcAV 9ruI7ts8eDzVh0XkYKfxEQSfe/AfcefZbM0/VuEsCEeNn8oPemrGCQCFKF0DkYbAz5hQ O3hjZqAYUJ5RENZNZc6YlPKvQ3UigiNkSXO5eG21E2UwXICQ8pV+THGZnTmfC6I7L/RQ jTevMtOeCrcnLrhUBXJjyCNWUpX7BWZJwybZf9R9/gArVtQC+F0mL2BYJKQV4endMmJt inag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hxk66eJJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id by4-20020a056a02058400b005c6be9a9841si7021739pgb.469.2023.12.11.15.11.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 15:11:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hxk66eJJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id A1D96804F639; Mon, 11 Dec 2023 15:11:10 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345172AbjLKXKj (ORCPT + 99 others); Mon, 11 Dec 2023 18:10:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230101AbjLKXKi (ORCPT ); Mon, 11 Dec 2023 18:10:38 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B469C9A for ; Mon, 11 Dec 2023 15:10:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702336244; x=1733872244; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=fdZ2x/5+NDcHqfPGDDUoiJaMPSKPPuvvjvF9z/kpukA=; b=hxk66eJJFbvWrSlYgym/xWotfSSem/NLIN7Z/EOS24ltAIBF4Oggcb/S Cy6o3semsjSVe7kpPLCB6s/gLORZAy4IrgZfenskKwvRU7ikCumz6O2Rk bHG9GJkzLwqjstoBoK3ysQLp3kvOFg2Logiom1IgitHgQQRe3TSruXIjO 1oXeIA2UxnzEG02PwCLs0LevhKnjD61TkpokaOVLQ2+1VYkxytX4SGBsd eBIZPOWTxDJuM/iJxlKb3CHdlars98zqu4u5eaOg9PQH00LH8+2JiALmm zMJHN1l236ouayX6JR4V2azrOzCGzJl95s2Z0aL0LkwaQGvTGFYYQ9wWz g==; X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="374229721" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="374229721" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Dec 2023 15:10:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="722994661" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="722994661" Received: from liviuoct-mobl.ger.corp.intel.com (HELO box.shutemov.name) ([10.252.47.81]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Dec 2023 15:10:38 -0800 Received: by box.shutemov.name (Postfix, from userid 1000) id 9998110A290; Tue, 12 Dec 2023 02:10:35 +0300 (+03) Date: Tue, 12 Dec 2023 02:10:35 +0300 From: "Kirill A. Shutemov" To: Paolo Bonzini , Sean Christopherson Cc: 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 , "Kalra, Ashish" , "Huang, Kai" , 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: <20231211231035.743cesujphsp5eve@box.shutemov.name> References: <20231205004510.27164-1-kirill.shutemov@linux.intel.com> <20231205004510.27164-6-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231205004510.27164-6-kirill.shutemov@linux.intel.com> X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 11 Dec 2023 15:11:10 -0800 (PST) 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. -- Kiryl Shutsemau / Kirill A. Shutemov