Reworked APLIC_IDC_REG as asked
- Queries
- All Stories
- Search
- Advanced Search
- Transactions
- Transaction Logs
Advanced Search
Mar 4 2024
Feb 12 2024
Feb 3 2024
Feb 1 2024
Sorry for the mess up in versions in comments. Last patch was v9, as per my local branches. This one is v10.
Changes in v10:
- Save hart indices from FDT and use them to create target value
Jan 28 2024
ping.
Jan 25 2024
After Convert local interrupt controller to a newbus PIC, commit rebase is required.
Jan 23 2024
Changes in v7:
- Keep per-cpu IDC offsets after reading interrupts-extended property
- Accessing IDC is via the stored per-CPU IDC offsets
- Remove cleanup after failure in *_attach function (like other drivers)
- Added aplic.c in files.riscv alphabetically
In D40474#993113, @ehem_freebsd_m5p.com wrote:In D40474#993106, @jrtc27 wrote:Whilst this looks like the right thing to do for the core framework, I believe our GICv2 driver won't like this in some edge cases, as for the FDT case it supports being a non-root PIC yet has an arm_gic_init_secondary which currently only runs for the root PIC, probably by design?
You want to have if (dev != intr_irq_root_dev) return; added to arm_gic_init_secondary() as part of this? I don't have any way to test this.
sys/arm/mv/mpic.c overrides it and isn't a root PIC, but the implementation is empty so that's harmless.
In fact D40475 is to remove this.
This will iterate in the reverse order in which the PICs were registered (since they're inserted at the head), which is probably the exact opposite of what you want, and not the current behaviour for GICv3, but that may or may not matter in that specific case.
I'm aware. This could be addressed by changing pic_list to a STAILQ, but the single instance where this was needed it doesn't matter. The (non-root!) PIC in question needs per-processor initialization soon after each processor starts, and doesn't care whether the root PIC has been initialized or not. Given this it seemed best to leave this alone until something came along which did care (or a reviewer decides this is important).
In D43293#993109, @jrtc27 wrote:In D43293#991986, @himanshu_thechauhan.dev wrote:@jrtc27 Thanks for your review! I have taken care of your comments. Patch will follow shortly.
Unless I'm mistaken you still use the hartid to index the APLIC, not the APLIC's hart indexes. You need to actually record, and later use, the index <-> cpu mapping when iterating over interrupts-extended.
Jan 20 2024
Jan 19 2024
Changes in v6:
- Added verification of harts that can take interrupt using "interrupts-extended" property of FDT.
- Added target_cpu cpuset which contains the bit map of logical cpus that can take interrupts.
- During binding of the irqs, the cpus from target_cpu cpuset is used.
- Handled failure case and deregister ircs.
- Took care of comments regarding the brackets.
- Added a macro APLIC_IDC to give offset of a given hart.
- Removed return of FILTER_STRAY when IRQ is 0, added a KASSERT instead.
- Use of DEFINE_CLASS_0
@jrtc27 Thanks for your review! I have taken care of your comments. Patch will follow shortly.
Jan 17 2024
I was trying to rebase and adapt my IMSIC patch to this one.
But the patch doesn't apply cleanly. I am using main branch of FreeBSD 15.0-CURRENT (at commit id 6caa19a08b8).
@mhorne That's great! Thanks for all your time and guidance! I really appreciate it!
Jan 16 2024
changes in v6:
- Fixed wrong sizing of isrcs
- Fixed indentation of goto label
Jan 14 2024
Jan 10 2024
Changes in v5:
- Use hartid instead of logical cpu when programming APLIC registers
- Add defines for some hard coded numbers
- Check for "msi-parent" property during attach and fail if found
- Removed the IDC structure and added defines for the IDC register offsets and calculations
- Removed reuse of local variables
- Removed unused function and structures
- Removed "all rights reserved" from copyright comment
- Removed ambiguity of cpu vs hartid
@mhorne Thanks for the review! I have taken care of your comments. Will be posting new patch shortly.
Jan 6 2024
v4
- Fixed bug
- Uniprocessor boot used to hang.
- Now it is tested from 1 CPU to 16 CPUs
- virtio block dev is tested
- virtionet is tested
Jan 4 2024
v3 changes:
- Removed duplicated defines
- Added comments to some of the structures and defines
- Cosmetic changes.
Took care of formatting and other comments.
Jan 3 2024
In D43293#986788, @jrtc27 wrote:I have a related series ending in https://reviews.freebsd.org/D35901 to get back to that should make having direct and IMSIC APLIC support less messy due to changing what the root PIC is. That shouldn’t block this patch as it’s (presumably) just similar tweaks to the normal PLIC, but for IMSIC support it’s probably worth me pushing forward on that before you get too far with it?
Time to teach my emacs the style(9) KNF. I will take care of these suggestions. Thanks!