From patchwork Fri May 14 15:13:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 438939 Delivered-To: patch@linaro.org Received: by 2002:a02:b78d:0:0:0:0:0 with SMTP id f13csp448819jam; Fri, 14 May 2021 08:37:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVkUrQVrx1iTFkF/k5SkUXBXeeTuDwFgqJjjtRl2jTJFaKgdPAMd3IA/Sn5JY7/rXdy0jt X-Received: by 2002:a05:6e02:d03:: with SMTP id g3mr154765ilj.156.1621006649651; Fri, 14 May 2021 08:37:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621006649; cv=none; d=google.com; s=arc-20160816; b=jbY4/ZqbZDEZqRh6xRoYikZTZ2X7OYVO8+gizMGI5L94SAVzYaWJjLZEIGNJJ5O1d8 MCocmkDQuDIsz367MkqYjT9hRbTn5y8xXkTNFpXrZ5gPRh/8kkuB15pEzgHA/T+71Nel k39xrrCR6Hyo6vVwYsONEJZsml1CC1FdQiS83KSoyBU/JhsyJwx0vwucoYfLEB5fULYj 5f0Ayex2brP0+qoiKto1JdsZ7QjvcagtaQIOntLTUMwjT4/93RmeHYqedqiuFeJdx/1o 9j2QD57FfkzTeoz++gnyjreoTN3xGwgHFyXSkyVroDw+BnFfmCulZiYQowzdbQCnF9JX AxaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=Ur+FEBIPEpzkrS9ckyRA/1MIuAhPbqvvO8o/uVK389I=; b=BrXF8Obbh7ZMK9ALoWod2Q1fP1/pzsdbyKpTzSfQYWCX3rW245WKqEQhbkY5BT4cSt uLhhEbOlAO/qDrgssYSIEIb0j54SEi7MZ+0CdwzJlpSYBLpmFq4LFMGfrKIW7m0Xko4I UNIYgEGOyTrBKgXyR9pMTQnUlPoCRZGzd8Lhspsi3qv0I95WEqK13hgEQM0AQyvHbi2c +/JBpbknKOCy2tb1a9rD6ePiuV2Pmzi1VvoQ0uMRB2pDOJd9dvQcQ6LIWOdD3FDGbalQ wyEsc9lm1nyWkXoZVKjAZfjeTeD4nPa9Ufm++OZP4ZHxMo6VHg41dYvbIWyxneAPrk/z vgzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=wsErnXgR; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y24si7771963ior.40.2021.05.14.08.37.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 May 2021 08:37:29 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=wsErnXgR; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:49976 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhZsX-0006mt-1G for patch@linaro.org; Fri, 14 May 2021 11:37:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37006) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhZW8-00062s-O0 for qemu-devel@nongnu.org; Fri, 14 May 2021 11:14:21 -0400 Received: from mail-qk1-x734.google.com ([2607:f8b0:4864:20::734]:33397) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lhZW3-00077K-Fz for qemu-devel@nongnu.org; Fri, 14 May 2021 11:14:20 -0400 Received: by mail-qk1-x734.google.com with SMTP id f29so16773996qka.0 for ; Fri, 14 May 2021 08:14:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ur+FEBIPEpzkrS9ckyRA/1MIuAhPbqvvO8o/uVK389I=; b=wsErnXgRO6CtFr0Mho/xPAqnHZPTG0czsUZI4zr9GL0Uwp6Og33b9aG/V+Uq4BfO3H t1PrpO1MCXZoSqYIPAIZT5ZYqSRxVqM7nf2KDGcAogICSF2mPRlh6FxOenK/MqfqKf0n EPCHTru/FJKeeprfg+vOcIB7eAzBH57g5bSCXO0CYUAEr2D1qcQUag3+DGKRrWiv3qn1 +sxYO9fbFxNAXki/hEAukHD3VT9gKy+xpUjdH/n/78D2TE+OoUrgi49YbXd/vT/ZhkE3 2ADDD6JgozsvNCLFH2+tLrb0ZgMYYOfRwmArameHzd6ujlHEi0jI4jF7fqemiF2P4SF3 j9Zg== 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:mime-version:content-transfer-encoding; bh=Ur+FEBIPEpzkrS9ckyRA/1MIuAhPbqvvO8o/uVK389I=; b=MmEotjF/27eDJ5+g108+CmK5Cd1sfeSzVYNLou3pvXvA1TFTU7nLklxhQH8G5Qi82U 1NYeOic1ewO6WqV/1ek6OCJQEPBaN76+aeaxHPYlb9B46LZoxNd13iaWNwQR5ejRVACg KD6Y3FHV9D3sHfIVHfcrv7foCvW0fa80gfGcXDC9zF0Zk2CDwSTU4AFBU2+aVW7b60/9 WTupCTl2cXh5il0X7sGbly/1D2tbLiEmJ9QfIQpUMOHRjwVDxrjG56uBvr3IW1fnSTaS +tMaiip8vHl9osfr2emb6kn7wIwFeufs6nhM6sbjMXOT+Cv/D3YVm9/dejWYyW/iicqi P96Q== X-Gm-Message-State: AOAM531xPt842BlKppDL1FAWJCYBKmKgw/H5Xw1Kn5YDHkVpUIrJAe2y cZQFKYkM0B9ZWG05FYkOqk4NZjkhhLExuaiThCw= X-Received: by 2002:a37:2714:: with SMTP id n20mr42912160qkn.434.1621005253474; Fri, 14 May 2021 08:14:13 -0700 (PDT) Received: from localhost.localdomain (163.189-204-200.bestelclientes.com.mx. [189.204.200.163]) by smtp.gmail.com with ESMTPSA id u6sm4778966qkj.117.2021.05.14.08.14.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 08:14:13 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 32/50] target/i386: Implement skinit in translate.c Date: Fri, 14 May 2021 10:13:24 -0500 Message-Id: <20210514151342.384376-33-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210514151342.384376-1-richard.henderson@linaro.org> References: <20210514151342.384376-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::734; envelope-from=richard.henderson@linaro.org; helo=mail-qk1-x734.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pbonzini@redhat.com, f4bug@amsat.org, ehabkost@redhat.com, cfontana@suse.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Our sysemu implementation is a stub. We can already intercept instructions for vmexit, and raising #UD is trivial. Signed-off-by: Richard Henderson --- target/i386/helper.h | 1 - target/i386/tcg/sysemu/svm_helper.c | 7 ------- target/i386/tcg/translate.c | 7 +++---- target/i386/tcg/user/svm_stubs.c | 4 ---- 4 files changed, 3 insertions(+), 16 deletions(-) -- 2.25.1 Reviewed-by: Paolo Bonzini diff --git a/target/i386/helper.h b/target/i386/helper.h index 095520f81f..7a09efd55b 100644 --- a/target/i386/helper.h +++ b/target/i386/helper.h @@ -117,7 +117,6 @@ DEF_HELPER_2(vmload, void, env, int) DEF_HELPER_2(vmsave, void, env, int) DEF_HELPER_1(stgi, void, env) DEF_HELPER_1(clgi, void, env) -DEF_HELPER_1(skinit, void, env) DEF_HELPER_2(invlpga, void, env, int) /* x86 FPU */ diff --git a/target/i386/tcg/sysemu/svm_helper.c b/target/i386/tcg/sysemu/svm_helper.c index c4e8e717a9..79c73d67af 100644 --- a/target/i386/tcg/sysemu/svm_helper.c +++ b/target/i386/tcg/sysemu/svm_helper.c @@ -412,13 +412,6 @@ void helper_clgi(CPUX86State *env) env->hflags2 &= ~HF2_GIF_MASK; } -void helper_skinit(CPUX86State *env) -{ - cpu_svm_check_intercept_param(env, SVM_EXIT_SKINIT, 0, GETPC()); - /* XXX: not implemented */ - raise_exception(env, EXCP06_ILLOP); -} - void helper_invlpga(CPUX86State *env, int aflag) { X86CPU *cpu = env_archcpu(env); diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 57ae515796..aeb72cd846 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -7578,10 +7578,9 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) || !PE(s)) { goto illegal_op; } - gen_update_cc_op(s); - gen_jmp_im(s, pc_start - s->cs_base); - gen_helper_skinit(cpu_env); - break; + gen_svm_check_intercept(s, pc_start, SVM_EXIT_SKINIT); + /* If not intercepted, not implemented -- raise #UD. */ + goto illegal_op; case 0xdf: /* INVLPGA */ if (!SVME(s) || !PE(s)) { diff --git a/target/i386/tcg/user/svm_stubs.c b/target/i386/tcg/user/svm_stubs.c index 97528b56ad..63b37f0de6 100644 --- a/target/i386/tcg/user/svm_stubs.c +++ b/target/i386/tcg/user/svm_stubs.c @@ -46,10 +46,6 @@ void helper_clgi(CPUX86State *env) { } -void helper_skinit(CPUX86State *env) -{ -} - void helper_invlpga(CPUX86State *env, int aflag) { }