* [2/6][PATCH] kvm: Moving memslot_id to x86.h
@ 2007-12-11 13:30 Zhang, Xiantao
[not found] ` <42DFA526FC41B1429CE7279EF83C6BDCACF90C-wq7ZOvIWXbMAbVU2wMM1CrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
0 siblings, 1 reply; 4+ 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: 1349 bytes --]
From: Zhang Xiantao <xiantao.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Date: Tue, 11 Dec 2007 20:45:48 +0800
Subject: [PATCH] kvm: Moving memslot_id to x86.h
Since it is not called in kvm_main.c, and it also will block
kvm structure split, so moved it out.
Signed-off-by: Zhang Xiantao <xiantao.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
drivers/kvm/kvm.h | 5 -----
drivers/kvm/x86.h | 5 +++++
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index 668a830..17715b9 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -417,11 +417,6 @@ static inline void kvm_guest_exit(void)
current->flags &= ~PF_VCPU;
}
-static inline int memslot_id(struct kvm *kvm, struct kvm_memory_slot
*slot)
-{
- return slot - kvm->memslots;
-}
-
static inline gpa_t gfn_to_gpa(gfn_t gfn)
{
return (gpa_t)gfn << PAGE_SHIFT;
diff --git a/drivers/kvm/x86.h b/drivers/kvm/x86.h
index 0fc7020..d711c91 100644
--- a/drivers/kvm/x86.h
+++ b/drivers/kvm/x86.h
@@ -493,4 +493,9 @@ static inline int kvm_arch_vcpu_runnable(struct
kvm_vcpu *vcpu)
|| vcpu->mp_state == VCPU_MP_STATE_SIPI_RECEIVED;
}
+static inline int memslot_id(struct kvm *kvm, struct kvm_memory_slot
*slot)
+{
+ return slot - kvm->memslots;
+}
+
#endif
--
1.5.1.2
[-- Attachment #2: 0002-kvm-Moving-memslot_id-to-x86.h.patch --]
[-- Type: application/octet-stream, Size: 1314 bytes --]
From cf746e3c4e2f0dfa8a58dbd1b6ca514f669cc56f Mon Sep 17 00:00:00 2001
From: Zhang Xiantao <xiantao.zhang@intel.com>
Date: Tue, 11 Dec 2007 20:45:48 +0800
Subject: [PATCH] kvm: Moving memslot_id to x86.h
Since it is not called in kvm_main.c, and it also will block
kvm structure split, so moved it out.
Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com>
---
drivers/kvm/kvm.h | 5 -----
drivers/kvm/x86.h | 5 +++++
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index 668a830..17715b9 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -417,11 +417,6 @@ static inline void kvm_guest_exit(void)
current->flags &= ~PF_VCPU;
}
-static inline int memslot_id(struct kvm *kvm, struct kvm_memory_slot *slot)
-{
- return slot - kvm->memslots;
-}
-
static inline gpa_t gfn_to_gpa(gfn_t gfn)
{
return (gpa_t)gfn << PAGE_SHIFT;
diff --git a/drivers/kvm/x86.h b/drivers/kvm/x86.h
index 0fc7020..d711c91 100644
--- a/drivers/kvm/x86.h
+++ b/drivers/kvm/x86.h
@@ -493,4 +493,9 @@ static inline int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu)
|| vcpu->mp_state == VCPU_MP_STATE_SIPI_RECEIVED;
}
+static inline int memslot_id(struct kvm *kvm, struct kvm_memory_slot *slot)
+{
+ return slot - kvm->memslots;
+}
+
#endif
--
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] 4+ messages in thread
* Re: [2/6][PATCH] kvm: Moving memslot_id to x86.h
[not found] ` <42DFA526FC41B1429CE7279EF83C6BDCACF90C-wq7ZOvIWXbMAbVU2wMM1CrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2007-12-13 14:27 ` Avi Kivity
[not found] ` <47614161.80402-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Avi Kivity @ 2007-12-13 14:27 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:45:48 +0800
> Subject: [PATCH] kvm: Moving memslot_id to x86.h
>
> Since it is not called in kvm_main.c, and it also will block
> kvm structure split, so moved it out.
>
memslot_id() is not x86 specific. Why are you moving it?
--
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] 4+ messages in thread
* Re: [2/6][PATCH] kvm: Moving memslot_id to x86.h
[not found] ` <47614161.80402-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-12-13 14:40 ` Zhang, Xiantao
[not found] ` <42DFA526FC41B1429CE7279EF83C6BDCAD006D-wq7ZOvIWXbMAbVU2wMM1CrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Zhang, Xiantao @ 2007-12-13 14:40 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:45:48 +0800
>> Subject: [PATCH] kvm: Moving memslot_id to x86.h
>>
>> Since it is not called in kvm_main.c, and it also will block
>> kvm structure split, so moved it out.
>>
>
> memslot_id() is not x86 specific. Why are you moving it?
Maybe we can move it to kvm_main.c. If it is inline style in kvm.h, it
will meet compile issue, since it needs to know kvm strucure. :)
Xiantao
-------------------------------------------------------------------------
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] 4+ messages in thread
* Re: [2/6][PATCH] kvm: Moving memslot_id to x86.h
[not found] ` <42DFA526FC41B1429CE7279EF83C6BDCAD006D-wq7ZOvIWXbMAbVU2wMM1CrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2007-12-13 14:49 ` Avi Kivity
0 siblings, 0 replies; 4+ messages in thread
From: Avi Kivity @ 2007-12-13 14:49 UTC (permalink / raw)
To: Zhang, Xiantao; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Zhang, Xiantao wrote:
> Avi Kivity wrote:
>
>> Zhang, Xiantao wrote:
>>
>>> From: Zhang Xiantao <xiantao.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
>>> Date: Tue, 11 Dec 2007 20:45:48 +0800
>>> Subject: [PATCH] kvm: Moving memslot_id to x86.h
>>>
>>> Since it is not called in kvm_main.c, and it also will block
>>> kvm structure split, so moved it out.
>>>
>>>
>> memslot_id() is not x86 specific. Why are you moving it?
>>
>
> Maybe we can move it to kvm_main.c. If it is inline style in kvm.h, it
> will meet compile issue, since it needs to know kvm strucure. :)
>
I see. What we want is to #include "x86.h" at the beginning of kvm.h.
That means we need to switch to
struct kvm {
struct kvm_arch arch;
...
};
(and similarly for struct kvm_vcpu) sooner rather than later. Otherwise
we will spiral into never-ending #include problems.
--
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] 4+ messages in thread
end of thread, other threads:[~2007-12-13 14:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-11 13:30 [2/6][PATCH] kvm: Moving memslot_id to x86.h Zhang, Xiantao
[not found] ` <42DFA526FC41B1429CE7279EF83C6BDCACF90C-wq7ZOvIWXbMAbVU2wMM1CrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-12-13 14:27 ` Avi Kivity
[not found] ` <47614161.80402-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-12-13 14:40 ` Zhang, Xiantao
[not found] ` <42DFA526FC41B1429CE7279EF83C6BDCAD006D-wq7ZOvIWXbMAbVU2wMM1CrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-12-13 14:49 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox