Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3314767imm; Fri, 25 May 2018 03:39:44 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqh3/PjzMGDBCw5z8KTt9ji3TX4hq3Y8z10C0aEmE2aA2YoaKRLfJOXIg36umpPCvTFokRE X-Received: by 2002:a17:902:6b44:: with SMTP id g4-v6mr2018964plt.390.1527244784837; Fri, 25 May 2018 03:39:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527244784; cv=none; d=google.com; s=arc-20160816; b=BgSzLJzH7NsoIuTz9i9BqLLHSg0rP0E0VV1q4oDo0vcAi4JLna3qZkXq3ZxXav3J+L j1+5A2ETLz+bDsfJayt4cQIpiZnCGqUrkyA1UdasiAGAmfYVTwhQnbcUlDoE/SG5/N+0 iZBMw25ooXP3Clqy6G7qnalBWuDi/uCp7V4C70s58ntmkVDRGKb+KGxum7teQoae3lx6 Zs4rIAvu+DNsPa4KEjoJSoi1tmrh/eqp0JlI9dO+Tu7BYpXfGxQYMs0QtnvQgrj0Bs6c Jj2V29ulETJB9mrEtcms01DAxCTbWDzKYQsOChSQeN36S5Hjkhe53Q4DCrQwOGsvvBsS yMeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=vZbDbDsnDE5IwO+h8YXSw6LZM0QChJEquzz3yAHUaEs=; b=jl5dXcXNXSu0Sy1iHFdJfNRc2ZEKIGxifKZP5qIuW++d3VZ/sNkSqvijmBG1ah+VLR D+f8xK92QyZ6WCHGOOkP2N2yy/pyVVSkK6yl4K8EwHwcChaaw8eZmTbESkwhzTJnA8zJ /D8Pee6Lc1h/4ZFXuIWtH2/Wfyu/iu7ariZolrA9IDCLlgy7gOjwdbs3BzkTJXBSDL4I 6iAWZdZ0hLfvEvLwrqFj/To8AHt3Np83sZg5Fken0h/4trmuBsCyWy2OzKOL3Gx7aC8c P5BEb+MKRUxCPQj1SevuX73esQh1n9zgTGsW8/CNCq1bfBrGeqot7pwiCnu5hEuWe0eV sWWw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 73-v6si13597277pgc.535.2018.05.25.03.39.29; Fri, 25 May 2018 03:39:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966239AbeEYKjV (ORCPT + 99 others); Fri, 25 May 2018 06:39:21 -0400 Received: from foss.arm.com ([217.140.101.70]:59226 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965255AbeEYKjT (ORCPT ); Fri, 25 May 2018 06:39:19 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7DAF280D; Fri, 25 May 2018 03:39:19 -0700 (PDT) Received: from [10.1.206.24] (e112298-lin.cambridge.arm.com [10.1.206.24]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9F5453F578; Fri, 25 May 2018 03:39:17 -0700 (PDT) Subject: Re: [PATCH v4 02/26] arm64: cpufeature: Add cpufeature for IRQ priority masking To: Suzuki K Poulose , linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, daniel.thompson@linaro.org, joel@joelfernandes.org, marc.zyngier@arm.com, mark.rutland@arm.com, christoffer.dall@arm.com, james.morse@arm.com, catalin.marinas@arm.com, will.deacon@arm.com References: <1527241772-48007-1-git-send-email-julien.thierry@arm.com> <1527241772-48007-3-git-send-email-julien.thierry@arm.com> From: Julien Thierry Message-ID: <54ff6127-928d-99a3-a6e9-59799628ca87@arm.com> Date: Fri, 25 May 2018 11:39:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25/05/18 11:36, Suzuki K Poulose wrote: > On 25/05/18 11:17, Julien Thierry wrote: >> >> >> On 25/05/18 11:04, Suzuki K Poulose wrote: >>> On 25/05/18 10:49, Julien Thierry wrote: >>>> Add a cpufeature indicating whether a cpu supports masking interrupts >>>> by priority. >>> >>> How is this different from the SYSREG_GIC_CPUIF cap ? Is it just >>> the description ? >> >> More or less. >> >> It is just to have an easier condition in the rest of the series. >> Basically the PRIO masking feature is enabled if we have a GICv3 CPUIF >> working *and* the option was selected at build time. Before this meant >> that I was checking for the GIC_CPUIF cap inside #ifdefs (and putting >> alternatives depending on that inside #ifdefs as well). >> >> Having this as a separate feature feels easier to manage in the code. >> It also makes it clearer at boot time that the kernel will be using >> irq priorities (although I admit it was not the initial intention): >> >> [    0.000000] CPU features: detected: IRQ priority masking >> >> >> But yes that new feature will be detected only if SYSREG_GIC_CPUIF >> gets detected as well. > > Well, you could always wrap the check like : > > static inline bool system_has_irq_priority_masking(void) > { >     return (IS_ENABLED(CONFIG_YOUR_CONFIG) && > cpus_have_const_cap(HWCAP_SYSREG_GIC_CPUIF)); > } > > and use it everywhere. > Yes, but I can't use that in the asm parts that use alternatives and would need to surround them in #ifdef... :\ > The description could be statically changed to reflect based on the #ifdef. > > > static const struct arm64_cpu_capabilities arm64_features[] = { >         { > #ifdef CONFIG_YOUR_CONFIG >         .desc = "GIC System register CPU interface with IRQ priority > masking" > #else >                 .desc = "GIC system register CPU interface", > #endif >                 .capability = ARM64_HAS_SYSREG_GIC_CPUIF, >                 .type = ARM64_CPUCAP_SYSTEM_FEATURE, >                 .matches = has_useable_gicv3_cpuif, >                 .sys_reg = SYS_ID_AA64PFR0_EL1, >                 .field_pos = ID_AA64PFR0_GIC_SHIFT, >                 .sign = FTR_UNSIGNED, >                 .min_field_value = 1, > > Cheers > Suzuki -- Julien Thierry