public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Min Xu" <min.m.xu@intel.com>
To: "Johnson, Brian" <brian.johnson@hpe.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>,
	"kraxel@redhat.com" <kraxel@redhat.com>,
	"West, Catharine" <catharine.west@intel.com>
Cc: "Ni, Ray" <ray.ni@intel.com>,
	"Wu, MingliangX" <mingliangx.wu@intel.com>,
	"Yao, Jiewen" <jiewen.yao@intel.com>,
	"Xue, Shengfeng" <xueshengfeng@byosoft.com.cn>,
	"Dong, Eric" <eric.dong@intel.com>,
	"Kumar, Rahul R" <rahul.r.kumar@intel.com>,
	"De, Debkumar" <debkumar.de@intel.com>
Subject: Re: [edk2-devel] [PATCH V1 1/1] UefiCpuPkg/ResetVector: Cache Disable should not be set by default in CR0
Date: Tue, 23 Jan 2024 05:01:54 +0000	[thread overview]
Message-ID: <PH0PR11MB50649ADBBE14F3EF7536CF5EC5742@PH0PR11MB5064.namprd11.prod.outlook.com> (raw)
In-Reply-To: <3505f62e-cc54-490e-983f-7b4312e41509@hpe.com>

Thanks much Johnson! We will investigate it based on your comments.

> -----Original Message-----
> From: Brian J. Johnson <brian.johnson@hpe.com>
> Sent: Tuesday, January 23, 2024 3:12 AM
> To: devel@edk2.groups.io; kraxel@redhat.com; West, Catharine
> <catharine.west@intel.com>
> Cc: Xu, Min M <min.m.xu@intel.com>; Ni, Ray <ray.ni@intel.com>; Wu,
> MingliangX <mingliangx.wu@intel.com>; Yao, Jiewen
> <jiewen.yao@intel.com>; Xue, Shengfeng <xueshengfeng@byosoft.com.cn>;
> Dong, Eric <eric.dong@intel.com>; Kumar, Rahul R
> <rahul.r.kumar@intel.com>; De, Debkumar <debkumar.de@intel.com>
> Subject: Re: [edk2-devel] [PATCH V1 1/1] UefiCpuPkg/ResetVector: Cache
> Disable should not be set by default in CR0
> 
> On 1/18/24 09:46, Gerd Hoffmann wrote:
> > On Wed, Jan 10, 2024 at 04:43:47PM +0000, West, Catharine wrote:
> >> Disabling cache by default results in violation of BTG protections (if BTG
> enabled).
> >>
> >> BIOS cannot assume that cache is disabled before it executes as ACM may
> be required to enable NEM.
> >>
> >> Whatever solution needs to be done here cannot evict ACM-enabled
> NEM.
> >
> > Well, it's OVMF in a virtual machine.  No boot guard involved.
> > So we could probably go for a OVMF-specific patch here.
> >
> > But I'd prefer to figure what exactly is happening here before going
> > down that route.  An extreme slowdown just because we flip that bit
> > doesn't make sense to me.
> >
> >> Why is boot time increasing?
> >
> > Not clear.  It seems to be the lzma uncompress of the firmware volume
> > in rom / pflash which is very slow.  Also it is apparently only
> > triggered in case pci device assignment is used.
> 
> I've seen extreme slowness on physical platforms when we've mixed up the
> MTRRs or page tables, causing code to be mapped uncached.
> 
> Lzma uncompress of ROM could be pretty slow as well, if the ROM is being
> read uncached.  Lzma probably reads the data a byte at a time, which is the
> worst case for uncached accesses.  Since this is a VM, it's not actually
> uncached at the hardware level, but I don't know how QEMU/KVM handles
> uncached guest mappings.... It may be doing a VMEXIT for every byte.
> 
> Anyway, I suggest double-checking your page tables and MTRRs.
> --
> Brian J. Johnson
> Enterprise X86 Lab
> Hewlett Packard Enterprise


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114173): https://edk2.groups.io/g/devel/message/114173
Mute This Topic: https://groups.io/mt/100367559/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  reply	other threads:[~2024-01-23  5:01 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-26  9:47 [edk2-devel] [PATCH V1 1/1] UefiCpuPkg/ResetVector: Cache Disable should not be set by default in CR0 xueshengfeng via groups.io
2023-07-26  9:55 ` Ni, Ray
     [not found] ` <177562550EF0534C.27380@groups.io>
2023-08-03  8:14   ` Ni, Ray
2024-01-10  7:51     ` Min Xu
2024-01-10 16:43       ` West, Catharine
2024-01-18 15:46         ` Gerd Hoffmann
2024-01-22 19:11           ` Brian J. Johnson
2024-01-23  5:01             ` Min Xu [this message]
2024-01-23 10:52             ` Gerd Hoffmann
2024-01-23 14:13               ` Laszlo Ersek
2024-01-23 16:11                 ` Gerd Hoffmann
2024-01-24  3:06                   ` Min Xu
2024-01-24 12:49                   ` Laszlo Ersek
2024-01-24 13:26                     ` Gerd Hoffmann
2024-01-24 14:45                       ` Laszlo Ersek
2024-01-24 17:11                         ` Gerd Hoffmann

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-list 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=PH0PR11MB50649ADBBE14F3EF7536CF5EC5742@PH0PR11MB5064.namprd11.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox