From patchwork Fri Feb 25 09:49:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hou Wenlong X-Patchwork-Id: 12759995 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 5592EC433F5 for ; Fri, 25 Feb 2022 09:49:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239247AbiBYJuR (ORCPT ); Fri, 25 Feb 2022 04:50:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233675AbiBYJuP (ORCPT ); Fri, 25 Feb 2022 04:50:15 -0500 Received: from out0-141.mail.aliyun.com (out0-141.mail.aliyun.com [140.205.0.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E972424CCFE for ; Fri, 25 Feb 2022 01:49:43 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R181e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018047202;MF=houwenlong.hwl@antgroup.com;NM=1;PH=DS;RN=4;SR=0;TI=SMTPD_---.Mvtm120_1645782581; Received: from localhost(mailfrom:houwenlong.hwl@antgroup.com fp:SMTPD_---.Mvtm120_1645782581) by smtp.aliyun-inc.com(127.0.0.1); Fri, 25 Feb 2022 17:49:41 +0800 From: "Hou Wenlong" To: kvm@vger.kernel.org Cc: "Paolo Bonzini" , "Sean Christopherson" , "Hou Wenlong" Subject: [kvm-unit-tests PATCH v4 0/3] x86/emulator: Add some tests for loading segment descriptor in emulator Date: Fri, 25 Feb 2022 17:49:24 +0800 Message-Id: X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Add some far ret and far jmp tests for the related x86 emulator bugs[*]. Those tests would be tested both on hardware and emulator. Enable kvm.force_emulation_prefix to test them on emulator. Changed from v3: - Fix build failure with --target-efi. Changed from v2: - Fix some complication errors, which are not gotten in my gcc. - Rename lret as far ret, and rename ljmp as far jmp. Changed from v1: - As Sean suggested, refactor the test loop to make the code simple. v3: https://lore.kernel.org/kvm/cover.1644481282.git.houwenlong.hwl@antgroup.com [*] https://lore.kernel.org/kvm/cover.1644292363.git.houwenlong.hwl@antgroup.com Hou Wenlong (3): x86/emulator: Add some tests for far ret instruction emulation x86/emulator: Rename test_ljmp() as test_far_jmp() x86/emulator: Add some tests for far jmp instruction emulation x86/emulator.c | 203 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 189 insertions(+), 14 deletions(-) --- 2.31.1