From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A006C10F14 for ; Thu, 3 Oct 2019 20:18:44 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 69F5620862 for ; Thu, 3 Oct 2019 20:18:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="uCdo6fWi"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="tPx7dShK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 69F5620862 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=U2y51lNWcsgtd+V9oJiVnPUWOQDoekHRn5uA3pMe/X8=; b=uCdo6fWiNRfChj +IOyjc3myjw5Y1O9gsqUHhP2OfURq4feWfUegbH2QbCQaE91XfpbTZW1BFOq1TwnRPPuemAMuAYx1 QfwG6nAqMVx85CL/m7lyTxo9zbv+aGJVfUKvF6TXoFG9mCulYCHVwBqFAIvH26sNbckZdcVR7fBnu jOeTKKpHqIE7ar1rQ+C6loLQTUbg5d96nogfxag8aMU2w56jvv4EI8P9t2I0AJH/aTn5+eFlUfFbL RnWuNoM3VMJvjaFP24im486G/GXWdBjPDWRsZXZUAKs4AGR8mkcIoF+SVFbrSNZPt/RdsHeBSNtYR T6zZKgxAYQqCG+ly5xLg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iG7YY-0008My-Pm; Thu, 03 Oct 2019 20:18:34 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1iG7YV-0008Lw-6y for linux-arm-kernel@lists.infradead.org; Thu, 03 Oct 2019 20:18:32 +0000 Received: by mail-pg1-x544.google.com with SMTP id i14so2381797pgt.11 for ; Thu, 03 Oct 2019 13:18:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+sLqpxQwn5IKAm1aZLON2pNwFcFKrH4kS1PpKV5io00=; b=tPx7dShK1fKz58midm5HFeKBUk9GrBo/Eg96g1VKDwJcr++u7xtVdw1qfs9lgGNkCf Gm3XpKa7FGISJdruBKtKBISHqkeXT9dvzY0uufVpkbUc0glzae6lcQvMVhvJaEvAq5jq fqZFNBCIAyp/Q2SDDs4IphqnH5invfbNJQSBuoZoi5CRS5GKHZAogCn6hV1OCf582/Cw FDY/G2bNiohgOVui/vaT2YycHrm4NNW1fVP/HEsPrScdt964iwQmOCraoDgUd0O+fXSL tvwaUkXXZPVXRI+78KM29C3E8UQ5XU8JozY4itSVuf0iRfs2jUnbanKc5XIB1IR7/ubh lWGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+sLqpxQwn5IKAm1aZLON2pNwFcFKrH4kS1PpKV5io00=; b=kJKHI1k6y0zA/I9EUftylEb0IoxrUsSMMrwJ+gFYpD2nOoro6ny1jos58GwpFa5Jjx DFDNU5/b/5q3wtYU0DDeQjXcALo5Kz+OZy/wj8yR2By/3IVHpBERBVVccrBTf8SJ+HY4 fTckI6geIULzYCzXYBj/ynb2VKcrVY94RmNKd1fWDKer3qulHy3j8xFfAFFrl8qhC8kD Bot6fDTHhfaTyQpz04kwNy7VISRAOTKc+tLLmgYaw7VlyMGJJMru6WkkaLcmIByaKxku wPy+M5vFskjZTB1DAHRiCQG2cEXW+afoYRbeaZELpo+lRYwVGhrS1aJJst4fB6+ZNsgy KF/w== X-Gm-Message-State: APjAAAXjYC67UJQUvAoA8fZbD0iIrfjmgKYl7P5AbBvS2bcV8MaYo9Sy jrkLyd44oGEtOcM4fHMxQQz4xDD13jgWvrhBRJGCuigu X-Google-Smtp-Source: APXvYqyD6BEnO4ZUoyiVVPkVY2fJjAirNyrjFZR5lstV7VlmlMPIqQuSaIj15lBFzeUrnMAnBoa05ZyW7Q0kii+jR8g= X-Received: by 2002:a17:90a:178d:: with SMTP id q13mr12760931pja.134.1570133907317; Thu, 03 Oct 2019 13:18:27 -0700 (PDT) MIME-Version: 1.0 References: <20191003174838.8872-1-vincenzo.frascino@arm.com> <20191003174838.8872-3-vincenzo.frascino@arm.com> In-Reply-To: <20191003174838.8872-3-vincenzo.frascino@arm.com> From: Nick Desaulniers Date: Thu, 3 Oct 2019 13:18:16 -0700 Message-ID: Subject: Re: [PATCH v5 2/6] arm64: vdso32: Detect binutils support for dmb ishld To: Vincenzo Frascino X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191003_131831_281221_4C3F1D8A X-CRM114-Status: GOOD ( 17.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel , Catalin Marinas , LKML , Andy Lutomirski , Thomas Gleixner , Will Deacon , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Oct 3, 2019 at 10:48 AM Vincenzo Frascino wrote: > > Older versions of binutils that do not support certain types of memory > barriers can cause build failure of the vdso32 library. Do you know specific version numbers of binutils that are affected? May be helpful to have in the commit message just for future travelers. > > Add a compilation time mechanism that detects if binutils supports those > instructions and configure the kernel accordingly. > > Cc: Will Deacon > Cc: Catalin Marinas > Reported-by: Will Deacon > Signed-off-by: Vincenzo Frascino > Reviewed-by: Catalin Marinas > Tested-by: Catalin Marinas > --- > arch/arm64/include/asm/vdso/compat_barrier.h | 2 +- > arch/arm64/kernel/vdso32/Makefile | 9 +++++++++ > 2 files changed, 10 insertions(+), 1 deletion(-) > > diff --git a/arch/arm64/include/asm/vdso/compat_barrier.h b/arch/arm64/include/asm/vdso/compat_barrier.h > index fb60a88b5ed4..3fd8fd6d8fc2 100644 > --- a/arch/arm64/include/asm/vdso/compat_barrier.h > +++ b/arch/arm64/include/asm/vdso/compat_barrier.h > @@ -20,7 +20,7 @@ > > #define dmb(option) __asm__ __volatile__ ("dmb " #option : : : "memory") > > -#if __LINUX_ARM_ARCH__ >= 8 > +#if __LINUX_ARM_ARCH__ >= 8 && defined(CONFIG_AS_DMB_ISHLD) > #define aarch32_smp_mb() dmb(ish) > #define aarch32_smp_rmb() dmb(ishld) > #define aarch32_smp_wmb() dmb(ishst) > diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32/Makefile > index 19e0d3115ffe..77aa61340374 100644 > --- a/arch/arm64/kernel/vdso32/Makefile > +++ b/arch/arm64/kernel/vdso32/Makefile > @@ -15,6 +15,8 @@ cc32-disable-warning = $(call try-run,\ > $(COMPATCC) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1))) > cc32-ldoption = $(call try-run,\ > $(COMPATCC) $(1) -nostdlib -x c /dev/null -o "$$TMP",$(1),$(2)) > +cc32-as-instr = $(call try-run,\ > + printf "%b\n" "$(1)" | $(COMPATCC) $(VDSO_AFLAGS) -c -x assembler -o "$$TMP" -,$(2),$(3)) > > # We cannot use the global flags to compile the vDSO files, the main reason > # being that the 32-bit compiler may be older than the main (64-bit) compiler > @@ -53,6 +55,7 @@ endif > VDSO_CAFLAGS += -fPIC -fno-builtin -fno-stack-protector > VDSO_CAFLAGS += -DDISABLE_BRANCH_PROFILING > > + > # Try to compile for ARMv8. If the compiler is too old and doesn't support it, > # fall back to v7. There is no easy way to check for what architecture the code > # is being compiled, so define a macro specifying that (see arch/arm/Makefile). > @@ -89,6 +92,12 @@ VDSO_CFLAGS += -Wno-int-to-pointer-cast > VDSO_AFLAGS := $(VDSO_CAFLAGS) > VDSO_AFLAGS += -D__ASSEMBLY__ > > +# Check for binutils support for dmb ishld > +dmbinstr := $(call cc32-as-instr,dmb ishld,-DCONFIG_AS_DMB_ISHLD=1) > + > +VDSO_CFLAGS += $(dmbinstr) > +VDSO_AFLAGS += $(dmbinstr) > + > VDSO_LDFLAGS := $(VDSO_CPPFLAGS) > # From arm vDSO Makefile > VDSO_LDFLAGS += -Wl,-Bsymbolic -Wl,--no-undefined -Wl,-soname=linux-vdso.so.1 > -- > 2.23.0 > -- Thanks, ~Nick Desaulniers _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel