[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH][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: Tue, 4 Oct 2022 12:54:02 +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=myCsOPLLwvskPzUEyXFnb7Ryw7+J9JKMiPDJIwkI0tE=; b=QREvQib2I3DRbmKvh/U9KtXt7CVM6g69xf/HkpDEuixvcao+wdAStZYFskIBx9hl1pr8EnZ3BOFfR+bjoF39OU+TB20yXi6Gs3I86dr1jl2Ydf3oUT3W8igxIxINPJdGRXKzWB1a/Y2xtRLah37lCGKYhtXlPJ9/Seno5yB1PxOAVFNRvVMFVyhi2oehzmZbdankYNIeYlVo641ZRckCgBX9gu1X0H19MjbCRxV76JMJ3l3/FEV6UOKmYhFwFS5bhnqrLMH+kpwpD2991pemonTAi7Yv1UjezjlUNe12uHPC5n7g6tVjXYdk7pjZd3zLxvPwzDYEZ6jW5h04RLq0Kw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VqN/Q2c/vvH1tVF8xg/81UhuK3NX1RkyCmfRam19UDANLciyhcadT7MoPwuAcS8RUfsa4aTVzBN7gMtSE4b5+Trwtwn1hq4yUrjMIyXprNoNnuqrS5hdwd2kI+dIGgMXzE+FwUG+qumj1V7BkoRa30YBHmy1v5KqffBEHHWbWHC35gokJe3EeGzBXipgodhz0xibgnkeqe++YKMYAS2Y6AklMZA/mJJlIoAdumQwqyPWeMqtZhRu1bcFlUqaqGpQLfmHzv5uxDKANbZrbCf34L6M90A7+6bkb0edkoVgFH9Dyl3sSvo/Qb268KVlOOxDoIrn69t7gLwOKmDr0JeZvw==
- 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: Tue, 04 Oct 2022 10:54:26 +0000
- Ironport-data: A9a23:PwISlqB8aP4CghVW/6Piw5YqxClBgxIJ4kV8jS/XYbTApGwhhTYEn zYZXmqBPqvZY2X8LdFyaNngp05U7cDcz9RrQQY4rX1jcSlH+JHPbTi7wuUcHAvJd5GeExg3h yk6QoOdRCzhZiaE/n9BCpC48T8mk/ngqoPUUIbsIjp2SRJvVBAvgBdin/9RqoNziJ2yDhjlV ena+qUzA3f4nW8vWo4ow/jb8kk25Kyu4GpwUmEWPpingnePzxH5M7pHTU2BByOQapVZGOe8W 9HCwNmRlo8O105wYj8Nuu+TnnwiGtY+DyDX4pZlc/HKbix5jj4zys4G2M80Mi+7vdkrc+dZk 72hvbToIesg0zaldO41C3G0GAkmVUFKFSOuzdFSfqV/wmWfG0YAzcmCA2lvMtMkxu10XlhX/ NM5DxosahO+rcGplefTpulE3qzPLeHNFaZH4DRK62icCvwrB5feX6/N+NlUmi8qgdxDFurfY MxfbidzaBPHYFtEPVJ/5JAWxb/0wCWgNWAB7g7PzUY0yzG7IAhZyr/iPcCTYtWXbc5UglyZt iTN+GGR7hQyZIXHlGDZqyrEaunnhib4QIw0LbKD6e92pwC19FI4JDJMSg7uyRW+ogvkMz5FE GQW8Cczqak59GSwU8LwGRa/pRasrhMaHtZdDeA+wAWM0bbPpRaUAHAeSTxMY8Bgs9U5LRQ10 neZktWvAiZg2JWXVHac+7G8vT60fy8PIgcqfjQYRAEI593ipoAbjR/VSNtnVqmvgbXdBzb0x DybqTkksL8ah8ULyqaT8EjOhnSnoZ2hZgQ4/BnNV2SpqAZwfpe4ZpeA4ELeq/1HKe6xblSHp mlCpMGY48gHF5TLnyuIKNjhB5ms7veBdTfa2FhmGsF+8yz3oyL5O4dN/Dt5OUFldN4efiPka 1PSvgUX44JPOHytbul8ZIfZ59kW8JUM3O/NDpj8BueiqLArHONb1EmCvXKt4l0=
- Ironport-hdrordr: A9a23:ly0GUqmShBB+3on9RBdqlx0sM6DpDfO3imdD5ihNYBxZY6Wkfp +V8cjzhCWftN9OYhodcLC7V5Voj0mskKKdxbNhRYtKOzOWw1dATbsSlLcKpgeNJ8SQzI5gPM tbAstD4ZjLfCJHZKXBkXaF+rQbsb66GcmT7I+xrkuFDzsaDZ2Ihz0JdjpzeXcGIDWua6BJdq Z1saF81kedkDksH7KGL0hAe9KGi8zAlZrgbxJDLxk76DOWhTftzLLhCRCX0joXTjsKmN4ZgC D4uj28wp/mn+Cwyxfa2WOWx5NKmOH5wt8GIMCXkMAaJhjllw7tToV8XL+puiwzvYiUmR8Xue iJhy1lE9V46nvXcG3wiRzx2zP42DJr0HPmwU/wuwqXneXJABYBT+ZRj4NQdRXUr2A6ustn7a 5N12WF87JKEBLphk3GlpT1fiAvsnDxjWspkOYVgXAae5AZcqVtoYsW+14QOIscHRj99JssHI BVfYzhDc5tAB2nhk3izyhSKITGZAVyIv7GeDlJhiWt6UkYoJgjpHFoh/D2nR87heAAotd/lq b5259T5cFzp/8tHNxA7dg6MLqK40z2MGbx2TGpUCPaPZBCHU7xgLjKx5hwzN2WWfUzvegPcd L6IRhliVI=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Tue, Oct 04, 2022 at 12:44:16PM +0200, Jan Beulich wrote:
> On 04.10.2022 12:38, Roger Pau Monné wrote:
> > On Tue, Oct 04, 2022 at 12:23:23PM +0200, Jan Beulich wrote:
> >> On 04.10.2022 11:33, Roger Pau Monné wrote:
> >>> On Tue, Oct 04, 2022 at 10:06:36AM +0200, Jan Beulich wrote:
> >>>> On 30.09.2022 16:28, Roger Pau Monné wrote:
> >>>>> On Fri, Sep 30, 2022 at 09:50:40AM +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 hence that type's handling can be left
> >>>>>> alone.
> >>>>>
> >>>>> What about dom0? Should it be translated to E820_RESERVED so that
> >>>>> dom0 doesn't try to use it either?
> >>>>
> >>>> I'm afraid I don't understand the questions. Not the least because I
> >>>> think "it" can't really mean "dom0" from the earlier sentence.
> >>>
> >>> Sorry, let me try again:
> >>>
> >>> The memory map provided to dom0 will contain E820_ACPI entries for
> >>> memory ranges with the EFI_MEMORY_RUNTIME attributes in the EFI memory
> >>> map. Is there a risk from dom0 reclaiming such E820_ACPI ranges,
> >>> overwriting the data needed for runtime services?
> >>
> >> How would Dom0 go about doing so? It has no control over what we hand
> >> to the page allocator - it can only free pages which were actually
> >> allocated to it. E820_ACPI and E820_RESERVED pages are assigned to
> >> DomIO - Dom0 can map and access them, but it cannot free them.
> >
> > Maybe I'm very confused, but what about dom0 overwriting the data
> > there, won't it cause issues to runtime services?
>
> If it overwrites it, of course there are going to be issues. Just like
> there are going to be problems from anything else Dom0 does wrong.
But would dom0 know it's doing something wrong?
The region is just marked as E820_ACPI from dom0 PoV, so it doesn't
know it's required by EFI runtime services, and dom0 could
legitimately overwrite the region once it considers all ACPI parsing
done from it's side.
Thanks, Roger.
|