From nobody Sun May 19 06:23:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1713536665; cv=none; d=zohomail.com; s=zohoarc; b=YR3p2V4KkRXrEC1iJvMj4kRgPR+tqSQ16VrC7mxPAccrzpaTiTbtAzB1t+/IsQ+eMFXlFM8MEkhLypes2UimSICNAV0HrgPoCK1z81tmlXPkp96vc0QjtWO3EjY6sxLLbrumBHQ5SDz3d0HTQnrbW2OVIyEdSSCZhNdNj7x2mHc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1713536665; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fvE04hK1QhYzx30yo+rpGP6awpQxcr4JZMIWUrH45M0=; b=k4IZ+J5vLisJf8R6JXJAt+CC3P9aZ9C7qR5WZsqZwFo2r7N1yBEcu/eRQYQfTX55XEmwXMuGqhm8Oa07l7Gpu8woIeSzN+HTtb/2VeTyhZlq/USmRtOOQ2Ordhw6MVraOkrtquSN12O0q6WTgTB8B5dtLT/L2qB+7K4zmhg4wbQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1713536665676838.9423318579684; Fri, 19 Apr 2024 07:24:25 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.709119.1108371 (Exim 4.92) (envelope-from ) id 1rxp9j-0004pp-FO; Fri, 19 Apr 2024 14:23:59 +0000 Received: by outflank-mailman (output) from mailman id 709119.1108371; Fri, 19 Apr 2024 14:23:59 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rxp9j-0004pi-CS; Fri, 19 Apr 2024 14:23:59 +0000 Received: by outflank-mailman (input) for mailman id 709119; Fri, 19 Apr 2024 14:23:58 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rxp9i-0004oC-4s for xen-devel@lists.xenproject.org; Fri, 19 Apr 2024 14:23:58 +0000 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [2a00:1450:4864:20::133]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 75383294-fe58-11ee-b909-491648fe20b8; Fri, 19 Apr 2024 16:23:57 +0200 (CEST) Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-516d2600569so2687301e87.0 for ; Fri, 19 Apr 2024 07:23:57 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id z4-20020ac24f84000000b00513d244005asm725847lfs.199.2024.04.19.07.23.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 07:23:55 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 75383294-fe58-11ee-b909-491648fe20b8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713536636; x=1714141436; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=fvE04hK1QhYzx30yo+rpGP6awpQxcr4JZMIWUrH45M0=; b=VEVcgNr3cvTaqL3E4PJjkZPuz0G0T8xsIGuIsiUn7oqQrmqOsA91kG/dogi2C0mkAH P0FQgWNTFlp2v40uVOY0Njlps3hqCHda94osdIxkNGK1KeIpt+xO8mWPdNa/6+4t5fON t+b4EFpHt3w4SOD44Pdwfw47+0ml+KdJvMXcllr74R3D6mWaIIahXbXyLTOebBLu5qbr Qc49wBpGR+Dan9pZNSZcsAJK1e0O9U2WyHtya0RXtN4lHpl8ovhVbRO38TMrVvRJJ0yZ WtfpLUiK0fLuzSaY9ZwQD1Z2n9bWxgn2T9ULtPgvmVxhRMTZJfrK2e6r9ad0vbF1g1Fr 4AVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713536636; x=1714141436; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=fvE04hK1QhYzx30yo+rpGP6awpQxcr4JZMIWUrH45M0=; b=U3w1gGKOQVoLk4DoDFiWqqdZaRWZ7et5qcw702nkTlIvMIP5gNe/lPWnPSilg7vRdN Om98sXHDt9eCXFYlYSI4B4rnnsaQfWoUgKwH83Nl2HmRHx6deS4gCV7x2eXNdFAxGHjU H8YQZSwuOD/NOk4bnoF7Vr1ormQe/8K0CCEbpfcRg5VjqDzxwwlFhbSLpSsF4icJ1hV1 +/2iOhMPURHHVvkotEhf2FuE2NFf+F5IiXZfNxhxCFblQbaoL5o1vh6he5B7dyPL+Isb LNUKUHWBqnMKKs3hnU1NPhXBeHk2iU+HBdJbTE6+nObYrvH6FbiADFpBDVpUqbA0Trqv iIYw== X-Gm-Message-State: AOJu0Yw5+/KLrkBJtXR9Rhr8tO5WJbQVEYJrmCb6zzqHpHWGI7+IcFxi gzD9GI/nnDaYLY8GOb3lE6I4v0LjPDQDFUO2kndjwASzuZ1yTt6JAzpoxw== X-Google-Smtp-Source: AGHT+IEEvH4dYfTcbMlGk0kZFT2F92pKHd04k/inXJR/mV8qO8O0RGMIT96AWGZ6a5i2N/gB5GQpSA== X-Received: by 2002:ac2:57ca:0:b0:518:e8a4:9266 with SMTP id k10-20020ac257ca000000b00518e8a49266mr1563939lfo.14.1713536636111; Fri, 19 Apr 2024 07:23:56 -0700 (PDT) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Alistair Francis , Bob Eshleman , Connor Davis , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini Subject: [PATCH v3] xen/riscv: check whether the assembler has Zbb extension support Date: Fri, 19 Apr 2024 16:23:53 +0200 Message-ID: <95441782d1920f219d63dee1c82c7df68424d374.1713523124.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1713536666275100001 Content-Type: text/plain; charset="utf-8" Update the argument of the as-insn for the Zbb case to verify that Zbb is supported not only by a compiler, but also by an assembler. Also, check-extenstion(ext_name, "insn") helper macro is introduced to check whether extension is supported by a compiler and an assembler. Signed-off-by: Oleksii Kurochko Acked-by: Jan Beulich --- Changes in V3: - code style fixes: use "-" insteaf of "_" for names. - update the commit message. --- Changes in V2: - introduce check_extenstion to abstract a check of if extenstion is supported or not. - update the commit message. --- xen/arch/riscv/arch.mk | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/xen/arch/riscv/arch.mk b/xen/arch/riscv/arch.mk index 53f3575e7d..dd242c91d1 100644 --- a/xen/arch/riscv/arch.mk +++ b/xen/arch/riscv/arch.mk @@ -11,9 +11,14 @@ riscv-march-$(CONFIG_RISCV_ISA_C) :=3D $(riscv-mar= ch-y)c =20 riscv-generic-flags :=3D $(riscv-abi-y) -march=3D$(riscv-march-y) =20 -zbb :=3D $(call as-insn,$(CC) $(riscv-generic-flags)_zbb,"",_zbb) -zihintpause :=3D $(call as-insn, \ - $(CC) $(riscv-generic-flags)_zihintpause,"pause",_zi= hintpause) +# check-extension: Check whether extenstion is supported by a compiler and +# an assembler. +# Usage: $(call check-extension,extension_name,"instr") +check-extension =3D $(call as-insn,$(CC) $(riscv-generic-flags)_$(1),$(2),= _$(1)) + +zbb-insn :=3D "andn t0, t0, t0" +zbb :=3D $(call check-extension,zbb,$(zbb-insn)) +zihintpause :=3D $(call check-extension,zihintpause,"pause") =20 extensions :=3D $(zbb) $(zihintpause) =20 --=20 2.44.0