From patchwork Thu Nov 28 00:55:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Christopherson X-Patchwork-Id: 13887508 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 46AD5D6D251 for ; Thu, 28 Nov 2024 01:11:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:Cc:To: From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=SIrOHFdLU07PpaXHI/YgxGMl42ASMs52y5wmlleZ1JI=; b=mgD/kWIPh+xZUwE+S8pIVZPI8q nac98JBdeWjluHF+T1aqA3oVaHxLq59X8Z6qT4SFBZ0YQefU4Bur9/NADwz9HX7cziAebAIxzatG6 DxE7Y0WJ3f6lDEwyJNAFL0V2CcGgBZ2h++L7JhDmIKWMkN3hEn5Hf5dnC4ACq+fh9zwMsf9QEhvnM LembuPtM/wh71lQYm3yl9CvjPXI+0pPMc9Q+BwGiXJdPgSU2uQC4txHAwOMLeS4TB2zsOPrMRmutA G4OS0JSEE62l5n70h24HITls7k8C7BfDE/gt2RKN8d94v3Drc+IUKSsM41K6OIP5NZf/CRgZD6m9J c//JhUMQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tGT3W-0000000EPfA-2drt; Thu, 28 Nov 2024 01:10:54 +0000 Received: from mail-pg1-x549.google.com ([2607:f8b0:4864:20::549]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tGSpO-0000000EM5z-3G2b for linux-arm-kernel@lists.infradead.org; Thu, 28 Nov 2024 00:56:20 +0000 Received: by mail-pg1-x549.google.com with SMTP id 41be03b00d2f7-7fb966ee0cdso203344a12.1 for ; Wed, 27 Nov 2024 16:56:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1732755378; x=1733360178; darn=lists.infradead.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=SIrOHFdLU07PpaXHI/YgxGMl42ASMs52y5wmlleZ1JI=; b=M6vk/+wtzRQ9mJsAu5jModq/HTmYYPJ3NKHx2tQ9fA0ScmnfgodZXVzRsWeWQngD4o pWAn0D6OylHcr7gaqzykIH4LFCLjfHy/FlMpKcf30+CJbTa4E3eZJr+SE1OSpUupaZtn /QioM8hhDwpOLRmx+9yGyzWcJe6PqCYYqBy9sY+yoTwX+rGHXaB8TUwezlJORM+MjKde DfZU+usdfqYsFFvLvATr8kSy7r4CehguZUkfajr3l5zhgqiKIeT56npspwoXmYHJSH7Z Lm/LNTaEUta7bA5TxgP8P9xdFQSLtxmdob2BhlK126os/my3j21G/hMUcPZFuiycaHH7 QxwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732755378; x=1733360178; 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=SIrOHFdLU07PpaXHI/YgxGMl42ASMs52y5wmlleZ1JI=; b=ijfqXrDCdtwxXWoN94LgBw02n8NndHodo2d/+HlqWayCMwp/OEzzWaMIEaWocSrUuu agqpuyaiSwFWhKIjvFnaw2uiiD3IrKdr5+I3rZHzejEc263sEggQ9QypLMkMtzsFY49m hXXNfmeTASUm31K8/W9snkBZOPamZ++BqlA24pP6TK4jeH4qx/ViVmtoYQUpoo9RadkH VuFNY3VWwRs/K/hZmCWY/j7B9EXYVzJKT1XP+FU1t+w/UzSZAyjk8vaHQRANMc2+rFPG nfdIRDmJypqxT17uQS5yjADP6P0L6PgcwM7Ve8mCXOQxwcdFSa1MBlFVGQH6tHkmgv6a 3qjA== X-Gm-Message-State: AOJu0YxEV4IQSyrL0nEme4W+l9Wh2gT4B83QzDLTWXGXXvayMypfkU2Y 9n0EfdaFAFCGrT/bFokbGlSAq+3XfH2XebB4lpeGE6CV0lKg8EZzGpIx6jOlakDroyncPqEGnFA Lgg== X-Google-Smtp-Source: AGHT+IEWNoqxkKJEuSCYYZMRl85uBIjfdRzypvum78dwg9LOBi3REl5p9HlxVwSIxD2wnWKazGYBZqWzZwk= X-Received: from pjbst14.prod.google.com ([2002:a17:90b:1fce:b0:2ea:9d23:79a0]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90a:9f93:b0:2ea:5658:9ed6 with SMTP id 98e67ed59e1d1-2ee25b38db4mr2121026a91.12.1732755377809; Wed, 27 Nov 2024 16:56:17 -0800 (PST) Date: Wed, 27 Nov 2024 16:55:47 -0800 In-Reply-To: <20241128005547.4077116-1-seanjc@google.com> Mime-Version: 1.0 References: <20241128005547.4077116-1-seanjc@google.com> X-Mailer: git-send-email 2.47.0.338.g60cca15819-goog Message-ID: <20241128005547.4077116-17-seanjc@google.com> Subject: [PATCH v4 16/16] KVM: selftests: Override ARCH for x86_64 instead of using ARCH_DIR From: Sean Christopherson To: Marc Zyngier , Oliver Upton , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Paolo Bonzini , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , Sean Christopherson Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Andrew Jones , James Houghton , Muhammad Usama Anjum X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241127_165618_830980_47436CC3 X-CRM114-Status: UNSURE ( 9.45 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Sean Christopherson Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Now that KVM selftests uses the kernel's canonical arch paths, directly override ARCH to 'x86' when targeting x86_64 instead of defining ARCH_DIR to redirect to appropriate paths. ARCH_DIR was originally added to deal with KVM selftests using the target triple ARCH for directories, e.g. s390x and aarch64; keeping it around just to deal with the one-off alias from x86_64=>x86 is unnecessary and confusing. Note, even when selftests are built from the top-level Makefile, ARCH is scoped to KVM's makefiles, i.e. overriding ARCH won't trip up some other selftests that (somehow) expects x86_64 and can't work with x86. Signed-off-by: Sean Christopherson --- tools/testing/selftests/kvm/Makefile | 4 +--- tools/testing/selftests/kvm/Makefile.kvm | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile index 9bc2eba1af1c..20af35a91d6f 100644 --- a/tools/testing/selftests/kvm/Makefile +++ b/tools/testing/selftests/kvm/Makefile @@ -6,9 +6,7 @@ ARCH ?= $(SUBARCH) ifeq ($(ARCH),$(filter $(ARCH),arm64 s390 riscv x86 x86_64)) # Top-level selftests allows ARCH=x86_64 :-( ifeq ($(ARCH),x86_64) - ARCH_DIR := x86 -else - ARCH_DIR := $(ARCH) + ARCH := x86 endif include Makefile.kvm else diff --git a/tools/testing/selftests/kvm/Makefile.kvm b/tools/testing/selftests/kvm/Makefile.kvm index 9888dd6bb483..4277b983cace 100644 --- a/tools/testing/selftests/kvm/Makefile.kvm +++ b/tools/testing/selftests/kvm/Makefile.kvm @@ -207,10 +207,10 @@ TEST_GEN_PROGS_riscv += steal_time SPLIT_TESTS += arch_timer SPLIT_TESTS += get-reg-list -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)) +TEST_PROGS += $(TEST_PROGS_$(ARCH)) +TEST_GEN_PROGS += $(TEST_GEN_PROGS_$(ARCH)) +TEST_GEN_PROGS_EXTENDED += $(TEST_GEN_PROGS_EXTENDED_$(ARCH)) +LIBKVM += $(LIBKVM_$(ARCH)) OVERRIDE_TARGETS = 1 @@ -222,14 +222,14 @@ include ../lib.mk INSTALL_HDR_PATH = $(top_srcdir)/usr LINUX_HDR_PATH = $(INSTALL_HDR_PATH)/include/ LINUX_TOOL_INCLUDE = $(top_srcdir)/tools/include -LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH_DIR)/include +LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \ -Wno-gnu-variable-sized-type-not-at-end -MD -MP -DCONFIG_64BIT \ -fno-builtin-memcmp -fno-builtin-memcpy \ -fno-builtin-memset -fno-builtin-strnlen \ -fno-stack-protector -fno-PIE -fno-strict-aliasing \ -I$(LINUX_TOOL_INCLUDE) -I$(LINUX_TOOL_ARCH_INCLUDE) \ - -I$(LINUX_HDR_PATH) -Iinclude -I$(