From patchwork Thu Feb 10 08:46:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hou Wenlong X-Patchwork-Id: 12741564 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 500D2C433EF for ; Thu, 10 Feb 2022 08:47:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237885AbiBJIq6 (ORCPT ); Thu, 10 Feb 2022 03:46:58 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:45272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237863AbiBJIq4 (ORCPT ); Thu, 10 Feb 2022 03:46:56 -0500 Received: from out0-149.mail.aliyun.com (out0-149.mail.aliyun.com [140.205.0.149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C132C10B2 for ; Thu, 10 Feb 2022 00:46:51 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R681e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018047203;MF=houwenlong.hwl@antgroup.com;NM=1;PH=DS;RN=3;SR=0;TI=SMTPD_---.MnuUICc_1644482808; Received: from localhost(mailfrom:houwenlong.hwl@antgroup.com fp:SMTPD_---.MnuUICc_1644482808) by smtp.aliyun-inc.com(127.0.0.1); Thu, 10 Feb 2022 16:46:48 +0800 From: "Hou Wenlong" To: kvm@vger.kernel.org Cc: "Sean Christopherson" , "Hou Wenlong" Subject: [kvm-unit-tests PATCH v3 0/2] x86/emulator: Add some tests for loading segment descriptor in emulator Date: Thu, 10 Feb 2022 16:46:32 +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 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. v2: https://lore.kernel.org/kvm/cover.1644311445.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 | 202 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 188 insertions(+), 14 deletions(-) --- 2.31.1