linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chao Peng <chao.p.peng@linux.intel.com>
To: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
	qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Sean Christopherson <seanjc@google.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	x86@kernel.org, "H . Peter Anvin" <hpa@zytor.com>,
	Hugh Dickins <hughd@google.com>, Jeff Layton <jlayton@kernel.org>,
	"J . Bruce Fields" <bfields@fieldses.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Yu Zhang <yu.c.zhang@linux.intel.com>,
	Chao Peng <chao.p.peng@linux.intel.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	luto@kernel.org, john.ji@intel.com, susie.li@intel.com,
	jun.nakajima@intel.com, dave.hansen@intel.com,
	ak@linux.intel.com, david@redhat.com
Subject: [RFC PATCH 09/13] qmp: Include "guest-private" property for memory backends
Date: Thu, 11 Nov 2021 22:13:48 +0800	[thread overview]
Message-ID: <20211111141352.26311-10-chao.p.peng@linux.intel.com> (raw)
In-Reply-To: <20211111141352.26311-1-chao.p.peng@linux.intel.com>

Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
---
 hw/core/machine-hmp-cmds.c | 3 +++
 hw/core/machine-qmp-cmds.c | 1 +
 qapi/machine.json          | 3 +++
 qapi/qom.json              | 3 +++
 4 files changed, 10 insertions(+)

diff --git a/hw/core/machine-hmp-cmds.c b/hw/core/machine-hmp-cmds.c
index 76b22b00d6..6bd66c25b7 100644
--- a/hw/core/machine-hmp-cmds.c
+++ b/hw/core/machine-hmp-cmds.c
@@ -112,6 +112,9 @@ void hmp_info_memdev(Monitor *mon, const QDict *qdict)
                        m->value->prealloc ? "true" : "false");
         monitor_printf(mon, "  share: %s\n",
                        m->value->share ? "true" : "false");
+        monitor_printf(mon, "  guest private: %s\n",
+                       m->value->guest_private ? "true" : "false");
+
         if (m->value->has_reserve) {
             monitor_printf(mon, "  reserve: %s\n",
                            m->value->reserve ? "true" : "false");
diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
index 216fdfaf3a..2c1c1de73f 100644
--- a/hw/core/machine-qmp-cmds.c
+++ b/hw/core/machine-qmp-cmds.c
@@ -174,6 +174,7 @@ static int query_memdev(Object *obj, void *opaque)
         m->dump = object_property_get_bool(obj, "dump", &error_abort);
         m->prealloc = object_property_get_bool(obj, "prealloc", &error_abort);
         m->share = object_property_get_bool(obj, "share", &error_abort);
+        m->guest_private = object_property_get_bool(obj, "guest-private", &error_abort);
         m->reserve = object_property_get_bool(obj, "reserve", &err);
         if (err) {
             error_free_or_abort(&err);
diff --git a/qapi/machine.json b/qapi/machine.json
index 157712f006..f568a6a0bf 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -798,6 +798,8 @@
 #
 # @share: whether memory is private to QEMU or shared (since 6.1)
 #
+# @guest-private: whether memory is private to guest (since X.X)
+#
 # @reserve: whether swap space (or huge pages) was reserved if applicable.
 #           This corresponds to the user configuration and not the actual
 #           behavior implemented in the OS to perform the reservation.
@@ -818,6 +820,7 @@
     'dump':       'bool',
     'prealloc':   'bool',
     'share':      'bool',
+    'guest-private':      'bool',
     '*reserve':    'bool',
     'host-nodes': ['uint16'],
     'policy':     'HostMemPolicy' }}
diff --git a/qapi/qom.json b/qapi/qom.json
index a25616bc7a..93af9b106e 100644
--- a/qapi/qom.json
+++ b/qapi/qom.json
@@ -550,6 +550,8 @@
 # @share: if false, the memory is private to QEMU; if true, it is shared
 #         (default: false)
 #
+# @guest-private: if true, the memory is guest private memory (default: false)
+#
 # @reserve: if true, reserve swap space (or huge pages) if applicable
 #           (default: true) (since 6.1)
 #
@@ -580,6 +582,7 @@
             '*prealloc': 'bool',
             '*prealloc-threads': 'uint32',
             '*share': 'bool',
+            '*guest-private': 'bool',
             '*reserve': 'bool',
             'size': 'size',
             '*x-use-canonical-path-for-ramblock-id': 'bool' } }
-- 
2.17.1


  parent reply	other threads:[~2021-11-11 14:16 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-11 14:13 [RFC PATCH 0/6] KVM: mm: fd-based approach for supporting KVM guest private memory Chao Peng
2021-11-11 14:13 ` [RFC PATCH 1/6] mm: Add F_SEAL_GUEST to shmem/memfd Chao Peng
2021-11-12 19:28   ` Kirill A. Shutemov
2021-11-11 14:13 ` [RFC PATCH 2/6] kvm: x86: Introduce guest private memory address space to memslot Chao Peng
2021-11-11 14:13 ` [RFC PATCH 3/6] kvm: x86: add private_ops " Chao Peng
2021-11-11 14:13 ` [RFC PATCH 4/6] kvm: x86: implement private_ops for memfd backing store Chao Peng
2021-11-11 14:13 ` [RFC PATCH 5/6] kvm: x86: add KVM_EXIT_MEMORY_ERROR exit Chao Peng
2021-11-11 15:08   ` Mika Penttilä
2021-11-12  5:50     ` Chao Peng
2021-11-11 14:13 ` [RFC PATCH 6/6] KVM: add KVM_SPLIT_MEMORY_REGION Chao Peng
2021-11-11 14:13 ` [RFC PATCH 07/13] linux-headers: Update Chao Peng
2021-11-11 14:13 ` [RFC PATCH 08/13] hostmem: Add guest private memory to memory backend Chao Peng
2021-11-11 14:13 ` Chao Peng [this message]
2021-11-11 14:13 ` [RFC PATCH 10/13] softmmu/physmem: Add private memory address space Chao Peng
2022-01-18  9:41   ` Philippe Mathieu-Daudé
2021-11-11 14:13 ` [RFC PATCH 11/13] kvm: register private memory slots Chao Peng
2021-11-11 14:13 ` [RFC PATCH 12/13] kvm: handle private to shared memory conversion Chao Peng
2021-11-11 14:13 ` [RFC PATCH 13/13] machine: Add 'private-memory-backend' property Chao Peng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211111141352.26311-10-chao.p.peng@linux.intel.com \
    --to=chao.p.peng@linux.intel.com \
    --cc=ak@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=bfields@fieldses.org \
    --cc=bp@alien8.de \
    --cc=corbet@lwn.net \
    --cc=dave.hansen@intel.com \
    --cc=david@redhat.com \
    --cc=hpa@zytor.com \
    --cc=hughd@google.com \
    --cc=jlayton@kernel.org \
    --cc=jmattson@google.com \
    --cc=john.ji@intel.com \
    --cc=joro@8bytes.org \
    --cc=jun.nakajima@intel.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=seanjc@google.com \
    --cc=susie.li@intel.com \
    --cc=tglx@linutronix.de \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.com \
    --cc=x86@kernel.org \
    --cc=yu.c.zhang@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).