From nobody Mon Dec 9 06:28:40 2024 Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 18DE42AD18 for ; Thu, 31 Oct 2024 04:53:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730350418; cv=none; b=B4DlaQTaWU0REbePDJCG3kg8otjcLUmbpBm+ihcBDUHUez101J7AjMTQl8Pqx8zKoGvmaRmwvTf35mUMM7EmPfWdcGQu3utZzupGglyKPlHOCZ9PwWpcgpkfgCyGiyZVMN1oVGhKGUplG32FlGyvERIh7dHeVQm/wAiAnsuffF8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730350418; c=relaxed/simple; bh=z1iWKrL0iGzDxEXyphps5/T+K15nDZVwxoo6gFUzZdI=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=CpHA6fmR4rDn2Q6TrpAzDz8gWTQSeMZ/up9JTRnqPPKJqvahEeTZwNsKBlYqwiOSok0+B+b1OyFFlcf8r0S38o03JNAYRK1vcNozX0zIhEaLqr7qwZ+ptrCejJDgooUdYRkV78w75oqrSmb8qiVYFMq794Mr8u6rPWqtzz3CAQw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=opstZuTz; arc=none smtp.client-ip=209.85.219.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="opstZuTz" Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-e30cd709b40so960289276.1 for ; Wed, 30 Oct 2024 21:53:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1730350416; x=1730955216; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:reply-to:from:to:cc :subject:date:message-id:reply-to; bh=wiY79yFUfgtheDtsdvwfegGiXXODeuQyPTQtmiFfHDk=; b=opstZuTzh5BWegHNlf25S0DM8TpzwesrjOwdubP3CxeWlz5A7fN/XaBNrxUzqihn+G uXPW96yR/g20Yt12FjgQ4dPqeurSwnlsnyHRpLAiZWuprTLaoq0R7xtAw2qXe2v2c4Ov fkX1v1WzuWxQ1MVIbOuLudvtvdHEj+eGPSQPcm6MD/v6DX2KwAhAtICrkAt/SqQ2DCbX z7f0W7OQzgSiVzmAiTdvLMaawGbXon2syStsWilAVUkYRczWFO2wCWD+zubGo5k6mYAK JRIWhg/60GsUqSj9TSpG/i4YkiqHurFbfdviS1oKiokfptExq6zmNlBtggRA0QfkpHZB vUow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730350416; x=1730955216; h=cc:to:from:subject:message-id:mime-version:date:reply-to :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=wiY79yFUfgtheDtsdvwfegGiXXODeuQyPTQtmiFfHDk=; b=tQbPAAk3Djs00kwlbk98cqCdZWYLBVfUK5dcKw4d0bHGl3dbFbOi+J9/pCq6jNRTF9 HhNuaLuyZTu+TtGcl/M7UVVw80XfIHObSMET+lqVx0YJ2IiNHClS+S56tiq/AduNDIjB FavPFsUKEmb/WDlfAUe2DCEw0ypbNkBkT/D5kjMFoBThu5SnK6QUwabVMpaeunlWsEZ9 8bmyaxi675Q3UBWkcitfeQgmdVHUUfZw/J1e6oIlvPMDSHdjHG6UOBXIkqN0X9tYn+s+ t6ODwMAwY+80eUCklpJ7rsp3G/t6Kb1o18K/S34dj2a/KGSD4ZGfODU2FcsyiT+kWgwF o0nA== X-Forwarded-Encrypted: i=1; AJvYcCXsMFhZGVgM3hGs5T/d7ngNJdYdyL25uNbMGvG/+noBUvsipXBzthsbz8lK6mzW1B/3pm7+hXUDIWKJO2I=@vger.kernel.org X-Gm-Message-State: AOJu0Yw18UMJz1HuAeobc6EU3vDTICCYyq26ggHidqFtO0ZF6DzIl+T5 NSt9BASBEAYZ5hedFCpAOdzKOmYzaLT7zvSqkZCXVjPiZFWqdGauBSSp6VC5mXSLvLFFI/hw+O/ COA== X-Google-Smtp-Source: AGHT+IHxjuV8TEM897E1NxoVuaOigtFAlzfKpVOG+ymJPAy9gjdsiAwT5dYX/hzyI2oKlKf9cypUwWpVNzQ= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:9d:3983:ac13:c240]) (user=seanjc job=sendgmr) by 2002:a25:8186:0:b0:e0e:4841:3a7e with SMTP id 3f1490d57ef6-e3087bd6059mr59225276.7.1730350416233; Wed, 30 Oct 2024 21:53:36 -0700 (PDT) Reply-To: Sean Christopherson Date: Wed, 30 Oct 2024 21:53:33 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog Message-ID: <20241031045333.1209195-1-seanjc@google.com> Subject: [PATCH] KVM: selftests: Don't force -march=x86-64-v2 if it's unsupported From: Sean Christopherson To: Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Vitaly Kuznetsov , Sean Christopherson Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Force -march=3Dx86-64-v2 to avoid SSE/AVX instructions if and only if the uarch definition is supported by the compiler, e.g. gcc 7.5 only supports x86-64. Fixes: 9a400068a158 ("KVM: selftests: x86: Avoid using SSE/AVX instructions= ") Cc: Vitaly Kuznetsov Signed-off-by: Sean Christopherson --- My big ol' AVX enabling series ain't looking so bad now ;-) tools/testing/selftests/kvm/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests= /kvm/Makefile index 156fbfae940f..5fa282643cff 100644 --- a/tools/testing/selftests/kvm/Makefile +++ b/tools/testing/selftests/kvm/Makefile @@ -249,8 +249,10 @@ ifeq ($(ARCH),s390) CFLAGS +=3D -march=3Dz10 endif ifeq ($(ARCH),x86) +ifeq ($(shell echo "void foo(void) { }" | $(CC) -march=3Dx86-64-v2 -x c - = -c -o /dev/null 2>/dev/null; echo "$$?"),0) CFLAGS +=3D -march=3Dx86-64-v2 endif +endif ifeq ($(ARCH),arm64) tools_dir :=3D $(top_srcdir)/tools arm64_tools_dir :=3D $(tools_dir)/arch/arm64/tools/ base-commit: 81983758430957d9a5cb3333fe324fd70cf63e7e --=20 2.47.0.163.g1226f6d8fa-goog