[PATCH v3 0/3] nvdimm: read-only file support

Stefan Hajnoczi posted 3 patches 3 years, 3 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210104171320.575838-1-stefanha@redhat.com
docs/nvdimm.txt           | 24 +++++++++++++++++-------
include/exec/memory.h     |  2 ++
include/exec/ram_addr.h   |  5 +++--
include/qemu/mmap-alloc.h |  2 ++
backends/hostmem-file.c   | 28 +++++++++++++++++++++++++++-
hw/mem/nvdimm.c           |  9 +++++++++
softmmu/memory.c          |  7 +++++--
softmmu/physmem.c         | 18 +++++++++++-------
util/mmap-alloc.c         | 10 ++++++----
util/oslib-posix.c        |  2 +-
qemu-options.hx           |  5 ++++-
11 files changed, 87 insertions(+), 25 deletions(-)
[PATCH v3 0/3] nvdimm: read-only file support
Posted by Stefan Hajnoczi 3 years, 3 months ago
v3:
 * Produce an error when -device nvdimm,unarmed=off is used with -object
   memory-backend-file,readonly=on instead of silently switching on
   unarmed. [Igor]
 * Use Object *obj instead of Object *o [Igor]
 * Do not dereference MEMORY_BACKEND_FILE(o)->readonly directly, use a
   local variable to hold the HostMemoryBackendFile pointer. [Igor]
v2:
 * s/the the/the/ in documentation [Philippe]
 * Assign nvdimm->unarmed earlier [Philippe]

There is currently no way to back an NVDIMM with a read-only file so it can be
safely shared between untrusted guests.

Introduce an -object memory-backend-file,readonly=on|off option.

Julio Montes sent an earlier patch here:
https://patchew.org/QEMU/20190708211936.8037-1-julio.montes@intel.com/

Eric Ernst requested this feature again for Kata Containers so I gave it a try.

Stefan Hajnoczi (3):
  memory: add readonly support to memory_region_init_ram_from_file()
  hostmem-file: add readonly=on|off option
  nvdimm: check -object memory-backend-file,readonly=on option

 docs/nvdimm.txt           | 24 +++++++++++++++++-------
 include/exec/memory.h     |  2 ++
 include/exec/ram_addr.h   |  5 +++--
 include/qemu/mmap-alloc.h |  2 ++
 backends/hostmem-file.c   | 28 +++++++++++++++++++++++++++-
 hw/mem/nvdimm.c           |  9 +++++++++
 softmmu/memory.c          |  7 +++++--
 softmmu/physmem.c         | 18 +++++++++++-------
 util/mmap-alloc.c         | 10 ++++++----
 util/oslib-posix.c        |  2 +-
 qemu-options.hx           |  5 ++++-
 11 files changed, 87 insertions(+), 25 deletions(-)

-- 
2.29.2

Re: [PATCH v3 0/3] nvdimm: read-only file support
Posted by Eduardo Habkost 3 years, 3 months ago
Is anybody already going to merge this?  If not, I can merge it.

On Mon, Jan 04, 2021 at 05:13:17PM +0000, Stefan Hajnoczi wrote:
> v3:
>  * Produce an error when -device nvdimm,unarmed=off is used with -object
>    memory-backend-file,readonly=on instead of silently switching on
>    unarmed. [Igor]
>  * Use Object *obj instead of Object *o [Igor]
>  * Do not dereference MEMORY_BACKEND_FILE(o)->readonly directly, use a
>    local variable to hold the HostMemoryBackendFile pointer. [Igor]
> v2:
>  * s/the the/the/ in documentation [Philippe]
>  * Assign nvdimm->unarmed earlier [Philippe]
> 
> There is currently no way to back an NVDIMM with a read-only file so it can be
> safely shared between untrusted guests.
> 
> Introduce an -object memory-backend-file,readonly=on|off option.
> 
> Julio Montes sent an earlier patch here:
> https://patchew.org/QEMU/20190708211936.8037-1-julio.montes@intel.com/
> 
> Eric Ernst requested this feature again for Kata Containers so I gave it a try.
> 
> Stefan Hajnoczi (3):
>   memory: add readonly support to memory_region_init_ram_from_file()
>   hostmem-file: add readonly=on|off option
>   nvdimm: check -object memory-backend-file,readonly=on option
> 
>  docs/nvdimm.txt           | 24 +++++++++++++++++-------
>  include/exec/memory.h     |  2 ++
>  include/exec/ram_addr.h   |  5 +++--
>  include/qemu/mmap-alloc.h |  2 ++
>  backends/hostmem-file.c   | 28 +++++++++++++++++++++++++++-
>  hw/mem/nvdimm.c           |  9 +++++++++
>  softmmu/memory.c          |  7 +++++--
>  softmmu/physmem.c         | 18 +++++++++++-------
>  util/mmap-alloc.c         | 10 ++++++----
>  util/oslib-posix.c        |  2 +-
>  qemu-options.hx           |  5 ++++-
>  11 files changed, 87 insertions(+), 25 deletions(-)
> 
> -- 
> 2.29.2
> 

-- 
Eduardo


Re: [PATCH v3 0/3] nvdimm: read-only file support
Posted by Stefan Hajnoczi 3 years, 3 months ago
On Mon, Jan 04, 2021 at 04:02:26PM -0500, Eduardo Habkost wrote:
> Is anybody already going to merge this?  If not, I can merge it.

Great, thank you for merging it, Eduardo!

Stefan
Re: [PATCH v3 0/3] nvdimm: read-only file support
Posted by Eduardo Habkost 3 years, 3 months ago
On Thu, Jan 14, 2021 at 02:05:06PM +0000, Stefan Hajnoczi wrote:
> On Mon, Jan 04, 2021 at 04:02:26PM -0500, Eduardo Habkost wrote:
> > Is anybody already going to merge this?  If not, I can merge it.
> 
> Great, thank you for merging it, Eduardo!

I had just queued the patches, but I will be able to send a pull
request only next Monday.  Sorry for the delay!

-- 
Eduardo