summaryrefslogtreecommitdiff
path: root/src/cpu/kvm/vm.hh
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas.sandberg@arm.com>2015-05-23 13:37:20 +0100
committerAndreas Sandberg <andreas.sandberg@arm.com>2015-05-23 13:37:20 +0100
commited447bbff97eb74779ff891734664ef16d4fe646 (patch)
tree361a5c6047eeef1df53bf799d65072879832bbf0 /src/cpu/kvm/vm.hh
parent12e91f701b4d4ecfd1a7d9ed92ed1e11c06bb69c (diff)
downloadgem5-ed447bbff97eb74779ff891734664ef16d4fe646.tar.xz
kvm, x86: Guard x86-specific APIs in KvmVM
Protect x86-specific APIs in KvmVM with compile-time guards to avoid breaking ARM builds.
Diffstat (limited to 'src/cpu/kvm/vm.hh')
-rw-r--r--src/cpu/kvm/vm.hh30
1 files changed, 21 insertions, 9 deletions
diff --git a/src/cpu/kvm/vm.hh b/src/cpu/kvm/vm.hh
index 84d526705..4710f2447 100644
--- a/src/cpu/kvm/vm.hh
+++ b/src/cpu/kvm/vm.hh
@@ -75,9 +75,6 @@ class Kvm
friend class KvmVM;
public:
- typedef std::vector<struct kvm_cpuid_entry2> CPUIDVector;
- typedef std::vector<uint32_t> MSRIndexVector;
-
virtual ~Kvm();
Kvm *create();
@@ -143,6 +140,16 @@ class Kvm
bool capXSave() const;
/** @} */
+#if defined(__i386__) || defined(__x86_64__)
+ public: // x86-specific
+ /**
+ * @{
+ * @name X86-specific APIs
+ */
+
+ typedef std::vector<struct kvm_cpuid_entry2> CPUIDVector;
+ typedef std::vector<uint32_t> MSRIndexVector;
+
/**
* Get the CPUID features supported by the hardware and Kvm.
*
@@ -181,6 +188,17 @@ class Kvm
*/
const MSRIndexVector &getSupportedMSRs() const;
+ private: // x86-specific
+ /** Cached vector of supported CPUID entries. */
+ mutable CPUIDVector supportedCPUIDCache;
+
+ /** Cached vector of supported MSRs. */
+ mutable MSRIndexVector supportedMSRCache;
+
+
+ /** @} */
+#endif
+
protected:
/**
* Check for the presence of an extension to the KVM API.
@@ -239,12 +257,6 @@ class Kvm
/** Size of the MMAPed vCPU parameter area. */
int vcpuMMapSize;
- /** Cached vector of supported CPUID entries. */
- mutable CPUIDVector supportedCPUIDCache;
-
- /** Cached vector of supported MSRs. */
- mutable MSRIndexVector supportedMSRCache;
-
/** Singleton instance */
static Kvm *instance;
};