From patchwork Tue Dec 13 00:16:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Christopherson X-Patchwork-Id: 32567 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2544687wrr; Mon, 12 Dec 2022 16:18:43 -0800 (PST) X-Google-Smtp-Source: AA0mqf7ZaO/185Hs3xQ3h7habLxMdW64GiCb79OdIe6s/jbCeatMBTItLTlntY3iiHG0+jXs5Yhz X-Received: by 2002:a17:902:da85:b0:187:143f:4c79 with SMTP id j5-20020a170902da8500b00187143f4c79mr26625052plx.49.1670890723335; Mon, 12 Dec 2022 16:18:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670890723; cv=none; d=google.com; s=arc-20160816; b=eoAQijoG72jqaunmgnBz7VIZUMFHhuWJYdlAbIHLRXMhb40AUutTyAnX79fg0CLnth yMrEdBwfIGbIINicncJFRxgmKKQSv0Wi6azUa4kYlsXd5Y0z9lKdi2QncQehLLokr7rM zmhA6f9Lr1eYOx/2LSi4UH1S/p7SknyETs6xpZUID6I8UK2FUIAXX+QdKXX+eRDuVgW7 QBiXXGf0Y2LtF9VsCC0TIx7QkYFxkEeBKfb170dNaxskcX9ggirHIFqZwuQa3ysI5+gs iMpbRt/lavf7jE0p/0iTjtQhP3X2a9Mt3E/TnHvTTfa5kO3gSz0tEJyYMPllDUy5XlD+ e/OA== 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=aL+0YmMhUjGpxjB47w5qgiiQkK7wv4sJmU0mewoCPIk=; b=O+taiWAfx0L0oScuzHm+sNEGfneZOyXme5T9xPW7f3IUweCb65R6f3YPf73p0fLlWX z1QpzVoPtMScyd8CKg02E0f2d0MiuQkojYn8/zFXPw/SkjGNK6sMz67RV6AQFTpCinkM EwxzK8ykmtRmrjVgvmOdwsqskCKYWl470lw/mdJ+fcnaXOisnCddaPtKmEF90jA9/IVR 6gjVHJqw8xPj8KOLQ48acZrXm6R0aHS0OcKHgQ6lwlblrHT5m/mCZCxGRE4obBwSqsWB juE5UdJ4tjckL3iMPh6GEMsht5LpnXzBgQqbyLPa415WaWnXAKRv7USNpLcpLAhFewOe ovfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="lXE9d6/l"; 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 n19-20020a170902d0d300b0018d7de3a859si8240124pln.142.2022.12.12.16.18.30; Mon, 12 Dec 2022 16:18:43 -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="lXE9d6/l"; 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 S234083AbiLMAR3 (ORCPT + 99 others); Mon, 12 Dec 2022 19:17:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234096AbiLMARI (ORCPT ); Mon, 12 Dec 2022 19:17:08 -0500 Received: from mail-pj1-x104a.google.com (mail-pj1-x104a.google.com [IPv6:2607:f8b0:4864:20::104a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59D581CB07 for ; Mon, 12 Dec 2022 16:17:07 -0800 (PST) Received: by mail-pj1-x104a.google.com with SMTP id z4-20020a17090ab10400b002195a146546so1012871pjq.9 for ; Mon, 12 Dec 2022 16:17:07 -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=aL+0YmMhUjGpxjB47w5qgiiQkK7wv4sJmU0mewoCPIk=; b=lXE9d6/lTyMaKAp9TWJ0VTH9OHNc6LWhK3blKtxoKuILCiWADb0CbU6Rsydob/gcil wHxIvfaDWuGlNvVquRWIv4yx5W+yznz7XM7a86CW8GDjqkZqbRCaIw2dz/EezUpsk1tU yj25I60njVb9EbdEvsJxtZS9+k7pDY33PzcH/LvsH4P5XlXsQXH7IoqjcG6Ie7dJ8g9T bujmb8hmgj/76jRObLTv9oiy9I32bf42pKVaFt8Dttopr1DOXN3wMxL93QijMNc8Zro1 fKhDmxLqJgYkJDp2BLZwakAToojNx+YfT0/EJedWbNtVv2az4c/koY91ZlwuaKe+3P20 zbHw== 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=aL+0YmMhUjGpxjB47w5qgiiQkK7wv4sJmU0mewoCPIk=; b=H+BlSwYH2AJ80MWxahOYqzOB1UIHhb7tw5bhgwrYuG2ytawpXOVuPy31V6w9Qgebg6 Ik7Ksc1itBSi65SJU0GADCMgMtep8TzcHqoLAAzPeBWmKby812xtL/YHSDze9xZZ5gh5 PdJBTHTH13noZh+qL7DVqcWlY+6c6KYXwtnu0G7XfL0NHVByI/K0RbECxzlI9Jvd8Lxb amxZ13cztBsIA0vypSPvDAQ/1wK+MOzqjLnCSsI943HTfVV7MKhtphKbHElR/S1dBpoq ypKUvZ36BoCcG01r4xX4b60Om1Kp49xBg+vZ6KnG0OJv7Bcz+qJ789ApM7k8VgbD5Bfe IKzg== X-Gm-Message-State: ANoB5pkou+KNiywOVHu4xg0Nezg8TAPW61i+Pt5TT0ZBibtKXBTJAvqe i5Zp5DntwNrxIcqlPnjtzDjgDQOXZA8= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:90b:3556:b0:219:f1a2:b641 with SMTP id lt22-20020a17090b355600b00219f1a2b641mr97398pjb.97.1670890626870; Mon, 12 Dec 2022 16:17:06 -0800 (PST) Reply-To: Sean Christopherson Date: Tue, 13 Dec 2022 00:16:45 +0000 In-Reply-To: <20221213001653.3852042-1-seanjc@google.com> Mime-Version: 1.0 References: <20221213001653.3852042-1-seanjc@google.com> X-Mailer: git-send-email 2.39.0.rc1.256.g54fd8350bd-goog Message-ID: <20221213001653.3852042-7-seanjc@google.com> Subject: [PATCH 06/14] KVM: selftests: Rename UNAME_M to ARCH_DIR, fill explicitly for x86 From: Sean Christopherson To: Paolo Bonzini , Marc Zyngier , Paul Walmsley , Palmer Dabbelt , Albert Ou , Nathan Chancellor , Nick Desaulniers Cc: James Morse , Alexandru Elisei , Suzuki K Poulose , Oliver Upton , Tom Rix , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu, linux-riscv@lists.infradead.org, llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Ricardo Koller , Sean Christopherson , Aaron Lewis , Raghavendra Rao Ananta 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?1752055910997401401?= X-GMAIL-MSGID: =?utf-8?q?1752055910997401401?= Rename UNAME_M to ARCH_DIR and explicitly set it directly for x86. At this point, the name of the arch directory really doesn't have anything to do with `uname -m`, and UNAME_M is unnecessarily confusing given that its purpose is purely to identify the arch specific directory. Signed-off-by: Sean Christopherson --- tools/testing/selftests/kvm/Makefile | 49 +++++++++------------------- 1 file changed, 15 insertions(+), 34 deletions(-) diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile index 947676983da1..d761a77c3a80 100644 --- a/tools/testing/selftests/kvm/Makefile +++ b/tools/testing/selftests/kvm/Makefile @@ -7,35 +7,16 @@ top_srcdir = ../../../.. include $(top_srcdir)/scripts/subarch.include ARCH ?= $(SUBARCH) -# For cross-builds to work, UNAME_M has to map to ARCH and arch specific -# directories and targets in this Makefile. "uname -m" doesn't map to -# arch specific sub-directory names. -# -# UNAME_M variable to used to run the compiles pointing to the right arch -# directories and build the right targets for these supported architectures. -# -# TEST_GEN_PROGS and LIBKVM are set using UNAME_M variable. -# LINUX_TOOL_ARCH_INCLUDE is set using ARCH variable. -# -# x86_64 targets are named to include x86_64 as a suffix and directories -# for includes are in x86_64 sub-directory. s390x and aarch64 follow the -# same convention. "uname -m" doesn't result in the correct mapping for -# s390x and aarch64. -# -# No change necessary for x86_64 -UNAME_M := $(shell uname -m) - -# Set UNAME_M for arm64 compile/install to work -ifeq ($(ARCH),arm64) - UNAME_M := aarch64 -endif -# Set UNAME_M s390x compile/install to work -ifeq ($(ARCH),s390) - UNAME_M := s390x -endif -# Set UNAME_M riscv compile/install to work -ifeq ($(ARCH),riscv) - UNAME_M := riscv +ifeq ($(ARCH),x86) + ARCH_DIR := x86_64 +else ifeq ($(ARCH),arm64) + ARCH_DIR := aarch64 +else ifeq ($(ARCH),s390) + ARCH_DIR := s390x +else ifeq ($(ARCH),riscv) + ARCH_DIR := riscv +else +$(error Unknown architecture '$(ARCH)') endif LIBKVM += lib/assert.c @@ -196,10 +177,10 @@ TEST_GEN_PROGS_riscv += kvm_page_table_test TEST_GEN_PROGS_riscv += set_memory_region_test TEST_GEN_PROGS_riscv += kvm_binary_stats_test -TEST_PROGS += $(TEST_PROGS_$(UNAME_M)) -TEST_GEN_PROGS += $(TEST_GEN_PROGS_$(UNAME_M)) -TEST_GEN_PROGS_EXTENDED += $(TEST_GEN_PROGS_EXTENDED_$(UNAME_M)) -LIBKVM += $(LIBKVM_$(UNAME_M)) +TEST_PROGS += $(TEST_PROGS_$(ARCH_DIR)) +TEST_GEN_PROGS += $(TEST_GEN_PROGS_$(ARCH_DIR)) +TEST_GEN_PROGS_EXTENDED += $(TEST_GEN_PROGS_EXTENDED_$(ARCH_DIR)) +LIBKVM += $(LIBKVM_$(ARCH_DIR)) INSTALL_HDR_PATH = $(top_srcdir)/usr LINUX_HDR_PATH = $(INSTALL_HDR_PATH)/include/ @@ -212,7 +193,7 @@ endif CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \ -fno-stack-protector -fno-PIE -I$(LINUX_TOOL_INCLUDE) \ -I$(LINUX_TOOL_ARCH_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude \ - -I$(