From nobody Sun Feb 8 21:47:31 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 1504584383806374.26706660158186; Mon, 4 Sep 2017 21:06:23 -0700 (PDT) Received: from localhost ([::1]:56758 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dp582-0001jx-Pq for importer@patchew.org; Tue, 05 Sep 2017 00:06:22 -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) 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) 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) 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+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 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 =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