diff mbox

[v2,06/15] kvmvapic: remove tcg related code

Message ID 1499076743-15477-7-git-send-email-yang.zhong@intel.com
State New
Headers show

Commit Message

Yang Zhong July 3, 2017, 10:12 a.m. UTC
Since Paolo's below patch has fixed A20 issue
commit bbfa326fc8028e275eddf8c9965c2a1b59405b2e
target/i386: enable A20 automatically in system management mod

The tcg code in kvmvapic.c is NOT useful, those code need remove.

Signed-off-by: Yang Zhong <yang.zhong@intel.com>
---
 hw/i386/kvmvapic.c | 24 ------------------------
 1 file changed, 24 deletions(-)

Comments

Paolo Bonzini July 3, 2017, 2:28 p.m. UTC | #1
On 03/07/2017 12:12, Yang Zhong wrote:
> Since Paolo's below patch has fixed A20 issue
> commit bbfa326fc8028e275eddf8c9965c2a1b59405b2e
> target/i386: enable A20 automatically in system management mod

How is this patch related to kvmvapic?  It fixes a bug with vapic
disabled, but it's not a reason to disable kvmvapic.

Paolo

> The tcg code in kvmvapic.c is NOT useful, those code need remove.
> 
> Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> ---
>  hw/i386/kvmvapic.c | 24 ------------------------
>  1 file changed, 24 deletions(-)
Yang Zhong July 4, 2017, 2:46 a.m. UTC | #2
On Mon, Jul 03, 2017 at 04:28:00PM +0200, Paolo Bonzini wrote:
> 
> 
> On 03/07/2017 12:12, Yang Zhong wrote:
> > Since Paolo's below patch has fixed A20 issue
> > commit bbfa326fc8028e275eddf8c9965c2a1b59405b2e
> > target/i386: enable A20 automatically in system management mod
> 
> How is this patch related to kvmvapic?  It fixes a bug with vapic
> disabled, but it's not a reason to disable kvmvapic.
> 
> Paolo
> 
  Hello Paolo,

  In that time, in order to verify the tcg code is not useful in kvmvapic.c 
  file, we disabled the kvmvapic rom in the seabios and use the tcg accelator 
  to boot guest image, we found this A20 bug.

  Once this A20 bug has been fixed, we can use the tcg to bootup the guest
  image without kvmvapic rom, which show the tcg code in kvmvapic is not useful.
  This is reason why i removed the tcg code replace of using tcg_enabled() to check
  the tcg code in kvmvapic.c. thanks!

  Regards,

  Yang  
  

> > The tcg code in kvmvapic.c is NOT useful, those code need remove.
> > 
> > Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> > ---
> >  hw/i386/kvmvapic.c | 24 ------------------------
> >  1 file changed, 24 deletions(-)
diff mbox

Patch

diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c
index 82a4955..5b7be5a 100644
--- a/hw/i386/kvmvapic.c
+++ b/hw/i386/kvmvapic.c
@@ -18,7 +18,6 @@ 
 #include "sysemu/kvm.h"
 #include "hw/i386/apic_internal.h"
 #include "hw/sysbus.h"
-#include "tcg/tcg.h"
 
 #define VAPIC_IO_PORT           0x7e
 
@@ -396,13 +395,9 @@  static void patch_call(VAPICROMState *s, X86CPU *cpu, target_ulong ip,
 static void patch_instruction(VAPICROMState *s, X86CPU *cpu, target_ulong ip)
 {
     CPUState *cs = CPU(cpu);
-    CPUX86State *env = &cpu->env;
     VAPICHandlers *handlers;
     uint8_t opcode[2];
     uint32_t imm32 = 0;
-    target_ulong current_pc = 0;
-    target_ulong current_cs_base = 0;
-    uint32_t current_flags = 0;
 
     if (smp_cpus == 1) {
         handlers = &s->rom_state.up;
@@ -410,17 +405,6 @@  static void patch_instruction(VAPICROMState *s, X86CPU *cpu, target_ulong ip)
         handlers = &s->rom_state.mp;
     }
 
-    if (!kvm_enabled()) {
-        cpu_get_tb_cpu_state(env, &current_pc, &current_cs_base,
-                             &current_flags);
-        /* Account this instruction, because we will exit the tb.
-           This is the first instruction in the block. Therefore
-           there is no need in restoring CPU state. */
-        if (use_icount) {
-            --cs->icount_decr.u16.low;
-        }
-    }
-
     pause_all_vcpus();
 
     cpu_memory_rw_debug(cs, ip, opcode, sizeof(opcode), 0);
@@ -455,14 +439,6 @@  static void patch_instruction(VAPICROMState *s, X86CPU *cpu, target_ulong ip)
     }
 
     resume_all_vcpus();
-
-    if (!kvm_enabled()) {
-        /* Both tb_lock and iothread_mutex will be reset when
-         *  longjmps back into the cpu_exec loop. */
-        tb_lock();
-        tb_gen_code(cs, current_pc, current_cs_base, current_flags, 1);
-        cpu_loop_exit_noexc(cs);
-    }
 }
 
 void vapic_report_tpr_access(DeviceState *dev, CPUState *cs, target_ulong ip,