qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 14/14] kvm: Add support for userspace MSR filtering and ha


From: Ashish Kalra
Subject: Re: [PATCH v4 14/14] kvm: Add support for userspace MSR filtering and handling of MSR_KVM_MIGRATION_CONTROL.
Date: Fri, 10 Sep 2021 09:14:06 +0000
User-agent: Mutt/1.9.4 (2018-02-28)

On Fri, Sep 10, 2021 at 07:56:36AM +0000, Wang, Wei W wrote:
> On Wednesday, August 4, 2021 8:00 PM, Ashish Kalra wrote:
> > +/*
> > + * Currently this exit is only used by SEV guests for
> > + * MSR_KVM_MIGRATION_CONTROL to indicate if the guest
> > + * is ready for migration.
> > + */
> > +static int kvm_handle_x86_msr(X86CPU *cpu, struct kvm_run *run) {
> > +    static uint64_t msr_kvm_migration_control;
> > +
> > +    if (run->msr.index != MSR_KVM_MIGRATION_CONTROL) {
> > +        run->msr.error = -EINVAL;
> > +        return -1;
> > +    }
> > +
> > +    switch (run->exit_reason) {
> > +    case KVM_EXIT_X86_RDMSR:
> > +        run->msr.error = 0;
> > +        run->msr.data = msr_kvm_migration_control;
> > +        break;
> > +    case KVM_EXIT_X86_WRMSR:
> > +        msr_kvm_migration_control = run->msr.data;
> > +        if (run->msr.data == KVM_MIGRATION_READY) {
> > +            sev_del_migrate_blocker();
> 
> It seems this is enabled/disabled by the guest, which means that the guest 
> can always refuse to be migrated?
> 

Yes.

Are there any specific concerns/issues with that ?

Thanks,
Ashish



reply via email to

[Prev in Thread] Current Thread [Next in Thread]