|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH v3 02/14] x86/svm: make asid.h private
The asm/hvm/svm/asid.h is used only internally by the SVM code, so it can be
changed into a private header.
Take the opportunity to use an SPDX tag for the licence and remove included
but unused xen/types.h.
No functional change intended.
Signed-off-by: Xenia Ragiadakou <burzalodowa@xxxxxxxxx>
---
Changes in v3:
- new patch
xen/arch/x86/hvm/svm/asid.c | 3 +-
xen/arch/x86/hvm/svm/asid.h | 38 +++++++++++++++++++
xen/arch/x86/hvm/svm/svm.c | 2 +-
xen/arch/x86/include/asm/hvm/svm/asid.h | 49 -------------------------
4 files changed, 41 insertions(+), 51 deletions(-)
create mode 100644 xen/arch/x86/hvm/svm/asid.h
delete mode 100644 xen/arch/x86/include/asm/hvm/svm/asid.h
diff --git a/xen/arch/x86/hvm/svm/asid.c b/xen/arch/x86/hvm/svm/asid.c
index ab06dd3f3a..1128434878 100644
--- a/xen/arch/x86/hvm/svm/asid.c
+++ b/xen/arch/x86/hvm/svm/asid.c
@@ -17,9 +17,10 @@
#include <asm/amd.h>
#include <asm/hvm/nestedhvm.h>
-#include <asm/hvm/svm/asid.h>
#include <asm/hvm/svm/svm.h>
+#include "asid.h"
+
void svm_asid_init(const struct cpuinfo_x86 *c)
{
int nasids = 0;
diff --git a/xen/arch/x86/hvm/svm/asid.h b/xen/arch/x86/hvm/svm/asid.h
new file mode 100644
index 0000000000..4dd6abb5fb
--- /dev/null
+++ b/xen/arch/x86/hvm/svm/asid.h
@@ -0,0 +1,38 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * asid.h: handling ASIDs in SVM.
+ *
+ * Copyright (c) 2007, Advanced Micro Devices, Inc.
+ */
+
+#ifndef __X86_HVM_SVM_ASID_PRIV_H__
+#define __X86_HVM_SVM_ASID_PRIV_H__
+
+#include <asm/hvm/asid.h>
+#include <asm/processor.h>
+
+void svm_asid_init(const struct cpuinfo_x86 *c);
+void svm_asid_handle_vmrun(void);
+
+static inline void svm_asid_g_invlpg(struct vcpu *v, unsigned long g_linear)
+{
+#if 0
+ /* Optimization? */
+ svm_invlpga(g_linear, v->arch.hvm.svm.vmcb->guest_asid);
+#endif
+
+ /* Safe fallback. Take a new ASID. */
+ hvm_asid_flush_vcpu(v);
+}
+
+#endif /* __X86_HVM_SVM_ASID_PRIV_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 6d394e4fe3..793a10eaca 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -37,7 +37,6 @@
#include <asm/hvm/monitor.h>
#include <asm/hvm/nestedhvm.h>
#include <asm/hvm/support.h>
-#include <asm/hvm/svm/asid.h>
#include <asm/hvm/svm/emulate.h>
#include <asm/hvm/svm/nestedsvm.h>
#include <asm/hvm/svm/svm.h>
@@ -55,6 +54,7 @@
#include <public/sched.h>
+#include "asid.h"
#include "svm.h"
void noreturn svm_asm_do_resume(void);
diff --git a/xen/arch/x86/include/asm/hvm/svm/asid.h
b/xen/arch/x86/include/asm/hvm/svm/asid.h
deleted file mode 100644
index 0e5ec3ab78..0000000000
--- a/xen/arch/x86/include/asm/hvm/svm/asid.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * asid.h: handling ASIDs in SVM.
- * Copyright (c) 2007, Advanced Micro Devices, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef __ASM_X86_HVM_SVM_ASID_H__
-#define __ASM_X86_HVM_SVM_ASID_H__
-
-#include <xen/types.h>
-#include <asm/hvm/asid.h>
-#include <asm/processor.h>
-
-void svm_asid_init(const struct cpuinfo_x86 *c);
-void svm_asid_handle_vmrun(void);
-
-static inline void svm_asid_g_invlpg(struct vcpu *v, unsigned long g_linear)
-{
-#if 0
- /* Optimization? */
- svm_invlpga(g_linear, v->arch.hvm.svm.vmcb->guest_asid);
-#endif
-
- /* Safe fallback. Take a new ASID. */
- hvm_asid_flush_vcpu(v);
-}
-
-#endif /* __ASM_X86_HVM_SVM_ASID_H__ */
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
--
2.37.2
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |