Received: by 10.192.165.148 with SMTP id m20csp3581023imm; Mon, 30 Apr 2018 02:48:25 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqqhnrBpOjm1kpUB79OduYshRazTFf/8iCgrcSkDl1G4/+cizffrdMzKh/zssmHDlQ9cyZl X-Received: by 2002:a17:902:aa4b:: with SMTP id c11-v6mr11836280plr.17.1525081705463; Mon, 30 Apr 2018 02:48:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525081705; cv=none; d=google.com; s=arc-20160816; b=gtSMXbsiAtup0CP3w/LHOWby+jyM4XCBdrGguCGcSgStPln5MwvHuS1G7MXqQN766A Q8WcAs+q4Qjn8dtI4FCC/jjHmTtxkB0smyZ/qxswNbWUYhrFTs8TUA15Sh+gwKtaVoEp oRuMKKc66qhWfdd+5J5tk0BcNFPdoIQSDkhtOsXKnMSiRTSmfNIsoHnNWgzTsEafnAcB NLAR+AyIqZAOJFhaR7KYIkaExkETS/WdFg9DHPPruPH7nZtoyXOnytZg7g72wGVNpDsV fUIzUkglpHKKvNUUBmnlLxYUB+lrYSyyy+nt/EDdF+vFsQ7ENNiw5xmqx5eAEcWm82hC /h1w== 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=+DErV2pjr2z47/Z6xitt3NAHeLf2R/XT8rx5dQYltJA=; b=GBlgTAfDOOxAzKfpJiPVZiyJwF9h+KLrwWVgpuawt9Bg+XsGnx3iGHzfwF77R1irje M/vvPt7XUQepEdP6ys1XM4swhogxUf1Nx8G57YQtLBspoV1g5MtvRdkBF5GDBM5rdpzm OWhnAl0W1CoXxqf94DH+z+kjzD8E4LAbvYJWgzI03eyF3qqkTzAng2MQrmglRVmnYPNX 9MN2e9hXzrmaVzSzkLpLmffZ35BT9dpIAwi6xt4A8J0lGMPMFUO2VmqvZsNHaCflviyp BgRRpExkIsdFjVL5S5FzxbFJgV5eLXzzUz8zhF+mu28dIQRVtJk7tPBAt7u5m9t7c4WH E2uA== 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 l12-v6si5925468pga.536.2018.04.30.02.48.11; Mon, 30 Apr 2018 02:48:25 -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 S1752762AbeD3Jqy (ORCPT + 99 others); Mon, 30 Apr 2018 05:46:54 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:57020 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750882AbeD3Jqx (ORCPT ); Mon, 30 Apr 2018 05:46:53 -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 0F46715AB; Mon, 30 Apr 2018 02:46:53 -0700 (PDT) Received: from [10.1.70.34] (e112298-lin.cambridge.arm.com [10.1.70.34]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AAB503F587; Mon, 30 Apr 2018 02:46:51 -0700 (PDT) Subject: Re: [PATCH v2 0/6] arm64: provide pseudo NMI with GICv3 To: Joel Fernandes Cc: Linux ARM Kernel List , Linux Kernel Mailing List , mark.rutland@arm.com, marc.zyngier@arm.com, james.morse@arm.com, daniel.thompson@linaro.org, Joel Fernandes References: <1516190084-18978-1-git-send-email-julien.thierry@arm.com> From: Julien Thierry Message-ID: Date: Mon, 30 Apr 2018 10:46:50 +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: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Joel, Thanks for the interest. On 29/04/18 07:35, Joel Fernandes wrote: > Hi Julien, > > I am interested in evaluating if using this is feasible for our > Android devices. There is quite a usecase for lockup detection that it > seems worthwhile if it works well. Atleast I feel this can be used a > debug option considering the performance downgrade. > > Do you have more details of if any GICv3 based system will work, or is > there a way an SoC can be misconfigured so that this series will not > work? I think Marc told me that's possible, but I wasn't sure. I will > be quite happy if it works on SoC as long as they have the requisite > GIC version. > > Some more questions below: > > On Wed, Jan 17, 2018 at 3:54 AM, Julien Thierry wrote: >> Hi, >> >> This series is a continuation of the work started by Daniel [1]. The goal >> is to use GICv3 interrupt priorities to simulate an NMI. >> >> To achieve this, set two priorities, one for standard interrupts and >> another, higher priority, for NMIs. Whenever we want to disable interrupts, >> we mask the standard priority instead so NMIs can still be raised. Some >> corner cases though still require to actually mask all interrupts >> effectively disabling the NMI. >> >> Of course, using priority masking instead of PSR.I comes at some cost. On >> hackbench, the drop of performance seems to be >1% on average for this >> version. I can only attribute that to recent changes in the kernel as > > Do you have more specific performance data on the performance overhead > with this series? > Not at the moment. I was planning on doing a v3 anyway considering this series is getting a bit old and the GICv3 driver has had some modifications. Once I get to it I can try to have more detailed performance data on a recent kernel. I've really only measured the performance on hackbench and on kernel build from defconfig (and for the kernel build the performance difference was completely hidden by the noise). >> hackbench seems slightly slower compared to my other benchmarks while the >> runs with the use of GICv3 priorities have stayed in the same time frames. >> KVM Guests do not seem to be affected preformance-wise by the host using >> PMR to mask interrupts or not. >> >> Currently, only PPIs and SPIs can be set as NMIs. IPIs being currently >> hardcoded IRQ numbers, there isn't a generic interface to set SGIs as NMI >> for now. I don't think there is any reason LPIs should be allowed to be set >> as NMI as they do not have an active state. >> When an NMI is active on a CPU, no other NMI can be triggered on the CPU. >> >> >> Requirements to use this: >> - Have GICv3 >> - SCR_EL3.FIQ is set to 1 when linux runs > > Ah I see it mentioned here. Again, can you clarify if this is > something that can be misconfigured? Is it something that the > bootloader sets? > Yes, this is something that the bootloader sets and we have seen a few cases where it is set to 0, so it can be "misconfigured". It is not impossible to handle this case, but this bit affects the view the GICv3 CPU interface has on interrupt priority values. However it requires to add some conditions in both the interrupt handling and masking/unmasking code, so ideally we would avoid adding things to this. But the idea is that Linux only deals with group 1 interrupts, and group 1 interrupts are only signaled as FIQs when the execution state is secure or at EL3, which should never happen in Linux's case. So ideally we'd like firmwares to set up this bit properly rather than to have to deal with both cases when only one of them makes sense for Linux. > Sorry if these questions sound premature, I haven't yet taken a closer > look at the series. > Cheers, -- Julien Thierry