From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) (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 708B0258EDA for ; Thu, 17 Sep 2026 00:12:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.71 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789603933; cv=none; b=Hvh3LMgnJYvkZ1waKFQ+SH5zDzf2xuhM/H2EXhfmGsNfAFV4n+EZ5GjUBTXNsDCqhXRYW+r1h6XY+O7eKDS9wtm9f4yzqryZRIe6dg1Uj7vSXaUHiNl6izf7dyHliWw2r4AQEFj/OYWepRLvXnF0PcV1ltuTb0ooFoZ48Wg7Has= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789603933; c=relaxed/simple; bh=HozO84mXGPcKS1igoe/VwSJOG7i5lKGoSVIesNmNWWw=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=WN7E3kV1+FGtLjLRIaZzM3j2TkPyN8X8cW469L7b3obaBIJmQ0SujzX51MQvG3Qvv1SUjqCsmzkC3lYdi6pSqynfMOl0tHiyO/88Gl6aoQuWjyrECL0MEjkUZZ89mYa8KrbVnhUJZpwXQ29VGdsRdnRSbP2U+RNN7n7t9AU6Svw= 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=PIi8kwNO; arc=none smtp.client-ip=209.85.216.71 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="PIi8kwNO" Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-39d865b11b4so315348a91.3 for ; Wed, 16 Sep 2026 17:12:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1789603932; x=1790208732; 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=j6iDNH5wuGoL3/bmQAOC4Dn6hjBP2bgu5FvPAn8HKIQ=; b=PIi8kwNOUE05OJOvW+p3JD2hKWNLG6LeG5NF4sm0t9pkSoAG3uIET79vZnP5gMjcnK 1Eg2mLY2GQZTsl0v7MYHN19VLBn34tsaRZawG3pLH0K6jtmrCs6dSLwoF2kZ5ptsPxm5 E4UjpLnrAyGbeGOSCmFxvyXMYW/6iQGsNizi7mityK33Qb5jfWqSwnr2xgAxOwa3xheb ZzRBj5eQXvr14wvds5IMEMcczqTCb1oEoYCTbRhG0Ka1tNqxA7XUFkvirSEGQNfg7b6+ WagWMif4BuHJ3ByIhnNisFNYLrjFBQdm8PDe58XDeb+commwjD4Klb7oQMlXDCAJeE+6 FLmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789603932; x=1790208732; 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=j6iDNH5wuGoL3/bmQAOC4Dn6hjBP2bgu5FvPAn8HKIQ=; b=KQgFRqUo011i6zdevdLFEH8AmFTZVqoa3Q5waOthPkgOJRzbBySDYLEhN/eZ5AQa7r 0p3nIF4LqwAWVqvuqQDhEhz/nTv3yug6RLcJxZ6+1yMW2IpHylW8S8qGDsP1kcIQhcy5 LQoQr+wDbPbvGK6uGnD1Qay5vnL/QJNoumrgCp/sZ5vRlpdYyVYjIpLONMkr3b+3oP+V 5H86Or4C64+QPXBpcclBeJpT2sd0UxxWSxk+tjubbjEDhhTeh5WlI/0nCQXbfAi39eFd 6T4DOm3ZcDPwGFw0mrcwvQNPXudofgMj/+ls5xtazdJ2SdHpGuJ1CmKI6llu7QbwsBOk jdwg== X-Forwarded-Encrypted: i=1; AKwUvBwzGMrl/FTamODYyvRhzpOurUnshGLg4I4cjvqU2zGqBpfvvKU4YWZnj1Zq5NufPK1UKTSmDh4k9cnk/s0=@vger.kernel.org X-Gm-Message-State: AFuF++k3ceHEPiSPci+PEK6hodY/ztd2ZRowEHjDt0X3JP/uASBwsvKA +HlUKDljYaQK/TMUnLqL0z5/AVDRflAjHxbVOu8jl7eaXMI475o+PSm5UZwb/bSwDEj8jPF3VEJ xSCONXA== X-Received: from pjqf7.prod.google.com ([2002:a17:90a:a787:b0:39e:18b3:6422]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:6cf:b0:38e:7168:281 with SMTP id 98e67ed59e1d1-39e1e329409mr10995151a91.10.1789603931494; Wed, 16 Sep 2026 17:12:11 -0700 (PDT) Date: Wed, 16 Sep 2026 17:12:10 -0700 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260902230932.2760127-1-seanjc@google.com> <20260902230932.2760127-2-seanjc@google.com> Message-ID: Subject: Re: [PATCH v3 1/3] KVM: x86/mmu: Use KVM's max TDP level to determine need for 32-bit TDP root From: Sean Christopherson To: Yan Zhao Cc: Paolo Bonzini , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Rick Edgecombe , Xiaoyao Li , Kai Huang , Binbin Wu Content-Type: text/plain; charset="us-ascii" On Mon, Sep 14, 2026, Yan Zhao wrote: > On a separate note, though it shouldn't be a real issue, is the below change > necessary? I would say this is technically correct, but unnecessary, because I can't imagine any 32-bit guest firmware would try to relocate BARs above 4G. > diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c > index bb68a021cfaf..abbba26dbdc6 100644 > --- a/arch/x86/kvm/cpuid.c > +++ b/arch/x86/kvm/cpuid.c > @@ -1810,7 +1810,7 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function) > phys_as = entry->eax & 0xff; > g_phys_as = phys_as; > if (kvm_mmu_get_max_tdp_level() < 5) > - g_phys_as = min(g_phys_as, 48U); > + g_phys_as = min(g_phys_as, kvm_mmu_get_max_tdp_level() == 3 ? 32U : 48U); FWIW, if we wanted to do this, my vote would be for: if (kvm_mmu_get_max_tdp_level() < 4) g_phys_as = min(g_phys_as, 32U); else if (kvm_mmu_get_max_tdp_level() < 5) g_phys_as = min(g_phys_as, 48U); but I think I'd prefer to just leave this be. Rr better, drop 32-bit kVM support :-D