From nobody Fri Nov 7 23:04:50 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1548811221056438.1230730201736; Tue, 29 Jan 2019 17:20:21 -0800 (PST) Received: from localhost ([127.0.0.1]:58206 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1goeY3-0000HC-1C for importer@patchew.org; Tue, 29 Jan 2019 20:20:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35684) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1goe3y-00007x-PU for qemu-devel@nongnu.org; Tue, 29 Jan 2019 19:49:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1goe3w-0001In-Mb for qemu-devel@nongnu.org; Tue, 29 Jan 2019 19:49:10 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:35613) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1goe3s-00010S-T4 for qemu-devel@nongnu.org; Tue, 29 Jan 2019 19:49:06 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 7B16422167; Tue, 29 Jan 2019 19:48:24 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 29 Jan 2019 19:48:24 -0500 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id CE7BAE4664; Tue, 29 Jan 2019 19:48:23 -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=4c/z1jan/mW3f9BqFLSAXVqHnIFG9F4t7aDBLtx/S3Y=; b=h610U UIXeWAXMYjT4ubznw+V6cM0/7EdoXNcBCeln5fwmRDjFkRPT8IexHYp9jblMt6Tg j3GD4XGZSsAh/gTJL3CkB++soD8zKhV+0HGzH499gwRVy3j42P0DV94n4M/mF8Kb 3zehJx7sWQ2ltaA6/Ji5I2dUEvNTfj70vtU6zo= 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=4c/z1jan/mW3f9BqFLSAXVqHnIFG9 F4t7aDBLtx/S3Y=; b=MONQPobi3KMAU+AJOn+tN3MG+MgviBNlxlfr4eILPTBUn xpIGHxKl/TgNk6tacj2Q5CLm2dHFTxY4HL+UuiV7QrlTJW2w+R/OIS8KpbqItFBw j9nDhbMUz40kVfYiCW/6t4TiYFwd3DPHa48OM6O9OfaQ3zTgX9c7DiGviUDAvR03 v22WP1w/78aAuFfIM6No1Agq/mli8yyMW+OxgRPSsVQ2k44K7xhNaGoL5sMhYqF/ 2Z026fIrCR2xE6UO297W+YKlvStQggehvHzohawKhUi+Q2HFcLXN9bZ2kSBQPaw3 WG6sGi78T3Ec2DTvLgpP+PZBh7lyOz6OfKivbK+zA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrjeefgddvkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthenuceurghilhhouhhtmecufedt tdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkffojg hfsedttdertdertddtnecuhfhrohhmpedfgfhmihhlihhoucfirdcuvehothgrfdcuoegt ohhtrgessghrrggrphdrohhrgheqnecukfhppeduvdekrdehledrvddtrddvudeinecurf grrhgrmhepmhgrihhlfhhrohhmpegtohhtrgessghrrggrphdrohhrghenucevlhhushht vghrufhiiigvpeek X-ME-Proxy: From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Tue, 29 Jan 2019 19:47:39 -0500 Message-Id: <20190130004811.27372-42-cota@braap.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190130004811.27372-1-cota@braap.org> References: <20190130004811.27372-1-cota@braap.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.25 Subject: [Qemu-devel] [PATCH v6 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: 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 Reviewed-by: Alex Benn=C3=A9e --- 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) =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); @@ -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; =20 irq =3D 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 =3D 1; } else { ht->request_interrupt_window =3D 0; @@ -473,19 +473,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); @@ -544,13 +544,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