* [Qemu-devel] [PATCH 1/1] Add support for async page fault to qemu
2010-11-06 0:43 Marcelo Tosatti
@ 2010-11-06 0:43 ` Marcelo Tosatti
0 siblings, 0 replies; 4+ messages in thread
From: Marcelo Tosatti @ 2010-11-06 0:43 UTC (permalink / raw)
To: Anthony Liguori; +Cc: Gleb Natapov, Marcelo Tosatti, qemu-devel, kvm
From: Gleb Natapov <gleb@redhat.com>
Add save/restore of MSR for migration and cpuid bit.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
---
target-i386/cpu.h | 1 +
target-i386/cpuid.c | 2 +-
target-i386/kvm.c | 14 ++++++++++++++
target-i386/machine.c | 26 ++++++++++++++++++++++++++
4 files changed, 42 insertions(+), 1 deletions(-)
diff --git a/target-i386/cpu.h b/target-i386/cpu.h
index 2440d65..06e40f3 100644
--- a/target-i386/cpu.h
+++ b/target-i386/cpu.h
@@ -681,6 +681,7 @@ typedef struct CPUX86State {
#endif
uint64_t system_time_msr;
uint64_t wall_clock_msr;
+ uint64_t async_pf_en_msr;
uint64_t tsc;
diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c
index 650a719..165045e 100644
--- a/target-i386/cpuid.c
+++ b/target-i386/cpuid.c
@@ -73,7 +73,7 @@ static const char *ext3_feature_name[] = {
};
static const char *kvm_feature_name[] = {
- "kvmclock", "kvm_nopiodelay", "kvm_mmu", NULL, NULL, NULL, NULL, NULL,
+ "kvmclock", "kvm_nopiodelay", "kvm_mmu", NULL, "kvm_asyncpf", NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index ae0a034..7dfc357 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -162,6 +162,9 @@ struct kvm_para_features {
#ifdef KVM_CAP_PV_MMU
{ KVM_CAP_PV_MMU, KVM_FEATURE_MMU_OP },
#endif
+#ifdef KVM_CAP_ASYNC_PF
+ { KVM_CAP_ASYNC_PF, KVM_FEATURE_ASYNC_PF },
+#endif
{ -1, -1 }
};
@@ -838,6 +841,9 @@ static int kvm_put_msrs(CPUState *env, int level)
kvm_msr_entry_set(&msrs[n++], MSR_KVM_SYSTEM_TIME,
env->system_time_msr);
kvm_msr_entry_set(&msrs[n++], MSR_KVM_WALL_CLOCK, env->wall_clock_msr);
+#ifdef KVM_CAP_ASYNC_PF
+ kvm_msr_entry_set(&msrs[n++], MSR_KVM_ASYNC_PF_EN, env->async_pf_en_msr);
+#endif
}
#ifdef KVM_CAP_MCE
if (env->mcg_cap) {
@@ -1064,6 +1070,9 @@ static int kvm_get_msrs(CPUState *env)
#endif
msrs[n++].index = MSR_KVM_SYSTEM_TIME;
msrs[n++].index = MSR_KVM_WALL_CLOCK;
+#ifdef KVM_CAP_ASYNC_PF
+ msrs[n++].index = MSR_KVM_ASYNC_PF_EN;
+#endif
#ifdef KVM_CAP_MCE
if (env->mcg_cap) {
@@ -1135,6 +1144,11 @@ static int kvm_get_msrs(CPUState *env)
}
#endif
break;
+#ifdef KVM_CAP_ASYNC_PF
+ case MSR_KVM_ASYNC_PF_EN:
+ env->async_pf_en_msr = msrs[i].data;
+ break;
+#endif
}
}
diff --git a/target-i386/machine.c b/target-i386/machine.c
index 5f8376c..d78eceb 100644
--- a/target-i386/machine.c
+++ b/target-i386/machine.c
@@ -373,6 +373,24 @@ static int cpu_post_load(void *opaque, int version_id)
return 0;
}
+static bool async_pf_msr_needed(void *opaque)
+{
+ CPUState *cpu = opaque;
+
+ return cpu->async_pf_en_msr != 0;
+}
+
+static const VMStateDescription vmstate_async_pf_msr = {
+ .name = "cpu/async_pf_msr",
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .minimum_version_id_old = 1,
+ .fields = (VMStateField []) {
+ VMSTATE_UINT64(async_pf_en_msr, CPUState),
+ VMSTATE_END_OF_LIST()
+ }
+};
+
static const VMStateDescription vmstate_cpu = {
.name = "cpu",
.version_id = CPU_SAVE_VERSION,
@@ -475,6 +493,14 @@ static const VMStateDescription vmstate_cpu = {
VMSTATE_YMMH_REGS_VARS(ymmh_regs, CPUState, CPU_NB_REGS, 12),
VMSTATE_END_OF_LIST()
/* The above list is not sorted /wrt version numbers, watch out! */
+ },
+ .subsections = (VMStateSubsection []) {
+ {
+ .vmsd = &vmstate_async_pf_msr,
+ .needed = async_pf_msr_needed,
+ } , {
+ /* empty */
+ }
}
};
--
1.7.2.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Qemu-devel] [PATCH 0/1] [PULL] qemu-kvm.git uq/master queue
@ 2010-11-06 0:44 Marcelo Tosatti
2010-11-06 0:44 ` [Qemu-devel] [PATCH 1/1] Add support for async page fault to qemu Marcelo Tosatti
2010-11-16 14:50 ` [Qemu-devel] [PATCH 0/1] [PULL] qemu-kvm.git uq/master queue Anthony Liguori
0 siblings, 2 replies; 4+ messages in thread
From: Marcelo Tosatti @ 2010-11-06 0:44 UTC (permalink / raw)
To: Anthony Liguori; +Cc: Marcelo Tosatti, qemu-devel, kvm
The following changes since commit d33ea50a958b2e050d2b28e5f17e3b55e91c6d74:
scsi-disk: Fix immediate failure of bdrv_aio_* (2010-11-04 13:54:37 +0100)
are available in the git repository at:
git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git uq/master
Gleb Natapov (1):
Add support for async page fault to qemu
target-i386/cpu.h | 1 +
target-i386/cpuid.c | 2 +-
target-i386/kvm.c | 14 ++++++++++++++
target-i386/machine.c | 26 ++++++++++++++++++++++++++
4 files changed, 42 insertions(+), 1 deletions(-)
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] [PATCH 1/1] Add support for async page fault to qemu
2010-11-06 0:44 [Qemu-devel] [PATCH 0/1] [PULL] qemu-kvm.git uq/master queue Marcelo Tosatti
@ 2010-11-06 0:44 ` Marcelo Tosatti
2010-11-16 14:50 ` [Qemu-devel] [PATCH 0/1] [PULL] qemu-kvm.git uq/master queue Anthony Liguori
1 sibling, 0 replies; 4+ messages in thread
From: Marcelo Tosatti @ 2010-11-06 0:44 UTC (permalink / raw)
To: Anthony Liguori; +Cc: Gleb Natapov, Marcelo Tosatti, qemu-devel, kvm
From: Gleb Natapov <gleb@redhat.com>
Add save/restore of MSR for migration and cpuid bit.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
---
target-i386/cpu.h | 1 +
target-i386/cpuid.c | 2 +-
target-i386/kvm.c | 14 ++++++++++++++
target-i386/machine.c | 26 ++++++++++++++++++++++++++
4 files changed, 42 insertions(+), 1 deletions(-)
diff --git a/target-i386/cpu.h b/target-i386/cpu.h
index 2440d65..06e40f3 100644
--- a/target-i386/cpu.h
+++ b/target-i386/cpu.h
@@ -681,6 +681,7 @@ typedef struct CPUX86State {
#endif
uint64_t system_time_msr;
uint64_t wall_clock_msr;
+ uint64_t async_pf_en_msr;
uint64_t tsc;
diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c
index 650a719..165045e 100644
--- a/target-i386/cpuid.c
+++ b/target-i386/cpuid.c
@@ -73,7 +73,7 @@ static const char *ext3_feature_name[] = {
};
static const char *kvm_feature_name[] = {
- "kvmclock", "kvm_nopiodelay", "kvm_mmu", NULL, NULL, NULL, NULL, NULL,
+ "kvmclock", "kvm_nopiodelay", "kvm_mmu", NULL, "kvm_asyncpf", NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index ae0a034..7dfc357 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -162,6 +162,9 @@ struct kvm_para_features {
#ifdef KVM_CAP_PV_MMU
{ KVM_CAP_PV_MMU, KVM_FEATURE_MMU_OP },
#endif
+#ifdef KVM_CAP_ASYNC_PF
+ { KVM_CAP_ASYNC_PF, KVM_FEATURE_ASYNC_PF },
+#endif
{ -1, -1 }
};
@@ -838,6 +841,9 @@ static int kvm_put_msrs(CPUState *env, int level)
kvm_msr_entry_set(&msrs[n++], MSR_KVM_SYSTEM_TIME,
env->system_time_msr);
kvm_msr_entry_set(&msrs[n++], MSR_KVM_WALL_CLOCK, env->wall_clock_msr);
+#ifdef KVM_CAP_ASYNC_PF
+ kvm_msr_entry_set(&msrs[n++], MSR_KVM_ASYNC_PF_EN, env->async_pf_en_msr);
+#endif
}
#ifdef KVM_CAP_MCE
if (env->mcg_cap) {
@@ -1064,6 +1070,9 @@ static int kvm_get_msrs(CPUState *env)
#endif
msrs[n++].index = MSR_KVM_SYSTEM_TIME;
msrs[n++].index = MSR_KVM_WALL_CLOCK;
+#ifdef KVM_CAP_ASYNC_PF
+ msrs[n++].index = MSR_KVM_ASYNC_PF_EN;
+#endif
#ifdef KVM_CAP_MCE
if (env->mcg_cap) {
@@ -1135,6 +1144,11 @@ static int kvm_get_msrs(CPUState *env)
}
#endif
break;
+#ifdef KVM_CAP_ASYNC_PF
+ case MSR_KVM_ASYNC_PF_EN:
+ env->async_pf_en_msr = msrs[i].data;
+ break;
+#endif
}
}
diff --git a/target-i386/machine.c b/target-i386/machine.c
index 5f8376c..d78eceb 100644
--- a/target-i386/machine.c
+++ b/target-i386/machine.c
@@ -373,6 +373,24 @@ static int cpu_post_load(void *opaque, int version_id)
return 0;
}
+static bool async_pf_msr_needed(void *opaque)
+{
+ CPUState *cpu = opaque;
+
+ return cpu->async_pf_en_msr != 0;
+}
+
+static const VMStateDescription vmstate_async_pf_msr = {
+ .name = "cpu/async_pf_msr",
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .minimum_version_id_old = 1,
+ .fields = (VMStateField []) {
+ VMSTATE_UINT64(async_pf_en_msr, CPUState),
+ VMSTATE_END_OF_LIST()
+ }
+};
+
static const VMStateDescription vmstate_cpu = {
.name = "cpu",
.version_id = CPU_SAVE_VERSION,
@@ -475,6 +493,14 @@ static const VMStateDescription vmstate_cpu = {
VMSTATE_YMMH_REGS_VARS(ymmh_regs, CPUState, CPU_NB_REGS, 12),
VMSTATE_END_OF_LIST()
/* The above list is not sorted /wrt version numbers, watch out! */
+ },
+ .subsections = (VMStateSubsection []) {
+ {
+ .vmsd = &vmstate_async_pf_msr,
+ .needed = async_pf_msr_needed,
+ } , {
+ /* empty */
+ }
}
};
--
1.7.2.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH 0/1] [PULL] qemu-kvm.git uq/master queue
2010-11-06 0:44 [Qemu-devel] [PATCH 0/1] [PULL] qemu-kvm.git uq/master queue Marcelo Tosatti
2010-11-06 0:44 ` [Qemu-devel] [PATCH 1/1] Add support for async page fault to qemu Marcelo Tosatti
@ 2010-11-16 14:50 ` Anthony Liguori
1 sibling, 0 replies; 4+ messages in thread
From: Anthony Liguori @ 2010-11-16 14:50 UTC (permalink / raw)
To: Marcelo Tosatti; +Cc: qemu-devel, kvm
On 11/05/2010 07:44 PM, Marcelo Tosatti wrote:
> The following changes since commit d33ea50a958b2e050d2b28e5f17e3b55e91c6d74:
>
> scsi-disk: Fix immediate failure of bdrv_aio_* (2010-11-04 13:54:37 +0100)
>
Pulled. Thanks.
Regards,
Anthony Liguori
> are available in the git repository at:
> git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git uq/master
>
> Gleb Natapov (1):
> Add support for async page fault to qemu
>
> target-i386/cpu.h | 1 +
> target-i386/cpuid.c | 2 +-
> target-i386/kvm.c | 14 ++++++++++++++
> target-i386/machine.c | 26 ++++++++++++++++++++++++++
> 4 files changed, 42 insertions(+), 1 deletions(-)
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-11-16 14:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-06 0:44 [Qemu-devel] [PATCH 0/1] [PULL] qemu-kvm.git uq/master queue Marcelo Tosatti
2010-11-06 0:44 ` [Qemu-devel] [PATCH 1/1] Add support for async page fault to qemu Marcelo Tosatti
2010-11-16 14:50 ` [Qemu-devel] [PATCH 0/1] [PULL] qemu-kvm.git uq/master queue Anthony Liguori
-- strict thread matches above, loose matches on Subject: below --
2010-11-06 0:43 Marcelo Tosatti
2010-11-06 0:43 ` [Qemu-devel] [PATCH 1/1] Add support for async page fault to qemu Marcelo Tosatti
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).