<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lwn.git/drivers/irqchip/irq-gic-v3.c, branch standardize-docs</title>
<subtitle>Linux kernel documentation tree maintained by Jonathan Corbet</subtitle>
<id>http://mirrors.hust.edu.cn/git/lwn.git/atom?h=standardize-docs</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/lwn.git/atom?h=standardize-docs'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/'/>
<updated>2017-06-30T14:32:17+00:00</updated>
<entry>
<title>irqchip/gic-v3: Fix out-of-bound access in gic_set_affinity</title>
<updated>2017-06-30T14:32:17+00:00</updated>
<author>
<name>Suzuki K Poulose</name>
<email>suzuki.poulose@arm.com</email>
</author>
<published>2017-06-30T09:58:28+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=866d7c1b0a3c70387646c4e455e727a58c5d465a'/>
<id>urn:sha1:866d7c1b0a3c70387646c4e455e727a58c5d465a</id>
<content type='text'>
The GICv3 driver doesn't check if the target CPU for gic_set_affinity
is valid before going ahead and making the changes. This triggers the
following splat with KASAN:

[  141.189434] BUG: KASAN: global-out-of-bounds in gic_set_affinity+0x8c/0x140
[  141.189704] Read of size 8 at addr ffff200009741d20 by task swapper/1/0
[  141.189958]
[  141.190158] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.12.0-rc7
[  141.190458] Hardware name: Foundation-v8A (DT)
[  141.190658] Call trace:
[  141.190908] [&lt;ffff200008089d70&gt;] dump_backtrace+0x0/0x328
[  141.191224] [&lt;ffff20000808a1b4&gt;] show_stack+0x14/0x20
[  141.191507] [&lt;ffff200008504c3c&gt;] dump_stack+0xa4/0xc8
[  141.191858] [&lt;ffff20000826c19c&gt;] print_address_description+0x13c/0x250
[  141.192219] [&lt;ffff20000826c5c8&gt;] kasan_report+0x210/0x300
[  141.192547] [&lt;ffff20000826ad54&gt;] __asan_load8+0x84/0x98
[  141.192874] [&lt;ffff20000854eeec&gt;] gic_set_affinity+0x8c/0x140
[  141.193158] [&lt;ffff200008148b14&gt;] irq_do_set_affinity+0x54/0xb8
[  141.193473] [&lt;ffff200008148d2c&gt;] irq_set_affinity_locked+0x64/0xf0
[  141.193828] [&lt;ffff200008148e00&gt;] __irq_set_affinity+0x48/0x78
[  141.194158] [&lt;ffff200008bc48a4&gt;] arm_perf_starting_cpu+0x104/0x150
[  141.194513] [&lt;ffff2000080d73bc&gt;] cpuhp_invoke_callback+0x17c/0x1f8
[  141.194783] [&lt;ffff2000080d94ec&gt;] notify_cpu_starting+0x8c/0xb8
[  141.195130] [&lt;ffff2000080911ec&gt;] secondary_start_kernel+0x15c/0x200
[  141.195390] [&lt;0000000080db81b4&gt;] 0x80db81b4
[  141.195603]
[  141.195685] The buggy address belongs to the variable:
[  141.196012]  __cpu_logical_map+0x200/0x220
[  141.196176]
[  141.196315] Memory state around the buggy address:
[  141.196586]  ffff200009741c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[  141.196913]  ffff200009741c80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[  141.197158] &gt;ffff200009741d00: 00 00 00 00 fa fa fa fa 00 00 00 00 00 00 00 00
[  141.197487]                                ^
[  141.197758]  ffff200009741d80: 00 00 00 00 00 00 00 00 fa fa fa fa 00 00 00 00
[  141.198060]  ffff200009741e00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[  141.198358] ==================================================================
[  141.198609] Disabling lock debugging due to kernel taint
[  141.198961] CPU1: Booted secondary processor [410fd051]

This patch adds the check to make sure the cpu is valid.

