public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: PPC: refer to paravirt docs in header file
@ 2012-01-11 23:37 Scott Wood
  2012-01-11 23:39 ` Alexander Graf
  0 siblings, 1 reply; 3+ messages in thread
From: Scott Wood @ 2012-01-11 23:37 UTC (permalink / raw)
  To: agraf; +Cc: avi, kvm, kvm-ppc

Instead of keeping separate copies of struct kvm_vcpu_arch_shared (one in
the code, one in the docs) that inevitably fail to be kept in sync
(already sr[] is missing from the doc version), just point to the header
file as the source of documentation on the contents of the magic page.

Signed-off-by: Scott Wood <scottwood@freescale.com>
---
 Documentation/virtual/kvm/ppc-pv.txt |   24 ++----------------------
 arch/powerpc/include/asm/kvm_para.h  |   10 ++++++++++
 2 files changed, 12 insertions(+), 22 deletions(-)

diff --git a/Documentation/virtual/kvm/ppc-pv.txt b/Documentation/virtual/kvm/ppc-pv.txt
index 2b7ce19..6e7c370 100644
--- a/Documentation/virtual/kvm/ppc-pv.txt
+++ b/Documentation/virtual/kvm/ppc-pv.txt
@@ -81,28 +81,8 @@ additional registers to the magic page. If you add fields to the magic page,
 also define a new hypercall feature to indicate that the host can give you more
 registers. Only if the host supports the additional features, make use of them.
 
-The magic page has the following layout as described in
-arch/powerpc/include/asm/kvm_para.h:
-
-struct kvm_vcpu_arch_shared {
-	__u64 scratch1;
-	__u64 scratch2;
-	__u64 scratch3;
-	__u64 critical;		/* Guest may not get interrupts if == r1 */
-	__u64 sprg0;
-	__u64 sprg1;
-	__u64 sprg2;
-	__u64 sprg3;
-	__u64 srr0;
-	__u64 srr1;
-	__u64 dar;
-	__u64 msr;
-	__u32 dsisr;
-	__u32 int_pending;	/* Tells the guest if we have an interrupt */
-};
-
-Additions to the page must only occur at the end. Struct fields are always 32
-or 64 bit aligned, depending on them being 32 or 64 bit wide respectively.
+The magic page layout is described by struct kvm_vcpu_arch_shared
+in arch/powerpc/include/asm/kvm_para.h.
 
 Magic page features
 ===================
diff --git a/arch/powerpc/include/asm/kvm_para.h b/arch/powerpc/include/asm/kvm_para.h
index ece70fb..7b754e7 100644
--- a/arch/powerpc/include/asm/kvm_para.h
+++ b/arch/powerpc/include/asm/kvm_para.h
@@ -22,6 +22,16 @@
 
 #include <linux/types.h>
 
+/*
+ * Additions to this struct must only occur at the end, and should be
+ * accompanied by a KVM_MAGIC_FEAT flag to advertise that they are present
+ * (albeit not necessarily relevant to the current target hardware platform).
+ *
+ * Struct fields are always 32 or 64 bit aligned, depending on them being 32
+ * or 64 bit wide respectively.
+ *
+ * See Documentation/virtual/kvm/ppc-pv.txt
+ */
 struct kvm_vcpu_arch_shared {
 	__u64 scratch1;
 	__u64 scratch2;
-- 
1.7.7.rc3.4.g8d714

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

* Re: [PATCH] KVM: PPC: refer to paravirt docs in header file
  2012-01-11 23:37 [PATCH] KVM: PPC: refer to paravirt docs in header file Scott Wood
@ 2012-01-11 23:39 ` Alexander Graf
  2012-01-12  8:40   ` Avi Kivity
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Graf @ 2012-01-11 23:39 UTC (permalink / raw)
  To: Scott Wood; +Cc: avi, kvm, kvm-ppc


On 12.01.2012, at 00:37, Scott Wood wrote:

> Instead of keeping separate copies of struct kvm_vcpu_arch_shared (one in
> the code, one in the docs) that inevitably fail to be kept in sync
> (already sr[] is missing from the doc version), just point to the header
> file as the source of documentation on the contents of the magic page.
> 
> Signed-off-by: Scott Wood <scottwood@freescale.com>

Avi, please ack.


Alex

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

* Re: [PATCH] KVM: PPC: refer to paravirt docs in header file
  2012-01-11 23:39 ` Alexander Graf
@ 2012-01-12  8:40   ` Avi Kivity
  0 siblings, 0 replies; 3+ messages in thread
From: Avi Kivity @ 2012-01-12  8:40 UTC (permalink / raw)
  To: Alexander Graf; +Cc: Scott Wood, kvm, kvm-ppc

On 01/12/2012 01:39 AM, Alexander Graf wrote:
> On 12.01.2012, at 00:37, Scott Wood wrote:
>
> > Instead of keeping separate copies of struct kvm_vcpu_arch_shared (one in
> > the code, one in the docs) that inevitably fail to be kept in sync
> > (already sr[] is missing from the doc version), just point to the header
> > file as the source of documentation on the contents of the magic page.
> > 
> > Signed-off-by: Scott Wood <scottwood@freescale.com>
>
> Avi, please ack.
>


ACK

-- 
error compiling committee.c: too many arguments to function

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

end of thread, other threads:[~2012-01-12  8:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-11 23:37 [PATCH] KVM: PPC: refer to paravirt docs in header file Scott Wood
2012-01-11 23:39 ` Alexander Graf
2012-01-12  8:40   ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox