summary refs log tree commit diff
path: root/hypervisor/src/kvm/x86_64.rs
blob: 56681f929cf5f96c864688507e9adfc4b1d3851c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright 2020 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

use sys_util::Result;

use super::{Kvm, KvmVcpu, KvmVm};
use crate::{CpuId, HypervisorX86_64, Regs, VcpuX86_64, VmX86_64};

impl HypervisorX86_64 for Kvm {
    fn get_supported_cpuid(&self) -> Result<CpuId> {
        unimplemented!("get_supported_cpuid for Kvm is not yet implemented");
    }

    fn get_emulated_cpuid(&self) -> Result<CpuId> {
        unimplemented!("get_emulated_cpuid for Kvm is not yet implemented");
    }
}

impl VmX86_64 for KvmVm {
    type Vcpu = KvmVcpu;

    fn create_vcpu(&self, id: usize) -> Result<Self::Vcpu> {
        self.create_kvm_vcpu(id)
    }
}

impl VcpuX86_64 for KvmVcpu {
    fn get_regs(&self) -> Result<Regs> {
        Ok(Regs {})
    }
}