Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp819482rdf; Fri, 3 Nov 2023 17:04:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG0mxkQvvNh1gfU/OUlvonJeHhwupO35XavVUTCeCvHrjmd1LrAJBEOgcEDlzDLJaey9S8l X-Received: by 2002:a05:6808:1513:b0:3a7:2621:2daf with SMTP id u19-20020a056808151300b003a726212dafmr27061080oiw.42.1699056282129; Fri, 03 Nov 2023 17:04:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699056282; cv=none; d=google.com; s=arc-20160816; b=MXcamk9wa7QCzZPMHJ9pd9jQB0BL7uCGdoWUUsRsEHhTfKl8H3r+CX5V3XfNCNCwiq jeUTNZtCj2IgdIvHvPBXE/NeV2y38VI4I9EsGmZrPhgC8tjY8wLywBhcdzg8fs33S3pD U7ji4cbVDvOQAWQx7u+5f4tQwiSnZ8md9yyLGmJdMwJKiNOd3uGVD6Axas6ycW1+stv8 AImQHzuFjx4hmVWNd3HWnOw1pv8J38b99lDqBHeoaLAOhCnwbcYPgjZsObvyjySiJ2L1 8ZYfFzLp63cTD0zAiGlejXifcHTfIhMnNwSs9UUaa3I6IcI2xWLBL/8S1GWFL2xdzXd8 ddmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:reply-to:dkim-signature; bh=ivj987AddR8Owbgd5+Jve951XXZrxlCEMaI81HO/fho=; fh=z/UQYx9FUD9Bz9JyYrmi2ijAScp29gktKr8lejSUuXU=; b=CK+JprLLvHswMiv0QTIOu2ynyv9zP9cDePxlKzsFax6kfcO8IW2Zf8i3+I82hqEjJU Wa6Fw9cWl+yxwkHAEkiWjftHX9JZwelvapE3gLobAfsdbixz32NXGZ6tpzjl96IuRukF v1eOdw8mMVY2PbN4MczMcQOPoUv45BqndS8NSE86SYvX9jDgCjvESGzWX44j4x+dP3NZ gpD5XHJtpgj40E0E//G+J87/6HPWI+Pd+mkmKt+vhjWCrOEd7EAZSyUH50wNp89Eq7zy EGspHoedX8mTvofiQqBC2eS37lhcPom0K4EPsX3QrDChvRVHC8Qls5GJVc/k/prG0PIi tpGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=vB8uk2ra; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id az2-20020a056a02004200b005b869e53b1csi2705927pgb.797.2023.11.03.17.04.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 17:04:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=vB8uk2ra; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 4411B82976BF; Fri, 3 Nov 2023 17:04:31 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232286AbjKDAEF (ORCPT + 99 others); Fri, 3 Nov 2023 20:04:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232371AbjKDADk (ORCPT ); Fri, 3 Nov 2023 20:03:40 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE5411728 for ; Fri, 3 Nov 2023 17:03:17 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-5b0c27d504fso20296597b3.1 for ; Fri, 03 Nov 2023 17:03:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1699056197; x=1699660997; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=ivj987AddR8Owbgd5+Jve951XXZrxlCEMaI81HO/fho=; b=vB8uk2rachPlU9IgHAvpB3Hex6MGK3TRc2L9isZdLll/Fr2xUopomBfabgLbdmkMt5 91EPG9deV9taAczbA/Y8BNhdKPfuata77syMBR4C152f5AK6DVxSOESXBJPmbtQjzhDl dOgvwwi9GmZwq+P+FQrSpRMZIi03x5MBt5ga0s1KA3YCFl6L5hIHD8hN7d6nUWDyF6d3 TIOkNf+noq6k30PDhvpxRCrfIqUJ8zYYUZZc4y3D2DYxVbvCYMclNXkIYicJBEKr/yVA urW+2xo+qqL/tDA6WuMdaL2mxadjQ+vhERKIbgGm5mWDKwi8LxXTKdhUzcqhcTr0n6v7 x84Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699056197; x=1699660997; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ivj987AddR8Owbgd5+Jve951XXZrxlCEMaI81HO/fho=; b=GOf4a3B9vTIoLcRQDMRn3UZC7cYzQneCKU1oxgNDlJeimIRE7/PqKHakkWsSwJVG/c O0WusxQPqLfnrMUc0mq6UJUOhf7LGArnaC8DV34xpHXQNgZKtAwicsP80wDpvvqau4um XqSd2/TTmGsGPeYEtS+S/x1p8zdamFIr6jNc/XKXiKLL23Bi0LMKNEmAT3rG00hnuINc dMDY4Lqj71SRoanxcZEjEQlT5xy+tmPg9UG6IDVcJ1D7eef5iOhWG7K5MuQ0Qu4cegdy Fyhnm8y5WYKuSq9fEbgqgTiENAs67vRrwl7OKHFWuoK3xWK5DAbkMiRlZWNs5egxlVrB /hBA== X-Gm-Message-State: AOJu0Yx1HOHGKhZnXkIAIlWeaBJgUzTqfZQIh05NiCjkEec4+WtMPO1R CTTilY396WQmj/gl7qI3rNhaIfQkuD0= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:690c:3690:b0:5ae:75db:92c5 with SMTP id fu16-20020a05690c369000b005ae75db92c5mr114654ywb.2.1699056197083; Fri, 03 Nov 2023 17:03:17 -0700 (PDT) Reply-To: Sean Christopherson Date: Fri, 3 Nov 2023 17:02:37 -0700 In-Reply-To: <20231104000239.367005-1-seanjc@google.com> Mime-Version: 1.0 References: <20231104000239.367005-1-seanjc@google.com> X-Mailer: git-send-email 2.42.0.869.gea05f2083d-goog Message-ID: <20231104000239.367005-20-seanjc@google.com> Subject: [PATCH v6 19/20] KVM: selftests: Move KVM_FEP macro into common library header From: Sean Christopherson To: Sean Christopherson , Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Kan Liang , Dapeng Mi , Jinrong Liang , Like Xu , Jim Mattson , Aaron Lewis Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 03 Nov 2023 17:04:31 -0700 (PDT) Move the KVM_FEP definition, a.k.a. the KVM force emulation prefix, into processor.h so that it can be used for other tests besides the MSR filter test. Signed-off-by: Sean Christopherson --- tools/testing/selftests/kvm/include/x86_64/processor.h | 3 +++ tools/testing/selftests/kvm/x86_64/userspace_msr_exit_test.c | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/kvm/include/x86_64/processor.h b/tools/testing/selftests/kvm/include/x86_64/processor.h index 47612742968d..764e7c58a518 100644 --- a/tools/testing/selftests/kvm/include/x86_64/processor.h +++ b/tools/testing/selftests/kvm/include/x86_64/processor.h @@ -22,6 +22,9 @@ extern bool host_cpu_is_intel; extern bool host_cpu_is_amd; +/* Forced emulation prefix, used to invoke the emulator unconditionally. */ +#define KVM_FEP "ud2; .byte 'k', 'v', 'm';" + #define NMI_VECTOR 0x02 #define X86_EFLAGS_FIXED (1u << 1) diff --git a/tools/testing/selftests/kvm/x86_64/userspace_msr_exit_test.c b/tools/testing/selftests/kvm/x86_64/userspace_msr_exit_test.c index 9e12dbc47a72..ab3a8c4f0b86 100644 --- a/tools/testing/selftests/kvm/x86_64/userspace_msr_exit_test.c +++ b/tools/testing/selftests/kvm/x86_64/userspace_msr_exit_test.c @@ -12,8 +12,6 @@ #include "kvm_util.h" #include "vmx.h" -/* Forced emulation prefix, used to invoke the emulator unconditionally. */ -#define KVM_FEP "ud2; .byte 'k', 'v', 'm';" static bool fep_available; #define MSR_NON_EXISTENT 0x474f4f00 -- 2.42.0.869.gea05f2083d-goog