{"id":806344,"url":"http://patchwork.ozlabs.org/api/1.0/patches/806344/?format=json","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/1.0/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20170828015654.2530-15-Sergio.G.DelReal@gmail.com>","date":"2017-08-28T01:56:54","name":"[14/14] hvf: inject General Protection Fault when vmexit through vmcall","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"be3a92f719d9866c447edafcfc405c83331ac167","submitter":{"id":70675,"url":"http://patchwork.ozlabs.org/api/1.0/people/70675/?format=json","name":"Sergio Andres Gomez Del Real","email":"sergio.g.delreal@gmail.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20170828015654.2530-15-Sergio.G.DelReal@gmail.com/mbox/","series":[{"id":56,"url":"http://patchwork.ozlabs.org/api/1.0/series/56/?format=json","date":"2017-08-28T01:56:40","name":"add support for Hypervisor.framework in QEMU","version":1,"mbox":"http://patchwork.ozlabs.org/series/56/mbox/"}],"check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/806344/checks/","tags":{},"headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"mMUSYgeT\"; dkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xgZnm6wPJz9sNq\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 28 Aug 2017 12:04:12 +1000 (AEST)","from localhost ([::1]:36524 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dm9PO-0001Ez-Tx\n\tfor incoming@patchwork.ozlabs.org; Sun, 27 Aug 2017 22:04:10 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:42162)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <sergio.g.delreal@gmail.com>) id 1dm9JL-0005Au-Kz\n\tfor qemu-devel@nongnu.org; Sun, 27 Aug 2017 21:57:56 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <sergio.g.delreal@gmail.com>) id 1dm9JJ-0001PF-Ky\n\tfor qemu-devel@nongnu.org; Sun, 27 Aug 2017 21:57:55 -0400","from mail-vk0-x242.google.com ([2607:f8b0:400c:c05::242]:34776)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <sergio.g.delreal@gmail.com>)\n\tid 1dm9JJ-0001Nr-99\n\tfor qemu-devel@nongnu.org; Sun, 27 Aug 2017 21:57:53 -0400","by mail-vk0-x242.google.com with SMTP id l132so1887362vke.1\n\tfor <qemu-devel@nongnu.org>; Sun, 27 Aug 2017 18:57:53 -0700 (PDT)","from localhost.localdomain ([191.109.6.191])\n\tby smtp.gmail.com with ESMTPSA id\n\ty12sm2696824uad.22.2017.08.27.18.57.51\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tSun, 27 Aug 2017 18:57:52 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=csc4rV+F45UbQaFRXt6lvY/+i947G+pQjwkK520n0AY=;\n\tb=mMUSYgeTRyrkP09TyITPtVKx3fsV2b+kLdVftd5QBaZwxbOkL/LYacwzcDLd0IOrCW\n\t/QW6CCmVJq7xJktSU//33CL9r8h5RolLUAvuHcadcsYIJgcteIkcIxeybsIBwJdS+sRZ\n\tSXRzwxkHZk/Hb0JP79p9AwLYtIASRGQ8VVP/m+3WULesIyDJc8jMg9W8CzFb4kgo6HI3\n\tll9UtsVD3dj87b4IbKoH9YttgZhT65z7wJUIBIl5TYJA75Wck8dUw6PnAcKGizDuHUy9\n\txKg++gaRUBhE1xPVqpDXYCVF1hsZbNMkCixSzljkV5mAJMc6MBcfZ7wGalQPXXwU2rCx\n\ttTYw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=csc4rV+F45UbQaFRXt6lvY/+i947G+pQjwkK520n0AY=;\n\tb=rNMXzYqT+XWj0S/4ID0sp+1I2RBadkiSa+HLaRjXaT+dxKNBvyuZH+mWt/+MBLC5ra\n\tuUzGJaJtolp4nccJ6GlsDMgLprVebDvUE/u9ymTyEsqfo1h4IYZIBdLgeSRHTfIE7El1\n\t0sHgMNKcLXLDXXylPca9e2MeikH7PpZSVVcznDApiU2Y279h9ZEIMCpQ6SNo8kPfpQPd\n\tnkbTwHqAGPIReANW4yRvT5CVzkmS8T/gZ1UlKQWIvSiCEJ/ghsVdg9+J9zoaBYdVJLMP\n\tkC8zuOAl1vzH3Z0bl8mvAb+WzTq0UoFuqJLltNrl22WcaSqMrEEL4dypBpQQm9QggY76\n\t5dmw==","X-Gm-Message-State":"AHYfb5gjNBAOw8eqo7MKTY5+N08x1xDk0QoQJbvEyxGzXOsHClBe8ayY\n\t67AQfoS4vzqkPPKV","X-Received":"by 10.31.14.11 with SMTP id 11mr3479323vko.69.1503885472528;\n\tSun, 27 Aug 2017 18:57:52 -0700 (PDT)","From":"Sergio Andres Gomez Del Real <sergio.g.delreal@gmail.com>","X-Google-Original-From":"Sergio Andres Gomez Del Real\n\t<Sergio.G.DelReal@gmail.com>","To":"qemu-devel@nongnu.org","Date":"Sun, 27 Aug 2017 20:56:54 -0500","Message-Id":"<20170828015654.2530-15-Sergio.G.DelReal@gmail.com>","X-Mailer":"git-send-email 2.11.0","In-Reply-To":"<20170828015654.2530-1-Sergio.G.DelReal@gmail.com>","References":"<20170828015654.2530-1-Sergio.G.DelReal@gmail.com>","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2607:f8b0:400c:c05::242","Subject":"[Qemu-devel] [PATCH 14/14] hvf: inject General Protection Fault\n\twhen vmexit through vmcall","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Sergio Andres Gomez Del Real <Sergio.G.DelReal@gmail.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"},"content":"This commit injects a GP fault when the guest vmexit's by executing a\nvmcall instruction.\n\nSigned-off-by: Sergio Andres Gomez Del Real <Sergio.G.DelReal@gmail.com>\n---\n target/i386/hvf-all.c | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)","diff":"diff --git a/target/i386/hvf-all.c b/target/i386/hvf-all.c\nindex 25e4fd4eb2..fdb2b12c8a 100644\n--- a/target/i386/hvf-all.c\n+++ b/target/i386/hvf-all.c\n@@ -1064,7 +1064,9 @@ int hvf_vcpu_exec(CPUState *cpu)\n             macvm_set_rip(cpu, rip + ins_len);\n             break;\n         case VMX_REASON_VMCALL:\n-            /* TODO: inject #GP fault */\n+            env->exception_injected = EXCP0D_GPF;\n+            env->has_error_code = true;\n+            env->error_code = 0;\n             break;\n         default:\n             fprintf(stderr, \"%llx: unhandled exit %llx\\n\", rip, exit_reason);\n","prefixes":["14/14"]}