Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp4236307rwr; Mon, 8 May 2023 05:08:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ53Sk0535tnFK82tL9G6UJ+CXFcjAZlugRTyvZbMV+4mdGZ/96i8kVPZHRag/26ZyxHYUZU X-Received: by 2002:a05:6a20:160b:b0:f0:f2a:ff4f with SMTP id l11-20020a056a20160b00b000f00f2aff4fmr13732153pzj.8.1683547737881; Mon, 08 May 2023 05:08:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683547737; cv=none; d=google.com; s=arc-20160816; b=r3My8Z5lFPrt3UW/jTa3Y4jCSnzU7tQe5voZvIRiUFNzTg29Or4Kw/P+eDwQYMveL9 isM1dmscey+mdv9WGStgpTLvXVYo18EaAulCgPECe3f+9MCalVa0Ilay6fzxucwIX6/g L/n4ZlPuuBItJQUa+ewIa1F8IvWc8iKVGN+mN9qO2E1Jw1DUvubmCCoAn876aucIMmAO /FXEZfVHrFXwlQsbdl7vQ4b7x4uEwKhHEzcKhfzEzfi8UQ+j05gDr0VTaUU6eCsJxedc Y2d4kMkOU09Dwtj3qJuvYkqWXh7nESaJ5JGC0XfV9czx3y3aaCHyCI3qSHLwmN45elhy LtDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qd6PQ1vE/SZdiXRk2V4YVd/9ukw5PfEy62nQ6sf0Uk0=; b=h/ab7RfuoNAl1PlCk+gezXgvrRkDBbaI1TdSdJXD7ICkrASjdLhrxzu7N/Uf+R4YbI bwG6z9DFc3Hr6eeky10qhWo2CmTai4gzmG4wFJL0he4mGZf9cXELOlYp3lhOZKiPwvWG o52JPs4CT+NPQugAKmOz45SGiPYpqSFR5cdvEiV2WDT78VSds70JWBNdan33QCPPDvtG H7VLngaZfWcarXlEGx/PaEDL8cv3Csub9sIYVgIfjXElrHMTOe21KkHUvveOEfShnN8i QICL9FaHHgL46o9EFFoweM9DGH8eMT0gw/CG/xhSbONmOFio+BGUpiRMsxp77NqU4EEK qu3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=Wj+BdFY0; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w7-20020a627b07000000b006436ead4abasi8376429pfc.246.2023.05.08.05.08.30; Mon, 08 May 2023 05:08:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=Wj+BdFY0; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236427AbjEHLxv (ORCPT + 99 others); Mon, 8 May 2023 07:53:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236432AbjEHLxa (ORCPT ); Mon, 8 May 2023 07:53:30 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05622429C8 for ; Mon, 8 May 2023 04:53:20 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1aaf706768cso33123005ad.0 for ; Mon, 08 May 2023 04:53:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1683546800; x=1686138800; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qd6PQ1vE/SZdiXRk2V4YVd/9ukw5PfEy62nQ6sf0Uk0=; b=Wj+BdFY08go+Klnkl9ikMjatb5QJpTO2cewG54fs1b3lW77HcXNjgQTN2vzRD/j8ke U3yyKNS6ssEcggGMDfAXgwZPVb+FBmqfOr+Em+1ArsfHhZf2wSJZfgC6VkUq+JwWgyLn g+RLMWOOtmon/m7EVa2DCP+ETl1ECCK4M3nMIjFho7LKvb2yNVDCezwfPiVlDcs9QJCj 8LW7073DSm3mdChDFXxsHRRaDLUKp6u28cqpHj2tCtL9vO7xzRypFejOqMQyJUAGg7RB COx5W+bUevsvQur/1Cp+1+YUYxa7JkuqnS6OOhyy6oxt/zn2DyhnlYWkHpifR+QPUO6n siaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683546800; x=1686138800; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qd6PQ1vE/SZdiXRk2V4YVd/9ukw5PfEy62nQ6sf0Uk0=; b=Me/f2xEZrqb2r4E1+f/aQCK0Iq3ONGAQ1bdv+Cy+ziAtxkUbg/jh/CnsazXbEwFUrP kUjp7dKI95w0fas/GSxHoCUb2HM9ri5jdzbXwV79VY/c5IK0vb/5AqvoTh9aC4aufLqz xXtQYug6GhhoRZ+Pm4FFz11MwjYnfq4UgqPbPRCGnGy8+OT1GFOOxM18q9asLiMx5agB Ssqk9dXWO7WadjUXEgeDioapBJxxh2OnKLRv7S1CILNuK/u5krxN+VnsAvESw8V3GD6J ruoJLrTw1VCbCg/uep2ZCHmNrv6L65TL+Y+WpbLTFNrFfhnXBlQPfJuvbgFwaniTLfrN iJ0g== X-Gm-Message-State: AC+VfDwiTLWEAADF2xJwHAp6AXmhbMXIV5cytOCoN3T/OTKtZM+phWyA LnzfR6I5Ne7pVX03p8YrlNpuRw== X-Received: by 2002:a17:903:1252:b0:1aa:f0a7:933 with SMTP id u18-20020a170903125200b001aaf0a70933mr12699535plh.25.1683546800261; Mon, 08 May 2023 04:53:20 -0700 (PDT) Received: from sunil-laptop.. ([106.51.189.144]) by smtp.gmail.com with ESMTPSA id w9-20020a170902904900b001aaed524541sm7015149plz.227.2023.05.08.04.53.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 May 2023 04:53:19 -0700 (PDT) From: Sunil V L To: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org, linux-crypto@vger.kernel.org, platform-driver-x86@vger.kernel.org, llvm@lists.linux.dev Cc: Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , "Rafael J . Wysocki" , Len Brown , Daniel Lezcano , Thomas Gleixner , Weili Qian , Zhou Wang , Herbert Xu , "David S . Miller" , Marc Zyngier , Maximilian Luz , Hans de Goede , Mark Gross , Nathan Chancellor , Nick Desaulniers , Tom Rix , Sunil V L Subject: [PATCH V5 03/21] crypto: hisilicon/qm: Fix to enable build with RISC-V clang Date: Mon, 8 May 2023 17:22:19 +0530 Message-Id: <20230508115237.216337-4-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230508115237.216337-1-sunilvl@ventanamicro.com> References: <20230508115237.216337-1-sunilvl@ventanamicro.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org With CONFIG_ACPI enabled for RISC-V, this driver gets enabled in allmodconfig build. However, build fails with clang and below error is seen. drivers/crypto/hisilicon/qm.c:627:10: error: invalid output constraint '+Q' in asm "+Q" (*((char __iomem *)fun_base)) ^ This is expected error with clang due to the way it is designed. To fix this issue, move arm64 assembly code under #if. Link: https://github.com/ClangBuiltLinux/linux/issues/999 Signed-off-by: Nathan Chancellor [sunilvl@ventanamicro.com: Moved tmp0 and tmp1 into the #if] Signed-off-by: Sunil V L --- drivers/crypto/hisilicon/qm.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c index ad0c042b5e66..2eaeaac2e246 100644 --- a/drivers/crypto/hisilicon/qm.c +++ b/drivers/crypto/hisilicon/qm.c @@ -610,13 +610,9 @@ EXPORT_SYMBOL_GPL(hisi_qm_wait_mb_ready); static void qm_mb_write(struct hisi_qm *qm, const void *src) { void __iomem *fun_base = qm->io_base + QM_MB_CMD_SEND_BASE; - unsigned long tmp0 = 0, tmp1 = 0; - if (!IS_ENABLED(CONFIG_ARM64)) { - memcpy_toio(fun_base, src, 16); - dma_wmb(); - return; - } +#if IS_ENABLED(CONFIG_ARM64) + unsigned long tmp0 = 0, tmp1 = 0; asm volatile("ldp %0, %1, %3\n" "stp %0, %1, %2\n" @@ -626,6 +622,11 @@ static void qm_mb_write(struct hisi_qm *qm, const void *src) "+Q" (*((char __iomem *)fun_base)) : "Q" (*((char *)src)) : "memory"); +#else + memcpy_toio(fun_base, src, 16); + dma_wmb(); +#endif + } static int qm_mb_nolock(struct hisi_qm *qm, struct qm_mailbox *mailbox) -- 2.34.1