From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) by mx.groups.io with SMTP id smtpd.web10.2391.1684365397002997371 for ; Wed, 17 May 2023 16:16:37 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@gmail.com header.s=20221208 header.b=QHFA0pV/; spf=pass (domain: gmail.com, ip: 209.85.218.43, mailfrom: pedro.falcato@gmail.com) Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-96f0678de80so230398966b.3 for ; Wed, 17 May 2023 16:16:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684365394; x=1686957394; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ClSorx640RxqsFXJM6K0ZaNk5yA6xCtquCMa6ekIwf4=; b=QHFA0pV/ShGVNCqQL81iEkcGrV3ASPV0HpIpGA6kNhQkdSzKWt21yMBY4FDPfC5sz7 zW14+2/wFnUH11Yuq2MzLr7aKCpF13ISFte6QPZG0PaomUpmBFfNuLhrjOLCFaKx29Yv dSzcPonKoz+f9WpR4oWyk/7oBm3KgjW+EcKq5cnrpFfbmFvsj6MNFkvuzf2k4Jdnsv6/ ZYAh/c2DZpcprSKGF3OCcZrRamJA+6C4tkyAQHHN2jUs6cIntqz2fTsQgh2gI3dJSrEW SMxtTTkDLPI3/U4BZBFLXctXEYxLyY5bGbBfvUypxTTfATHi64JQSi7Z3xiBNWqCYYHc b1Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684365394; x=1686957394; 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=ClSorx640RxqsFXJM6K0ZaNk5yA6xCtquCMa6ekIwf4=; b=RkIxlK/F/bZY37ufN/NcFoPaUsqIcZkI/vG1JIvT91P0OafmIHcFkNUsHcxWpXTvLu I8vWHvUve3cb4J3paHJDEjvdMdoVFeBNNAl6+6IM4hEdCpwDd8PoBcUVMI1x9/M0NkpP qAM3I+NFYJPozJ/lhYFixx93/G0L+5km6j/XS4b2sVJ4LEFpAP19l13aaez7ZcNJRW8B nfP5EvlL989b11uqVi8ASZaqyvjMlwgXmK1zoazvu5xEkX1tZneL9+WLsfJof7VvUK0x AJwNxUUe1A/kgPOH4Lz8t8EvoXn3T19aVTPpd+lmKlOhv8hewbs3Aih821aEZXDowsW3 I39Q== X-Gm-Message-State: AC+VfDwDlYTWmyGE1dFHhJUvW22DArbuX8e+Wnz9Qv7y9T0NVgidgFvJ 1znAIVIh6F5AGqX0kQ3u4Ky+DcMpZaGGMnfXPHl8Oj5IZ4U= X-Google-Smtp-Source: ACHHUZ5Lp4jIaAEZaE3Zd0M4bU96MaC6K61tLk9QDcyG1LpXNHmqSfLP5a8mh8xUayKyZb+ZtLgQhl+QNv0OI3xsT7E= X-Received: by 2002:a17:907:843:b0:94f:5847:8ac with SMTP id ww3-20020a170907084300b0094f584708acmr40608826ejb.51.1684365394278; Wed, 17 May 2023 16:16:34 -0700 (PDT) MIME-Version: 1.0 References: <20230517102449.1334621-1-kraxel@redhat.com> In-Reply-To: <20230517102449.1334621-1-kraxel@redhat.com> From: "Pedro Falcato" Date: Thu, 18 May 2023 00:16:21 +0100 Message-ID: Subject: Re: [edk2-devel] [PATCH 0/3] OvmfPkg: gigabyte page tweaks To: devel@edk2.groups.io, kraxel@redhat.com Cc: Jordan Justen , Oliver Steffen , Pawel Polawski , Ard Biesheuvel , Jiewen Yao Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, May 17, 2023 at 11:24=E2=80=AFAM Gerd Hoffmann = wrote: > > > > Gerd Hoffmann (3): > OvmfPkg/PlatformInitLib: check PcdUse1GPageTable > OvmfPkg/OvmfPkgIa32X64: enable 1G pages > OvmfPkg/MicrovmX64: enable 1G pages > > OvmfPkg/Microvm/MicrovmX64.dsc | 3 +++ > OvmfPkg/OvmfPkgIa32X64.dsc | 3 +++ > OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf | 1 + > OvmfPkg/Library/PlatformInitLib/MemDetect.c | 5 +++++ > 4 files changed, 12 insertions(+) Just a passing comment: note that this change can have possibly bad side effects on reliability/performance. I noticed this a few days ago when snooping around info mem/tlb for various kernels and firmware. The Intel SDM and AMD manuals both mention possible bad side effects for having large pages (2MB/4MB/1GB) spanning multiple MTRRs. Quoting from the AMD manual (just for a change, the Intel SDM has similar passings plus a "we hacked it up because everyone was breaking it" clause for the lower ~2MB region of physical space): "When paging is enabled, software can use large page sizes (2 Mbytes and 4 Mbytes) in addition to the more typical 4-Kbyte page size. When large page sizes are used, it is possible for multiple MTRRs to span the memory range within a single large page. Each MTRR can characterize the regions within the page with different memory types. If this occurs, the effective memory-type used by the processor within the large page is undefined." As far as I know, EDK2 (or at least my local OVMF builds) do not handle this. In theory, you should break these particular large pages down. In practice, nothing bad seems to have come up yet (AFAIK), except poor-ish/poor-er performance. So this problem is still standing (I'm meaning to take a stab at this in the near future), but using 1GB pages may worsen the situation by increasing the nasty overlaps a heck of a lot more. While I don't expect my comment to be a blocker (particularly as other OVMF platforms are already using them), I think it's probably a good idea to let you know. --=20 Pedro