Fixes: commit 021f653791ad17e03f98 ("irqchip: gic-v3: Initial support for GICv3")
Cc: stable@vger.kernel.org
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Signed-off-by: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
</content>
</entry>
<entry>
<title>irqchip/gic: Consolidate hotplug state space</title>
<updated>2016-12-25T09:47:44+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2016-12-21T19:19:56+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=6896bcd198df04777820cab4acc70142e87d5ce0'/>
<id>urn:sha1:6896bcd198df04777820cab4acc70142e87d5ce0</id>
<content type='text'>
Even if both drivers are compiled in only one instance can run on a given
system depending on the available GIC version.

So having seperate hotplug states for them is pointless.


Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Cc: Sebastian Siewior &lt;bigeasy@linutronix.de&gt;
Link: http://lkml.kernel.org/r/20161221192112.252416267@linutronix.de
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;

</content>
</entry>
<entry>
<title>cpu/hotplug: Cleanup state names</title>
<updated>2016-12-25T09:47:44+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2016-12-21T19:19:54+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=73c1b41e63f040e92669e61a02c7893933bfe743'/>
<id>urn:sha1:73c1b41e63f040e92669e61a02c7893933bfe743</id>
<content type='text'>
When the state names got added a script was used to add the extra argument
to the calls. The script basically converted the state constant to a
string, but the cleanup to convert these strings into meaningful ones did
not happen.

Replace all the useless strings with 'subsys/xxx/yyy:state' strings which
are used in all the other places already.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Sebastian Siewior &lt;bigeasy@linutronix.de&gt;
Link: http://lkml.kernel.org/r/20161221192112.085444152@linutronix.de
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;

</content>
</entry>
<entry>
<title>arm64: Add hypervisor safe helper for checking constant capabilities</title>
<updated>2016-11-16T17:50:51+00:00</updated>
<author>
<name>Suzuki K Poulose</name>
<email>suzuki.poulose@arm.com</email>
</author>
<published>2016-11-08T13:56:20+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=a4023f682739439b434165b54af7cb3676a4766e'/>
<id>urn:sha1:a4023f682739439b434165b54af7cb3676a4766e</id>
<content type='text'>
The hypervisor may not have full access to the kernel data structures
and hence cannot safely use cpus_have_cap() helper for checking the
system capability. Add a safe helper for hypervisors to check a constant
system capability, which *doesn't* fall back to checking the bitmap
maintained by the kernel. With this, make the cpus_have_cap() only
check the bitmask and force constant cap checks to use the new API
for quicker checks.

Cc: Robert Ritcher &lt;rritcher@cavium.com&gt;
Cc: Tirumalesh Chalamarla &lt;tchalamarla@cavium.com&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Reviewed-by: Will Deacon &lt;will.deacon@arm.com&gt;
Reviewed-by: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Signed-off-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
</content>
</entry>
<entry>
<title>irqchip/gicv3: Handle loop timeout proper</title>
<updated>2016-10-14T12:26:55+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2016-10-14T07:26:21+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=d102eb5c1ac5e6743b1c6d145c06a25d98ad1375'/>
<id>urn:sha1:d102eb5c1ac5e6743b1c6d145c06a25d98ad1375</id>
<content type='text'>
The timeout loop terminates when the loop count is zero, but the decrement
of the count variable is post check. So count is -1 when we check for the
timeout and therefor the error message is supressed.

Change it to predecrement, so the error message is emitted.

[ tglx: Massaged changelog ] 

Fixes: a2c225101234 ("irqchip: gic-v3: Refactor gic_enable_redist to support both enabling and disabling")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Acked-by: Sudeep Holla &lt;sudeep.holla@arm.com&gt;
Cc: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Cc: kernel-janitors@vger.kernel.org
Cc: Jason Cooper &lt;jason@lakedaemon.net&gt;
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/20161014072534.GA15168@mwanda
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;

</content>
</entry>
<entry>
<title>Merge branch 'irq/urgent' into irq/core</title>
<updated>2016-09-20T21:20:32+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2016-09-20T21:20:32+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=464b5847e61085f81bb99ce48eb427a0dc7617dc'/>
<id>urn:sha1:464b5847e61085f81bb99ce48eb427a0dc7617dc</id>
<content type='text'>
Merge urgent fixes so pending patches for 4.9 can be applied.
</content>
</entry>
<entry>
<title>irqchip/gicv3: Silence noisy DEBUG_PER_CPU_MAPS warning</title>
<updated>2016-09-19T23:43:23+00:00</updated>
<author>
<name>James Morse</name>
<email>james.morse@arm.com</email>
</author>
<published>2016-09-19T17:29:15+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=727653d6ce7103b245eb8041f55dd5885f4c3289'/>
<id>urn:sha1:727653d6ce7103b245eb8041f55dd5885f4c3289</id>
<content type='text'>
gic_raise_softirq() walks the list of cpus using for_each_cpu(), it calls
gic_compute_target_list() which advances the iterator by the number of
CPUs in the cluster.

