From patchwork Tue Feb 21 16:36:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mingwei Zhang X-Patchwork-Id: 60174 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp115207wrd; Tue, 21 Feb 2023 08:58:39 -0800 (PST) X-Google-Smtp-Source: AK7set+iGNCo5TPsRoC8B7KxdPOut7x3T7uUcyT4GOOvtCFkDklRx7Pf321KAASnezxww9TG2r8i X-Received: by 2002:a17:902:e84b:b0:198:f8c9:7f4b with SMTP id t11-20020a170902e84b00b00198f8c97f4bmr3858066plg.2.1676998719442; Tue, 21 Feb 2023 08:58:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676998719; cv=none; d=google.com; s=arc-20160816; b=siD+sClERxQs2UDftWsnn5kFPewtIqDO/kIvRz/sYbUL+DhzfyjScKe3jtnDVJOx9+ lp61FsV0mDKwgDdC5471aJLRZ66pehrjEoL/aCuCfW46KKmIGw/GkhYHIEO7NFdqVSFr 1EGdzea+nDxtFko6jzh+st7v0mijJs7KZPrkbdkMk0octLJU/13S45IBOi+B0rvAn4M3 wa3LTmB6tRCl+6AG4Bww7qYT6bJzYZ4ZLINXciRhTX2okFTSukLpHSlnJn1JNWvoandE S5ESlmf1/wN1r4NDn/IA04Qulc+QW9piV0twj93sFe9/vWeU5+2r9VUBT6BTiKCMyZwK 7a4Q== 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=HMhvhuYsZ3myRfljiC/gjTRwZifcMTe4p3PNN7RnFQc=; b=nc+Wc29q0Ewl3M20NbbdgfIrAiKMvykkFtfMYVtWBzBBnDZk0h9Hwgx580LP5TNK3S Q826Fj+/i7u752OU2eGlAGSExnMSlP/g/YB6Kr6onUTdgn0vlKxGO/DZUZ0JFKQ8lY2N e/d7hEA08f8D/BUb8o1Yt0EKR1jZ11TqDtkedWN2YpkJkRNpfZc0iRkgmtQpxYfYc0X7 fdTpzO4/nzEEGfTML+QKtJHWvpZtGW5Nb9nOPJ3v2IdlyJcAqxNyvTaWedO7uQCnZ/lH 2v7j0AzlF3JFA5tldpTRuRtm5VW76poNnWMCFZbq5GuMUvHTrA9wPeP6ri/Fn9kmzA9F yTHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=KmVIllOg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ix9-20020a170902f80900b0019611a98665si6274181plb.112.2023.02.21.08.58.26; Tue, 21 Feb 2023 08:58:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=KmVIllOg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234969AbjBUQih (ORCPT + 99 others); Tue, 21 Feb 2023 11:38:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234862AbjBUQiK (ORCPT ); Tue, 21 Feb 2023 11:38:10 -0500 Received: from mail-pg1-x54a.google.com (mail-pg1-x54a.google.com [IPv6:2607:f8b0:4864:20::54a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59B352D168 for ; Tue, 21 Feb 2023 08:37:44 -0800 (PST) Received: by mail-pg1-x54a.google.com with SMTP id o38-20020a635d66000000b004fbec68e875so1519400pgm.1 for ; Tue, 21 Feb 2023 08:37:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; 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=HMhvhuYsZ3myRfljiC/gjTRwZifcMTe4p3PNN7RnFQc=; b=KmVIllOgr72sC/pqD6niGV7eoTluq+PS7s7CCPGlsX1a2kPtiFgCkfe/csntWgWF9O OmiYudDws7aCektHRVfDdkOlHQnKMwbf59UDCpld140yXaGH+KdKApX6nXhTN/SgZ2nq 5U1n+Lxme8YZL0X0OOafeKn73deIl7BysH+vQNQw5kIWq78UX6dnOhjQ7IP8rDCLcYIT 4hN80G10dXWP4zMV4Bjl90+cJk/RDZIBOYURHPeIwUegjZDRIYoNYTggUb3Qzz6fPH+g MguyLJitJgtzcDpXLOsQoIfVG2/345V/I7EC3KPaLv8bj/LmBYyfcUSN5ReCIyGhkxhY uXDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=HMhvhuYsZ3myRfljiC/gjTRwZifcMTe4p3PNN7RnFQc=; b=Rct222PeZ+68VBInbPTeW+h8VTd51Nq/U6fTBU1mwDcIIdMIo6UqlIVW7JzBa+BBjB XBfi9LB55IitBILmnXfoMlRZVA4nXto/STbadeCL3d4MpYmKQy4vaf8KfayqED6PgxxI /DPFTezueSUzcreHbgdwLP4Vkwc1W69LulxKxbFWPVc38Y5Yl0zJZhGc3uEdxnH/ucZR H7JHppKSbcobxXpmXevngJ5RYKocZGhnX+8RZPaEQbF5C9aWkvXYCjoE0D6RfaA9wh+W RHF8FheCDZQrp1Zrm+IRIm4rGD0DX08KURUml7gICQgh5m+6MM4Eaolosi8wmggittqZ iQWw== X-Gm-Message-State: AO0yUKXhDUXB4lr8roxrQdC0iWkGOP1rHzJ92nxEL+pUM28yIQNunuEm mIprmlbdy3xkqxrCQ0QXblMvtBD+MC+H X-Received: from mizhang-super.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:1071]) (user=mizhang job=sendgmr) by 2002:a63:3445:0:b0:4fb:d8d:2362 with SMTP id b66-20020a633445000000b004fb0d8d2362mr748058pga.8.1676997460862; Tue, 21 Feb 2023 08:37:40 -0800 (PST) Reply-To: Mingwei Zhang Date: Tue, 21 Feb 2023 16:36:55 +0000 In-Reply-To: <20230221163655.920289-1-mizhang@google.com> Mime-Version: 1.0 References: <20230221163655.920289-1-mizhang@google.com> X-Mailer: git-send-email 2.39.2.637.g21b0678d19-goog Message-ID: <20230221163655.920289-14-mizhang@google.com> Subject: [PATCH v3 13/13] KVM: selftests: x86: Check that XTILEDATA supports XFD From: Mingwei Zhang To: Sean Christopherson , Paolo Bonzini , Thomas Gleixner Cc: "H. Peter Anvin" , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, Mingwei Zhang , Jim Mattson , Venkatesh Srinivas , Aaron Lewis , "Chang S. Bae" , Chao Gao X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758460609240381959?= X-GMAIL-MSGID: =?utf-8?q?1758460609240381959?= From: Aaron Lewis Check that XTILEDATA supports XFD. In amx_test, add the requirement that the guest allows the xfeature, XTILEDATA, to be set in XFD. Otherwise, the test may fail. Signed-off-by: Aaron Lewis Signed-off-by: Mingwei Zhang --- tools/testing/selftests/kvm/include/x86_64/processor.h | 1 + tools/testing/selftests/kvm/x86_64/amx_test.c | 1 + 2 files changed, 2 insertions(+) diff --git a/tools/testing/selftests/kvm/include/x86_64/processor.h b/tools/testing/selftests/kvm/include/x86_64/processor.h index a6a86c41ed75..4f6d2d31ff34 100644 --- a/tools/testing/selftests/kvm/include/x86_64/processor.h +++ b/tools/testing/selftests/kvm/include/x86_64/processor.h @@ -140,6 +140,7 @@ struct kvm_x86_cpu_feature { #define X86_FEATURE_XTILEDATA KVM_X86_CPU_FEATURE(0xD, 0, EAX, 18) #define X86_FEATURE_XSAVES KVM_X86_CPU_FEATURE(0xD, 1, EAX, 3) #define X86_FEATURE_XFD KVM_X86_CPU_FEATURE(0xD, 1, EAX, 4) +#define X86_FEATURE_XTILEDATA_XFD KVM_X86_CPU_FEATURE(0xD, 18, ECX, 2) /* * Extended Leafs, a.k.a. AMD defined diff --git a/tools/testing/selftests/kvm/x86_64/amx_test.c b/tools/testing/selftests/kvm/x86_64/amx_test.c index 2fd6a8a928d9..2eb265297898 100644 --- a/tools/testing/selftests/kvm/x86_64/amx_test.c +++ b/tools/testing/selftests/kvm/x86_64/amx_test.c @@ -257,6 +257,7 @@ int main(int argc, char *argv[]) TEST_REQUIRE(kvm_cpu_has(X86_FEATURE_AMX_TILE)); TEST_REQUIRE(kvm_cpu_has(X86_FEATURE_XTILECFG)); TEST_REQUIRE(kvm_cpu_has(X86_FEATURE_XTILEDATA)); + TEST_REQUIRE(kvm_cpu_has(X86_FEATURE_XTILEDATA_XFD)); /* Create VM */ vm = vm_create_with_one_vcpu(&vcpu, guest_code);