[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230907100614.35mxxo63xwkz7ohw@box.shutemov.name>
Date: Thu, 7 Sep 2023 13:06:14 +0300
From: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
To: Adrian Hunter <adrian.hunter@...el.com>
Cc: Borislav Petkov <bp@...en8.de>,
Andrew Morton <akpm@...ux-foundation.org>,
Dave Hansen <dave.hansen@...el.com>,
Vlastimil Babka <vbabka@...e.cz>,
Mike Rapoport <rppt@...ux.ibm.com>,
Lorenzo Stoakes <lstoakes@...il.com>,
Tom Lendacky <thomas.lendacky@....com>,
Baoquan He <bhe@...hat.com>, Vivek Goyal <vgoyal@...hat.com>,
Dave Young <dyoung@...hat.com>, linux-kernel@...r.kernel.org,
linux-fsdevel@...r.kernel.org, linux-mm@...ck.org,
linux-coco@...ts.linux.dev, linux-efi@...r.kernel.org,
kexec@...ts.infradead.org
Subject: Re: [PATCH 3/3] /dev/mem: Do not map unaccepted memory
On Wed, Sep 06, 2023 at 10:39:02AM +0300, Adrian Hunter wrote:
> Support for unaccepted memory was added recently, refer commit
> dcdfdd40fa82 ("mm: Add support for unaccepted memory"), whereby
> a virtual machine may need to accept memory before it can be used.
>
> Do not map unaccepted memory because it can cause the guest to fail.
>
> For /dev/mem, this means a read of unaccepted memory will return zeros,
> a write to unaccepted memory will be ignored, but an mmap of unaccepted
> memory will return an error.
I am unsure who currently uses /dev/mem. The change to the mmap path has the
potential to cause issues as it is a new behavior. However, it appears to
be a common practice as we also fail to mmap if PAT is set on a page in
the rang. I suppose it is acceptable.
Another option is to accept the memory on mmap, but it seems excessive at
this point.
--
Kiryl Shutsemau / Kirill A. Shutemov
Powered by blists - more mailing lists