From: David Gibson <david@gibson.dropbear.id.au>
To: benh@kernel.crashing.org, paulus@samba.org
Cc: lvivier@redhat.com, thuth@redhat.com, agraf@suse.de,
qemu-devel@nongnu.org, qemu-ppc@nongnu.org,
bharata@linux.vnet.ibm.com,
David Gibson <david@gibson.dropbear.id.au>
Subject: [Qemu-devel] [RFC 1/3] pseries: Stub hypercalls for HPT resizing
Date: Mon, 18 Jan 2016 16:44:39 +1100 [thread overview]
Message-ID: <1453095881-16704-2-git-send-email-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <1453095881-16704-1-git-send-email-david@gibson.dropbear.id.au>
This introduces stub implementations of the H_RESIZE_HPT_PREPARE and
H_RESIZE_HPT_COMMIT hypercalls which we hope to add in a PAPR extension to
allow run time resizing of a guest's hash page table.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
hw/ppc/spapr_hcall.c | 29 +++++++++++++++++++++++++++++
include/hw/ppc/spapr.h | 4 +++-
trace-events | 2 ++
3 files changed, 34 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
index 1a1bea8..01c034c 100644
--- a/hw/ppc/spapr_hcall.c
+++ b/hw/ppc/spapr_hcall.c
@@ -316,6 +316,30 @@ static target_ulong h_read(PowerPCCPU *cpu, sPAPRMachineState *spapr,
return H_SUCCESS;
}
+static target_ulong h_resize_hpt_prepare(PowerPCCPU *cpu,
+ sPAPRMachineState *spapr,
+ target_ulong opcode,
+ target_ulong *args)
+{
+ target_ulong flags = args[0];
+ target_ulong shift = args[1];
+
+ trace_spapr_h_resize_hpt_prepare(flags, shift);
+ return H_HARDWARE;
+}
+
+static target_ulong h_resize_hpt_commit(PowerPCCPU *cpu,
+ sPAPRMachineState *spapr,
+ target_ulong opcode,
+ target_ulong *args)
+{
+ target_ulong flags = args[0];
+ target_ulong shift = args[1];
+
+ trace_spapr_h_resize_hpt_commit(flags, shift);
+ return H_HARDWARE;
+}
+
static target_ulong h_set_dabr(PowerPCCPU *cpu, sPAPRMachineState *spapr,
target_ulong opcode, target_ulong *args)
{
@@ -974,6 +998,11 @@ static void hypercall_register_types(void)
/* hcall-bulk */
spapr_register_hypercall(H_BULK_REMOVE, h_bulk_remove);
+ /* hcall-hpt-resize */
+ spapr_register_hypercall(KVMPPC_H_RESIZE_HPT_PREPARE,
+ h_resize_hpt_prepare);
+ spapr_register_hypercall(KVMPPC_H_RESIZE_HPT_COMMIT, h_resize_hpt_commit);
+
/* hcall-dabr */
spapr_register_hypercall(H_SET_DABR, h_set_dabr);
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index 53af76a..028afc9 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -352,7 +352,9 @@ struct sPAPRMachineState {
#define KVMPPC_H_LOGICAL_MEMOP (KVMPPC_HCALL_BASE + 0x1)
/* Client Architecture support */
#define KVMPPC_H_CAS (KVMPPC_HCALL_BASE + 0x2)
-#define KVMPPC_HCALL_MAX KVMPPC_H_CAS
+#define KVMPPC_H_RESIZE_HPT_PREPARE (KVMPPC_HCALL_BASE + 0x3)
+#define KVMPPC_H_RESIZE_HPT_COMMIT (KVMPPC_HCALL_BASE + 0x4)
+#define KVMPPC_HCALL_MAX KVMPPC_H_RESIZE_HPT_COMMIT
typedef struct sPAPRDeviceTreeUpdateHeader {
uint32_t version_id;
diff --git a/trace-events b/trace-events
index 934a7b6..f0d6e49 100644
--- a/trace-events
+++ b/trace-events
@@ -1403,6 +1403,8 @@ spapr_cas_continue(unsigned long n) "Copy changes to the guest: %ld bytes"
# hw/ppc/spapr_hcall.c
spapr_cas_pvr_try(uint32_t pvr) "%x"
spapr_cas_pvr(uint32_t cur_pvr, bool cpu_match, uint32_t new_pvr, uint64_t pcr) "current=%x, cpu_match=%u, new=%x, compat flags=%"PRIx64
+spapr_h_resize_hpt_prepare(uint64_t flags, uint64_t shift) "flags=0x%"PRIx64", shift=%"PRIu64
+spapr_h_resize_hpt_commit(uint64_t flags, uint64_t shift) "flags=0x%"PRIx64", shift=%"PRIu64
# hw/ppc/spapr_iommu.c
spapr_iommu_put(uint64_t liobn, uint64_t ioba, uint64_t tce, uint64_t ret) "liobn=%"PRIx64" ioba=0x%"PRIx64" tce=0x%"PRIx64" ret=%"PRId64
--
2.5.0
next prev parent reply other threads:[~2016-01-18 5:43 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-18 5:44 [Qemu-devel] [RFC 0/3] Draft implementation of HPT resizing (qemu side) David Gibson
2016-01-18 5:44 ` David Gibson [this message]
2016-01-18 5:44 ` [Qemu-devel] [RFC 2/3] pseries: Implement HPT resizing David Gibson
2016-01-18 5:44 ` [Qemu-devel] [RFC 3/3] pseries: Advertise HPT resize capability David Gibson
2016-01-18 5:45 ` [Qemu-devel] [RFC 0/3] Draft implementation of HPT resizing (qemu side) David Gibson
2016-01-19 7:48 ` Bharata B Rao
2016-01-19 11:02 ` David Gibson
2016-01-28 21:04 ` Alexander Graf
2016-01-28 22:09 ` Paul Mackerras
2016-01-29 2:47 ` David Gibson
2016-01-29 6:18 ` Alexander Graf
2016-01-29 23:11 ` David Gibson
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=1453095881-16704-2-git-send-email-david@gibson.dropbear.id.au \
--to=david@gibson.dropbear.id.au \
--cc=agraf@suse.de \
--cc=benh@kernel.crashing.org \
--cc=bharata@linux.vnet.ibm.com \
--cc=lvivier@redhat.com \
--cc=paulus@samba.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=thuth@redhat.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).