[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2][4.17] EFI: don't convert memory marked for runtime use to ordinary RAM


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Thu, 6 Oct 2022 11:51:10 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TqMqzPuCSglOGtU5MOkOsCLR9mksTpAyA5QPdJyClHs=; b=C5Toj/0HdL3fKMWJlW7W5sBrJCgU9KJSnADb9KuicBbGlTCaKLbNHqvpAh63lf3bC+5S+DjOgrW4B8PgBsQMx6hPwUwt2mYLXgX9+YAiZklBu45piAzrZNDgxZNwV6DHHxhzkiEctFYbwM3GiXGEpBuRK6BocUPJeF5Sf+hQdk7LRRPvFrmNw8c0gX2fBU0iAvI1urirrTdswpQqi0js9voyGTdQ1FNDHXIZpKzjVOKD5qo1q7jSBLIG5DnKEWFIvfX4i8nlDN6IL9Pu+zH1PZi3qolUO4X/s+OPwca0SXllzfTtMvq/Tb4t7XQ6jP3hd9E03jICbDOHocWpdKf6kA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=euSDPsdf/eRCb8vW4KtcMnt6pFEyEGBzrtym93wno6e/MiZsjSmL8nybtFl16MH7pXi+30ud2OtGzScFEuzBCa9aPLBPOmWIgIuDS56D6TyYKXnxSxmnmzpraE9ELMTQDu8CsJzjlbPNCVMnvMCqR7a24tr660lMbrDR3SUro1xDnhUnWx31UpY7bDNAOSN3YyO6aG1dnQTIlWc2DuQKSjqCjQps6KzeGcAQJajM+hF2KXpQnvrtrV7Wx+n+OrJNHx7IDOMSR6XUbkbSzYwu/wPTSxSG7ZtUQu0eGkt0e+UA/z3YnzGk0hOJpNf18pikM45x/0g2hZziJ8ymFQG+Gg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Henry Wang <Henry.Wang@xxxxxxx>
  • Delivery-date: Thu, 06 Oct 2022 09:51:28 +0000
  • Ironport-data: A9a23:8ZGI4ap1JKpo1IEp4bNNUbiGnEleBmKNZBIvgKrLsJaIsI4StFCzt garIBmBPfbZa2X8KI8nYYqxoRlXu8TXx9FnHQRvrysyFy4X8JuZCYyVIHmrMnLJJKUvbq7FA +Y2MYCccZ9uHhcwgj/3b9ANeFEljfngqoLUUbKCYGYpLeNdYH9JoQp5nOIkiZJfj9G8Agec0 fv/uMSaM1K+s9JOGjt8B5mr9VU+4ZwehBtC5gZkPKgT4geH/5UoJMl3yZ+ZfiOQrrZ8RoZWd 86bpJml82XQ+QsaC9/Nut4XpWVTH9Y+lSDX4pZnc/DKbipq/0Te4Y5iXBYoUm9Fii3hojxE4 I4lWapc6+seFvakdOw1C3G0GszlVEFM0OevzXOX6aR/w6BaGpdFLjoH4EweZOUlFuhL7W5m1 tMnBAsDdwm6rbi6zbiHbutIvdUFFZy+VG8fkikIITDxK98DGMmGb4CUoNhS0XE3m9xEGuvYa 4wBcz1zYR/cYhpJfFAKFJY5m+TujX76G9FagAvN+exrvC6Ok0oojuiF3Nn9I7RmQe1PmU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Jjs+og44+msZdgh0IYyop LcS1lV3FRCNH4GMff+nKGjzyq9A1lUBV/Wu4NjDtlCy/HBrYPQQGy+oAtEqbrknx0daverKc pbdqgmR8MLFlGeabqh7zeOJaW6FkNuIfH9muxLL25m8fi7XbHCh6j8TMv5AobLPHINZl7fa0 FzLwQbYv8wo3yWZg==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Thu, Oct 06, 2022 at 10:58:43AM +0200, Jan Beulich wrote:
> On 06.10.2022 10:53, Roger Pau Monné wrote:
> > On Thu, Oct 06, 2022 at 10:40:56AM +0200, Jan Beulich wrote:
> >> efi_init_memory() in both relevant places is treating EFI_MEMORY_RUNTIME
> >> higher priority than the type of the range. To avoid accessing memory at
> >> runtime which was re-used for other purposes, make
> >> efi_arch_process_memory_map() follow suit. While on x86 in theory the
> >> same would apply to EfiACPIReclaimMemory, we don't actually "reclaim"
> >> E820_ACPI memory there (and it would be a bug if the Dom0 kernel tried
> >> to do so, bypassing Xen's memory management), hence that type's handling
> > 
> > Strictly speaking I don't think dom0 needs to bypass Xen's memory
> > management, just overwriting the page would be bad enough for runtime
> > services to not work correctly I would think.
> 
> Then how about:
> 
> "While on x86 in theory the same would apply to EfiACPIReclaimMemory, we don't
>  actually "reclaim" or clobber E820_ACPI memory there (and it would be a bug 
> if
>  the Dom0 kernel tried to reclaim the range, bypassing Xen's memory 
> management,
>  plus it would be at least bogus if it clobbered that space), hence that 
> type's
>  handling can be left alone."
> 
> I didn't think the clobbering aspect needed pointing out, as the same applies
> to all other memory which Dom0 is able to access beyond its actual allocation.

I think it makes it clear that just clobbering it from dom0 could
cause issues to runtime services.  I guess it can be extrapolated that
clobbering is also bad if reclaiming is.

Thanks, Roger.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.