Received: by 10.213.65.16 with SMTP id m16csp267241imf; Mon, 12 Mar 2018 03:10:34 -0700 (PDT) X-Google-Smtp-Source: AG47ELtjBeYR2yZ5crnATi7UPSA0SI0tFXOXUOWdpqbYMT3owKdz2AvzJtIRoKRIMoG7x7wpeytE X-Received: by 10.98.63.75 with SMTP id m72mr7517124pfa.122.1520849434476; Mon, 12 Mar 2018 03:10:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520849434; cv=none; d=google.com; s=arc-20160816; b=MSQXvt9G+pQG9Mm/znSBdfUrn8bnbCGYaXjKtXkH1kyk8L/L5jZVB13kbxpphX+ome mOmvsONPaBKf14K+exv/2OZgNGVmAriSMKSX50DgRcg00Nqapj6p3uJkvEHJQ7k/7pKq 7wHHLEwBPL/T6KmgIFVnRHSBSZZpq7hdbTTV2prLKnjimznACPhnlbM1U9i+QRf/a1p0 VJCUJYfPVMTragfHWUI7Z1udRD9nXdsxbtTswHMwQPhWR/2N9R+piNWY8ISOMc1mgK9Q 5iSk3BupCJVF/522tlQS2p3sunyfb21GWdINI52cDTixd1lVeAzgfSdjNKWewzbNZaLz sEBQ== 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:organization:from:references:cc:to:subject :arc-authentication-results; bh=5kcYrQZ7QzQ90CoPw9EZTM6dsWRiBQAmtfkjTkxvfp8=; b=umFc2x0gdDIDzwj/USh8DRispLVOES79WY30NNI+H0iKdna0BEtKkVTX9jQSNrjhhu aW+94zuN2uuU42Ggc+9LWFaQKTMkqkWrz8fYQFpZryObBWIyxu2IrCHVxCnrPL7USlHj JAMbtUAidkBmi7oi8Z38UKwbMr/FWb9ZSwJsrsgSQbhRQh8QbK+SauZQCEkO3nmR1zbM weAF8wKdcsPXIQtp/huSYUTbrhVITXSgkFEVzbxCSfe1uB8p+J/AhwrSe/bwN1ZtuyRa EH0BoFRiKALPABVgON6hoTFxSmOQ9B6q0kaK5otPSaN1LR9CcNUSB42njRT8yEfRP3FZ drKQ== 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 l67si5476186pfb.329.2018.03.12.03.10.20; Mon, 12 Mar 2018 03:10:34 -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 S1752614AbeCLKJH (ORCPT + 99 others); Mon, 12 Mar 2018 06:09:07 -0400 Received: from foss.arm.com ([217.140.101.70]:52022 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751881AbeCLKJE (ORCPT ); Mon, 12 Mar 2018 06:09:04 -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 2B19115AB; Mon, 12 Mar 2018 03:09:04 -0700 (PDT) Received: from [10.1.207.62] (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 762A33F24A; Mon, 12 Mar 2018 03:09:02 -0700 (PDT) Subject: Re: [RFC PATCH] KVM: arm/arm64: vgic: change condition for level interrupt resampling To: "Yang, Shunyong" , "cdall@kernel.org" Cc: "linux-kernel@vger.kernel.org" , "ard.biesheuvel@linaro.org" , "kvmarm@lists.cs.columbia.edu" , "Zheng, Joey" , "will.deacon@arm.com" , "linux-arm-kernel@lists.infradead.org" , "david.daney@cavium.com" , "eric.auger@redhat.com" References: <1520492490-7943-1-git-send-email-shunyong.yang@hxt-semitech.com> <9ad47673-068e-f732-d2ca-9c76a8fbdfbc@arm.com> <0a15633d-8944-cb9b-3e6b-b08ee5ec42b9@arm.com> <20180308161900.GC1917@lvm> <86r2oubho3.wl-marc.zyngier@arm.com> <20180309213612.GD1917@lvm> <86k1ukazr0.wl-marc.zyngier@arm.com> <20180311121733.643fb1a5@why.wild-wind.fr.eu.org> <1520822024.2985.12.camel@hxt-semitech.com> From: Marc Zyngier Organization: ARM Ltd Message-ID: <103f560a-d7ad-ba6c-e129-eda172312576@arm.com> Date: Mon, 12 Mar 2018 10:09:01 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1520822024.2985.12.camel@hxt-semitech.com> Content-Type: text/plain; charset=iso-8859-15 Content-Language: en-GB Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/03/18 02:33, Yang, Shunyong wrote: > Hi, Marc, > > On Sun, 2018-03-11 at 12:17 +0000, Marc Zyngier wrote: >> On Sun, 11 Mar 2018 01:55:08 +0000 >> Christoffer Dall wrote: >> >>> >>> On Sat, Mar 10, 2018 at 12:20 PM, Marc Zyngier >> m> wrote: >>>> >>>> On Fri, 09 Mar 2018 21:36:12 +0000, >>>> Christoffer Dall wrote:?? >>>>> >>>>> >>>>> On Thu, Mar 08, 2018 at 05:28:44PM +0000, Marc Zyngier wrote:?? >>>>>> >>>>>> I'd be more confident if we did forbid P+A for such >>>>>> interrupts >>>>>> altogether, as they really feel like another kind of HW >>>>>> interrupt.?? >>>>> How about a slightly bigger hammer:??Can we avoid doing P+A for >>>>> level >>>>> interrupts completely???I don't think that really makes much >>>>> sense, and >>>>> I think we simply everything if we just come back out and >>>>> resample the >>>>> line.??For an edge, something like a network card, there's a >>>>> potential >>>>> performance win to appending a new pending state, but I doubt >>>>> that this >>>>> is the case for level interrupts.?? >>>> I started implementing the same thing yesterday. Somehow, it >>>> feels >>>> slightly better to have the same flow for all level interrupts, >>>> including the timer, and we only use the MI on EOI as a way to >>>> trigger >>>> the next state of injection. Still testing, but looking good so >>>> far. >>>> >>>> I'm still puzzled that we have this level-but-not-quite behaviour >>>> for >>>> VFIO interrupts. At some point, it is going to bite us badly. >>>> ? >>> Where is the departure from level-triggered behavior with VFIO???As >>> far as I can tell, the GIC flow of the interrupts will be just a >>> level >>> interrupt,? >> The GIC is fine, I believe. What is not exactly fine is the >> signalling >> from the device, which will never be dropped until the EOI has been >> detected. >> >>> >>> but we just need to make sure the resamplefd mechanism is >>> supported for both types of interrupts.??Whether or not that's a >>> decent mechanism seems orthogonal to me, but that's a discussion >>> for >>> another day I think. >> Given that VFIO is built around this mechanism, I don't think we have >> a >> choice but to support it. Anyway, I came up with the following patch, >> which I tested on Seattle with mtty. It also survived my usual >> hammering of cyclictest, hackbench??and bulk VM installs. >> >> Shunyong, could you please give it a go? >> >> Thanks, >> >> M. >> > > I have tested the patch. It works on QDF2400 platform > and?kvm_notify_acked_irq() is called when state is idle. Thanks a lot for testing. > > BTW, I have following questions when I was debugging the issue. > Coud you please give me some help? > 1)what does "mi" mean in gic code? such as lr_signals_eoi_mi(); MI stands for Maintenance Interrupts. Life is too short to write that all the time ;-) > 2)In some __hyp_text?code where printk() will cause "HYP panic:", such > as in __kvm_vcpu_run(). How can I output debug information? You can't. None of the kernel is mapped at EL2 on pre-VHE hardware. You'll need to find indirect ways of outputting information (store data in memory, and output it once you're back to EL1). Thanks again, M. -- Jazz is not dead. It just smells funny...