Page MenuHomeFreeBSD

arm64/vgic_v3: Fix an inverted test when reading GICD_I<C|S>ENABLER
AcceptedPublic

Authored by markj on Mon, Jan 12, 10:25 PM.

Details

Reviewers
andrew
jrtc27
manu
Summary

On read, these registers' fields return 1 if forwarding of the
corresponding interrupt is enabled, and 0 otherwise. The test in
read_enabler() was inverted.

Reported by: Kevin Day <kevin@your.org>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 69847
Build 66730: arc lint + arc unit

Event Timeline

Does nothing actually care about the return value today?

Does nothing actually care about the return value today?

It doesn't seem so, at least in FreeBSD. The only read of these registers I found is in arm_gic_db_show().

This revision is now accepted and ready to land.Wed, Jan 14, 5:00 PM

It doesn't seem so, at least in FreeBSD. The only read of these registers I found is in arm_gic_db_show().

Ah, OK. Probably worth including a note in the commit message to that effect.

It doesn't seem so, at least in FreeBSD. The only read of these registers I found is in arm_gic_db_show().

Ah, OK. Probably worth including a note in the commit message to that effect.

Linux does seem to read these registers in a few places, but it's hard to see whether the bug is likely to cause problems.

Linux does seem to read these registers in a few places, but it's hard to see whether the bug is likely to cause problems.

I'm mainly hoping to have an answer if someone wonders (as I did) how it worked before if the return value is inverted from what it's supposed to be.

Linux does seem to read these registers in a few places, but it's hard to see whether the bug is likely to cause problems.

I'm mainly hoping to have an answer if someone wonders (as I did) how it worked before if the return value is inverted from what it's supposed to be.

From skimming, the GIC driver itself doesn't read this register, it's just reads it to implement more generic interrupt controller interfaces, maybe as part of optional features like interrupt rebalancing.

It looks like this bug might also break a pseudo-NMI implementation, but as far as I can see that's not a fatal problem.