From: Zenghui Yu <yuzenghui@huawei.com>
To: <linux-kernel@vger.kernel.org>
Cc: <maz@kernel.org>, <tglx@linutronix.de>, <jason@lakedaemon.net>,
<wanghaibin.wang@huawei.com>, Zenghui Yu <yuzenghui@huawei.com>,
Nianyao Tang <tangnianyao@huawei.com>
Subject: [PATCH] irqchip/gic-v4.1: Disallow setting affinity for virtual SGIs
Date: Sat, 11 Apr 2020 17:10:32 +0800 [thread overview]
Message-ID: <20200411091032.661-1-yuzenghui@huawei.com> (raw)
Running a guest on the GICv4.1-implemented board, we will get the
following warning:
[ 59.062120] genirq: irq_chip GICv4.1-sgi did not update eff. affinity mask of irq 46
It may be caused by irqbalance (or other userspace tools) which tries to
change the affinity of virtual SGIs on the host. One way to "fix" it is
to update the effective_affinity value in irq_set_affinity callback. But
as the comment above says, "There is no notion of affinity for virtual
SGIs, at least not on the host", doing so only makes things confusing.
Given the vSGIs are private to the specified vPE, changing the affinity
on host is actually meaningless and achieves nothing. Let's just forbid
it.
Reported-by: Nianyao Tang <tangnianyao@huawei.com>
Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
---
Hi Marc,
This just restores the behavior of your v5 [*]. I wonder that what's the
reason to change it to 'return IRQ_SET_MASK_OK' in v6? What I've missed
here?
[*] https://lore.kernel.org/kvm/20200304203330.4967-9-maz@kernel.org/
Thanks.
drivers/irqchip/irq-gic-v3-its.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index 54d142ccc63a..101c3e52c769 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -4033,9 +4033,8 @@ static int its_sgi_set_affinity(struct irq_data *d,
/*
* There is no notion of affinity for virtual SGIs, at least
* not on the host (since they can only be targetting a vPE).
- * Tell the kernel we've done whatever it asked for.
*/
- return IRQ_SET_MASK_OK;
+ return -EINVAL;
}
static int its_sgi_set_irqchip_state(struct irq_data *d,
--
2.19.1
next reply other threads:[~2020-04-11 9:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-11 9:10 Zenghui Yu [this message]
2020-04-11 9:41 ` Marc Zyngier
2020-04-14 8:09 ` Zenghui Yu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200411091032.661-1-yuzenghui@huawei.com \
--to=yuzenghui@huawei.com \
--cc=jason@lakedaemon.net \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
--cc=tangnianyao@huawei.com \
--cc=tglx@linutronix.de \
--cc=wanghaibin.wang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®