From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) (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 2974227BF7D for ; Tue, 17 Feb 2026 16:31:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771345905; cv=none; b=UkRRLbAdgvl9K0/Iyx7HOAw0YlLDk+baOK8e8WagiFa0YkcHIJiMBMr1lxGZTW0zWFmwIgXJIZCgOhv3BIs8Q7+PHGsccPtBju0hRbkv6s/Gydn4mZjZ8Ix6/lx/QJy9AOsDQmQT7VjSNpKVgiOFfvNBWWmQiR1zTZYTiUb5Gxw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771345905; c=relaxed/simple; bh=SGREBuuKhZojW/qxb3YvvKLZ4Emj2RxLhOOQtbx0/ag=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=aiOv9GN83OJ7Bb0f07fkyZeP854cZcasgoZL9/mr5ns8jHUmhfVoRzvfBugOSFK2j6zNXMu2SN9bRBZjgteCRqAG1gj+7JPffh9LQshnxRrLRgNqhDXjILO9e0ozmK+y7fav56HJHBYXEwdXy68bp3nCX7sMfx0TR10JYDuKKX0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=FLFrbygh; arc=none smtp.client-ip=209.85.214.202 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="FLFrbygh" Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-2a946c0e441so44586545ad.1 for ; Tue, 17 Feb 2026 08:31:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1771345902; x=1771950702; 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=3VZfOz+HSVZa7yIGW57B4e3fv7GIVEIIOWdcsv8P8bE=; b=FLFrbyghd5p5Pu7OhJZNo3LLDlG1GvUzlaLBp4sH3GSwMFB9Ae8O9fDImkqDQb/b81 WjR3lVm6BbC/XdJNcQlcbqOzet8Rf21+tK9Pp/+bjIHz3cQUXmSaB6/KCINfLwBSGrJy gTpy0eYR1Us/6mEznPt1jaX9/969KRNIcEKFhoD6jq4HQ3SglrIwaAqkFHFQFT2nVPhu Zq+TPZSEmddM5VuoHu2YhU+Cz9nQ7ILCDedc1zbaZ7LLq/wnaAc3NW0pg/eT5ZEMhTyZ e/UFHk8C2Xv9/ORvnuKaEdQQRyxaywbwxdWFp1tRI1VFigxTD7cPsgQCBwhn833BbTeb H1Ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771345902; x=1771950702; 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=3VZfOz+HSVZa7yIGW57B4e3fv7GIVEIIOWdcsv8P8bE=; b=SYRZj4LYCZL8ov0c1ub3Ogro/SAVQ5aWs/WC/UBLBwjXXAScAbK9nhq/TjCaPxFybL g0tpT2yfNrXaMWcDiu+9q1zHFrbzZ/Nrk3pRbP69AC/5lnKDDj14Mg/8frx5CVBmcGOT 0sEmDY0Z8NYL/Rj6rGo6cI/TAsxBaBwQpLzrlD6HpLJtLwl0gTCf4laEKvwB/E/WdNF9 Is6eWen/wOLcUdlLhvlDiJCHA6ESoT/Bx6SB0Z7nSXb2scCbSUZzuaIDaBmCQ2KFlW5n ptimuQAOXooCzyyAZHLzWKp5hR4eMiYX7TLkyzknxcRLGck+bSDXjZ+Uv9Z4FBV4rxm0 vijA== X-Forwarded-Encrypted: i=1; AJvYcCUO+fyRI+1kleJW8apvkMXct/GWdiJ5zKlmCbmX4ISDtYJkAIuYy/vr27be4DlgfYe8O4y/A6Ym8Bjku7A=@vger.kernel.org X-Gm-Message-State: AOJu0YxrKvwSG6+u4/2TK9Sc+oAbWQVLfhAImU7eEWgt3O+OvcqHA+Ej 9pswh0J0IZWDCHFp52CjxwtOMaGphim9KdwsNzkWQjzSy/Lox0EqfpajGp1pNi1wTzuRSrVK/8L OUo6F6w== X-Received: from plbmi8.prod.google.com ([2002:a17:902:fcc8:b0:29f:1bbb:de14]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:3843:b0:2aa:d671:e613 with SMTP id d9443c01a7336-2ab50586724mr116397175ad.38.1771345902214; Tue, 17 Feb 2026 08:31:42 -0800 (PST) Date: Tue, 17 Feb 2026 08:31:40 -0800 In-Reply-To: <699383e5939ed_2f4a1006f@dwillia2-mobl4.notmuch> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260214012702.2368778-1-seanjc@google.com> <20260214012702.2368778-6-seanjc@google.com> <699383e5939ed_2f4a1006f@dwillia2-mobl4.notmuch> Message-ID: Subject: Re: [PATCH v3 05/16] x86/virt: Force-clear X86_FEATURE_VMX if configuring root VMCS fails From: Sean Christopherson To: dan.j.williams@intel.com Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Kiryl Shutsemau , Peter Zijlstra , Arnaldo Carvalho de Melo , Namhyung Kim , Paolo Bonzini , linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, kvm@vger.kernel.org, linux-perf-users@vger.kernel.org, Chao Gao , Xu Yilun Content-Type: text/plain; charset="us-ascii" On Mon, Feb 16, 2026, dan.j.williams@intel.com wrote: > Sean Christopherson wrote: > > If allocating and configuring a root VMCS fails, clear X86_FEATURE_VMX in > > all CPUs so that KVM doesn't need to manually check root_vmcs. As added > > bonuses, clearing VMX will reflect that VMX is unusable in /proc/cpuinfo, > > and will avoid a futile auto-probe of kvm-intel.ko. > > > > WARN if allocating a root VMCS page fails, e.g. to help users figure out > > why VMX is broken in the unlikely scenario something goes sideways during > > boot (and because the allocation should succeed unless there's a kernel > > bug). Tweak KVM's error message to suggest checking kernel logs if VMX is > > unsupported (in addition to checking BIOS). > > > > Signed-off-by: Sean Christopherson > [..] > > diff --git a/arch/x86/virt/hw.c b/arch/x86/virt/hw.c > > index 56972f594d90..40495872fdfb 100644 > > --- a/arch/x86/virt/hw.c > > +++ b/arch/x86/virt/hw.c > [..] > > @@ -56,7 +56,7 @@ static __init int x86_vmx_init(void) > > struct vmcs *vmcs; > > > > page = __alloc_pages_node(node, GFP_KERNEL | __GFP_ZERO, 0); > > - if (!page) { > > + if (WARN_ON_ONCE(!page)) { > > Is the warn_alloc() deep in this path not sufficient? Either way, this > patch looks good to me. Not sure, I don't have much experience with warn_alloc() in practice. Reading the code, my initial reaction is that I don't want to rely on warn_alloc() since it's ratelimited. Multiple allocation failures during boot seems unlikely, but at the same time, the cost of the WARN_ON_ONCE() here is really just the handful of bytes for the bug_table entry.