Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp3622462ybh; Tue, 17 Mar 2020 03:36:57 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtesepMGZ7mwzhN4XIlB4pNlKUsm+87R2ZPM3UxIwWV2k2hal8+kr9Nrtu8Vw7vjKh7qfv9 X-Received: by 2002:a9d:383:: with SMTP id f3mr3081453otf.165.1584441417821; Tue, 17 Mar 2020 03:36:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584441417; cv=none; d=google.com; s=arc-20160816; b=DMBl24BB0JLtpvGmNrbKzMfop/RwAh7+3U5D7Tyn+YMKpPTp+zfWYb/7VA4QVb+/yc KmbcwYDfyZ+kiXGk5ErC43WFfactZpfgExDCY8sMMdjk8VWcPjDtA2d2RktHDCKLnF3x K0eXMmISEA6cb/kwgPOTbymWtE+BuvY3dU/Lb/oJhCD0uw14rFMrXv8TJgn42KDHoNfS XDvl62JCer2rCQ28Vc3N4dVDWqgpcEVuOx9/FpYnkfHhRP7Bbv2ifbUjcBUo3ZmBHbjf wyIs2glVAfFtWmt/leL8Jh/u38/2WCzhbJMRPKpU5jyPKJHXxQu/NbeF2TaGAM4Esox3 e+0A== 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:dkim-signature; bh=PDF9KX2gWP/KQxi7FPC/r6zYWiKxTIB+y9Tt6qr75x0=; b=RjcvEdsnqvt8ztMXfNJtq7nW/30IATjQrwRj7AfdY1+3WUIRsC6Ltcq0ODQiyyJ51f A8ijgVoadHx2WMDhuebs6xksiPiQX7u+Y3GGYhL+4tjWa94oTo1qH97HIhlsLmc6Ihiz rNqiCg8EEO3mnq8l5Fv14thc+T4FZUvqFHheUl0evwT9xY/b9Wx8fJf/E762dskqh5kz qhF1aiP+n6EefC6DR9COzGhlefD8vIxE3opxDyIs3d22RhjVULZIfu3yMLRVA0FWxgeD 6S0dm4sVrbggePEaMjUqwjZro7si3O8/nOr6oWmSzLoKaY6pgoz6gguq186ZB1KgwpMf YS6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Nc8IM5/p"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c14si1566849otm.146.2020.03.17.03.36.45; Tue, 17 Mar 2020 03:36:57 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Nc8IM5/p"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726057AbgCQKfY (ORCPT + 99 others); Tue, 17 Mar 2020 06:35:24 -0400 Received: from us-smtp-delivery-74.mimecast.com ([63.128.21.74]:25214 "EHLO us-smtp-delivery-74.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725730AbgCQKfX (ORCPT ); Tue, 17 Mar 2020 06:35:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584441322; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PDF9KX2gWP/KQxi7FPC/r6zYWiKxTIB+y9Tt6qr75x0=; b=Nc8IM5/p2kEfKVbONuOE93Zu4S3yzZEIiJuyDCGm/rqb3To/HfiqeAfooJESHWvvrjLo/U Jgo8DPC+SLDsQjkOIds6hZIrkZ1GEP0mvRpjfxUsQbbHw8/VDGoTFiF5MjxuRo0U4dk5eE TCJj9G2PW2jRGUJg0zZGiWtHaROSYBM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-362-MHeVK9nTPLqv1JiyvpOjEw-1; Tue, 17 Mar 2020 06:35:18 -0400 X-MC-Unique: MHeVK9nTPLqv1JiyvpOjEw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0656118A551B; Tue, 17 Mar 2020 10:35:16 +0000 (UTC) Received: from [10.36.113.142] (ovpn-113-142.ams2.redhat.com [10.36.113.142]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F33D75C1C3; Tue, 17 Mar 2020 10:35:12 +0000 (UTC) Subject: Re: [PATCH v5 12/23] irqchip/gic-v4.1: Plumb set_vcpu_affinity SGI callbacks To: Marc Zyngier , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Lorenzo Pieralisi , Jason Cooper , Robert Richter , Thomas Gleixner , Zenghui Yu , James Morse , Julien Thierry , Suzuki K Poulose References: <20200304203330.4967-1-maz@kernel.org> <20200304203330.4967-13-maz@kernel.org> From: Auger Eric Message-ID: <2f981328-92e8-7554-ccf7-962c79add0c3@redhat.com> Date: Tue, 17 Mar 2020 11:35:11 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20200304203330.4967-13-maz@kernel.org> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Marc, On 3/4/20 9:33 PM, Marc Zyngier wrote: > Just like for vLPIs, there is some configuration information that cannot > be directly communicated through the normal irqchip API, and we have to > use our good old friend set_vcpu_affinity as a side-band communication > mechanism. > > 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 fb2b836c31ff..effb0e0b0c9d 100644 > --- a/drivers/irqchip/irq-gic-v3-its.c > +++ b/drivers/irqchip/irq-gic-v3-its.c > @@ -4033,6 +4033,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: PROP_UPDATE_VSGI directly? > + vpe->sgi_config[d->hwirq].priority = info->priority; > + vpe->sgi_config[d->hwirq].group = info->group; > + its_configure_sgi(d, false); > + return 0; > + extra line > + default: > + return -EINVAL; > + } > +} > + > static struct irq_chip its_sgi_irq_chip = { > .name = "GICv4.1-sgi", > .irq_mask = its_sgi_mask_irq, > @@ -4040,6 +4057,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 44e8c19e3d56..b4dbf899460b 100644 > --- a/include/linux/irqchip/arm-gic-v4.h > +++ b/include/linux/irqchip/arm-gic-v4.h > @@ -103,6 +103,7 @@ enum its_vcpu_info_cmd_type { > SCHEDULE_VPE, > DESCHEDULE_VPE, > INVALL_VPE, > + PROP_UPDATE_SGI, > }; > > struct its_cmd_info { > @@ -115,6 +116,10 @@ struct its_cmd_info { > bool g0en; > bool g1en; > }; > + struct { > + u8 priority; > + bool group; > + }; > }; > }; > > Reviewed-by: Eric Auger Eric