From nobody Sat Feb 7 07:10:10 2026 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; dkim=fail; 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 1505293839604653.5502547905062; Wed, 13 Sep 2017 02:10:39 -0700 (PDT) Received: from localhost ([::1]:41075 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ds3gs-0006CK-S5 for importer@patchew.org; Wed, 13 Sep 2017 05:10:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34145) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ds3cT-0001d1-Jz for qemu-devel@nongnu.org; Wed, 13 Sep 2017 05:06:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ds3cS-0007bl-DA for qemu-devel@nongnu.org; Wed, 13 Sep 2017 05:06:05 -0400 Received: from mail-vk0-x242.google.com ([2607:f8b0:400c:c05::242]:36913) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ds3cS-0007bZ-A5 for qemu-devel@nongnu.org; Wed, 13 Sep 2017 05:06:04 -0400 Received: by mail-vk0-x242.google.com with SMTP id 184so3319699vkn.4 for ; Wed, 13 Sep 2017 02:06:04 -0700 (PDT) Received: from localhost.localdomain ([190.66.154.128]) by smtp.gmail.com with ESMTPSA id r74sm2677601vkf.19.2017.09.13.02.06.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Sep 2017 02:06:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=sQZfEirLUEfl+0nLwAE0//xDERmby12p+jvWz+cQod0=; b=GI2Q8BH94yL8bLp4SAnG3jxGfk5q7Mi6WMHwgZQDsdojPGvnpbc0TAj6ZNbmb0noiX 7NRcW7Vbj4IXON/P2cApJX0oEqPy/0EzutEt3EPH5R/zJyEZUU/fNCdVbdla5BHwNvjg OP+CreSBBkNV98wnJfyg4J/siII5pBxA30/WrAqLJiMqVoNPqKXSD+l4GgPuMxUuBhUZ yFO3pXS5CqRsEwmZ9uae1an7HCe7FsUkt9vv7tftQ2hIit/5BMNb5xZTTPBotspfMFli CTTw48hArUhL9Pd62XaiLNdfLkliPE6GHpSJh2lWFgg8sKqyDjF8Em97BpofbWgdDkCr tfpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=sQZfEirLUEfl+0nLwAE0//xDERmby12p+jvWz+cQod0=; b=Hd8G18RVh/yTQvrac4i7pu2hbmQGQ/y09o/ndZ0VshuI686wO9rBETLsdNAx8fjNzR 2CZVspUzXWbRNBxuSsaWiShwXeeaLxm8Y0lvoQpaNzJ4tsSIwpUQJZQpnLviqUETRnIm zlmIBAGP4jDXRWNM97T+durmhQZweXR4J4guGJ8sFTXz8nHu5PguNe21y651v3ztXRHI EdLbkkQUyoHQNcbSb/zrRMSywIzAuewnfEgMaBlAXNsIU3HoY1HDo1SOquw1dcdGBi2z 8gCi4ZbeExlETB/FHakHmn88jeZitJjOqPaLTfyopIo24hVX9Ly7nLolsHFmU/dCDkWy xoVg== X-Gm-Message-State: AHPjjUg6ipwZtUGwKdvSh8mHP2muaQf3J/lFwCh45RdwdrqqHajrFOTu 3Xv1CAyBoRM/UfPV X-Google-Smtp-Source: AOwi7QBRJnVziFnUXeM7Ed9gxB0Dh8lH16ohcwLq2FSjaXvjYf6DzYVs1YcNQgwMBA1t0L98uSlhWg== X-Received: by 10.31.107.68 with SMTP id g65mr12480121vkc.9.1505293563736; Wed, 13 Sep 2017 02:06:03 -0700 (PDT) From: Sergio Andres Gomez Del Real X-Google-Original-From: Sergio Andres Gomez Del Real To: qemu-devel@nongnu.org Date: Wed, 13 Sep 2017 04:05:22 -0500 Message-Id: <20170913090522.4022-15-Sergio.G.DelReal@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170913090522.4022-1-Sergio.G.DelReal@gmail.com> References: <20170913090522.4022-1-Sergio.G.DelReal@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400c:c05::242 Subject: [Qemu-devel] [PATCH v4 14/14] hvf: inject General Protection Fault when vmexit through vmcall 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: Sergio Andres Gomez Del Real , pbonzini@redhat.com, stefanha@gmail.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This patch injects a GP fault when the guest vmexit's by executing a vmcall instruction. Signed-off-by: Sergio Andres Gomez Del Real --- target/i386/hvf-all.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/i386/hvf-all.c b/target/i386/hvf-all.c index 105a63ad4f..0a544470ad 100644 --- a/target/i386/hvf-all.c +++ b/target/i386/hvf-all.c @@ -903,7 +903,9 @@ int hvf_vcpu_exec(CPUState *cpu) macvm_set_rip(cpu, rip + ins_len); break; case VMX_REASON_VMCALL: - /* TODO: inject #GP fault */ + env->exception_injected =3D EXCP0D_GPF; + env->has_error_code =3D true; + env->error_code =3D 0; break; default: error_report("%llx: unhandled exit %llx\n", rip, exit_reason); --=20 2.14.1