qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] nvdimm: read-only file support
@ 2021-01-04 17:13 Stefan Hajnoczi
  2021-01-04 17:13 ` [PATCH v3 1/3] memory: add readonly support to memory_region_init_ram_from_file() Stefan Hajnoczi
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Stefan Hajnoczi @ 2021-01-04 17:13 UTC (permalink / raw)
  To: qemu-devel
  Cc: Xiao Guangrong, Michael S. Tsirkin, Julio Montes, Eduardo Habkost,
	eric.g.ernst, Stefan Hajnoczi, Igor Mammedov, Paolo Bonzini,
	Richard Henderson

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-01-21 20:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-04 17:13 [PATCH v3 0/3] nvdimm: read-only file support Stefan Hajnoczi
2021-01-04 17:13 ` [PATCH v3 1/3] memory: add readonly support to memory_region_init_ram_from_file() Stefan Hajnoczi
2021-01-04 17:13 ` [PATCH v3 2/3] hostmem-file: add readonly=on|off option Stefan Hajnoczi
2021-01-04 17:13 ` [PATCH v3 3/3] nvdimm: check -object memory-backend-file, readonly=on option Stefan Hajnoczi
2021-01-04 21:02 ` [PATCH v3 0/3] nvdimm: read-only file support Eduardo Habkost
2021-01-14 14:05   ` Stefan Hajnoczi
2021-01-21 20:41     ` Eduardo Habkost

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).