[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: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 6 Oct 2022 10:58:43 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=+g9Z81TrUgStBViTUU7+fdK5QF94vDa5G8ADkRzwww0=; b=AhUZyi1zOGC7Llu0uH+3Poz+tbEhAjpK/+vwLv7soqEJAZVYaawnkdVTcsWernN55ig/4gSmxfq0iO1DL/lDttI9ipY9niedCCXqIChbp5YQjjZmFShzeDbnDLA6aNlRCpZk0jrANHzID3WNsdaguRvf1qG/qc6rCKv1Nh4uOQEp2bJnPvFVfJiok6wNa2GRUdYwYgK8mC9jEW65cu+t5ExSsm10KXa47sUnpnyv5iCm2SSeaW7L8kQTr8tU5hbI7SJneYBlNINrIE04na8ZzvtXPISScyAq8NUUONbC51/1whQWzR04M4BmlJ+if9ENpvgA7EUKTgprttSs+409Sg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WBhTYfzdGLKL9kdBx6PRRrEBQTzxwkRgNb3jUFI9e2hA6xeGoSSObBEVGxfvD05g7YSh2UsNlTkePIqHddn51q/9JeBTqB4P7agA1Mg8q9xY0bSUdGhjhyj7D2/0C3kTD0uXr3qNP7Oqf/MAir29Ky5u7XeCAyvnGnVLDXrfwetMPsmLcpBOekMxXOhTh2FX6wrSKjqvOpv9jeT5JOFxcOmkRQ4dF6oIOAnvKVQmXcKhMQZKbrjLGnhJ68YAPfeFZ5h/jonssdYAF5giTmtwfqi4Bg335WSq+rpc6qdepb64bp73unGeYPbrcoI+u/dnetUCZCkMBqYn46GEXHWF6w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.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 08:58:55 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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.

>> can be left alone.
>>
>> Fixes: bf6501a62e80 ("x86-64: EFI boot code")
>> Fixes: facac0af87ef ("x86-64: EFI runtime code")
>> Fixes: 6d70ea10d49f ("Add ARM EFI boot support")
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
>> Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx> # Arm
>> Tested-By: Luca Fancellu <luca.fancellu@xxxxxxx> # Arm
>> Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx> #arm
> 
> Acked-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

Thanks.

Jan



 


Rackspace

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