If gic_compute_target_list() reaches the last CPU it leaves the iterator
pointing at the last CPU. This means the next time round the for_each_cpu()
loop cpumask_next() will be called with an invalid CPU.

This triggers a warning when built with CONFIG_DEBUG_PER_CPU_MAPS:
[    3.077738] GICv3: CPU1: found redistributor 1 region 0:0x000000002f120000
[    3.077943] CPU1: Booted secondary processor [410fd0f0]
[    3.078542] ------------[ cut here ]------------
[    3.078746] WARNING: CPU: 1 PID: 0 at ../include/linux/cpumask.h:121 gic_raise_softirq+0x12c/0x170
[    3.078812] Modules linked in:
[    3.078869]
[    3.078930] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.8.0-rc5+ #5188
[    3.078994] Hardware name: Foundation-v8A (DT)
[    3.079059] task: ffff80087a1a0080 task.stack: ffff80087a19c000
[    3.079145] PC is at gic_raise_softirq+0x12c/0x170
[    3.079226] LR is at gic_raise_softirq+0xa4/0x170
[    3.079296] pc : [&lt;ffff0000083ead24&gt;] lr : [&lt;ffff0000083eac9c&gt;] pstate: 200001c9
[    3.081139] Call trace:
[    3.081202] Exception stack(0xffff80087a19fbe0 to 0xffff80087a19fd10)

[    3.082269] [&lt;ffff0000083ead24&gt;] gic_raise_softirq+0x12c/0x170
[    3.082354] [&lt;ffff00000808e614&gt;] smp_send_reschedule+0x34/0x40
[    3.082433] [&lt;ffff0000080e80a0&gt;] resched_curr+0x50/0x88
[    3.082512] [&lt;ffff0000080e89d0&gt;] check_preempt_curr+0x60/0xd0
[    3.082593] [&lt;ffff0000080e8a60&gt;] ttwu_do_wakeup+0x20/0xe8
[    3.082672] [&lt;ffff0000080e8bb8&gt;] ttwu_do_activate+0x90/0xc0
[    3.082753] [&lt;ffff0000080ea9a4&gt;] try_to_wake_up+0x224/0x370
[    3.082836] [&lt;ffff0000080eabc8&gt;] default_wake_function+0x10/0x18
[    3.082920] [&lt;ffff000008103134&gt;] __wake_up_common+0x5c/0xa0
[    3.083003] [&lt;ffff0000081031f4&gt;] __wake_up_locked+0x14/0x20
[    3.083086] [&lt;ffff000008103f80&gt;] complete+0x40/0x60
[    3.083168] [&lt;ffff00000808df7c&gt;] secondary_start_kernel+0x15c/0x1d0
[    3.083240] [&lt;00000000808911a4&gt;] 0x808911a4
[    3.113401] Detected PIPT I-cache on CPU2

Avoid updating the iterator if the next call to cpumask_next() would
cause the for_each_cpu() loop to exit.

There is no change to gic_raise_softirq()'s behaviour, (cpumask_next()s
eventual call to _find_next_bit() will return early as start &gt;= nbits),
this patch just silences the warning.

Fixes: 021f653791ad ("irqchip: gic-v3: Initial support for GICv3")
Signed-off-by: James Morse &lt;james.morse@arm.com&gt;
Acked-by: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Cc: linux-arm-kernel@lists.infradead.org
Cc: Jason Cooper &lt;jason@lakedaemon.net&gt;
Link: http://lkml.kernel.org/r/1474306155-3303-1-git-send-email-james.morse@arm.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>irqchip/gicv3-its: Refactor ITS DT init code to prepare for ACPI</title>
<updated>2016-09-12T19:32:42+00:00</updated>
<author>
<name>Tomasz Nowicki</name>
<email>tn@semihalf.com</email>
</author>
<published>2016-09-12T18:32:24+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=db40f0a7aea5e03ef044ef5dbc51a364e1ff7991'/>
<id>urn:sha1:db40f0a7aea5e03ef044ef5dbc51a364e1ff7991</id>
<content type='text'>
In order to add ACPI support we need to isolate ACPI&amp;DT common code and
move DT logic to corresponding functions. To achieve this we are using
firmware agnostic handle which can be unpacked to either DT or ACPI node.

