From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3FB4DC001B0 for ; Mon, 24 Jul 2023 21:40:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230161AbjGXVkM (ORCPT ); Mon, 24 Jul 2023 17:40:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229454AbjGXVkK (ORCPT ); Mon, 24 Jul 2023 17:40:10 -0400 Received: from mail-pg1-x549.google.com (mail-pg1-x549.google.com [IPv6:2607:f8b0:4864:20::549]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AA8C126 for ; Mon, 24 Jul 2023 14:40:06 -0700 (PDT) Received: by mail-pg1-x549.google.com with SMTP id 41be03b00d2f7-563396c1299so4296254a12.2 for ; Mon, 24 Jul 2023 14:40:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1690234805; x=1690839605; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=8BXNvlgPl86R5u1hRBm87aT1u2p7UCsAkEmDEcFG3FM=; b=WQVwrhACND8PT5c7alEIYasKcI4Gp7ux8sDxSBc+Z2bJbXkeTQ5jBOUHXIeOX7mlDT IA9pzFYjQzEITJml3F0PjSrEsUo05ZsNqrb8ZwrdQPd0nMVfILzegzYolD0BGNic81Gz s/fdxjhr9ssohjwdFcYBZFpTEIY+Cqf0ZgzvRQr8pLNrIFSvHblY82xsimwQ5Hoxpxag ZEchK0cmfSc5EC0KjP2jeYQcYdm/+0G52yT8+C/fGHF0OSFhlgDympjozQGmHyuKGxkf fMrqX+sFQNcqhs5SEIEVfG4p8fZpQ9QGuGj6l2J8Jvr1lkwN+TT1rHadFW5PB+D/1gaQ ICdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690234805; x=1690839605; 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=8BXNvlgPl86R5u1hRBm87aT1u2p7UCsAkEmDEcFG3FM=; b=Ophv0piF6z8lJ3wzoq+ZJrqcuJW8IPTpBnJ8v1LbsH8oUm/N3Eq5GdSRfpD0TCn5AE Pl03vGkPDEzNNZ2oDqKoUcsjm90U4yno/LPCsjIhZn/ixh0rjVUpDCzTO5FNKu38z+Kj gMZJMTL6vZxosa0QTLiQwACvLjbzEN18KE0EsQo12g6X/IQVHds083X74jp8brVFu7Gb lIozTmz+5YXW4lKRdR9UhEz4BVuEj1Qb91wk+poeFT2qTH4OKWtJmIKfVtOv8YCcS4/i YVH1ksvNctqlcxjgPp5N+b7wSgDXLL0WoU9PJvqZUs5wPjkxPKbAiMXA8qv7kwBM48jb deLA== X-Gm-Message-State: ABy/qLaOYvb7ThIPXsOQa86zkU2yQYsgn5a8CwIKbJgaNHdfjVHwAqPC 3Qar7QK1kyV7oXNNmd2B4nVPjRORrE4= X-Google-Smtp-Source: APBJJlGr3Xi9CBngHaiIYWxM1PJJW9h3BT6/cv5dUH1y6ZztFyeHVEzhLcBu5fYxBfWr79u2kv7wLBA+Mcw= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:903:32c3:b0:1b9:e338:a90d with SMTP id i3-20020a17090332c300b001b9e338a90dmr44909plr.3.1690234805271; Mon, 24 Jul 2023 14:40:05 -0700 (PDT) Date: Mon, 24 Jul 2023 14:40:03 -0700 In-Reply-To: <20230724212150.GH3745454@hirez.programming.kicks-ass.net> Mime-Version: 1.0 References: <20230721201859.2307736-1-seanjc@google.com> <20230721201859.2307736-15-seanjc@google.com> <20230724212150.GH3745454@hirez.programming.kicks-ass.net> Message-ID: Subject: Re: [PATCH v4 14/19] KVM: SVM: Check that the current CPU supports SVM in kvm_is_svm_supported() From: Sean Christopherson To: Peter Zijlstra Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Paolo Bonzini , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Andrew Cooper , Kai Huang , Chao Gao Content-Type: text/plain; charset="us-ascii" Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Mon, Jul 24, 2023, Peter Zijlstra wrote: > On Fri, Jul 21, 2023 at 01:18:54PM -0700, Sean Christopherson wrote: > > Check "this" CPU instead of the boot CPU when querying SVM support so that > > the per-CPU checks done during hardware enabling actually function as > > intended, i.e. will detect issues where SVM isn't support on all CPUs. > > Is that a realistic concern? It's not a concern in the sense that it should never happen, but I know of at least one example where VMX on Intel completely disappeared[1]. The "compatibility" checks are really more about the entire VMX/SVM feature set, the base VMX/SVM support check is just an easy and obvious precursor to the full compatibility checks. Of course, SVM doesn't currently have compatibility checks on the full SVM feature set, but that's more due to lack of a forcing function than a desire to _not_ have them. Intel CPUs have a pesky habit of bugs, ucode updates, and/or in-field errors resulting in VMX features randomly appearing or disappearing. E.g. there's an ongoing buzilla (sorry) issue[2] where a user is only able to load KVM *after* a suspend+resume cycle, because TSC scaling only shows up on one socket immediately after boot, which is then somehow resolved by suspend+resume. [1] 009bce1df0bb ("x86/split_lock: Don't write MSR_TEST_CTRL on CPUs that aren't whitelisted") [2] https://bugzilla.kernel.org/show_bug.cgi?id=217574