Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp11912095ybl; Sat, 28 Dec 2019 01:21:48 -0800 (PST) X-Google-Smtp-Source: APXvYqxAgdFd0WtTswQapPN53HQGnOWm1jlWf/tVuItBzXvpESMKpR2ubAJAtfRQ3VmmQ5L5Rehx X-Received: by 2002:a9d:198b:: with SMTP id k11mr31953974otk.295.1577524908674; Sat, 28 Dec 2019 01:21:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577524908; cv=none; d=google.com; s=arc-20160816; b=JbHmUFyhy6ZUu+rY9ucie1EYWJdb/xG+HmmMTmbijwr4FS4uyMExExQicCbKXdWNoF Q7RFL+Eg9PSPYISw+ZNfBRBazhb/Yg193F1857AvpRtvLIbvcTwLfN7Vcj4oLmDGu08o lUW36hVdxfdv3cPk7/8MflJG85iPKuBvKbtYsqL3Gu4y8Ew8+MuXTav15sPXIT1movA+ jIOGyfmDdkWw8LlhBEe5b/CfrmR/llmsPmHYZAbA8/J0+Fgky6+YZF844B1eauhl6bKW hZQHaKFLE15p+7d/v69OSbm13P85f7spsn5g3oYeZ1H5Zh07DpKvP26/o7rd8I8t2bzT jB+g== 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; bh=M4aU2zq0itiFuXdnUUV3FAw/qy41Cr2rZYGEvpouJrE=; b=EX4GxAacRRbJbN3011iFffV5zY5H0zEMgo5rK+cGLxNhgraJqprdrS8liFamxAqrMv PKAaYBYT/W00X0UinbRcAeRFbeqnEDiX34Qg40TXUspeFPS5UwgecgILc1uAxdbotsv5 uUl/UgypYn88IGxD8LahTGn0a0vpWIQNnuYQX9Nu2egG/rge4l5n+MbHa+OW4BWxu40/ Ov6yCAWHn1ZSEKfmIGol/pucLwZ7DOWiHuRCY811F5Ir6cDYS7jCiX+fagWG7dGUNK5T kq+nW6NiEI8z234apwSa9CFDROtKhOnQg+Hs5QQbmYhhlA4z0utR0yv4JFDk94H+0QPs AiVg== 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 h125si17304663oia.253.2019.12.28.01.21.24; Sat, 28 Dec 2019 01:21:48 -0800 (PST) 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 S1726362AbfL1JTs (ORCPT + 99 others); Sat, 28 Dec 2019 04:19:48 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:8641 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725999AbfL1JTs (ORCPT ); Sat, 28 Dec 2019 04:19:48 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id CA2A4ECB5E1963F89944; Sat, 28 Dec 2019 17:19:45 +0800 (CST) Received: from [127.0.0.1] (10.173.222.27) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.439.0; Sat, 28 Dec 2019 17:19:38 +0800 Subject: Re: [PATCH v3 28/32] KVM: arm64: GICv4.1: Add direct injection capability to SGI registers To: Marc Zyngier , , CC: Eric Auger , James Morse , Julien Thierry , Suzuki K Poulose , Thomas Gleixner , Jason Cooper , Lorenzo Pieralisi , "Andrew Murray" , Robert Richter References: <20191224111055.11836-1-maz@kernel.org> <20191224111055.11836-29-maz@kernel.org> From: Zenghui Yu Message-ID: Date: Sat, 28 Dec 2019 17:19:36 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.2.0 MIME-Version: 1.0 In-Reply-To: <20191224111055.11836-29-maz@kernel.org> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.173.222.27] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Marc, On 2019/12/24 19:10, Marc Zyngier wrote: > Most of the GICv3 emulation code that deals with SGIs now has to be > aware of the v4.1 capabilities in order to benefit from it. > > Add such support, keyed on the interrupt having the hw flag set and > being a SGI. > > Signed-off-by: Marc Zyngier > --- > diff --git a/virt/kvm/arm/vgic/vgic-mmio.c b/virt/kvm/arm/vgic/vgic-mmio.c > index 0d090482720d..6ebf747a7806 100644 > --- a/virt/kvm/arm/vgic/vgic-mmio.c > +++ b/virt/kvm/arm/vgic/vgic-mmio.c > @@ -290,6 +345,20 @@ void vgic_mmio_write_cpending(struct kvm_vcpu *vcpu, > > raw_spin_lock_irqsave(&irq->irq_lock, flags); > > + if (irq->hw && vgic_irq_is_sgi(irq->intid)) { > + /* HW SGI? Ask the GIC to inject it */ Shouldn't this be "Ask the GIC to clear its pending state"? Otherwise looks good! Thanks, Zenghui > + int err; > + err = irq_set_irqchip_state(irq->host_irq, > + IRQCHIP_STATE_PENDING, > + false); > + WARN_RATELIMIT(err, "IRQ %d", irq->host_irq); > + > + raw_spin_unlock_irqrestore(&irq->irq_lock, flags); > + vgic_put_irq(vcpu->kvm, irq); > + > + continue; > + } > + > if (irq->hw) > vgic_hw_irq_cpending(vcpu, irq, is_uaccess); > else