[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC v17 08/14] i386: split smm helper (softmmu)
From: |
Claudio Fontana |
Subject: |
[RFC v17 08/14] i386: split smm helper (softmmu) |
Date: |
Wed, 10 Feb 2021 16:28:53 +0100 |
smm is only really useful for softmmu, split in two modules
around the CONFIG_USER_ONLY, in order to remove the ifdef
and use the build system instead.
Signed-off-by: Claudio Fontana <cfontana@suse.de>
---
target/i386/tcg/{ => softmmu}/smm_helper.c | 18 ++-----------
target/i386/tcg/user/smm_helper_user.c | 31 ++++++++++++++++++++++
target/i386/tcg/meson.build | 1 -
target/i386/tcg/softmmu/meson.build | 1 +
target/i386/tcg/user/meson.build | 1 +
5 files changed, 35 insertions(+), 17 deletions(-)
rename target/i386/tcg/{ => softmmu}/smm_helper.c (98%)
create mode 100644 target/i386/tcg/user/smm_helper_user.c
diff --git a/target/i386/tcg/smm_helper.c b/target/i386/tcg/softmmu/smm_helper.c
similarity index 98%
rename from target/i386/tcg/smm_helper.c
rename to target/i386/tcg/softmmu/smm_helper.c
index 62d027abd3..107de2b63d 100644
--- a/target/i386/tcg/smm_helper.c
+++ b/target/i386/tcg/softmmu/smm_helper.c
@@ -1,5 +1,5 @@
/*
- * x86 SMM helpers
+ * x86 SMM helpers (softmmu-only)
*
* Copyright (c) 2003 Fabrice Bellard
*
@@ -22,23 +22,11 @@
#include "cpu.h"
#include "exec/helper-proto.h"
#include "exec/log.h"
-#include "helper-tcg.h"
+#include "tcg/helper-tcg.h"
/* SMM support */
-#if defined(CONFIG_USER_ONLY)
-
-void do_smm_enter(X86CPU *cpu)
-{
-}
-
-void helper_rsm(CPUX86State *env)
-{
-}
-
-#else
-
#ifdef TARGET_X86_64
#define SMM_REVISION_ID 0x00020064
#else
@@ -330,5 +318,3 @@ void helper_rsm(CPUX86State *env)
qemu_log_mask(CPU_LOG_INT, "SMM: after RSM\n");
log_cpu_state_mask(CPU_LOG_INT, CPU(cpu), CPU_DUMP_CCOP);
}
-
-#endif /* !CONFIG_USER_ONLY */
diff --git a/target/i386/tcg/user/smm_helper_user.c
b/target/i386/tcg/user/smm_helper_user.c
new file mode 100644
index 0000000000..50a1100e5e
--- /dev/null
+++ b/target/i386/tcg/user/smm_helper_user.c
@@ -0,0 +1,31 @@
+/*
+ * x86 SMM helpers, user mode
+ *
+ * Copyright (c) 2003 Fabrice Bellard
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "qemu/osdep.h"
+#include "cpu.h"
+#include "exec/helper-proto.h"
+#include "tcg/helper-tcg.h"
+
+void do_smm_enter(X86CPU *cpu)
+{
+}
+
+void helper_rsm(CPUX86State *env)
+{
+}
diff --git a/target/i386/tcg/meson.build b/target/i386/tcg/meson.build
index 68fa0c3187..ec5daa1edc 100644
--- a/target/i386/tcg/meson.build
+++ b/target/i386/tcg/meson.build
@@ -8,7 +8,6 @@ i386_ss.add(when: 'CONFIG_TCG', if_true: files(
'misc_helper.c',
'mpx_helper.c',
'seg_helper.c',
- 'smm_helper.c',
'svm_helper.c',
'tcg-cpu.c',
'translate.c'), if_false: files('tcg-stub.c'))
diff --git a/target/i386/tcg/softmmu/meson.build
b/target/i386/tcg/softmmu/meson.build
index 77453740ad..cc29893758 100644
--- a/target/i386/tcg/softmmu/meson.build
+++ b/target/i386/tcg/softmmu/meson.build
@@ -1,3 +1,4 @@
i386_softmmu_ss.add(when: ['CONFIG_TCG', 'CONFIG_SOFTMMU'], if_true: files(
'tcg-cpu-softmmu.c',
+ 'smm_helper.c',
))
diff --git a/target/i386/tcg/user/meson.build b/target/i386/tcg/user/meson.build
index b479c7dcdf..976415e35f 100644
--- a/target/i386/tcg/user/meson.build
+++ b/target/i386/tcg/user/meson.build
@@ -1,3 +1,4 @@
i386_user_ss.add(when: ['CONFIG_TCG', 'CONFIG_USER_ONLY'], if_true: files(
'tcg-cpu-user.c',
+ 'smm_helper_user.c',
))
--
2.26.2
- [RFC v17 00/14] i386 cleanup PART 2, Claudio Fontana, 2021/02/10
- [RFC v17 02/14] cpu: call AccelCPUClass::cpu_realizefn in cpu_exec_realizefn, Claudio Fontana, 2021/02/10
- [RFC v17 04/14] target/i386: fix host_cpu_adjust_phys_bits error handling, Claudio Fontana, 2021/02/10
- [RFC v17 03/14] accel: introduce new accessor functions, Claudio Fontana, 2021/02/10
- [RFC v17 08/14] i386: split smm helper (softmmu),
Claudio Fontana <=
- [RFC v17 06/14] meson: add target_user_arch, Claudio Fontana, 2021/02/10
- [RFC v17 01/14] i386: split cpu accelerators from cpu.c, using AccelCPUClass, Claudio Fontana, 2021/02/10
- [RFC v17 05/14] accel-cpu: make cpu_realizefn return a bool, Claudio Fontana, 2021/02/10
- [RFC v17 07/14] i386: split user and softmmu functionality in tcg-cpu, Claudio Fontana, 2021/02/10
- [RFC v17 09/14] i386: split tcg excp_helper into softmmu and user parts, Claudio Fontana, 2021/02/10
- [RFC v17 12/14] i386: separate fpu_helper into user and softmmu parts, Claudio Fontana, 2021/02/10
- [RFC v17 11/14] i386: split misc helper into user and softmmu parts, Claudio Fontana, 2021/02/10
- [RFC v17 10/14] i386: split tcg btp_helper into softmmu and user parts, Claudio Fontana, 2021/02/10