Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1881625rdd; Thu, 11 Jan 2024 12:02:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IG91XQxOcPjUmFEEPh76/6FnRv9WNLOYus6JHUvxMD0me9uaQS4cOuqniuj/MozjrUIvUQn X-Received: by 2002:a17:903:2348:b0:1d4:bd1f:8667 with SMTP id c8-20020a170903234800b001d4bd1f8667mr329763plh.52.1705003379101; Thu, 11 Jan 2024 12:02:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705003379; cv=none; d=google.com; s=arc-20160816; b=QREe8WaW1Q2Nos71W1AU+eIsZlUcByCImIIMEt0pel2qJUT/mGT6lgIfh4TyE8Qvvc tOSdCqp0k6NfjyfA9a1WKniB/7L3QeRjRdf1o2fmm7sdNqRvVBSAIMh8Y0e7S6J8xxv0 wToKISLCAS80NU5v2YLv/eVt90rRoGB/oFcOPpEV4sV4RMn+6SpUKAbEILi5H5JJ1maE 0pt7pbLk530+YzhOOl+Rq0IiYAfdVisgtq0GMF6Abwys57KqFRKWmCiDiqzKUuyaVFTu Xel1JHxwxdvKYl0ack3S2Ps+xs/WsHW2zaHfhGkTu6QYAQtxWZzbNsumW6JCl8KKP6mS ED8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=YQwwxKRUEjSXUAuYik8yvl11rO3m+mqgyAXUo3DD30s=; fh=cfu/QgAy94m6kJ5lbYPCmgzAL3espopj/FrCKWf3y6Y=; b=Q6I+R5t0nKFdjEP9IkakVXeXwItamZCuVYrUXBn9n3zSHmCxAICm/NStTIXTofwp7D rgmoBnf42AhJa6mYqYWHfQTLxqsjHLSMlPs2eMcaLywa0W4rPKQzrWNfFEkn15wqN3nU O+NMuNl9MWRxqkr/UTosTAQ7ZGfSoSokoKncgozGSfZhOc8RQ7Cy8fMQdJITiOlO6Cnj Za6+6w+YETugKF8g2FxesVSbZCX8hCzKcMK8LmGk4ThvG+Hml8bnnbxIbE9UPC32166v 91goUKq8Jb8tsQNgVtosSIz5svJbURUhB0tsmRESk/kO1FZqaRCsPX/rQKxIwlX+cJxf IN6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bYEsWHEd; spf=pass (google.com: domain of linux-kernel+bounces-24030-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24030-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id e8-20020a170902cf4800b001d3ac497f07si1672649plg.565.2024.01.11.12.02.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 12:02:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-24030-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bYEsWHEd; spf=pass (google.com: domain of linux-kernel+bounces-24030-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24030-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id C7C4B287F39 for ; Thu, 11 Jan 2024 20:02:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B53E25677A; Thu, 11 Jan 2024 20:02:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="bYEsWHEd" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8714356751 for ; Thu, 11 Jan 2024 20:02:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1705003353; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YQwwxKRUEjSXUAuYik8yvl11rO3m+mqgyAXUo3DD30s=; b=bYEsWHEdAthB8SSUWbs5VZhDFh1/7aA+AXDw/OTtgIyLD7T0pNsxieR/ibeh8I2uwAMC9X OOvalu+UTkc7pPBmpYQWpqTtytBWJWFR2X+6/XP1ZORFLYdutphA/odT+sbjK7wDltYFzC fY1SajGf0tE1Zcs/duZl4Xq05srUbb0= Received: from mail-ot1-f71.google.com (mail-ot1-f71.google.com [209.85.210.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-255-iUZzaHmpOaSx5wxNpyi50g-1; Thu, 11 Jan 2024 15:02:32 -0500 X-MC-Unique: iUZzaHmpOaSx5wxNpyi50g-1 Received: by mail-ot1-f71.google.com with SMTP id 46e09a7af769-6de02906654so3666463a34.1 for ; Thu, 11 Jan 2024 12:02:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705003351; x=1705608151; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YQwwxKRUEjSXUAuYik8yvl11rO3m+mqgyAXUo3DD30s=; b=kzlVGhgS7NROZ59ZaiiURvhV9DLTFp309SBXBRncOfMQ4v+syG40x85zRZMW4S5cEi jME8ZEFSmTh4JUmrfAjueB5To62BMqVDZfeE4Vi4oxcEkONeozCFvSaVvIh5fKXuWlsu MnCcG3oR6ZvPbHADkGf3tZhzoccwkDYEjzl3VeDPvFerNza0DL2FobNGJ8BykZrhlKt/ bIYbKF//Kguh4d8Q03oKfVgWF9g171opUViLoPKSoZBbxRTByvk/UrEvSVDnyOuJIA+D 8c6nEoY1VWg0550PV97CtB0x6FRyD6EvMWRBNUkSmxov3cETz0mjGKR+8bBQ3YcEEuLk dslg== X-Gm-Message-State: AOJu0YxpS2qwtdfELgAfNlK4Az46A3Vy6hA3rWMu4HWXMaqrtbar4GVw k/XY2SWOUegEWmZJ228KoBIMkVkkCXYELvbDiN+dunPgQTUKh21BsRtNsIMK3zQVnealr6Hro4D 48w4WaS5WqTyo0p3oNfpsynovFTyxyAi/2eaMYJn6j36sm8vt X-Received: by 2002:a05:6830:60d:b0:6dd:e445:343a with SMTP id w13-20020a056830060d00b006dde445343amr361438oti.53.1705003351134; Thu, 11 Jan 2024 12:02:31 -0800 (PST) X-Received: by 2002:a05:6830:60d:b0:6dd:e445:343a with SMTP id w13-20020a056830060d00b006dde445343amr361422oti.53.1705003350916; Thu, 11 Jan 2024 12:02:30 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240110002340.485595-1-seanjc@google.com> In-Reply-To: From: Paolo Bonzini Date: Thu, 11 Jan 2024 21:02:18 +0100 Message-ID: Subject: Re: [PATCH] x86/cpu: Add a VMX flag to enumerate 5-level EPT support to userspace To: Sean Christopherson Cc: Tao Su , Chao Gao , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Yi Lai , Xudong Hao Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Jan 11, 2024 at 5:25=E2=80=AFPM Sean Christopherson wrote: > > It is unusual to assign a huge RAM to guest, but passthrough a device a= lso may trigger > > this issue which we have met, i.e. alloc memslot for the 64bit BAR whic= h can set > > bits[51:48]. BIOS can control the BAR address, e.g. seabios moved 64bit= pci window > > to end of address space by using advertised physical bits[1]. > > Drat. Do you know if these CPUs are going to be productized? We'll stil= l need > something in KVM either way, but whether or not the problems are more or = less > limited to funky software setups might influence how we address this. Wait, we do have an API for guest physical address size. It's KVM_GET_SUPPORTED_CPUID2: the # of bits is in leaf 0x80000008, bits 0:7 of EAX. In fact that leaf is what firmware uses to place the BARs. So it just needs to be adjusted for VMX in __do_cpuid_func, and looked up in selftests. Paolo