public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Gleb Natapov <gleb@redhat.com>
Cc: kvm@vger.kernel.org, qemu-devel@nongnu.org
Subject: Re: [PATCHv2] Add support for async page fault to qemu
Date: Thu, 21 Oct 2010 14:03:25 -0200	[thread overview]
Message-ID: <20101021160325.GA26489@amt.cnet> (raw)
In-Reply-To: <20101021150845.GD2343@redhat.com>

On Thu, Oct 21, 2010 at 05:08:45PM +0200, Gleb Natapov wrote:
> Add save/restore of MSR for migration and cpuid bit.
> 
> Signed-off-by: Gleb Natapov <gleb@redhat.com>
> ---
>  v1->v2
>   - use vmstate subsection to migrate new msr.
> 
> diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c
> index 59aacd0..145c863 100644
> --- a/qemu-kvm-x86.c
> +++ b/qemu-kvm-x86.c
> @@ -678,6 +678,9 @@ static int get_msr_entry(struct kvm_msr_entry *entry, CPUState *env)
>          env->mcg_ctl = entry->data;
>          break;
>  #endif
> +    case MSR_KVM_ASYNC_PF_EN:
> +        env->async_pf_en_msr = entry->data;
> +        break;
>      default:
>  #ifdef KVM_CAP_MCE
>          if (entry->index >= MSR_MC0_CTL &&
> @@ -967,6 +970,7 @@ void kvm_arch_load_regs(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);
> +        kvm_msr_entry_set(&msrs[n++], MSR_KVM_ASYNC_PF_EN, env->async_pf_en_msr);
>      }
>  #ifdef KVM_CAP_MCE
>      if (env->mcg_cap) {
> @@ -1186,6 +1190,7 @@ void kvm_arch_save_regs(CPUState *env)
>  #endif
>      msrs[n++].index = MSR_KVM_SYSTEM_TIME;
>      msrs[n++].index = MSR_KVM_WALL_CLOCK;
> +    msrs[n++].index = MSR_KVM_ASYNC_PF_EN;
>  
>  #ifdef KVM_CAP_MCE
>      if (env->mcg_cap) {
> diff --git a/target-i386/cpu.h b/target-i386/cpu.h
> index 8b6efed..6d1d6a0 100644
> --- a/target-i386/cpu.h
> +++ b/target-i386/cpu.h
> @@ -669,6 +669,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 d63fdcb..0ee1f88 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 f4fc063..0eb1e90 100644
> --- a/target-i386/kvm.c
> +++ b/target-i386/kvm.c
> @@ -151,6 +151,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 }
>  };
>  
> @@ -672,6 +675,7 @@ 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);
> +        kvm_msr_entry_set(&msrs[n++], MSR_KVM_ASYNC_PF_EN, env->async_pf_en_msr);
>      }
>  
>      msr_data.info.nmsrs = n;
> @@ -880,6 +884,7 @@ static int kvm_get_msrs(CPUState *env)
>  #endif
>      msrs[n++].index = MSR_KVM_SYSTEM_TIME;
>      msrs[n++].index = MSR_KVM_WALL_CLOCK;
> +    msrs[n++].index = MSR_KVM_ASYNC_PF_EN;
>  
>      msr_data.info.nmsrs = n;
>      ret = kvm_vcpu_ioctl(env, KVM_GET_MSRS, &msr_data);
> @@ -926,6 +931,9 @@ static int kvm_get_msrs(CPUState *env)
>          case MSR_VM_HSAVE_PA:
>              env->vm_hsave = msrs[i].data;
>              break;
> +	case MSR_KVM_ASYNC_PF_EN:
> +            env->async_pf_en_msr = msrs[i].data;
> +            break;
>          }

I think this is going to break the build if MSR_KVM_ASYNC_PF_EN is not
defined.

Please regenerate against uq/master.

      reply	other threads:[~2010-10-21 16:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-18 13:25 [PATCH] Add support for async page fault to qemu Gleb Natapov
2010-10-18 15:48 ` Juan Quintela
2010-10-18 15:53   ` Avi Kivity
2010-10-18 16:29   ` Gleb Natapov
2010-10-21 15:08 ` [PATCHv2] " Gleb Natapov
2010-10-21 16:03   ` Marcelo Tosatti [this message]

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=20101021160325.GA26489@amt.cnet \
    --to=mtosatti@redhat.com \
    --cc=gleb@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    /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