From patchwork Wed Aug 30 08:27:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?UTF-8?q?Sergio=20Andr=C3=A9s=20G=C3=B3mez=20Del=20Real?= X-Patchwork-Id: 9928895 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5760260380 for ; Wed, 30 Aug 2017 08:34:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 477DA2811A for ; Wed, 30 Aug 2017 08:34:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3BFEB28161; Wed, 30 Aug 2017 08:34:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E657C2811A for ; Wed, 30 Aug 2017 08:33:59 +0000 (UTC) Received: from localhost ([::1]:49003 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmyRi-0006by-KH for patchwork-qemu-devel@patchwork.kernel.org; Wed, 30 Aug 2017 04:33:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60612) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmyLt-0002g9-NG for qemu-devel@nongnu.org; Wed, 30 Aug 2017 04:27:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dmyLp-0000S0-OP for qemu-devel@nongnu.org; Wed, 30 Aug 2017 04:27:57 -0400 Received: from mail-ua0-x241.google.com ([2607:f8b0:400c:c08::241]:34721) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dmyLp-0000Rs-KV for qemu-devel@nongnu.org; Wed, 30 Aug 2017 04:27:53 -0400 Received: by mail-ua0-x241.google.com with SMTP id 105so2346980uad.1 for ; Wed, 30 Aug 2017 01:27:53 -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=JS9h4IR1W4wkzkxDlH8v7NiNkRiyUCfYOFTl8tcbF/0=; b=VW/m9j4jyvOmGORAAA0ZF67M4ufrqSSndj5G0rTr4gaC7pWB5dAzvu09GyhoFHW7aT ykSfNvJsyKH+aJNT+L90MFFAVhvl5JwtBQ/mNbjZjc+0NkIpxqRrhn+w5SNQWEM7XVOp +wbQVLAEyNQS8JCsmUyuZTbbjsCb9mNr403eJKvU+dgVXUhQ1cxcytIYWstcN7/9TY8Y T/tzscDdbSCWgM0KiG8k3D/AcvEE749o+mynkd8s+rpNZU0OYx2rbVs9TM4gizK5bbjx vNx+4vZ2HtQL9zMFe5P7trMEmuQmVeQexeEnoiS2UX+s5EJLy9Q8QD1nvFgXsgMW8HWX cmpw== 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=JS9h4IR1W4wkzkxDlH8v7NiNkRiyUCfYOFTl8tcbF/0=; b=VcEEiw9V3I0VDzXuO+b7eo7PGEUgaHoxDq/dhmJGnOcGgPrKV+r7Gl9P/aL2335yHh ihuD9OqvhYX0Ks/qELSExvh3CcvopztNTD5LdNsfbPuL+bg6nuhkhLYR/rsXfcxRYN+E Aldrih0z8cdsqxzvYWw/E9RoZNoTE0vsP4MWnwC8ouFpJjpzHs5w3iurcRbGI9+yk1L3 OLY8V2c4g9hn1coUXeqn9ZTJa4cG1BlFhb6gF+SFqvPCOEJSu2QSvtiZ37OjzcMDxSI8 pNkEBEU6BPS6Eoup5dN9mAhvEk5ZXNMuqah0ei3Yk3Xzo/I4Wa7eUNQPxNmEAjP8cvpw KYPA== X-Gm-Message-State: AHYfb5jx6AEuaQ1vxapM8jtWZHH7LvgymGTidDZqBgElCJUIAtOGNp7s G6SSutp2dKxbQjBI X-Received: by 10.176.69.6 with SMTP id r6mr540985uar.170.1504081673014; Wed, 30 Aug 2017 01:27:53 -0700 (PDT) Received: from localhost.localdomain ([191.109.6.85]) by smtp.gmail.com with ESMTPSA id h74sm1079197vka.8.2017.08.30.01.27.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Aug 2017 01:27:52 -0700 (PDT) From: Sergio Andres Gomez Del Real X-Google-Original-From: Sergio Andres Gomez Del Real To: qemu-devel@nongnu.org Date: Wed, 30 Aug 2017 03:27:02 -0500 Message-Id: <20170830082702.3011-14-Sergio.G.DelReal@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170830082702.3011-1-Sergio.G.DelReal@gmail.com> References: <20170830082702.3011-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:c08::241 Subject: [Qemu-devel] [PATCH v2 13/13] 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 Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP This commit 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 430affd9ce..ccd19bd629 100644 --- a/target/i386/hvf-all.c +++ b/target/i386/hvf-all.c @@ -1076,7 +1076,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 = EXCP0D_GPF; + env->has_error_code = true; + env->error_code = 0; break; default: error_report("%llx: unhandled exit %llx\n", rip, exit_reason);