x86_cpu.cc (10905:a6ca6831e775) x86_cpu.cc (11150:a8a64cca231b)
1/*
2 * Copyright (c) 2013 Andreas Sandberg
3 * All rights reserved
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 1128 unchanged lines hidden (view full) ---

1137 syncThreadContext();
1138
1139 {
1140 // Migrate to the interrupt controller's thread to get the
1141 // interrupt. Even though the individual methods are safe to
1142 // call across threads, we might still lose interrupts unless
1143 // they are getInterrupt() and updateIntrInfo() are called
1144 // atomically.
1/*
2 * Copyright (c) 2013 Andreas Sandberg
3 * All rights reserved
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 1128 unchanged lines hidden (view full) ---

1137 syncThreadContext();
1138
1139 {
1140 // Migrate to the interrupt controller's thread to get the
1141 // interrupt. Even though the individual methods are safe to
1142 // call across threads, we might still lose interrupts unless
1143 // they are getInterrupt() and updateIntrInfo() are called
1144 // atomically.
1145 EventQueue::ScopedMigration migrate(interrupts->eventQueue());
1146 fault = interrupts->getInterrupt(tc);
1147 interrupts->updateIntrInfo(tc);
1145 EventQueue::ScopedMigration migrate(interrupts[0]->eventQueue());
1146 fault = interrupts[0]->getInterrupt(tc);
1147 interrupts[0]->updateIntrInfo(tc);
1148 }
1149
1150 X86Interrupt *x86int(dynamic_cast<X86Interrupt *>(fault.get()));
1151 if (dynamic_cast<NonMaskableInterrupt *>(fault.get())) {
1152 DPRINTF(KvmInt, "Delivering NMI\n");
1153 kvmNonMaskableInterrupt();
1154 } else if (dynamic_cast<InitInterrupt *>(fault.get())) {
1155 DPRINTF(KvmInt, "INIT interrupt\n");

--- 26 unchanged lines hidden (view full) ---

1182
1183}
1184
1185Tick
1186X86KvmCPU::kvmRun(Tick ticks)
1187{
1188 struct kvm_run &kvm_run(*getKvmRunState());
1189
1148 }
1149
1150 X86Interrupt *x86int(dynamic_cast<X86Interrupt *>(fault.get()));
1151 if (dynamic_cast<NonMaskableInterrupt *>(fault.get())) {
1152 DPRINTF(KvmInt, "Delivering NMI\n");
1153 kvmNonMaskableInterrupt();
1154 } else if (dynamic_cast<InitInterrupt *>(fault.get())) {
1155 DPRINTF(KvmInt, "INIT interrupt\n");

--- 26 unchanged lines hidden (view full) ---

1182
1183}
1184
1185Tick
1186X86KvmCPU::kvmRun(Tick ticks)
1187{
1188 struct kvm_run &kvm_run(*getKvmRunState());
1189
1190 if (interrupts->checkInterruptsRaw()) {
1191 if (interrupts->hasPendingUnmaskable()) {
1190 if (interrupts[0]->checkInterruptsRaw()) {
1191 if (interrupts[0]->hasPendingUnmaskable()) {
1192 DPRINTF(KvmInt,
1193 "Delivering unmaskable interrupt.\n");
1194 syncThreadContext();
1195 deliverInterrupts();
1196 } else if (kvm_run.ready_for_interrupt_injection) {
1197 // KVM claims that it is ready for an interrupt. It might
1198 // be lying if we just updated rflags and disabled
1199 // interrupts (e.g., by doing a CPU handover). Let's sync
1200 // the thread context and check if there are /really/
1201 // interrupts that should be delivered now.
1202 syncThreadContext();
1192 DPRINTF(KvmInt,
1193 "Delivering unmaskable interrupt.\n");
1194 syncThreadContext();
1195 deliverInterrupts();
1196 } else if (kvm_run.ready_for_interrupt_injection) {
1197 // KVM claims that it is ready for an interrupt. It might
1198 // be lying if we just updated rflags and disabled
1199 // interrupts (e.g., by doing a CPU handover). Let's sync
1200 // the thread context and check if there are /really/
1201 // interrupts that should be delivered now.
1202 syncThreadContext();
1203 if (interrupts->checkInterrupts(tc)) {
1203 if (interrupts[0]->checkInterrupts(tc)) {
1204 DPRINTF(KvmInt,
1205 "M5 has pending interrupts, delivering interrupt.\n");
1206
1207 deliverInterrupts();
1208 } else {
1209 DPRINTF(KvmInt,
1210 "Interrupt delivery delayed due to KVM confusion.\n");
1211 kvm_run.request_interrupt_window = 1;

--- 417 unchanged lines hidden ---
1204 DPRINTF(KvmInt,
1205 "M5 has pending interrupts, delivering interrupt.\n");
1206
1207 deliverInterrupts();
1208 } else {
1209 DPRINTF(KvmInt,
1210 "Interrupt delivery delayed due to KVM confusion.\n");
1211 kvm_run.request_interrupt_window = 1;

--- 417 unchanged lines hidden ---