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=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_PASS 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 14234C43387 for ; Thu, 20 Dec 2018 17:54:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DA0A6218D3 for ; Thu, 20 Dec 2018 17:54:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linaro.org header.i=@linaro.org header.b="FnbPkDPL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388246AbeLTRyF (ORCPT ); Thu, 20 Dec 2018 12:54:05 -0500 Received: from mail-io1-f66.google.com ([209.85.166.66]:33964 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388191AbeLTRyF (ORCPT ); Thu, 20 Dec 2018 12:54:05 -0500 Received: by mail-io1-f66.google.com with SMTP id l22so638666ioh.1 for ; Thu, 20 Dec 2018 09:54:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+w81jMbb1o2ygo2dFZKor/RnHjUNYim0qXEYOaVTDLc=; b=FnbPkDPLEuqKdeWe1yEFJJZBekH1QO+pKfgDgKGFEwq8gAd4uvTADH9/BuvWR9V1f+ 6kAR2citfpmJctvSKlLZwenOiV9M9Oc7tg7QvUtAWiN48ciAl0JQfXwb/vp/zU+C7IMf x4IV6Ym0i0JaTtiu8z4PulYcpLT/n0qulLFLU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+w81jMbb1o2ygo2dFZKor/RnHjUNYim0qXEYOaVTDLc=; b=HcpWul676e9A74Hz0OrMnsDE49BhYYMzx4x1M4WNsDEcsHoBqRI+kXnmnhN2EIWPFM EhhPepcHYXGOs+dOxeSBtOo+tpcPKHPrXP7xUT7lVA3zoOAx5bCtJe0tjE3ZnWGKZEQO PyDX2OGdAJhNoNbYoGAgre7X9RJwG/xIpb8O/ZbmFQQoCsV55osksr+TeqVpNu1DAZ43 s4duwj65yG7uf7C+SGHj8W+AEq3/DRWPPBFSmKJSTqWw1/YXcWBIPhXI5kNDhcs1Ugz7 l4TsO0/d9c5zWp6DlX9aSHfEkBAGb+Qm8Nra6f7nOwp4JDpzV/8maL/f2kfW6CstfGG9 gpOw== X-Gm-Message-State: AA+aEWYZbZLqtqZU/C4AkyKp5tmQTa9QMMLjfw6uGSR4en3nMth2HlLT cig6UDGMxpZ1lXNR7dZz1uOUDchiKGWUDCdbfcfehA== X-Google-Smtp-Source: AFSGD/Vp+zhHyHp1nKMdtFw4tma8WbKDd6zssG67ODBx/MRA4s6TcuYWmfeK3vKs6cMQBA1XTO1HTT1ZnDOBJTq64So= X-Received: by 2002:a5e:cb0b:: with SMTP id p11mr22959730iom.60.1545328444007; Thu, 20 Dec 2018 09:54:04 -0800 (PST) MIME-Version: 1.0 References: <1544633245-6036-1-git-send-email-julien.thierry@arm.com> <1544633245-6036-12-git-send-email-julien.thierry@arm.com> <19500d6b-62a3-21cb-9ac0-a4e5d4714a63@arm.com> <31e41461-763f-aa7d-91ea-b493ede81eed@arm.com> <7d42f570-541a-59a3-79fc-f00dc0b51689@arm.com> <9c64a977-fdee-b2b2-d726-1e9744d229a7@arm.com> <0e6edb8d-dd41-fd3d-0598-7f02ce4ee9ef@arm.com> In-Reply-To: <0e6edb8d-dd41-fd3d-0598-7f02ce4ee9ef@arm.com> From: Ard Biesheuvel Date: Thu, 20 Dec 2018 18:53:51 +0100 Message-ID: Subject: Re: [PATCH v7 11/25] arm64: irqflags: Use ICC_PMR_EL1 for interrupt masking To: Julien Thierry Cc: linux-arm-kernel , Linux Kernel Mailing List , Daniel Thompson , joel@joelfernandes.org, Marc Zyngier , Christoffer Dall , James Morse , Catalin Marinas , Will Deacon , Mark Rutland , oleg@redhat.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 19 Dec 2018 at 18:01, Julien Thierry wrote: > > Hi Ard, > > On 14/12/2018 16:40, Julien Thierry wrote: > > > > > > On 14/12/2018 15:49, Ard Biesheuvel wrote: > >> On Fri, 14 Dec 2018 at 16:23, Julien Thierry wrote: > >>> > >>> Hi, > >>> > >>> On 13/12/2018 15:03, Julien Thierry wrote: > >>>> > >>>> Argh, not as simple as I had expected. > >>>> > >>>> Turns out include/linux/efi.h does not include asm/efi.h (including it > >>>> at the beginning of the file breaks the build because asm/efi.h misses > >>>> the efi type definitions. > >>>> > >>>> So a thing like: > >>>> > >>>> #ifndef efi_get_irqflags > >>>> #define efi_get_irqflags(flags) local_save_flags(flags) > >>>> #endif > >>>> > >>>> in include/linux/efi.h cannot be overridden. > >>>> > >>>> Either I would need to introduce the definitions arm, arm64 and x86 (I > >>>> don't think there are other arch supporting EFI right now) or I'll need > >>>> to come up with another solution. > >>>> > >>> > >> > >> It might be a bit nasty, but can we put the #ifndef above in > >> runtime-wrappers.c directly? The only reference in linux/efi.h is a > >> macro, so that shouldn't matter afaict. > >> > > > > Sadly, in arch/x86/platform/uv/bios_uv.c, uv_bios_call() has a reference > > to the macro efi_call_virt_pointer() which wouldn't be able to see the > > definition in runtime-wrappers.c > > > > Otherwise, we could've moved efi_call_virt_pointer() and > > __efi_call_virt_pointer in runtime-wrappers.c and things would not have > > been as nasty. > > > > But no, I don't think we can do that without breaking some x86 build :( . > > > > Since the above does not work, would the solution with the > HAVE_GENERIC_EFI_FLAGS below be acceptable to you? Or would you rather I > defined helpers in for all arm/arm64/x86? > > Or neither and I shall find another way? > Would it be possible to introduce a function efi_call_virt_save_flags() [as a counterpart to efi_call_virt_check_flags()], and put the implementation in runtime-wrappers.c (which already includes asm/efi.h)? That should allow you to put arch-specific hooks in asm/efi.h, and use them in the implementation of efi_call_virt_save_flags(). AFAICT, that removes the need for Kconfig glue. 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=-1.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 258E9C43387 for ; Thu, 20 Dec 2018 17:54:23 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 ED63F218D3 for ; Thu, 20 Dec 2018 17:54: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="tVWlaszc"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=linaro.org header.i=@linaro.org header.b="FnbPkDPL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ED63F218D3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-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=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=kqLD529OfdE/mlVapj1C75WNS96hc1xeCSvU3dwL78E=; b=tVWlaszcpSp2Jd baOlkX4tMmxVdQVVZP9GJBqg+ydPsL3Yyxg6ZFFDDx4g1ZDYP+/iEETYADw9Le2aex1CvQPyIM+xw DCbpMzNPetPfj9OUHzhGfJAW+oODyxEgz5barKbiHTYg5AfhwhK/dKsbC6KYpisiF38uv8w5zfkDU JE57da6Qh+lMBOmGWtvDFRasL4AWzbdGki9XLRQj01pOUeSD1XaVY+A+7JkDWYt9yaledXsHqVh3l Y3YorYKBa+eJTJ1VQCZmueetUKdVH/nwbt8k+5B8nt2KGSTsuuM3W4C/dkIC1I5EklrKesaOPeRou A4jpAe28OxQI4LUhtYVA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ga2WY-00046K-4H; Thu, 20 Dec 2018 17:54:18 +0000 Received: from mail-io1-xd42.google.com ([2607:f8b0:4864:20::d42]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1ga2WV-00044Y-Aj for linux-arm-kernel@lists.infradead.org; Thu, 20 Dec 2018 17:54:16 +0000 Received: by mail-io1-xd42.google.com with SMTP id t24so1530684ioi.0 for ; Thu, 20 Dec 2018 09:54:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+w81jMbb1o2ygo2dFZKor/RnHjUNYim0qXEYOaVTDLc=; b=FnbPkDPLEuqKdeWe1yEFJJZBekH1QO+pKfgDgKGFEwq8gAd4uvTADH9/BuvWR9V1f+ 6kAR2citfpmJctvSKlLZwenOiV9M9Oc7tg7QvUtAWiN48ciAl0JQfXwb/vp/zU+C7IMf x4IV6Ym0i0JaTtiu8z4PulYcpLT/n0qulLFLU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+w81jMbb1o2ygo2dFZKor/RnHjUNYim0qXEYOaVTDLc=; b=oxLaw5sRnZbAKQwNTw9FksOl4wcweBRIQ4tbaEZntNoIizRKVaBvdSpZIecaNGOIsL iSzycEoPNl7bcv90wnNvcGEJHKXIGJR6rHvQI9BumenuOnZLnNyL9hae18la9IrDAU5l 8fKUb1l+3AKIkzULqi7XBsAmOkmBw1UdorXdNB441lELVPPsa5jV1smz7n+iC6uV3WRb DKYzkjZPTCPOKIoyBRg8DsOXDhl4Qq0mHoj1dIBiKHV0RpV/QXjoBZ6cnKHZqe6QV6Yg NhDSi6G0s+2L29W9an6Eco+nW+AbaisCKPtacWkkmqbRxP/IwwSA1pnF+qcLdjJpW+Pu 7CeA== X-Gm-Message-State: AA+aEWbypawqbPZM/+fYfw60ri1lm9SaV31RifUPtpVWSPe0oatmju12 cFt34dMGIa6//OMujYw6+FuNlDCYIETiaxUb3cOD5g== X-Google-Smtp-Source: AFSGD/Vp+zhHyHp1nKMdtFw4tma8WbKDd6zssG67ODBx/MRA4s6TcuYWmfeK3vKs6cMQBA1XTO1HTT1ZnDOBJTq64So= X-Received: by 2002:a5e:cb0b:: with SMTP id p11mr22959730iom.60.1545328444007; Thu, 20 Dec 2018 09:54:04 -0800 (PST) MIME-Version: 1.0 References: <1544633245-6036-1-git-send-email-julien.thierry@arm.com> <1544633245-6036-12-git-send-email-julien.thierry@arm.com> <19500d6b-62a3-21cb-9ac0-a4e5d4714a63@arm.com> <31e41461-763f-aa7d-91ea-b493ede81eed@arm.com> <7d42f570-541a-59a3-79fc-f00dc0b51689@arm.com> <9c64a977-fdee-b2b2-d726-1e9744d229a7@arm.com> <0e6edb8d-dd41-fd3d-0598-7f02ce4ee9ef@arm.com> In-Reply-To: <0e6edb8d-dd41-fd3d-0598-7f02ce4ee9ef@arm.com> From: Ard Biesheuvel Date: Thu, 20 Dec 2018 18:53:51 +0100 Message-ID: Subject: Re: [PATCH v7 11/25] arm64: irqflags: Use ICC_PMR_EL1 for interrupt masking To: Julien Thierry X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181220_095415_366267_4F532AB2 X-CRM114-Status: GOOD ( 20.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Daniel Thompson , Marc Zyngier , Catalin Marinas , Will Deacon , Linux Kernel Mailing List , Christoffer Dall , James Morse , oleg@redhat.com, joel@joelfernandes.org, linux-arm-kernel Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, 19 Dec 2018 at 18:01, Julien Thierry wrote: > > Hi Ard, > > On 14/12/2018 16:40, Julien Thierry wrote: > > > > > > On 14/12/2018 15:49, Ard Biesheuvel wrote: > >> On Fri, 14 Dec 2018 at 16:23, Julien Thierry wrote: > >>> > >>> Hi, > >>> > >>> On 13/12/2018 15:03, Julien Thierry wrote: > >>>> > >>>> Argh, not as simple as I had expected. > >>>> > >>>> Turns out include/linux/efi.h does not include asm/efi.h (including it > >>>> at the beginning of the file breaks the build because asm/efi.h misses > >>>> the efi type definitions. > >>>> > >>>> So a thing like: > >>>> > >>>> #ifndef efi_get_irqflags > >>>> #define efi_get_irqflags(flags) local_save_flags(flags) > >>>> #endif > >>>> > >>>> in include/linux/efi.h cannot be overridden. > >>>> > >>>> Either I would need to introduce the definitions arm, arm64 and x86 (I > >>>> don't think there are other arch supporting EFI right now) or I'll need > >>>> to come up with another solution. > >>>> > >>> > >> > >> It might be a bit nasty, but can we put the #ifndef above in > >> runtime-wrappers.c directly? The only reference in linux/efi.h is a > >> macro, so that shouldn't matter afaict. > >> > > > > Sadly, in arch/x86/platform/uv/bios_uv.c, uv_bios_call() has a reference > > to the macro efi_call_virt_pointer() which wouldn't be able to see the > > definition in runtime-wrappers.c > > > > Otherwise, we could've moved efi_call_virt_pointer() and > > __efi_call_virt_pointer in runtime-wrappers.c and things would not have > > been as nasty. > > > > But no, I don't think we can do that without breaking some x86 build :( . > > > > Since the above does not work, would the solution with the > HAVE_GENERIC_EFI_FLAGS below be acceptable to you? Or would you rather I > defined helpers in for all arm/arm64/x86? > > Or neither and I shall find another way? > Would it be possible to introduce a function efi_call_virt_save_flags() [as a counterpart to efi_call_virt_check_flags()], and put the implementation in runtime-wrappers.c (which already includes asm/efi.h)? That should allow you to put arch-specific hooks in asm/efi.h, and use them in the implementation of efi_call_virt_save_flags(). AFAICT, that removes the need for Kconfig glue. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel