From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) (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 442A22652B2 for ; Sat, 17 Oct 2026 00:54:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792198441; cv=none; b=DYFIdV8Qeburq8iLciJ2YlXXQKrcbDDSS0WK3bbUKR80BTbkeJXRU1MQjqgivZPBXZZcb770CMSOBNkRchRqxKKwMFHIBRdZlgSeqgN44c5vaEuZBLYARqjUsHOwVL0RRZFlHgHJcHrwx7WiroelQaUyYCxXSnWt1avTPXowaDM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792198441; c=relaxed/simple; bh=alQQ26vtWvd5KFj0NrkrESuOW1SHNgTSSy6eUycpSEM=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=ZDrXZSPq2ivZC+5MSmN3WYGzadgsTFnjb5GL+os3yMSvH03e46WeuxwfRg5r0hgz9wwyIZuQXNNuHO4Bwixz6h79NcpPfcwelYb6bVjC7UNUV7/oEkC0801fQ9EaVyP3juTDGUBVTIvQksXoypAB+qJ/5uDj4veNzyNXeT70124= 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=ggncy25V; arc=none smtp.client-ip=209.85.215.199 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="ggncy25V" Received: by mail-pg1-f199.google.com with SMTP id 41be03b00d2f7-cd3e7a65fa8so297587a12.2 for ; Fri, 16 Oct 2026 17:54:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1792198439; x=1792803239; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=q4/0F4cnJR4U7rEfwJymIH2uxAq9mMyOs2TKpXvv5og=; b=ggncy25VWISJ21Z3/HU3fjADOcxV0aRVb50FOZtotMAG0DJthFUUqXkbWpIMX2WChv d5YLZ3v9NF4DfKAb2baZru+bQRJWGqCpxtXhAKO67gfb0xnu+ienniD/PjeKmrtIQiqN 8Hqw+FhsNm+EncWb7T8iZ/ZQiYkPrWWI0ehtAOV1tB0s8pghwPWX9jGLGT9JRJjBgIUx L92R6EeR06an7+CwNaCEcelj62LWlBXdc+5bkf/ZbOUjcMkmDaW9rbSClTdNCH0NndBf G4guGbRSjW+6/Yu7cFQDA5MBeQi9mlN/0fNhQcfW4CF2b8iaITpWUHLjbeTo7aEup5jF ZrPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792198439; x=1792803239; h=content-type: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:content-type; bh=q4/0F4cnJR4U7rEfwJymIH2uxAq9mMyOs2TKpXvv5og=; b=tTiFGGO/N5bsTzhvbHEvd4JLVmvQFGRT24bgphGrG9Vc3wkLMwTrQZVAo2cFtql3eC NwWBL+JcAuHibJ4mwJs4OXvJCykWrwgW3SvfwuudqKls7mQZ2K3+AxO34NufNdTSjThR ctsRAdDYzNbI5js/O3lwAFzJ3V5NcRzP5e3c0EI45oxnzkUrVQB8/AJlFcDBjzFBdVYV jU7xhi72MI9EvTYraigKlXQaF8wNdClelbwGGmApqoPNkdwhvTD8Bd5CR/dPc3dRW5KR Pm2RfXqfXBBzqnrUebZQyaXQBIXuUBEo2KkLZxXCCgiajr2jRb+RBj6GZUNA6DxlNcSP mKiQ== X-Forwarded-Encrypted: i=1; AKwUvBykigPXOXuUqs9XD/tNNxxMaTM6ETrxy1VRsY779NXYtWYyPD+YFkUJ2kSIfR21SAkmtTov30OKnyuSUPQ=@vger.kernel.org X-Gm-Message-State: AFq9FYIsSddQ7ZP9RlyCyaVkqSQT/lHxOlVp9jv8WlDNRXKFU7TJzCZZ xqGMbaQa08VCq7D+WAwZFp3Q46iNl0mHpX17fBb/y9+I5bIcUBVV9pW2Fdp+o2QMKQETY0VPzHJ yxO/ovw== X-Received: from pgca7-n1.prod.google.com ([2002:a05:6a02:6387:10b0:cc7:52da:b682]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:6a0a:b0:3e2:200b:dc1b with SMTP id adf61e73a8af0-3e225fec787mr773961637.51.1792198439153; Fri, 16 Oct 2026 17:53:59 -0700 (PDT) Date: Fri, 16 Oct 2026 17:53:58 -0700 In-Reply-To: <20261016235221.33726-4-amirmohammad.eftekhar@cispa.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20261016235221.33726-4-amirmohammad.eftekhar@cispa.de> Message-ID: Subject: Re: [BUG/RFC] KVM: nVMX: nested_get_vmcs12_pages() kills the VM when the APIC-access page is unbacked, unlike its sibling pointers From: Sean Christopherson To: Amirmohammad Eftekhar Cc: pbonzini@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="us-ascii" On Sat, Oct 17, 2026, Amirmohammad Eftekhar wrote: > Hi, > > nested_get_vmcs12_pages() (arch/x86/kvm/vmx/nested.c:3448) maps three > L1-supplied guest-physical pointers into vmcs02 on nested VM-entry. Each is > VALIDATE-checked for format only (page_address_valid / legal-aligned-gpa), > never for backing, so a legal-format GPA with no memslot passes every > consistency check and can only fail at the kvm_vcpu_map() step. When that map > fails, the three pointers are handled three incompatible ways: > > apic_access_addr -> vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR, > suberror EMULATION, return false. The VM dies > (every userspace VMM treats INTERNAL_ERROR as fatal). > virtual_apic_page_addr -> clears CPU_BASED_TPR_SHADOW, or writes INVALID_GPA > to force a clean VM-entry failure -> L1 gets a > well-formed VMfail. > posted_intr_desc_addr -> pi_desc = NULL; clears PIN_BASED_POSTED_INTR and > runs L2 anyway, with no signal to L1. ... > Question / suggested direction: should the apic_access arm be made to fail the > nested entry cleanly (as virtual_apic does), rather than kill the VM? No. KVM goes out of its way to limp along if the vAPIC or PID pages are bad, mostly to play nice with tests and pedantic developers. AFAIK, there's no good option to allow the VM to limp along. If someone has a strong use case *and* a "fix", they are more than welcome to post it.