[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 6/7] target/i386: Implement mc->kvm_type() to get VM type
From: |
Paolo Bonzini |
Subject: |
Re: [PATCH 6/7] target/i386: Implement mc->kvm_type() to get VM type |
Date: |
Tue, 19 Mar 2024 15:25:53 +0100 |
On Tue, Mar 19, 2024 at 3:15 PM Daniel P. Berrangé <berrange@redhat.com> wrote:
> > +int kvm_get_vm_type(MachineState *ms, const char *vm_type)
>
> The 'vm_type' parameter is never used here. What value is it expected
> to have, and should be diagnosing an error if some unexpected value
> is provided.
It's the value of the kvm-type machine property, if any; but no x86
machine defines one, so right now it's always NULL. I left it in
because then it's clearer than this is an implementation of
mc->kvm_type, but I can remove it or pass it down to
x86_confidential_guest_kvm_type().
Paolo
> > +{
> > + int kvm_type = KVM_X86_DEFAULT_VM;
> > +
> > + if (ms->cgs) {
> > + if (!object_dynamic_cast(OBJECT(ms->cgs),
> > TYPE_X86_CONFIDENTIAL_GUEST)) {
> > + error_report("configuration type %s not supported for x86
> > guests",
> > + object_get_typename(OBJECT(ms->cgs)));
> > + exit(1);
> > + }
> > + kvm_type = x86_confidential_guest_kvm_type(
> > + X86_CONFIDENTIAL_GUEST(ms->cgs));
> > + }
> > +
> > + if (!kvm_is_vm_type_supported(kvm_type)) {
> > + error_report("vm-type %s not supported by KVM",
> > vm_type_name[kvm_type]);
> > + exit(1);
> > + }
> > +
> > + return kvm_type;
> > +}
> > +
> > bool kvm_has_smm(void)
> > {
> > return kvm_vm_check_extension(kvm_state, KVM_CAP_X86_SMM);
> > --
> > 2.44.0
> >
> >
>
> With regards,
> Daniel
> --
> |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org -o- https://fstop138.berrange.com :|
> |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
>
- [PATCH 0/7] target/i386: VM type infrastructure and KVM_SEV_INIT2 support, Paolo Bonzini, 2024/03/19
- [PATCH 2/7] runstate: skip initial CPU reset if reset is not actually possible, Paolo Bonzini, 2024/03/19
- [PATCH 4/7] KVM: remove kvm_arch_cpu_check_are_resettable, Paolo Bonzini, 2024/03/19
- [PATCH 3/7] KVM: track whether guest state is encrypted, Paolo Bonzini, 2024/03/19
- [PATCH 5/7] target/i386: introduce x86-confidential-guest, Paolo Bonzini, 2024/03/19
- [PATCH 1/7] linux-headers hack, Paolo Bonzini, 2024/03/19
- [PATCH 6/7] target/i386: Implement mc->kvm_type() to get VM type, Paolo Bonzini, 2024/03/19
Re: [PATCH 6/7] target/i386: Implement mc->kvm_type() to get VM type, Xiaoyao Li, 2024/03/22
[PATCH 7/7] target/i386: SEV: use KVM_SEV_INIT2 if possible, Paolo Bonzini, 2024/03/19