From nobody Tue Jun 30 04:32:29 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B254CC433F5 for ; Tue, 25 Jan 2022 22:17:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233632AbiAYWRb (ORCPT ); Tue, 25 Jan 2022 17:17:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233619AbiAYWR2 (ORCPT ); Tue, 25 Jan 2022 17:17:28 -0500 Received: from mail-pf1-x449.google.com (mail-pf1-x449.google.com [IPv6:2607:f8b0:4864:20::449]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABFE2C061744 for ; Tue, 25 Jan 2022 14:17:27 -0800 (PST) Received: by mail-pf1-x449.google.com with SMTP id bd15-20020a056a00278f00b004c7617c47dbso6510885pfb.0 for ; Tue, 25 Jan 2022 14:17:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=reply-to:date:message-id:mime-version:subject:from:to:cc; bh=/+v2uJEC9GW92ygJxqjTBrbdhjHIHPQE/KKmpBU8lZ0=; b=lYn13ORlI48oTAmm5CYnegV5CmPcOEoLSRCO6F7G9up/wWyP0hKgg6VvkxRQeiE6vB XciD6v7qLn1zQDzNBJmOoDTEJ60u771EfrfzDghGgsMzCIgEDu/56L9n1xBOy9W73fnK UwhGd78JmY3CbZVOC6TrOyeD1JxhKntoY4B3yBbHt9seeKevzf54DqyjsgwWQ5kvvWvD kngOZWiv9M/SffHdxNsbR47MVCoAyeokZgN4l9tFTllQ5U/Ip4Eo1sdnfwdKq65QWSuB xJbkfAJxzl1hZo7b8w6bNRyIzh0BZaOPrkSqDVhDa2iB8RVKxp/VPvwkfDVhWBFpVXn/ NlVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:reply-to:date:message-id:mime-version:subject :from:to:cc; bh=/+v2uJEC9GW92ygJxqjTBrbdhjHIHPQE/KKmpBU8lZ0=; b=QjuDytKcDBIUZuq6TlMw6DI/nCQSZhvRg6Ap/wbJeObSMotEhQlO3Nocy1v+8ohGw4 vbZPYPqZtbV0tPVgWkWAdRXBpdb3qWisrmVlLJcRcwP43px1LbqjqR5+qZdBq4NCkMAO PUCRcZg4k1Q0AKiTp28oyRZFmFWy5QHxYyDpTNCHIdyEfTBhitg1fk3CdFBlgDVQMbcq 47qOjsM7dFMjif3J42JZg2Pr17eajvhtNW/U8iiZHuEknAFLVICwjMJWQFbzftIhUU/3 xV79/IK0ID1HZQMp9gnsa72GZcQz9LPXfDG9iBds/sxQtLwRLnzI6ZNlClCalp4BYJVX tBnA== X-Gm-Message-State: AOAM5307gl6jWlPtrYNzywFI2VDUhfVaE58xi03shECfX40beDIqdcus R/HbEEOfFGgYxfgMwE+q+8RquB1fIJU= X-Google-Smtp-Source: ABdhPJyXSBHupuR6L+QWJ2moUDGC1Jp8OBVYsb8BNa//eG7RdCOYo9cgmlA2seVPcwvWxRfLRIJsEtxeJRM= X-Received: from seanjc.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:3e5]) (user=seanjc job=sendgmr) by 2002:a62:3142:0:b0:4c3:a26a:331b with SMTP id x63-20020a623142000000b004c3a26a331bmr20395184pfx.21.1643149047175; Tue, 25 Jan 2022 14:17:27 -0800 (PST) Reply-To: Sean Christopherson Date: Tue, 25 Jan 2022 22:17:25 +0000 Message-Id: <20220125221725.2101126-1-seanjc@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.35.0.rc0.227.g00780c9af4-goog Subject: [PATCH] KVM: selftests: Don't skip L2's VMCALL in SMM test for SVM guest From: Sean Christopherson To: Paolo Bonzini Cc: Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Maxim Levitsky Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Don't skip the vmcall() in l2_guest_code() prior to re-entering L2, doing so will result in L2 running to completion, popping '0' off the stack for RET, jumping to address '0', and ultimately dying with a triple fault shutdown. It's not at all obvious why the test re-enters L2 and re-executes VMCALL, but presumably it serves a purpose. The VMX path doesn't skip vmcall(), and the test can't possibly have passed on SVM, so just do what VMX does. Fixes: d951b2210c1a ("KVM: selftests: smm_test: Test SMM enter from L2") Cc: Maxim Levitsky Signed-off-by: Sean Christopherson --- tools/testing/selftests/kvm/x86_64/smm_test.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/testing/selftests/kvm/x86_64/smm_test.c b/tools/testing/= selftests/kvm/x86_64/smm_test.c index 2da8eb8e2d96..a626d40fdb48 100644 --- a/tools/testing/selftests/kvm/x86_64/smm_test.c +++ b/tools/testing/selftests/kvm/x86_64/smm_test.c @@ -105,7 +105,6 @@ static void guest_code(void *arg) =20 if (cpu_has_svm()) { run_guest(svm->vmcb, svm->vmcb_gpa); - svm->vmcb->save.rip +=3D 3; run_guest(svm->vmcb, svm->vmcb_gpa); } else { vmlaunch(); base-commit: e2e83a73d7ce66f62c7830a85619542ef59c90e4 --=20 2.35.0.rc0.227.g00780c9af4-goog