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=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 3068EC35669 for ; Fri, 21 Feb 2020 20:15:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 03CEC206ED for ; Fri, 21 Feb 2020 20:15:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726725AbgBUUPq (ORCPT ); Fri, 21 Feb 2020 15:15:46 -0500 Received: from muru.com ([72.249.23.125]:56950 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726443AbgBUUPq (ORCPT ); Fri, 21 Feb 2020 15:15:46 -0500 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 0EF00807E; Fri, 21 Feb 2020 20:16:29 +0000 (UTC) Date: Fri, 21 Feb 2020 12:15:42 -0800 From: Tony Lindgren To: Arnd Bergmann Cc: linux-omap , Linux ARM , kbuild test robot , Aaro Koskinen , "Andrew F . Davis" , Catalin Marinas , Marc Zyngier , Rob Herring , Russell King , Steven Price , Will Deacon Subject: Re: [PATCH] ARM: OMAP2+: Fix compile if CONFIG_HAVE_ARM_SMCCC is not set Message-ID: <20200221201542.GB37466@atomide.com> References: <20200221180901.15812-1-tony@atomide.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org * Arnd Bergmann [200221 20:06]: > On Fri, Feb 21, 2020 at 7:09 PM Tony Lindgren wrote: > > > > Recent omap changes added runtime checks to use omap_smccc_smc() > > when optee is configured in dts. As the omap-secure code can be > > built for ARMv6 only without ARMv7 and use custom smc calls, we > > now get a build error: > > > > omap-secure.c:(.text+0x94): undefined reference to `__arm_smccc_smc' > > > > Let's just ifdef out omap_smccc_smc() unless the CPU has selected > > CONFIG_HAVE_ARM_SMCCC. The other option discussed was to add an > > inline function to arm-smccc.h, but we'd still also have to add > > ifdef around omap_smccc_smc() to avoid a warning for uninitialized > > value for struct arm_smccc_res in omap_smccc_smc(). And we probably > > should not start initializing values in arm-smccc.h if disabled. > > > > Let's also warn on trying to use omap_smccc_smc() if disabled as > > suggested by Andrew F. Davis . > > > > +#ifdef CONFIG_HAVE_ARM_SMCCC > > void omap_smccc_smc(u32 fn, u32 arg) > > { > > struct arm_smccc_res res; > > @@ -85,6 +86,12 @@ void omap_smccc_smc(u32 fn, u32 arg) > > 0, 0, 0, 0, 0, 0, &res); > > WARN(res.a0, "Secure function call 0x%08x failed\n", fn); > > } > > +#else > > Looking through the callers again, this can and is only called > for ARMv7 CPUs, so can't you just avoid the #else path and > turn it into a link error if we ever get callers on ARMv6-only builds? Hmm yeah maybe. If ARMv6 machines (basically n8x0) is not using omap-smc.S at all, it's unlike it would need omap-secure.c either. Regards, Tony