Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp205132ybv; Wed, 19 Feb 2020 19:37:32 -0800 (PST) X-Google-Smtp-Source: APXvYqyPuJzndzm292ezvr73U5L6pHOvDXhiYHrQ6bv9Ighpr9OQVoDkIREqzE49MZicrXbncJJW X-Received: by 2002:aca:5094:: with SMTP id e142mr633273oib.101.1582169852086; Wed, 19 Feb 2020 19:37:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582169852; cv=none; d=google.com; s=arc-20160816; b=Jt86zyYmW3e+u9n15Et41QiyUiV/94IO87K+pXoip2Xisft4h7l4QT1sO+yOYIWMKI SEfjrPSojUBAIv9NNbHD+C7XdntwpUfnOuV8CUWnfdjaZf1ahstSl/5NQ8OKC6GK3eBI yb3suczNd2ofc1hgvtojy8bll3IpVs189NAuXXbH80Yn28v7nhUlhRZNT3fySc178zIy NC/OZFQIOIOXt5XDAWJlM42f1EGh49W43hOFuBskVluc3aREKJdkkFr7cJcG1j2tR1AH DJTF4FlfJLAUNmlSbxZiHWC96lYAY9Lse4kEzwMYKiJ+3+zrxHYqw+tnP5ff3xilfvRz u7Rg== 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=TUxC5ecz1MPNIpTnvpv9WzUTEYWUaz5xxbfVtC2T1yk=; b=yhZMhEtpMYpx2rpjLXonqtHebWoHHHS2n76Gynngi/kDEuQJeILROh/PqH560ynkYW WkYoypMnQnG8KUpMV7MQWYHfZ65DDy56egdOyRmKdvbBZzRrbXa8kXPPjdbN5Bg53ulM sGFyOjnUw4MqAmGJNsa+6XJE1fK0SkNKdTSF9Ula3/6aouTo79qjejkyGSrWMxACqcXM VOq8skHlhkQ9Y1aI0RsvJvQXRtPEGfV+YBnayxxp5lsS8vO5PMC+B/YL9IRk+oQY9G0q qLxLwCu6Rhig+iI+BGCuBwrdZ0MoEMZrDdUcwhcgNHYhUWJHn9JLd5xiD5+CA25BLIzx TDOw== 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 z15si1040912oti.126.2020.02.19.19.37.20; Wed, 19 Feb 2020 19:37:32 -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 S1727749AbgBTDhQ (ORCPT + 99 others); Wed, 19 Feb 2020 22:37:16 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:45154 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727370AbgBTDhP (ORCPT ); Wed, 19 Feb 2020 22:37:15 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 2580BC2684EA7326FDBC; Thu, 20 Feb 2020 11:37:08 +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; Thu, 20 Feb 2020 11:37:01 +0800 Subject: Re: [PATCH v4 09/20] irqchip/gic-v4.1: Plumb set_vcpu_affinity SGI callbacks To: Marc Zyngier , , , , CC: Lorenzo Pieralisi , Jason Cooper , Robert Richter , "Thomas Gleixner" , Eric Auger , "James Morse" , Julien Thierry , Suzuki K Poulose References: <20200214145736.18550-1-maz@kernel.org> <20200214145736.18550-10-maz@kernel.org> From: Zenghui Yu Message-ID: <38b42ac1-5a5d-2f10-2cba-b50f37c7a965@huawei.com> Date: Thu, 20 Feb 2020 11:37:00 +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: <20200214145736.18550-10-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 2020/2/14 22:57, Marc Zyngier wrote: > As for VLPIs, there is a number of configuration bits that cannot As for vSGIs, > be directly communicated through the normal irqchip API, and we > have to use our good old friend set_vcpu_affinity. > > This is used to configure group and priority for a given vSGI. > > Signed-off-by: Marc Zyngier Reviewed-by: Zenghui Yu > --- > drivers/irqchip/irq-gic-v3-its.c | 18 ++++++++++++++++++ > include/linux/irqchip/arm-gic-v4.h | 5 +++++ > 2 files changed, 23 insertions(+) > > diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c > index a9753435c4ff..a2e824eae43f 100644 > --- a/drivers/irqchip/irq-gic-v3-its.c > +++ b/drivers/irqchip/irq-gic-v3-its.c > @@ -3969,6 +3969,23 @@ static int its_sgi_get_irqchip_state(struct irq_data *d, > return 0; > } > > +static int its_sgi_set_vcpu_affinity(struct irq_data *d, void *vcpu_info) > +{ > + struct its_vpe *vpe = irq_data_get_irq_chip_data(d); > + struct its_cmd_info *info = vcpu_info; > + > + switch (info->cmd_type) { > + case PROP_UPDATE_SGI: > + vpe->sgi_config[d->hwirq].priority = info->priority; > + vpe->sgi_config[d->hwirq].group = info->group; > + its_configure_sgi(d, false); > + return 0; > + > + default: > + return -EINVAL; > + } > +} > + > static struct irq_chip its_sgi_irq_chip = { > .name = "GICv4.1-sgi", > .irq_mask = its_sgi_mask_irq, > @@ -3976,6 +3993,7 @@ static struct irq_chip its_sgi_irq_chip = { > .irq_set_affinity = its_sgi_set_affinity, > .irq_set_irqchip_state = its_sgi_set_irqchip_state, > .irq_get_irqchip_state = its_sgi_get_irqchip_state, > + .irq_set_vcpu_affinity = its_sgi_set_vcpu_affinity, > }; > > static int its_sgi_irq_domain_alloc(struct irq_domain *domain, > diff --git a/include/linux/irqchip/arm-gic-v4.h b/include/linux/irqchip/arm-gic-v4.h > index 30b4855bf766..a1a9d40266f5 100644 > --- a/include/linux/irqchip/arm-gic-v4.h > +++ b/include/linux/irqchip/arm-gic-v4.h > @@ -98,6 +98,7 @@ enum its_vcpu_info_cmd_type { > SCHEDULE_VPE, > DESCHEDULE_VPE, > INVALL_VPE, > + PROP_UPDATE_SGI, Maybe better to use 'PROP_UPDATE_VSGI'? Thanks, Zenghui > }; > > struct its_cmd_info { > @@ -110,6 +111,10 @@ struct its_cmd_info { > bool g0en; > bool g1en; > }; > + struct { > + u8 priority; > + bool group; > + }; > }; > }; > >