-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make proofs generic in maxIRQ and irq bit width #773
Conversation
- getActiveIRQ in machine/ was trying to ensure that we're not returning "Some Kernel_C.irqInvalid", but it was using the wrong value (0xFF), and Kernel_C.irqInvalid is not representable in the type getActiveIRQ returns, so nothing needs to be done here. This is a remnant of old ARM 32 bit proofs were irqInvalid was 0xFF. Even in those times, it would not have been needed, because on platforms that use 0xFF, we already know maxIRQ < 0xFF. - remove the lemmas in CRefine that were trying to make use of that obsolete check. It is obvious by type (and by simp) that Kernel_C.irqInvalid can't be returned, so none of them are needed on gic_v2/gic_v3 platforms. Signed-off-by: Gerwin Klein <[email protected]>
Signed-off-by: Gerwin Klein <[email protected]>
Signed-off-by: Gerwin Klein <[email protected]>
Signed-off-by: Gerwin Klein <[email protected]>
Signed-off-by: Gerwin Klein <[email protected]>
Signed-off-by: Gerwin Klein <[email protected]>
Signed-off-by: Gerwin Klein <[email protected]>
For Arm platforms (32 and 64), maxIRQ is defined in platform_gen.h as an explicit number. Parse this number and emit in Kernel_Config.thy. For X64, the value is fixed and does not need to be generated. For RISCV64, the value is computed (by virtue of being the last constant in the enum) and extraction is more complex. Leaving it unimplemented for now. Signed-off-by: Gerwin Klein <[email protected]>
Signed-off-by: Gerwin Klein <[email protected]>
Extract the value of IRQ_CNODE_SLOT_BITS into Kernel_Config.irqBits, for later use in value_type to define irq_len and the irq type. Signed-off-by: Gerwin Klein <[email protected]>
Define irq_len and the irq type in terms of Kernel_Config.irqBits for Arm and RISC-V platforms (fixed on X64). Use that type in ASpec via machine/L4V_ARCH/Platform.thy. Signed-off-by: Gerwin Klein <[email protected]>
Consistently make `int_word` available on all architectures for the word type that corresponds to a plain `int` in C for that architecture. All unadorned C numerals are of this type. This name can now be used generically in the rest of the proofs. Signed-off-by: Gerwin Klein <[email protected]>
- Kernel_Config lemmas for maxIRQ - remove all unfoldings of maxIRQ_def - use Arch_Kernel_Config lemmas for maxIRQ for array guards and other proof obligations. Signed-off-by: Gerwin Klein <[email protected]>
- add Kernel_Config lemmas for maxIRQ - use irq and irq_len types instead of magic type numbers - use Kernel_Config.maxIRQ where possible instead of numbers - avoid unfoldings of Kernel_Config.maxIRQ and Kernel_C.maxIRQ Signed-off-by: Gerwin Klein <[email protected]>
Give names to irq bith width, size of IRQ array, and size of interrupt state array. Since there is no Kernel_Config.maxIRQ on X64, use Kernel_C.maxIRQ where necessary. Signed-off-by: Gerwin Klein <[email protected]>
Define size of IRQ array and interrupt state array symbolically. Signed-off-by: Gerwin Klein <[email protected]>
It turns out that there are platforms with 8-bit wide IRQ types on AArch64. This means we need the same kind of invariant for VPPIEvent fault here as we have in ARM_HYP, saying that VPPIEvent only stores IRQs up to the IRQ bit width, even though the C declares a potentially wider type. Signed-off-by: Gerwin Klein <[email protected]>
Signed-off-by: Gerwin Klein <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be fine now. Cheers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late comments, but here's a few very minor things that I had found.
There's also a typo in the first commit message, in the second paragraph were
should be where
.
irqInvalid
encoding confusionmaxIRQ
andirq_len
from kernel configmaxIRQ
andirq_len
consistently in specs