From patchwork Tue Sep 5 03:54:57 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: 9937761 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 130616038C for ; Tue, 5 Sep 2017 04:06:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0675B28874 for ; Tue, 5 Sep 2017 04:06:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EF6C128876; Tue, 5 Sep 2017 04:06:01 +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 A843028874 for ; Tue, 5 Sep 2017 04:06:01 +0000 (UTC) Received: from localhost ([::1]:56755 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dp57g-0000xb-W4 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 05 Sep 2017 00:06:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41734) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dp4y1-0001y8-Va for qemu-devel@nongnu.org; Mon, 04 Sep 2017 23:56:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dp4xw-0008E9-PS for qemu-devel@nongnu.org; Mon, 04 Sep 2017 23:56:02 -0400 Received: from mail-vk0-x243.google.com ([2607:f8b0:400c:c05::243]:37787) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dp4xw-0008DY-Jw for qemu-devel@nongnu.org; Mon, 04 Sep 2017 23:55:56 -0400 Received: by mail-vk0-x243.google.com with SMTP id 184so713224vkn.4 for ; Mon, 04 Sep 2017 20:55:56 -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=Dmh7f0H7KDxGlSuaiP1VmQ86fT19tVOGb7IoeZYfZdw=; b=e+7NRmOWh+cuwZhPkp/z74aeY2N1B1NLI4OEfkji8GShmyGx1VhmWlw3orGli/Bsew 0XKMv6MsOdHx69LitozSK/HpyhiqLoF/BNNA+jNldA3zrS4tax/Iyp2cVhadWtJa/c21 2sVIXOLHBCznO4Z3TMwcIlgMVfwobTAKwoEcCfufIwHNCuJJ00TUAgJOPuWsjnPu60mH 5Qj/nH7WIBIv26FhAxHi2KHHJ/r4vjCaHIYlwzTwjubtAoo0IQZKiEIoAF8QcTb3OwqB qHWUDKfKZk1hnWa35AtLP8ClEtabnudnn6zqtu3/tBbRtMCnuuYkCwDy6c5qst9OnfLM x5ow== 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=Dmh7f0H7KDxGlSuaiP1VmQ86fT19tVOGb7IoeZYfZdw=; b=bTMM50MEYl9njrEB/5cntk0Dk/dU0lsDzp0n3cGTZs+0Net81erTA4fGwLslIk9g1A Ml9nRN1xeY1TjHZK/2AuS7ptWO1/uMtJfYTodZuYAH96ZLpZYh8n9q/D23TB3AAqDvCb ENV4XqTEqNmHPg2oAIBMOGfSa1nNt0TgRNSIjguN2T72+PtxP6OaRakzIU5GhmG16FC8 mHbudb+bZI9KLk0CTt5zspTXrPj2GRPEeDcRhQEVzyeH3kmIbG/3trOlTH1Bq1f64VO5 B8yX2WBT4Qqe6HKiPZOhFnAQ3z2pS+s8bkxLIObhInQuQ2121S5PTlQA54JRD2pqIpoL oVjg== X-Gm-Message-State: AHPjjUiN0YBcQtDGgWWsvi0Dt9bhWKNsuwmDCFsW47KHabi+ya8kRhvb DH57x6eBjhIWAOvK X-Google-Smtp-Source: ADKCNb6UnekckK28zKSH/wJMAnCaG9xjYOiL8QX+SENmxQ7QUWUh4S1A3TylgFvShtTBAnZ2g29OGA== X-Received: by 10.31.188.11 with SMTP id m11mr1514663vkf.110.1504583755855; Mon, 04 Sep 2017 20:55:55 -0700 (PDT) Received: from localhost.localdomain ([161.10.80.59]) by smtp.gmail.com with ESMTPSA id d206sm1877252vka.29.2017.09.04.20.55.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Sep 2017 20:55:55 -0700 (PDT) From: Sergio Andres Gomez Del Real X-Google-Original-From: Sergio Andres Gomez Del Real To: qemu-devel@nongnu.org Date: Mon, 4 Sep 2017 22:54:57 -0500 Message-Id: <20170905035457.3753-15-Sergio.G.DelReal@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170905035457.3753-1-Sergio.G.DelReal@gmail.com> References: <20170905035457.3753-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::243 Subject: [Qemu-devel] [PATCH v3 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+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 8fc6a0b5d1..cdf4d6f8e7 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 = EXCP0D_GPF; + env->has_error_code = true; + env->error_code = 0; break; default: error_report("%llx: unhandled exit %llx\n", rip, exit_reason);