[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v6 41/73] i386/hax-all: convert to cpu_interrupt_req
From: |
Emilio G. Cota |
Subject: |
[Qemu-devel] [PATCH v6 41/73] i386/hax-all: convert to cpu_interrupt_request |
Date: |
Tue, 29 Jan 2019 19:47:39 -0500 |
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Emilio G. Cota <address@hidden>
---
target/i386/hax-all.c | 30 +++++++++++++++++-------------
1 file changed, 17 insertions(+), 13 deletions(-)
diff --git a/target/i386/hax-all.c b/target/i386/hax-all.c
index 518c6ff103..18da1808c6 100644
--- a/target/i386/hax-all.c
+++ b/target/i386/hax-all.c
@@ -284,7 +284,7 @@ int hax_vm_destroy(struct hax_vm *vm)
static void hax_handle_interrupt(CPUState *cpu, int mask)
{
- cpu->interrupt_request |= mask;
+ cpu_interrupt_request_or(cpu, mask);
if (!qemu_cpu_is_self(cpu)) {
qemu_cpu_kick(cpu);
@@ -418,7 +418,7 @@ static int hax_vcpu_interrupt(CPUArchState *env)
* Unlike KVM, HAX kernel check for the eflags, instead of qemu
*/
if (ht->ready_for_interrupt_injection &&
- (cpu->interrupt_request & CPU_INTERRUPT_HARD)) {
+ (cpu_interrupt_request(cpu) & CPU_INTERRUPT_HARD)) {
int irq;
irq = cpu_get_pic_interrupt(env);
@@ -432,7 +432,7 @@ static int hax_vcpu_interrupt(CPUArchState *env)
* interrupt, request an interrupt window exit. This will
* cause a return to userspace as soon as the guest is ready to
* receive interrupts. */
- if ((cpu->interrupt_request & CPU_INTERRUPT_HARD)) {
+ if ((cpu_interrupt_request(cpu) & CPU_INTERRUPT_HARD)) {
ht->request_interrupt_window = 1;
} else {
ht->request_interrupt_window = 0;
@@ -473,19 +473,19 @@ static int hax_vcpu_hax_exec(CPUArchState *env)
cpu_halted_set(cpu, 0);
- if (cpu->interrupt_request & CPU_INTERRUPT_POLL) {
+ if (cpu_interrupt_request(cpu) & CPU_INTERRUPT_POLL) {
cpu_reset_interrupt(cpu, CPU_INTERRUPT_POLL);
apic_poll_irq(x86_cpu->apic_state);
}
- if (cpu->interrupt_request & CPU_INTERRUPT_INIT) {
+ if (cpu_interrupt_request(cpu) & CPU_INTERRUPT_INIT) {
DPRINTF("\nhax_vcpu_hax_exec: handling INIT for %d\n",
cpu->cpu_index);
do_cpu_init(x86_cpu);
hax_vcpu_sync_state(env, 1);
}
- if (cpu->interrupt_request & CPU_INTERRUPT_SIPI) {
+ if (cpu_interrupt_request(cpu) & CPU_INTERRUPT_SIPI) {
DPRINTF("hax_vcpu_hax_exec: handling SIPI for %d\n",
cpu->cpu_index);
hax_vcpu_sync_state(env, 0);
@@ -544,13 +544,17 @@ static int hax_vcpu_hax_exec(CPUArchState *env)
ret = -1;
break;
case HAX_EXIT_HLT:
- if (!(cpu->interrupt_request & CPU_INTERRUPT_HARD) &&
- !(cpu->interrupt_request & CPU_INTERRUPT_NMI)) {
- /* hlt instruction with interrupt disabled is shutdown */
- env->eflags |= IF_MASK;
- cpu_halted_set(cpu, 1);
- cpu->exception_index = EXCP_HLT;
- ret = 1;
+ {
+ uint32_t interrupt_request = cpu_interrupt_request(cpu);
+
+ if (!(interrupt_request & CPU_INTERRUPT_HARD) &&
+ !(interrupt_request & CPU_INTERRUPT_NMI)) {
+ /* hlt instruction with interrupt disabled is shutdown */
+ env->eflags |= IF_MASK;
+ cpu_halted_set(cpu, 1);
+ cpu->exception_index = EXCP_HLT;
+ ret = 1;
+ }
}
break;
/* these situations will continue to hax module */
--
2.17.1
- [Qemu-devel] [PATCH v6 31/73] cpu: convert to cpu_halted, (continued)
- [Qemu-devel] [PATCH v6 31/73] cpu: convert to cpu_halted, Emilio G. Cota, 2019/01/29
- [Qemu-devel] [PATCH v6 40/73] i386/kvm: convert to cpu_interrupt_request, Emilio G. Cota, 2019/01/29
- [Qemu-devel] [PATCH v6 35/73] i386: use cpu_reset_interrupt, Emilio G. Cota, 2019/01/29
- [Qemu-devel] [PATCH v6 39/73] i386: convert to cpu_interrupt_request, Emilio G. Cota, 2019/01/29
- [Qemu-devel] [PATCH v6 46/73] cris: convert to cpu_interrupt_request, Emilio G. Cota, 2019/01/29
- [Qemu-devel] [PATCH v6 48/73] lm32: convert to cpu_interrupt_request, Emilio G. Cota, 2019/01/29
- [Qemu-devel] [PATCH v6 55/73] sparc: convert to cpu_interrupt_request, Emilio G. Cota, 2019/01/29
- [Qemu-devel] [PATCH v6 61/73] cpu: call .cpu_has_work with the CPU lock held, Emilio G. Cota, 2019/01/29
- [Qemu-devel] [PATCH v6 37/73] openrisc: use cpu_reset_interrupt, Emilio G. Cota, 2019/01/29
- [Qemu-devel] [PATCH v6 51/73] nios: convert to cpu_interrupt_request, Emilio G. Cota, 2019/01/29
- [Qemu-devel] [PATCH v6 41/73] i386/hax-all: convert to cpu_interrupt_request,
Emilio G. Cota <=
- [Qemu-devel] [PATCH v6 53/73] alpha: convert to cpu_interrupt_request, Emilio G. Cota, 2019/01/29
- [Qemu-devel] [PATCH v6 47/73] hppa: convert to cpu_interrupt_request, Emilio G. Cota, 2019/01/29
- [Qemu-devel] [PATCH v6 50/73] mips: convert to cpu_interrupt_request, Emilio G. Cota, 2019/01/29
- [Qemu-devel] [PATCH v6 56/73] openrisc: convert to cpu_interrupt_request, Emilio G. Cota, 2019/01/29
- [Qemu-devel] [PATCH v6 60/73] cpu: convert to interrupt_request, Emilio G. Cota, 2019/01/29
- [Qemu-devel] [PATCH v6 49/73] m68k: convert to cpu_interrupt_request, Emilio G. Cota, 2019/01/29
- [Qemu-devel] [PATCH v6 43/73] i386/hvf: convert to cpu_request_interrupt, Emilio G. Cota, 2019/01/29
- [Qemu-devel] [PATCH v6 59/73] accel/tcg: convert to cpu_interrupt_request, Emilio G. Cota, 2019/01/29
- [Qemu-devel] [PATCH v6 36/73] s390x: use cpu_reset_interrupt, Emilio G. Cota, 2019/01/29
- [Qemu-devel] [PATCH v6 52/73] s390x: convert to cpu_interrupt_request, Emilio G. Cota, 2019/01/29