All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: David Matlack <dmatlack@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Fuad Tabba <tabba@google.com>,  Peter Gonda <pgonda@google.com>,
	Ackerley Tng <ackerleytng@google.com>,
	 Chao Peng <chao.p.peng@linux.intel.com>,
	Vishal Annapurve <vannapurve@google.com>,
	 Michael Roth <michael.roth@amd.com>,
	Andrew Jones <ajones@ventanamicro.com>,
	kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: selftests: Create memslot 0 at GPA 0x100000000 on x86_64
Date: Thu, 7 Mar 2024 14:37:09 -0800	[thread overview]
Message-ID: <ZepBlYLPSuhISTTc@google.com> (raw)
In-Reply-To: <20240307194255.1367442-1-dmatlack@google.com>

On Thu, Mar 07, 2024, David Matlack wrote:
> Create memslot 0 at 0x100000000 (4GiB) to avoid it overlapping with
> KVM's private memslot for the APIC-access page.

This is going to cause other problems, e.g. from max_guest_memory_test.c

	/*
	 * Skip the first 4gb and slot0.  slot0 maps <1gb and is used to back
	 * the guest's code, stack, and page tables.  Because selftests creates
	 * an IRQCHIP, a.k.a. a local APIC, KVM creates an internal memslot
	 * just below the 4gb boundary.  This test could create memory at
	 * 1gb-3gb,but it's simpler to skip straight to 4gb.
	 */
	const uint64_t start_gpa = SZ_4G;

Trying to move away from starting at '0' is going to be problematic/annoying,
e.g. using low memory allows tests to safely assume 4GiB+ is always available.
And I'd prefer not to make the infrastucture all twisty and weird for all tests
just because memstress tests want to play with huge amounts of memory.

Any chance we can solve this by using huge pages in the guest, and adjusting the
gorilla math in vm_nr_pages_required() accordingly?  There's really no reason to
use 4KiB pages for a VM with 256GiB of memory.  That'd also be more represantitive
of real world workloads (at least, I hope real world workloads are using 2MiB or
1GiB pages in this case).

  reply	other threads:[~2024-03-07 22:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-07 19:42 [PATCH] KVM: selftests: Create memslot 0 at GPA 0x100000000 on x86_64 David Matlack
2024-03-07 22:37 ` Sean Christopherson [this message]
2024-03-07 23:27   ` David Matlack
2024-03-07 23:53     ` David Matlack
2024-03-13 14:31       ` Sean Christopherson
2024-03-14 21:11         ` David Matlack
2024-03-14 23:14           ` Sean Christopherson
2024-03-15 16:16             ` David Matlack
2024-03-15 17:25               ` Sean Christopherson
2024-04-08 13:47           ` Nico Boehr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZepBlYLPSuhISTTc@google.com \
    --to=seanjc@google.com \
    --cc=ackerleytng@google.com \
    --cc=ajones@ventanamicro.com \
    --cc=chao.p.peng@linux.intel.com \
    --cc=dmatlack@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=michael.roth@amd.com \
    --cc=pbonzini@redhat.com \
    --cc=pgonda@google.com \
    --cc=tabba@google.com \
    --cc=vannapurve@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.