No functional changes other than a very minor one:
1. Terminate its_init call with -ENODEV for non-DT case which allows
to remove hack from its-gic-v3.c.
2. Fix ITS base register address type (from 'unsigned long' to 'phys_addr_t'),
as a bonus we get nice string formatting.
3. Since there is only one of ITS parent domain convert it to static global
variable and drop the parameter from its_probe_one. Users can refer to it
in more convenient way then.

Signed-off-by: Hanjun Guo &lt;hanjun.guo@linaro.org&gt;
Signed-off-by: Tomasz Nowicki &lt;tn@semihalf.com&gt;
Signed-off-by: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
</content>
</entry>
<entry>
<title>irqchip/gic-v3: Reset BPR during initialization</title>
<updated>2016-09-12T18:46:19+00:00</updated>
<author>
<name>Daniel Thompson</name>
<email>daniel.thompson@linaro.org</email>
</author>
<published>2016-08-19T16:13:09+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=91ef84428a86b75a52e15c6fe4f56b446ba75f93'/>
<id>urn:sha1:91ef84428a86b75a52e15c6fe4f56b446ba75f93</id>
<content type='text'>
Currently, when running on FVP, CPU 0 boots up with its BPR changed from
the reset value. This renders it impossible to (preemptively) prioritize
interrupts on CPU 0.

This is harmless on normal systems since Linux typically does not
support preemptive interrupts. It does however cause problems in
systems with additional changes (such as patches for NMI simulation).

Many thanks to Andrew Thoelke for suggesting the BPR as having the
potential to harm preemption.

Suggested-by: Andrew Thoelke &lt;andrew.thoelke@arm.com&gt;
Signed-off-by: Daniel Thompson &lt;daniel.thompson@linaro.org&gt;
Signed-off-by: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
</content>
</entry>
<entry>
<title>irqchip/gicv3: Remove disabling redistributor and group1 non-secure interrupts</title>
<updated>2016-08-17T17:33:07+00:00</updated>
<author>
<name>Sudeep Holla</name>
<email>sudeep.holla@arm.com</email>
</author>
<published>2016-08-17T12:49:19+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=ccd9432a5c85f35df7b491a1b701560d247466a5'/>
<id>urn:sha1:ccd9432a5c85f35df7b491a1b701560d247466a5</id>
<content type='text'>
As per the GICv3 specification, to power down a processor using GICv3
and allow automatic power-on if an interrupt must be sent to a processor,
software must set Enable to zero for all interrupt groups(by writing
to GICC_CTLR or ICC_IGRPEN{0,1}_EL1/3 as appropriate.

When commit 3708d52fc6bb ("irqchip: gic-v3: Implement CPU PM notifier")
was introduced there were no firmware implementations(in particular PSCI)
handling this.

Linux kernel may not be aware of the CPU power state details and might
fail to identify the power states that require quiescing the CPU
interface. Even if it can be aware of those details, it can't determine
which CPU power state have been triggered at the platform level and how
the power control is implemented.

This patch make disabling redistributor and group1 non-secure interrupts
in the power down path and re-enabling of redistributor in the power-up
path conditional. It will be handled in the kernel if and only if the
non-secure accesses are permitted to access and modify control registers.
It is left to the platform implementation otherwise.

Cc: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Cc: Lorenzo Pieralisi &lt;lorenzo.pieralisi@arm.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Jason Cooper &lt;jason@lakedaemon.net&gt;
Tested-by: Christopher Covington &lt;cov@codeaurora.org&gt;
Signed-off-by: Sudeep Holla &lt;sudeep.holla@arm.com&gt;
Signed-off-by: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
</content>
</entry>
</feed>
