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 2964414F112 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=1771345904; cv=none; b=TGGmuEbXYvWJ+fgV0EqSKLpHp4RkRxtwE00KD/ecm4ywd5yRHPBsnu4zURTHmEsq3YwVV6Mx9K7HnpmL2fg63j0Ow6pjU7XMqeaJyKZNTxYXep7qjWVM1zNfgE5hbohyAjJauwe7KtOmIxPqoWltZkYrXvVEqxkvxo+h92E66Ak= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771345904; c=relaxed/simple; bh=SGREBuuKhZojW/qxb3YvvKLZ4Emj2RxLhOOQtbx0/ag=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=GNdwW4FkgmPM6LoBXwERsjPi8OUJkUuvqAtKsJAfhWC39WIVctMYkW6qpc/Tj8S7+Ug2lziYgquF3SwTnawiltu6bcJiapkRawVuW0EjJRaIKbayVcsR8GzqM9bPzPfGF7No3RqMD/AQRD4wC0gEDoXWGnQlXB92bPr90rCY+lM= 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=3dq/f+4a; 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="3dq/f+4a" Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-2a77040ede0so47821745ad.2 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=lists.linux.dev; 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=3dq/f+4a53c2lIqh9ew77LqQILHjJ22c8EygfD8nZT8Y8/URWbA1fDTXRoNkhDv91k SDnX5RwjZQOp6FxdqYQ7vQXG1ZOQRW8Yx4EFioaFWxrCchOLV1SIIkZb0yBYQnDHXMuy 2NwDsUXHC82qnpUXL7obdfusFdyegcXy2feNTR69tY5hmgEj4a89vt5uYGOGlJ+IibiK zfvOGgG6KQCBnLa9u056lF/rlaIur3B/BL8X0Mpio+LgUKFBY6iWy9ycCXvz5lP7FlY2 g9HTG5h6GOGNO2is3DWle5op01QFzUsgMkntUHoS5Hg8vQPvHyodRzmkCUOTiFtJluP6 ob0w== 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=BPcSgwN8VjAgbJra3O55qRY+O+ID2kjMZukgzV0GNlVJQiG9B/+N9tcobS80wdACUH 14z+09mZYYW5HranQStdSg8ipuNcRGCR1dFV7sXN5VKBh0UShIKSNtboQR/U8GShLeE9 HD2Cw/XCLtSBQxOIfh9xlCXXnx8A8pJ8naeyOycx9rHZXodTj7cbvTLoSn4dr9za/p3F HUgrrA6N/sZ6EWgYferuXtVlv+On42FmiJVyR6pRalhdN62ZIajOsaLh1SI/6+DV/5G1 TN/O2m2S1TlqdNAdPcQbsgl7+ExqJqKLR3PnCLwz0kdyfncGuBQV38nAute1FdUSCyK0 r7OA== X-Forwarded-Encrypted: i=1; AJvYcCUnTJxNbl5qay6XUs88HGvirHonRzSp9xMcM+lB7SfNfNQpogeUf29azANiHrsDik3X7JsLfBsoKJkb@lists.linux.dev X-Gm-Message-State: AOJu0YwruuPSI32BLLTWkqKJBBAd0VE6NDrwwkOff0A86IC9qOq92lcl /ptGjujPlgWCQ/NLf9FgahYQtu1u49RTS5C9KO/0rm/KTjQmVsQaPfW2/Tr0zQjwybWqP60HOL6 ZnQrbLw== 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-coco@lists.linux.dev 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.