From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) (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 11D4145C1C for ; Fri, 15 Mar 2024 17:25:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710523546; cv=none; b=Y5bd3eMtl8lyGzWwbRbhTokAIvwTLwuNYrabNRWUwefSNhv4TU6+cEfkT15nCg5Y9+E606By9eeICnSl580Czj1vqKFqK+PbPYh+Re0nxwjjOh+8pH9L+Vz/39YuMBlry1rq595d7GFm/zS/gLVwlnQFrU2BfthAp4m3nZ2YWzs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710523546; c=relaxed/simple; bh=eeKd4spMf+Uy0PlUDK9x/iwKFMO+wzelF5PbI7I8mVU=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=NnQO4xb9i3iLrkRnIZWgef7F1OjAi+j9pTN14mjFUpf6xKxCTt1un3UAyS9cP9ITp1VAwuxRej6Y6S9ohvZD2nBHvwjRWZMC5fesc8If4tHUl7WPKG/1rEIQCOFZpUIl4MAbGtBS2THPvT18R7JVn6o5sUKw1/hMP9LJgtvaWMw= 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=qAWJM8QR; arc=none smtp.client-ip=209.85.216.73 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="qAWJM8QR" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-29c751d57ddso1903856a91.1 for ; Fri, 15 Mar 2024 10:25:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1710523544; x=1711128344; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=m4Vnl5HwZiL6Q7VrzAb9hY7moF6rWo1bsM5QKtkdFQc=; b=qAWJM8QRFAGVl3hkmzrErZA9TYurBHlqHcI3BRF5VpMXiy4hSsG8DJCBay1ChBiniM 6AUZMeOlKc+0CLt+h5C+2rwtGbbp+zjQVhs5098V2Cg3QkdrIB5uoiFLGXg6WB0CQijt hAf4/weYd0Cuv6lkuay4YL2vRcXRQHhgL5PeNNwHhQmlKblpL2UcqkU2dgNEm14nuvV2 zLIDhg+MA+nD2YD1JfoDZ6K3ZFSieBe2ss+EBKOVO0pK04RooHF9dWdl2+2fkzqA9hrZ LfRuuGYAdJzPh6fDPUvLj4OS6dDzIWbv7JTL9tliqnuKzmFV+2DDAL10pOXtm3dd+Djv H06w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710523544; x=1711128344; h=content-transfer-encoding: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=m4Vnl5HwZiL6Q7VrzAb9hY7moF6rWo1bsM5QKtkdFQc=; b=xLfFU+kcE56OaqY85hB27KDuQzdY6No/LjcuZosdDarauhJWRuxUIRZHngt58Hbysp Oh4Y1UsEUQxB1FhLfu/JoG76Ho00sLHNlyIj+THneXlvskLjP8mUnUTl9xL2RlJ/oWVC 9bNF5ybE+nIF7iRwjLHEdOWkh88sNLluMiCZ2fEugv24r8HXKB5s0jnFByG3iCSge1++ 2ps4KKp0ioTD0lXpD/qixkG/zyXvR7HXZ/C8RsflISSQXlm7IVScO5dqG6KnIDvshltR Z0h8BRc6DvxjlGGNmjbEqUzt+SWlOiTt3k3sbXrZgIbN1GNW/yTxflH8/eJruhexM7xM 21Cw== X-Forwarded-Encrypted: i=1; AJvYcCULs5qq44uFisgfJ3/5EV2kU2KY7dpawvuO8Dg6djBiDYpro2PM/K1jxC9U1vMEpSTXFgXjXjwvMxDevmR00JJD6/fH X-Gm-Message-State: AOJu0YyUkPr4Qvkzyu0uMific006vqflgAFeOlF8Iezx13lHW4JXzFIH rhZSj+IOzspxGBo0ENrqtCjwtMp9c5o1dEfTdpJ6QDieVOwT4Oghl5mP8AvKpDYvLMvu+kN+19I pBg== X-Google-Smtp-Source: AGHT+IGuoVEOZmu57ryf7R42ne0RICfXK9gAAm5NOxVmQTDuhjeqpmM1Ct6M33yYLk2lfD2kd9rRxNMam2g= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:90a:c582:b0:29b:f557:3ebb with SMTP id l2-20020a17090ac58200b0029bf5573ebbmr13428pjt.9.1710523544230; Fri, 15 Mar 2024 10:25:44 -0700 (PDT) Date: Fri, 15 Mar 2024 10:25:42 -0700 In-Reply-To: Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240307194255.1367442-1-dmatlack@google.com> Message-ID: Subject: Re: [PATCH] KVM: selftests: Create memslot 0 at GPA 0x100000000 on x86_64 From: Sean Christopherson To: David Matlack Cc: Paolo Bonzini , Fuad Tabba , Peter Gonda , Ackerley Tng , Chao Peng , Vishal Annapurve , Michael Roth , Andrew Jones , kvm@vger.kernel.org, nrb@linux.ibm.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Fri, Mar 15, 2024, David Matlack wrote: > On Thu, Mar 14, 2024 at 4:14=E2=80=AFPM Sean Christopherson wrote: > > > > 5. Use separate memslots for CODE, DATA, and PT by default. This= will allow > > > > for more precise sizing of the CODE and DATA slots. > > > > > > What do you mean by "[separate memslots] will allow for more precise = sizing"? > > > > I suspect there is a _lot_ of slop in the arbitrary 512 pages that are = tacked on > > by vm_nr_pages_required(). Those 2MiBs probably don't matter, I just d= on't like > > completely magical numbers. >=20 > That makes sense, we can probably tighten up those heuristics and > maybe even get rid of the magic numbers. But I wasn't following what > _separate memslots_ has to do with it? Ah, don't dwell on that too much, it was somewhat of a passing thought. My thinking was that the gorilla math for the page tables makes it hard to = determine how much of those 512 pages is actually for DATA, versus how much is actual= ly a weird recursive calculation for the page tables themselves. I.e. it's hard= to trim down @nr_pages, because it might no be easy to tell if DATA shrank too= much, or if it actually caused to PT to shrink too much, and so no one touches th= at mess.