qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 49/50] target/i386: Move helper_check_io to sysemu


From: Richard Henderson
Subject: Re: [PATCH v2 49/50] target/i386: Move helper_check_io to sysemu
Date: Fri, 14 May 2021 12:45:04 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1

On 5/14/21 10:13 AM, Richard Henderson wrote:
--- a/target/i386/tcg/translate.c
+++ b/target/i386/tcg/translate.c
@@ -193,6 +193,7 @@ typedef struct DisasContext {
      { qemu_build_not_reached(); }
#ifdef CONFIG_USER_ONLY
+STUB_HELPER(check_io, TCGv_env env, TCGv_i32 port, TCGv_i32 size)
  STUB_HELPER(clgi, TCGv_env env)
  STUB_HELPER(flush_page, TCGv_env env, TCGv addr)
  STUB_HELPER(hlt, TCGv_env env, TCGv_i32 pc_ofs)
...
@@ -681,6 +683,14 @@ static void gen_helper_out_func(MemOp ot, TCGv_i32 v, 
TCGv_i32 n)
  static bool gen_check_io(DisasContext *s, MemOp ot, TCGv_i32 port,
                           uint32_t svm_flags)
  {
+#ifdef CONFIG_USER_ONLY
+    /*
+     * We do not implement the iopriv(2) syscall, so the TSS check
+     * will always fail.
+     */
+    gen_exception_gpf(s);
+    return false;
+#else
      if (PE(s) && (CPL(s) > IOPL(s) || VM86(s))) {
          gen_helper_check_io(cpu_env, port, tcg_constant_i32(1 << ot));
      }
@@ -699,6 +709,7 @@ static bool gen_check_io(DisasContext *s, MemOp ot, 
TCGv_i32 port,
                                  tcg_constant_i32(next_eip - cur_eip));
      }
      return true;
+#endif

This ifdef means the STUB_HELPER above isn't even used.
This is caught by clang as an unused inline function.
Will fix for v3.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]