summary refs log tree commit diff
path: root/hypervisor/src/kvm/aarch64.rs
blob: 4e5b65c7153accb5b29963cbcbf4c4d3b6be1a96 (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
33
34
35
36
// 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 libc::ENXIO;

use sys_util::{Error, Result};

use super::{KvmVcpu, KvmVm};
use crate::{ClockState, VcpuAArch64, VmAArch64};

impl KvmVm {
    /// Arch-specific implementation of `Vm::get_pvclock`.  Always returns an error on AArch64.
    pub fn get_pvclock_arch(&self) -> Result<ClockState> {
        Err(Error::new(ENXIO))
    }

    /// Arch-specific implementation of `Vm::set_pvclock`.  Always returns an error on AArch64.
    pub fn set_pvclock_arch(&self, _state: &ClockState) -> Result<()> {
        Err(Error::new(ENXIO))
    }
}

impl VmAArch64 for KvmVm {
    type Vcpu = KvmVcpu;

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

impl VcpuAArch64 for KvmVcpu {
    fn set_one_reg(&self, _reg_id: u64, _data: u64) -> Result<()> {
        Ok(())
    }
}