Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3025052pxf; Sun, 21 Mar 2021 16:02:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx17y9+d+uceWX9fpCEgbh4kSrEL2ntVRl6ARbRULLnThmRMxdZOm7QoiU1yavpvd46UgOg X-Received: by 2002:a17:906:5e4a:: with SMTP id b10mr16412602eju.116.1616367729822; Sun, 21 Mar 2021 16:02:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616367729; cv=none; d=google.com; s=arc-20160816; b=ahhLW0ctdho2xtZi9NR+pJr6bZ9b8LpzXjNWzVb6/q8sXsrTEyO/obtkyz4ThLKOiH mIFS3c78A3fZCbEdDt/L/gaLOeu3TnHundSXI0zssbFxRmFZUdVC+iSEaMqjCOqcEE0F X1tSXUkoc2L2VqGFgVoaPoN9RLVmYMXitji6jS5DeDlbGiqiYY7/qqPx3ajh/9JvYN4o et+0ZHdeHRmYPXcwALdwswS8hkxZDt9PlXyneapafM6MgGACvdWIUppCn5Ankt99pTFa VJEyb4n6cGwUtJkZhQqDID78zNws+7blLiIqJlX032krX+cqzgOngdklDubNmeGAyQi3 GRfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=xUQjD2hDdGidLOCA2V0g/NDNMrzOrwuhfVr8T/leSmM=; b=oMxjA8liOU6taw8zg3Gv+nabO+dFHzDUVvMoZ6B4ES6TpeBFbBw349bTu2GuEW4fKh 92CHgv5TfvFHKZRMgs30FkiFlolvioalIuDSFBu5BhbVFFuUv3scZr4sTlHEQrEo3DpH IIbxv0WtJb8esPMrSTndeRUh2iWcDPtcUbuwm1gxKa1d0Q7hnzqWkZ+gxBg5Enj0qkac Ej1Vv5nl41u45A6w+MxyarEaSqERG6AQ+b6W6bYcugcx7KwrJaV8LL4QVROVnlUsn89m wY+/b4yswdgElDVm+w6tAAdKEkxU2HcS6u720R04TSnpC+eP5c27OCbaomn2ireSpwXD EdrQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jz16si9973739ejb.586.2021.03.21.16.01.47; Sun, 21 Mar 2021 16:02:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230107AbhCUVKj (ORCPT + 99 others); Sun, 21 Mar 2021 17:10:39 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:56243 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229993AbhCUVKR (ORCPT ); Sun, 21 Mar 2021 17:10:17 -0400 Received: from mail-oi1-f181.google.com ([209.85.167.181]) by mrelayeu.kundenserver.de (mreue106 [213.165.67.113]) with ESMTPSA (Nemesis) id 1MVMNF-1lDOEp0jNX-00SLUM for ; Sun, 21 Mar 2021 22:10:16 +0100 Received: by mail-oi1-f181.google.com with SMTP id a8so11048021oic.11 for ; Sun, 21 Mar 2021 14:10:15 -0700 (PDT) X-Gm-Message-State: AOAM533tB5To74EC3z3DVtDUSQB6mDFMFFuWGuDUWR+1jDBNVgmEZqnW tHcdbMFUi8QVTSiJPAE702K00OtAHYWp+DM49oI= X-Received: by 2002:aca:5945:: with SMTP id n66mr7657182oib.11.1616361014951; Sun, 21 Mar 2021 14:10:14 -0700 (PDT) MIME-Version: 1.0 References: <20210321184650.10926-1-krzysztof.kozlowski@canonical.com> In-Reply-To: <20210321184650.10926-1-krzysztof.kozlowski@canonical.com> From: Arnd Bergmann Date: Sun, 21 Mar 2021 22:09:59 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] firmware: stratix10-svc: build only on 64-bit ARM To: Krzysztof Kozlowski Cc: Richard Gong , Linux Kernel Mailing List , Dinh Nguyen , kbuild-all@lists.01.org, Linux ARM , kernel test robot , Lorenzo Pieralisi , Jens Wiklander Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:k5+ivsvCZ+8b37T4P8AwxFHJ6+6ysWJwzYOG/E1Gzb2onLWnrBX X17qQk0M/GdUXk1/gx5QugF7d/qMKvYPDUgmHROWuX38LYNvG+n8Eom9fEK+NBEa8Uo31YM +41g0tHbWGxHlJLvoDc/VNEna7d5MmGTbq7TO8hs4W7UkLQl8JNZeiCg7b+XmTjlLhWX9VC DeDLcIlfLBLyq+ykul7bw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:YSWe2k7uMec=:dS90OFaESI/BUuSo7/htr/ 92CnDk9yFySkjEewEYXklnbm7G4QLW7Ilt5F1wl7dk3JH2U+M59yZR39hDw6HnLYyENY6BtyO FST7WrdfERUvzjRqJyb4F2GCaKzflZHbrvVXCYDje5Jh6nn8j4rOWtgo0fcn3y/xAylLwe2A3 +MBndXoIqrIHO5fVd+Bm7S0n5+W/W03djruqWGa8ZZxDH2BPV6MmXIeN+7aDSxn+HpnyZWE4d x4Qn1frXslJdWyJsbSCDr7DqSbQ6RMR0xeZWDEwX5LI5juSDVkEt60w1xl8Y49Utvwe4UA4Mc fJj2IzLEdxzIk5bche4Cyza+HPLJ7UQTKgH30pqmsT1QdMlV2gReZjieyQnmx4TiTvKGcczh+ 8CPp5P/9urb1Xi509UULDKCx8bNq+332NM7HNJAZtdEZ510XNwPW9kMCyM4CCzZXR/rTH5h3B NHg6ntsIFzDRwubbMb6tbfV0VAcUCa00JkrSOH7tgPNJ4dyGeAXk4lrMfnBMf15YbNuFuUvAK OA4yThTmhimeI2/QuuCBHI6AfDGTORlTsTyZDENc6AALZZJs+XkjB/N+VDzaFf17Q== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Mar 21, 2021 at 7:46 PM Krzysztof Kozlowski wrote: > > The Stratix10 service layer and RCU drivers are useful only on > Stratix10, so on ARMv8. Compile testing the RCU driver on 32-bit ARM > fails: > > drivers/firmware/stratix10-rsu.c: In function 'rsu_status_callback': > include/linux/compiler_types.h:320:38: error: call to '__compiletime_assert_179' > declared with attribute error: FIELD_GET: type of reg too small for mask > _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) > ... > drivers/firmware/stratix10-rsu.c:96:26: note: in expansion of macro 'FIELD_GET' > priv->status.version = FIELD_GET(RSU_VERSION_MASK, > > Signed-off-by: Krzysztof Kozlowski > Reported-by: kernel test robot While I agree that one shouldn't run 32-bit kernels on this, we should also try to write drivers portably, and in theory any SoC that can run a 64-bit Arm kernel should also be able to run a 32-bit kernel if you include the same drivers. It seems that the problem here is in the smccc definition struct arm_smccc_res { unsigned long a0; unsigned long a1; unsigned long a2; unsigned long a3; }; so the result of #define RSU_VERSION_MASK GENMASK_ULL(63, 32) priv->status.version = FIELD_GET(RSU_VERSION_MASK, res->a2); tries to access bits that are just not returned by the firmware here, which indicates that it probably won't work in this case. What I'm not entirely sure about is whether this is a problem in the Intel firmware implementation requiring the smccc caller to run in a 64-bit context, or if it's a mistake in the way the driver extracts the information if the firmware can actually pass it down correctly. Arnd