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=-12.2 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, USER_AGENT_SANE_1 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 DBDFAC5519F for ; Mon, 30 Nov 2020 08:22:22 +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 645EE20719 for ; Mon, 30 Nov 2020 08:22:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="D0WlBbC/"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OkxnoyEM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 645EE20719 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-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-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Zy8Es0Qspb9CHN3dgwQQeTHywd25u0AOKB4Jit6sFIA=; b=D0WlBbC/NVVGRKYrdd5Cqg1uJ qGGOyjH/gwqTkpvRL8dk9V4zLYgOGe0h8PHW+aUI3o/aTHojNrhRgkoKmMceViigfOueGzLD7q168 i968blMZPJbxFRKL2IW86Ozte34iD/qOWf3PTISybDtlXd4Ah5GwSksBFBABbqHa59ufvTAUylVS2 YXUOcwa4cAnmvYK/W2j3VwvNB63yoDrr/Vku2P4O7AwO2pib/mw1Dz0eo8Dp3KJV0l1wmN0iNYN8o yjq/Z9yw2Z5ocMM9FRRtH6GtH6NjSAq3g8DRhr3giHWqCnOjph320DCPJ4Yy1iI35Zn70IAyHDRue JbziMTXEA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kjeQh-00084m-TF; Mon, 30 Nov 2020 08:21:03 +0000 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kjeQf-00084G-M3 for linux-arm-kernel@lists.infradead.org; Mon, 30 Nov 2020 08:21:02 +0000 Received: by mail-wm1-x333.google.com with SMTP id k10so10864779wmi.3 for ; Mon, 30 Nov 2020 00:20:59 -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:user-agent; bh=LsButuHFAqy+OskYL0jzAl5KW1Dckt4dG1CLIfV9Upk=; b=OkxnoyEMLuvHqGcegIUZFOiKoveic7OUkMbqUILxx4SYxmIVB75XWby8PJbSAyGxPU CSOr54HH4xLHUaUPKo/IunfF5r+m9tDwUq1g/nWN+F2MS0CIpe6TjmiODReCBhRvG5gQ 0svQ+Ry7W/iina6anhc+lHkCDmF6+RXzcNAPnG2cTlDGMOPhmI+TlOlfLzFEsNxjkybc x5LNsl4YJI+Zm5xvMByijiUVKG7ObURRm6Z+4ehQEHNIkfuf/b3cUxZ5mPeHvbQ27mpz SRD1w6IJB1bQXN15u7PMPVk+P8YsyGqa5sZziZX74s6EI3PmejAdJ1Tf2CzB5HbELeNL 1E5g== 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:user-agent; bh=LsButuHFAqy+OskYL0jzAl5KW1Dckt4dG1CLIfV9Upk=; b=Wlx+MX9IfC6wiiSLSZWo72P4vBNFOgyTig8Aac9sroF+qIZwbS4PUlG5qT13bpq+9h N7VBjIFQ1k1q6HnI7ul/djpSV0n/JRlvLTxJSOKjUiOZbTKoXtSNW0Dgr4G4Ano1fpkQ 53+SdS+8NB/X0t+PLuAxYoInaKmMM8twWo2R8aEnTZoKoZxZT3FGfKFgSaQDCm2K3hU+ g7RPkpmgxN6dKyj8DvaQk8Pyg2OQhl1BIq1TabNMYAvKjEN8AJAxe4cqAY0SbScGV5pJ rp4QYRH3RtjC5oh/AI0G3ZR5Vn6UUUB7DBvTE6Q2IJ6huE4zVs+25JcXtqDpBdsf+tbt LjdA== X-Gm-Message-State: AOAM531VXhd7rVWPe3yQN4nCMqXPbymogZWb3wu3UovMruJ1YrkhLd33 a76EMH4Opcers7kzc/tixcRLAQvKmnJRYw== X-Google-Smtp-Source: ABdhPJw/7z1HciIsdbptb3bMN7e1HWonB9acEvSEe03DvjIjw6KldmtK6STDUqWSKBxdsbW9M3nOVw== X-Received: by 2002:a1c:2d84:: with SMTP id t126mr21608418wmt.132.1606724458643; Mon, 30 Nov 2020 00:20:58 -0800 (PST) Received: from penyung-VirtualBox (60-250-204-170.HINET-IP.hinet.net. [60.250.204.170]) by smtp.gmail.com with ESMTPSA id b14sm25852005wrq.47.2020.11.30.00.20.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Nov 2020 00:20:57 -0800 (PST) Date: Mon, 30 Nov 2020 16:20:32 +0800 From: Antony Yu To: Nick Desaulniers Subject: [PATCH v2] ARM: fix __div64_32() error when compiling with clang Message-ID: <20201130082032.GA25739@penyung-VirtualBox> References: <20201123073634.6854-1-swpenim@gmail.com> <20201123181602.GA2637357@ubuntu-m3-large-x86> <20201124074211.GA26157@penyung-VirtualBox> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201130_032101_767613_E778311C X-CRM114-Status: GOOD ( 15.36 ) 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: swpenim@gmail.com, Russell King , LKML , clang-built-linux , Nathan Chancellor , Linux ARM Content-Type: multipart/mixed; boundary="===============4205393998997837711==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============4205393998997837711== Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v2-0001-ARM-fix-__div64_32-error-when-compiling-with-clan.patch" >From 3a4c19e09079324a625941ea3c16fe4b0df2ed86 Mon Sep 17 00:00:00 2001 From: Antony Yu Date: Mon, 9 Nov 2020 17:31:52 +0800 Subject: [PATCH v2] ARM: fix __div64_32() error when compiling with clang __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 Reported-by: kernel test robot --- changed in v2 - add kernel-test-robot tag - fix build failure on big endian 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..961a129eb41f 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" (__xl) : "r" (__n), "r" (__base) : "ip", "lr", "cc"); *n = __res; -- 2.29.0 --===============4205393998997837711== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============4205393998997837711==--