Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5467055rdb; Wed, 13 Dec 2023 09:22:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IE50jpIeo8636WOLApO3balzD/QG0aIpCzZBLSy7o9Bf19bmG/EOixRsY5xBdJ6Sq/tO3xl X-Received: by 2002:a05:6e02:156f:b0:35d:a285:14b4 with SMTP id k15-20020a056e02156f00b0035da28514b4mr13690407ilu.50.1702488170794; Wed, 13 Dec 2023 09:22:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702488170; cv=none; d=google.com; s=arc-20160816; b=z3Bcxrbl5HCokGy4T9krTxPYOY6FbZhcZ6+SCqfJCSbmUZgky+XLekSoH1/dg1UKNl GZFVco6lEaU1W3Q6/Z6bBHKwEL2bbKOQCklsMl42v2g8SFKwxzB5rL5VJZ1hRpbKK3ty YV2Di5MVBXrug32mnpBMQeBHzymwINz/t4iGHrOLrWL5lujYXdaEt3n1QnrwqSDBRbRM 0XgnbR6xpUnitlgEl+d6Qnv6xV0W11wexjvv+rvAGerPTh8OSLV4VOB4bf0YT+sOk2la K4bKCBcz+rkBMi05d0QB8cldO/UZQQglUlFVyDis6Xjk4lSBvy+XdCMlvG+XVafQ5vno ux0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=6ViX/Qqiqk/4TxTiVczHsfkpJiJjwcbO6aH0GOTDDcw=; fh=VzAEdswdqDgC3pDazoW4gZZ+EKnw8RNB9qTc7W097lw=; b=u8DxIW9v/Zsjn2pzAsylylG7jqigub9wGNpqPNXEBWb+5VlH6NpVKUF9iztBxNrDx7 Sf4YX7wb8812sQdyId+Uy33ehNHL8SCQ87A8DSER9j21tYZcFKWETfi0ZzAe0qUrPFL1 b+Nm1aJF/UIPqI/OPwbjIrwsawj8U+g/OF60eFxDlDNio48Y5f7mrriNjBsJvk3/36a6 DUc8p7bSzDoUEgh4xwPWPhswYH0z4s7b7JDH+wgsKnjQwSzva27B8q1GwX7mOIMMOsme U4cMaHRy1mvC40bDcc9DB5NA5ml07VezyAH3cqd2nQjEy0EZVd7BW//QmKyHgCawaHnY AKaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=sCQ1KzGo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id k13-20020a6568cd000000b005be007363a4si9547498pgt.669.2023.12.13.09.22.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 09:22:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=sCQ1KzGo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 94EB28042D3C; Wed, 13 Dec 2023 09:22:48 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379156AbjLMRWd (ORCPT + 99 others); Wed, 13 Dec 2023 12:22:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229458AbjLMRWa (ORCPT ); Wed, 13 Dec 2023 12:22:30 -0500 Received: from mail-pg1-x54a.google.com (mail-pg1-x54a.google.com [IPv6:2607:f8b0:4864:20::54a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7CFD99 for ; Wed, 13 Dec 2023 09:22:36 -0800 (PST) Received: by mail-pg1-x54a.google.com with SMTP id 41be03b00d2f7-5c67bf38266so6311259a12.0 for ; Wed, 13 Dec 2023 09:22:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1702488156; x=1703092956; 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=6ViX/Qqiqk/4TxTiVczHsfkpJiJjwcbO6aH0GOTDDcw=; b=sCQ1KzGo1oVcAYIwnwgSkQDwNHzbjcssvfqw1qI34mRibe66RZ4IoL9Z++Z/SJP0K8 d9JtWO5wq5FcyWeSPbvbaZSXJtEvysW8NvGwfkNg5mXjwLOThzd+nfyYT5k63lxa1PhL p0rVga1Wpv2PhRqd5hAEk46N5ksmo5LfOxuWK18Dpl9WE2v8hOTsjSz9riPo6B6Wqtd/ QeU70OLWrGHppL1/oQSDNrRipHrotzvSaa5R27oXQ3/WcGSQCPZ28wfVQrrxw4pCdIET 1gMMhIJ+FJsZpP0GXCGsQmKoZkDliEC7Pk5XHdSJh3l0b6xtt+qKLnHJcsOj/fDxYLLz +t0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702488156; x=1703092956; 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=6ViX/Qqiqk/4TxTiVczHsfkpJiJjwcbO6aH0GOTDDcw=; b=CSX+Mpx2vF7OssbUsbs43yRpL88qNbC6IhXyOEn3tUTbnoXdAW5KjKS8RbyTSYB1Fs Cs7LlysFdCpTYHYV3Jzu5AeJVzECi2NdryQ6QG0tNnP7oiPdg7rCxj8NgVo/pqadzt2d 3kc4gRFqpN3VxBFD+Vn+4xPtcRLDQCqZSxqRC3Elf3JIP3B0JdOjXa4eILw/Kx63mtCx dM1D5SBW0Hgb3+LYkCyJiaWckI9jhF0MQhj0S1+BBnbdC5TLK4uDY6eAfuYh6xy8dcb3 t8bJvttlcrcJN3QJLvHUz2/vhwfknXHfC/mdT+X0raJzfG28S/RwYwTyX4lEeuWzujLJ 4ByA== X-Gm-Message-State: AOJu0YxQ0yJi/0t3kccAjwgImzotuKHPPQQ3J4rq1LtCG2WhYWGDzl41 9NDgNqDQpEpTWhKPeM9mI2nXpL9G6Lg= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:6a02:51e:b0:5ca:3b18:9ec6 with SMTP id bx30-20020a056a02051e00b005ca3b189ec6mr328107pgb.5.1702488156338; Wed, 13 Dec 2023 09:22:36 -0800 (PST) Date: Wed, 13 Dec 2023 09:22:34 -0800 In-Reply-To: <20231211231035.743cesujphsp5eve@box.shutemov.name> 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> 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" X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email 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 (morse.vger.email [0.0.0.0]); Wed, 13 Dec 2023 09:22:48 -0800 (PST) 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".