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=-10.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 573CFC2D0E4 for ; Mon, 23 Nov 2020 18:16:40 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 CF3BC204FD for ; Mon, 23 Nov 2020 18:16:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ElC8CdI6"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eJDt8chJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CF3BC204FD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=8rQhOB7kh02oBfONoWvNNIvJ0lNZaeAwSqsNNPrNtT8=; b=ElC8CdI6Bphzwk7YrqPiGRn8m LuSLot4ygNVy/ZFZVtvLMCGMfy5tMEZlyh5ur6mpnBT3xIDqBuKk/ATUMdp3Dfp1WFpO73jaM2XO3 giFYPrDNjlCrcEYV7XEvZoJrMiHChfxblgQfiTBWIDkOAlNOU3eHJD1DNwRq/2D7JtDhIF6Djl6/3 qr3Equ0YBURLvHtDbGSh3A8x1JhFrvfWIFYPTSaZgnGbatj7ELHZd/keCbU90UpXsplsNVKV7T7N2 DsLHrtZ/gWJKnkl7RvRI3jQbDWv0tSJWj8e+0SEqcNLhL3i6YKdeNbk+FVgfS5OeG623p6wox/LO1 hnT+InEuQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1khGNn-00021g-8A; Mon, 23 Nov 2020 18:16:11 +0000 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1khGNk-000212-3s for linux-arm-kernel@lists.infradead.org; Mon, 23 Nov 2020 18:16:08 +0000 Received: by mail-qk1-x742.google.com with SMTP id q22so17868937qkq.6 for ; Mon, 23 Nov 2020 10:16:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=n6ql3VbjYT3UQMZEAEWSAAKb2v1qSJpb45k+j/2GXXM=; b=eJDt8chJwEwQb4BqRB/iAFPtMcipaJigu/nYu8excAJUkwmXCUx6VWL5tq6do8TxUw waCqY2pD3H+R3Rzt+uIAEvZbMoTJC7awNdirtc9o8kDQetJtFoiDi7ADcyjHE8tdPPoJ eUMYCpGe+EFBMX59FUX8gLbOFc4s11FEExP2QDvzgBatfT4sO43Ym6R7qFHqxgHg9uTb PnLcVq4W3VPSplFkW1+FjxZaTYIenVx7c3wUuQMpoOibEb8y+R5T2VRxqe+7l5efNOlD JISITbdHvCG9YCyAjIXiogEbYeGg7LhsYKv64cMVxTG5oAKDMM4B63YudPJlBKu4YikM YQEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=n6ql3VbjYT3UQMZEAEWSAAKb2v1qSJpb45k+j/2GXXM=; b=m2f9N+7QlxBa0ULxZBZDnnynrYCCTQ0c4MvATOqULv7QQGllHQrv/2aL+MrOP0FmpW Lmz4n/k5t0JEMVywp2Tk9w2we6+Ozo2Px0EakyFq+x5UN6AxUwhehKvXV+fkpjyeJHH5 2UjQo8V/fmP52YeSN1Z7haugchQLFmYRG81Kes5kelefU/Kf088eyLrt9eKy72PXIxRh BpbIBM4wtt0tb2raN34Qq/l0Wsff6wAkCkxuQCiny4veTHMuoFKrIfj1DESZANlQQ1Go rpZTSv82HHiMBic6h8P1tPb7BJuoYcIAJN/23foHdKBjp9CYZ+y0zTC2iEIZxJA1uSBA Kwbw== X-Gm-Message-State: AOAM530ceJSxSdaoxHfdnNHyAISGSkpx8nVSX+nH29hUCseuwTgRB2NI Ff7FRawGkTqvOb7+elkVEAc= X-Google-Smtp-Source: ABdhPJzycUOxZG+7eq7Vxqy//dkWVKBJkpC4RER+mv98oDlBI9Mb3knAdF14SNIlusDqgX4QSGG/JA== X-Received: by 2002:a37:e40b:: with SMTP id y11mr744826qkf.29.1606155364813; Mon, 23 Nov 2020 10:16:04 -0800 (PST) Received: from ubuntu-m3-large-x86 ([2604:1380:45f1:1d00::1]) by smtp.gmail.com with ESMTPSA id g9sm10211626qti.86.2020.11.23.10.16.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 10:16:03 -0800 (PST) Date: Mon, 23 Nov 2020 11:16:02 -0700 From: Nathan Chancellor To: Antony Yu Subject: Re: [RESEND,PATCH] ARM: fix __div64_32() error when compiling with clang Message-ID: <20201123181602.GA2637357@ubuntu-m3-large-x86> References: <20201123073634.6854-1-swpenim@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201123073634.6854-1-swpenim@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201123_131608_208199_39D859D8 X-CRM114-Status: GOOD ( 19.41 ) 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: clang-built-linux@googlegroups.com, Nick Desaulniers , Russell King , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Nov 23, 2020 at 03:36:32PM +0800, Antony Yu wrote: > __do_div64 clobbers the input register r0 in little endian system. > According to the inline assembly document, if an input operand is > modified, it should be tied to a output operand. This patch can > prevent compilers from reusing r0 register after asm statements. > > Signed-off-by: Antony Yu > --- > arch/arm/include/asm/div64.h | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/arch/arm/include/asm/div64.h b/arch/arm/include/asm/div64.h > index 898e9c78a7e7..809efc51e90f 100644 > --- a/arch/arm/include/asm/div64.h > +++ b/arch/arm/include/asm/div64.h > @@ -39,9 +39,10 @@ static inline uint32_t __div64_32(uint64_t *n, uint32_t base) > asm( __asmeq("%0", __xh) > __asmeq("%1", "r2") > __asmeq("%2", "r0") > - __asmeq("%3", "r4") > + __asmeq("%3", "r0") > + __asmeq("%4", "r4") > "bl __do_div64" > - : "=r" (__rem), "=r" (__res) > + : "=r" (__rem), "=r" (__res), "=r" (__n) > : "r" (__n), "r" (__base) > : "ip", "lr", "cc"); > *n = __res; > -- > 2.23.0 > I am not sure that I am qualified to review this (my assembly knowledge is not the best) but your commit title mentions an error when compiling with clang. What is the exact error, what configuration generates it, and what version of clang? We have done fairly decent testing for 32-bit ARM, I would like to know what we are missing. Cheers, Nathan _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel