public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [3/6][PATCH] kvm: kvm structure split into common fileds and arch-dependent ones
@ 2007-12-11 13:30 Zhang, Xiantao
       [not found] ` <42DFA526FC41B1429CE7279EF83C6BDCACF90D-wq7ZOvIWXbMAbVU2wMM1CrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Zhang, Xiantao @ 2007-12-11 13:30 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

[-- Attachment #1: Type: text/plain, Size: 2984 bytes --]

From: Zhang Xiantao <xiantao.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Date: Tue, 11 Dec 2007 20:47:56 +0800
Subject: [PATCH] kvm: kvm structure split.

Using macro KVM_COMM to hold kvm common fields
as kvm_vcpu does. And, every arch defines its kvm structure
separately.
Signed-off-by: Zhang Xiantao <xiantao.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/kvm/kvm.h |   40 +++++++++++++---------------------------
 drivers/kvm/x86.h |   18 ++++++++++++++++++
 2 files changed, 31 insertions(+), 27 deletions(-)

diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index 17715b9..ebe5156 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -244,34 +244,20 @@ struct kvm_vm_stat {
 	u32 remote_tlb_flush;
 };
 
-struct kvm {
-	struct mutex lock; /* protects everything except vcpus */
-	struct mm_struct *mm; /* userspace tied to this vm */
-	int naliases;
-	struct kvm_mem_alias aliases[KVM_ALIAS_SLOTS];
-	int nmemslots;
-	struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS +
-					KVM_PRIVATE_MEM_SLOTS];
-	/*
-	 * Hash table of struct kvm_mmu_page.
-	 */
-	struct list_head active_mmu_pages;
-	unsigned int n_free_mmu_pages;
-	unsigned int n_requested_mmu_pages;
-	unsigned int n_alloc_mmu_pages;
-	struct hlist_head mmu_page_hash[KVM_NUM_MMU_PAGES];
-	struct kvm_vcpu *vcpus[KVM_MAX_VCPUS];
-	struct list_head vm_list;
-	struct file *filp;
-	struct kvm_io_bus mmio_bus;
-	struct kvm_io_bus pio_bus;
-	struct kvm_pic *vpic;
-	struct kvm_ioapic *vioapic;
+#define KVM_COMM
\
+	struct mutex lock; /* protects everything except vcpus */
\
+	struct mm_struct *mm; /* userspace tied to this vm */
\
+
\
+	int nmemslots;
\
+	struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS +
\
+					KVM_PRIVATE_MEM_SLOTS];
\
+	struct kvm_vcpu *vcpus[KVM_MAX_VCPUS];
\
+	struct list_head vm_list;
\
+	struct file *filp;
\
+	struct kvm_io_bus mmio_bus;
\
+	struct kvm_io_bus pio_bus;
\
 	int round_robin_prev_vcpu;
-	unsigned int tss_addr;
-	struct page *apic_access_page;
-	struct kvm_vm_stat stat;
-};
+struct kvm;
 
 /* The guest did something we don't support. */
 #define pr_unimpl(vcpu, fmt, ...)
\
diff --git a/drivers/kvm/x86.h b/drivers/kvm/x86.h
index d711c91..50abb2a 100644
--- a/drivers/kvm/x86.h
+++ b/drivers/kvm/x86.h
@@ -165,6 +165,24 @@ struct kvm_vcpu {
 	struct x86_emulate_ctxt emulate_ctxt;
 };
 
+struct kvm {
+	KVM_COMM;
+	int naliases;
+	struct kvm_mem_alias aliases[KVM_ALIAS_SLOTS];
+	/*
+	 * Hash table of struct kvm_mmu_page.
+	 */
+	struct list_head active_mmu_pages;
+	unsigned int n_free_mmu_pages;
+	unsigned int n_requested_mmu_pages;
+	unsigned int n_alloc_mmu_pages;
+	struct hlist_head mmu_page_hash[KVM_NUM_MMU_PAGES];
+	struct kvm_pic *vpic;
+	struct kvm_ioapic *vioapic;
+	unsigned int tss_addr;
+	struct page *apic_access_page;
+	struct kvm_vm_stat stat;
+};
 struct descriptor_table {
 	u16 limit;
 	unsigned long base;
-- 
1.5.1.2

[-- Attachment #2: 0003-kvm-kvm-structure-split.patch --]
[-- Type: application/octet-stream, Size: 2934 bytes --]

From c6df3fbb03be31ff0ed825ad3409bfdadb8ae1d9 Mon Sep 17 00:00:00 2001
From: Zhang Xiantao <xiantao.zhang@intel.com>
Date: Tue, 11 Dec 2007 20:47:56 +0800
Subject: [PATCH] kvm: kvm structure split.

Using macro KVM_COMM to hold kvm common fields
as kvm_vcpu does. And, every arch defines its kvm structure
separately.
Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com>
---
 drivers/kvm/kvm.h |   40 +++++++++++++---------------------------
 drivers/kvm/x86.h |   18 ++++++++++++++++++
 2 files changed, 31 insertions(+), 27 deletions(-)

diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index 17715b9..ebe5156 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -244,34 +244,20 @@ struct kvm_vm_stat {
 	u32 remote_tlb_flush;
 };
 
-struct kvm {
-	struct mutex lock; /* protects everything except vcpus */
-	struct mm_struct *mm; /* userspace tied to this vm */
-	int naliases;
-	struct kvm_mem_alias aliases[KVM_ALIAS_SLOTS];
-	int nmemslots;
-	struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS +
-					KVM_PRIVATE_MEM_SLOTS];
-	/*
-	 * Hash table of struct kvm_mmu_page.
-	 */
-	struct list_head active_mmu_pages;
-	unsigned int n_free_mmu_pages;
-	unsigned int n_requested_mmu_pages;
-	unsigned int n_alloc_mmu_pages;
-	struct hlist_head mmu_page_hash[KVM_NUM_MMU_PAGES];
-	struct kvm_vcpu *vcpus[KVM_MAX_VCPUS];
-	struct list_head vm_list;
-	struct file *filp;
-	struct kvm_io_bus mmio_bus;
-	struct kvm_io_bus pio_bus;
-	struct kvm_pic *vpic;
-	struct kvm_ioapic *vioapic;
+#define KVM_COMM							\
+	struct mutex lock; /* protects everything except vcpus */	\
+	struct mm_struct *mm; /* userspace tied to this vm */		\
+									\
+	int nmemslots;							\
+	struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS +		\
+					KVM_PRIVATE_MEM_SLOTS];		\
+	struct kvm_vcpu *vcpus[KVM_MAX_VCPUS];				\
+	struct list_head vm_list;					\
+	struct file *filp;						\
+	struct kvm_io_bus mmio_bus;					\
+	struct kvm_io_bus pio_bus;					\
 	int round_robin_prev_vcpu;
-	unsigned int tss_addr;
-	struct page *apic_access_page;
-	struct kvm_vm_stat stat;
-};
+struct kvm;
 
 /* The guest did something we don't support. */
 #define pr_unimpl(vcpu, fmt, ...)					\
diff --git a/drivers/kvm/x86.h b/drivers/kvm/x86.h
index d711c91..50abb2a 100644
--- a/drivers/kvm/x86.h
+++ b/drivers/kvm/x86.h
@@ -165,6 +165,24 @@ struct kvm_vcpu {
 	struct x86_emulate_ctxt emulate_ctxt;
 };
 
+struct kvm {
+	KVM_COMM;
+	int naliases;
+	struct kvm_mem_alias aliases[KVM_ALIAS_SLOTS];
+	/*
+	 * Hash table of struct kvm_mmu_page.
+	 */
+	struct list_head active_mmu_pages;
+	unsigned int n_free_mmu_pages;
+	unsigned int n_requested_mmu_pages;
+	unsigned int n_alloc_mmu_pages;
+	struct hlist_head mmu_page_hash[KVM_NUM_MMU_PAGES];
+	struct kvm_pic *vpic;
+	struct kvm_ioapic *vioapic;
+	unsigned int tss_addr;
+	struct page *apic_access_page;
+	struct kvm_vm_stat stat;
+};
 struct descriptor_table {
 	u16 limit;
 	unsigned long base;
-- 
1.5.1.2


[-- Attachment #3: Type: text/plain, Size: 277 bytes --]

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php

[-- Attachment #4: Type: text/plain, Size: 186 bytes --]

_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel

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

* Re: [3/6][PATCH] kvm: kvm structure split into common fileds and arch-dependent ones
       [not found] ` <42DFA526FC41B1429CE7279EF83C6BDCACF90D-wq7ZOvIWXbMAbVU2wMM1CrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2007-12-13 14:29   ` Avi Kivity
       [not found]     ` <476141CB.5000209-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Avi Kivity @ 2007-12-13 14:29 UTC (permalink / raw)
  To: Zhang, Xiantao; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Zhang, Xiantao wrote:
