From nobody Fri Nov 7 01:04:01 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544679649738558.2808174803462; Wed, 12 Dec 2018 21:40:49 -0800 (PST) Received: from localhost ([::1]:50609 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXJjn-00047g-NC for importer@patchew.org; Thu, 13 Dec 2018 00:40:43 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55890) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXJCr-0007rb-Un for qemu-devel@nongnu.org; Thu, 13 Dec 2018 00:06:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXJCo-0001u5-IC for qemu-devel@nongnu.org; Thu, 13 Dec 2018 00:06:41 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:34993) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXJCn-0001Zu-TB for qemu-devel@nongnu.org; Thu, 13 Dec 2018 00:06:38 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 25F3422239; Thu, 13 Dec 2018 00:05:46 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 13 Dec 2018 00:05:46 -0500 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id BB5371045C; Thu, 13 Dec 2018 00:05:45 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h= from:to:cc:subject:date:message-id:in-reply-to:references; s= mesmtp; bh=zw9HGX/Ff4tDOemvm09iyhYWPO2BXLFcvqH9eian3lc=; b=MJN5i vVEcxgYJwsllX9d2nusUCu1SsD14G68oxmHp0WQH3Bqv/6yfRR/UiZsRTeNKyoex lhfrkkAlBOb4ddmmzN8Kf4borBVIiXRqazIP6IcRoBJHZhFKp37zq4DtU7GWYQL4 F+BcvunGb8oRsIAodzZCyVD0/uYYey2snbwH84= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=zw9HGX/Ff4tDOemvm09iyhYWPO2BX LFcvqH9eian3lc=; b=eiItj5UGGAQFmpwejItK0uvDIiztIlsHRgyQfb3WDP6v+ qwkLcXnr6iqcEvQLsO5HpulT4+d4vmCRyzXgIyLpAqpANyLtwVt1q+5VIwC/MxfH KhnJJ5fH4knuaoeIYZy9/E2jjwRJMLPfFQ8ovT/FN4RzL4GGYapXZhid0RyxzGBM fCY8vefXM6cJ6F3VcMFPKwU1BIpLBRA+URRqyVkOLA4rsEmlOZerfY65yHZFSHSN eBc7NtclORFHuMbJQK8gNJDbD23h72K3EzBtS3gvJ8/e1kBUYtUcCQCnamISVW9X sxEEeMc7Mwstzx7OsmnOriV++a+T/bbXc/RXxTj2A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtkedrudehuddgkedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufffkof gjfhestddtredtredttdenucfhrhhomhepfdfgmhhilhhiohcuifdrucevohhtrgdfuceo tghothgrsegsrhgrrghprdhorhhgqeenucfkphepuddvkedrheelrddvtddrvdduieenuc frrghrrghmpehmrghilhhfrhhomheptghothgrsegsrhgrrghprdhorhhgnecuvehluhhs thgvrhfuihiivgepke X-ME-Proxy: From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 00:04:21 -0500 Message-Id: <20181213050453.9677-42-cota@braap.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181213050453.9677-1-cota@braap.org> References: <20181213050453.9677-1-cota@braap.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.25 Subject: [Qemu-devel] [PATCH v5 41/73] i386/hax-all: convert to cpu_interrupt_request X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Paolo Bonzini , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- 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 8b53a9708f..70cea8b1a1 100644 --- a/target/i386/hax-all.c +++ b/target/i386/hax-all.c @@ -293,7 +293,7 @@ int hax_vm_destroy(struct hax_vm *vm) =20 static void hax_handle_interrupt(CPUState *cpu, int mask) { - cpu->interrupt_request |=3D mask; + cpu_interrupt_request_or(cpu, mask); =20 if (!qemu_cpu_is_self(cpu)) { qemu_cpu_kick(cpu); @@ -427,7 +427,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; =20 irq =3D cpu_get_pic_interrupt(env); @@ -441,7 +441,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 =3D 1; } else { ht->request_interrupt_window =3D 0; @@ -482,19 +482,19 @@ static int hax_vcpu_hax_exec(CPUArchState *env) =20 cpu_halted_set(cpu, 0); =20 - 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); } =20 - 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); } =20 - 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); @@ -553,13 +553,17 @@ static int hax_vcpu_hax_exec(CPUArchState *env) ret =3D -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 |=3D IF_MASK; - cpu_halted_set(cpu, 1); - cpu->exception_index =3D EXCP_HLT; - ret =3D 1; + { + uint32_t interrupt_request =3D cpu_interrupt_request(cpu); + + if (!(interrupt_request & CPU_INTERRUPT_HARD) && + !(interrupt_request & CPU_INTERRUPT_NMI)) { + /* hlt instruction with interrupt disabled is shutdown= */ + env->eflags |=3D IF_MASK; + cpu_halted_set(cpu, 1); + cpu->exception_index =3D EXCP_HLT; + ret =3D 1; + } } break; /* these situations will continue to hax module */ --=20 2.17.1