lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200411091032.661-1-yuzenghui@huawei.com>
Date:   Sat, 11 Apr 2020 17:10:32 +0800
From:   Zenghui Yu <yuzenghui@...wei.com>
To:     <linux-kernel@...r.kernel.org>
CC:     <maz@...nel.org>, <tglx@...utronix.de>, <jason@...edaemon.net>,
        <wanghaibin.wang@...wei.com>, Zenghui Yu <yuzenghui@...wei.com>,
        Nianyao Tang <tangnianyao@...wei.com>
Subject: [PATCH] irqchip/gic-v4.1: Disallow setting affinity for virtual SGIs

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@...wei.com>
Signed-off-by: Zenghui Yu <yuzenghui@...wei.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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