> From: Zhang Xiantao <xiantao.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Date: Tue, 11 Dec 2007 20:47:56 +0800
> Subject: [PATCH] kvm: kvm structure split.
>
> Using macro KVM_COMM to hold kvm common fields
> as kvm_vcpu does. And, every arch defines its kvm structure
> separately.
>   


> +	struct kvm_vm_stat stat;
>   

This seems to be generic (although the structure contents itself is arch 
specific).


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


-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace

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

* Re: [3/6][PATCH] kvm: kvm structure split into common fileds and arch-dependent ones
       [not found]     ` <476141CB.5000209-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-12-13 15:11       ` Zhang, Xiantao
  0 siblings, 0 replies; 3+ messages in thread
From: Zhang, Xiantao @ 2007-12-13 15:11 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Avi Kivity wrote:
> Zhang, Xiantao wrote:
>> From: Zhang Xiantao <xiantao.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
>> Date: Tue, 11 Dec 2007 20:47:56 +0800
>> Subject: [PATCH] kvm: kvm structure split.
>> 
>> Using macro KVM_COMM to hold kvm common fields
>> as kvm_vcpu does. And, every arch defines its kvm structure
>> separately. 
>> 
> 
> 
>> +	struct kvm_vm_stat stat;

Agree to keep it in common :)

> This seems to be generic (although the structure contents itself is
> arch specific).


-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace

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

end of thread, other threads:[~2007-12-13 15:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-11 13:30 [3/6][PATCH] kvm: kvm structure split into common fileds and arch-dependent ones Zhang, Xiantao
     [not found] ` <42DFA526FC41B1429CE7279EF83C6BDCACF90D-wq7ZOvIWXbMAbVU2wMM1CrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-12-13 14:29   ` Avi Kivity
     [not found]     ` <476141CB.5000209-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-12-13 15:11       ` Zhang, Xiantao

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