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=-6.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,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 A4DF5C432C0 for ; Sat, 30 Nov 2019 09:29:55 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 2D48A20732 for ; Sat, 30 Nov 2019 09:29:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2D48A20732 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 8C9FF4AED0; Sat, 30 Nov 2019 04:29:54 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kCjhg4cBIp6k; Sat, 30 Nov 2019 04:29:53 -0500 (EST) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 893D54AED2; Sat, 30 Nov 2019 04:29:53 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 3702C4AED0 for ; Sat, 30 Nov 2019 04:29:52 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UIyF4ne7ZT5H for ; Sat, 30 Nov 2019 04:29:50 -0500 (EST) Received: from huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 8DCEE4ACC4 for ; Sat, 30 Nov 2019 04:29:50 -0500 (EST) Received: from DGGEMM402-HUB.china.huawei.com (unknown [172.30.72.54]) by Forcepoint Email with ESMTP id 8AF326C3FE04F1522288; Sat, 30 Nov 2019 17:29:45 +0800 (CST) Received: from dggeme766-chm.china.huawei.com (10.3.19.112) by DGGEMM402-HUB.china.huawei.com (10.3.20.210) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sat, 30 Nov 2019 17:29:44 +0800 Received: from dggeme763-chm.china.huawei.com (10.3.19.109) by dggeme766-chm.china.huawei.com (10.3.19.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Sat, 30 Nov 2019 17:29:45 +0800 Received: from dggeme763-chm.china.huawei.com ([10.6.66.36]) by dggeme763-chm.china.huawei.com ([10.6.66.36]) with mapi id 15.01.1713.004; Sat, 30 Nov 2019 17:29:44 +0800 From: linmiaohe To: "maz@kernel.org" , "james.morse@arm.com" , "julien.thierry.kdev@gmail.com" , "suzuki.poulose@arm.com" , "christoffer.dall@arm.com" , "catalin.marinas@arm.com" , "eric.auger@redhat.com" , "gregkh@linuxfoundation.org" , "will@kernel.org" , "andre.przywara@arm.com" , "tglx@linutronix.de" Subject: Re: [PATCH] KVM: arm: fix missing free_percpu_irq in kvm_timer_hyp_init() Thread-Topic: [PATCH] KVM: arm: fix missing free_percpu_irq in kvm_timer_hyp_init() Thread-Index: AdWnUfxPfkqh2LUwSkWjIhnvKAeisg== Date: Sat, 30 Nov 2019 09:29:44 +0000 Message-ID: Accept-Language: en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.184.189.20] MIME-Version: 1.0 X-CFilter-Loop: Reflected Cc: "kvm@vger.kernel.org" , "kvmarm@lists.cs.columbia.edu" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu friendly ping ... > From: Miaohe Lin > > When host_ptimer_irq request irq resource failed, we forget to release the host_vtimer_irq resource already requested. > Fix this missing irq release and other similar scenario. > > Fixes: 9e01dc76be6a ("KVM: arm/arm64: arch_timer: Assign the phys timer on VHE systems") > Signed-off-by: Miaohe Lin > --- > virt/kvm/arm/arch_timer.c | 17 ++++++++++++----- > 1 file changed, 12 insertions(+), 5 deletions(-) > > diff --git a/virt/kvm/arm/arch_timer.c b/virt/kvm/arm/arch_timer.c index f182b2380345..73867f97040c 100644 > --- a/virt/kvm/arm/arch_timer.c > +++ b/virt/kvm/arm/arch_timer.c > @@ -935,7 +935,7 @@ int kvm_timer_hyp_init(bool has_gic) > kvm_get_running_vcpus()); > if (err) { > kvm_err("kvm_arch_timer: error setting vcpu affinity\n"); > - goto out_free_irq; > + goto out_free_vtimer_irq; > } > > static_branch_enable(&has_gic_active_state); > @@ -960,7 +960,7 @@ int kvm_timer_hyp_init(bool has_gic) > if (err) { > kvm_err("kvm_arch_timer: can't request ptimer interrupt %d (%d)\n", > host_ptimer_irq, err); > - return err; > + goto out_disable_gic_state; > } > > if (has_gic) { > @@ -968,7 +968,7 @@ int kvm_timer_hyp_init(bool has_gic) > kvm_get_running_vcpus()); > if (err) { > kvm_err("kvm_arch_timer: error setting vcpu affinity\n"); > - goto out_free_irq; > + goto out_free_ptimer_irq; > } > } > > @@ -977,15 +977,22 @@ int kvm_timer_hyp_init(bool has_gic) > kvm_err("kvm_arch_timer: invalid physical timer IRQ: %d\n", > info->physical_irq); > err = -ENODEV; > - goto out_free_irq; > + goto out_disable_gic_state; > } > > cpuhp_setup_state(CPUHP_AP_KVM_ARM_TIMER_STARTING, > "kvm/arm/timer:starting", kvm_timer_starting_cpu, > kvm_timer_dying_cpu); > return 0; > -out_free_irq: > + > +out_free_ptimer_irq: > + free_percpu_irq(host_ptimer_irq, kvm_get_running_vcpus()); > +out_disable_gic_state: > + if (has_gic) > + static_branch_disable(&has_gic_active_state); > +out_free_vtimer_irq: > free_percpu_irq(host_vtimer_irq, kvm_get_running_vcpus()); > + > return err; > } > > -- > 2.19.1 _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm