Page MenuHomeFreeBSD
Feed Advanced Search

Feb 14 2024

mhorne closed D43293: RISCV: Introduce support for APLIC interrupt controller.
Feb 14 2024, 3:44 PM · riscv
mhorne accepted D43293: RISCV: Introduce support for APLIC interrupt controller.
Feb 14 2024, 3:27 PM · riscv

Feb 12 2024

himanshu_thechauhan.dev updated the diff for D43293: RISCV: Introduce support for APLIC interrupt controller.

Reworked APLIC_IDC_REG as asked

Feb 12 2024, 10:43 AM · riscv

Feb 3 2024

jrtc27 added inline comments to D43293: RISCV: Introduce support for APLIC interrupt controller.
Feb 3 2024, 10:04 AM · riscv
himanshu_thechauhan.dev added inline comments to D43293: RISCV: Introduce support for APLIC interrupt controller.
Feb 3 2024, 9:54 AM · riscv

Feb 2 2024

jrtc27 added inline comments to D43293: RISCV: Introduce support for APLIC interrupt controller.
Feb 2 2024, 10:26 PM · riscv

Feb 1 2024

himanshu_thechauhan.dev updated the diff for D43293: RISCV: Introduce support for APLIC interrupt controller.

Sorry for the mess up in versions in comments. Last patch was v9, as per my local branches. This one is v10.

Feb 1 2024, 3:42 PM · riscv
jrtc27 added inline comments to D43293: RISCV: Introduce support for APLIC interrupt controller.
Feb 1 2024, 11:28 AM · riscv
himanshu_thechauhan.dev updated the diff for D43293: RISCV: Introduce support for APLIC interrupt controller.
Feb 1 2024, 11:12 AM · riscv
himanshu_thechauhan.dev updated the diff for D43293: RISCV: Introduce support for APLIC interrupt controller.

Changes in v10:

  • Save hart indices from FDT and use them to create target value
Feb 1 2024, 11:07 AM · riscv

Jan 31 2024

jrtc27 added inline comments to D43293: RISCV: Introduce support for APLIC interrupt controller.
Jan 31 2024, 7:13 PM · riscv
jrtc27 requested changes to D43293: RISCV: Introduce support for APLIC interrupt controller.
Jan 31 2024, 7:13 PM · riscv
mhorne accepted D43293: RISCV: Introduce support for APLIC interrupt controller.

LGTM!

Jan 31 2024, 7:09 PM · riscv

Jan 28 2024

himanshu_thechauhan.dev added a comment to D43293: RISCV: Introduce support for APLIC interrupt controller.

ping.

Jan 28 2024, 3:50 AM · riscv

Jan 25 2024

himanshu_thechauhan.dev updated the diff for D43293: RISCV: Introduce support for APLIC interrupt controller.

After Convert local interrupt controller to a newbus PIC, commit rebase is required.

Jan 25 2024, 10:09 AM · riscv

Jan 23 2024

himanshu_thechauhan.dev updated the diff for D43293: RISCV: Introduce support for APLIC interrupt controller.

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
Jan 23 2024, 2:42 PM · riscv
jrtc27 added inline comments to D43293: RISCV: Introduce support for APLIC interrupt controller.
Jan 23 2024, 9:12 AM · riscv
jrtc27 added a comment to D43293: RISCV: Introduce support for APLIC interrupt controller.

@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.

Whatever hartid is read from the FDT, its logical CPU is kept in target_cpu cpuset. We already, in a way, keep that mapping. When the interrupts are bound, the logical CPU from target_cpu points to the required hart. There is no need to keep separate mapping.

Jan 23 2024, 9:12 AM · riscv
himanshu_thechauhan.dev added a comment to D43293: RISCV: Introduce support for APLIC interrupt controller.

@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 23 2024, 9:04 AM · riscv
jrtc27 added a comment to D43293: RISCV: Introduce support for APLIC interrupt controller.

@jrtc27 Thanks for your review! I have taken care of your comments. Patch will follow shortly.

Jan 23 2024, 1:46 AM · riscv

Jan 19 2024

himanshu_thechauhan.dev updated the diff for D43293: RISCV: Introduce support for APLIC interrupt controller.

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
Jan 19 2024, 12:02 PM · riscv
himanshu_thechauhan.dev added a comment to D43293: RISCV: Introduce support for APLIC interrupt controller.

@jrtc27 Thanks for your review! I have taken care of your comments. Patch will follow shortly.

Jan 19 2024, 11:17 AM · riscv

Jan 18 2024

mhorne added a comment to D43293: RISCV: Introduce support for APLIC interrupt controller.

Also this doesn't properly deal with the interrupts-extended property. I believe that, like the PLIC, you need to iterate over its cells to figure out the mapping between architectural hart ID and APLIC hart index, since they are two independent schemes.

Jan 18 2024, 8:10 PM · riscv
jrtc27 requested changes to D43293: RISCV: Introduce support for APLIC interrupt controller.

With apologies for the delay:

Jan 18 2024, 7:42 PM · riscv

Jan 17 2024

himanshu_thechauhan.dev added a comment to D43293: RISCV: Introduce support for APLIC interrupt controller.

@mhorne That's great! Thanks for all your time and guidance! I really appreciate it!

Jan 17 2024, 8:59 AM · riscv

Jan 16 2024

mhorne accepted D43293: RISCV: Introduce support for APLIC interrupt controller.

I am happy with it, and did some testing locally. Rebinding interrupts seems to work as expected.

Jan 16 2024, 7:49 PM · riscv
himanshu_thechauhan.dev updated the diff for D43293: RISCV: Introduce support for APLIC interrupt controller.

changes in v6:

  • Fixed wrong sizing of isrcs
  • Fixed indentation of goto label
Jan 16 2024, 10:20 AM · riscv
himanshu_thechauhan.dev added inline comments to D43293: RISCV: Introduce support for APLIC interrupt controller.
Jan 16 2024, 10:11 AM · riscv

Jan 15 2024

mhorne added a comment to D43293: RISCV: Introduce support for APLIC interrupt controller.

This looks pretty good, with one remaining issue that I see.

Jan 15 2024, 11:03 PM · riscv

Jan 14 2024

himanshu_thechauhan.dev updated the test plan for D43452: [RFC] riscv: Introduce support for Incoming MSI Controller (IMSIC).
Jan 14 2024, 8:35 AM · riscv
himanshu_thechauhan.dev requested review of D43452: [RFC] riscv: Introduce support for Incoming MSI Controller (IMSIC).
Jan 14 2024, 6:40 AM · riscv

Jan 10 2024

himanshu_thechauhan.dev updated the diff for D43293: RISCV: Introduce support for APLIC interrupt controller.

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
Jan 10 2024, 1:56 PM · riscv
himanshu_thechauhan.dev added a comment to D43293: RISCV: Introduce support for APLIC interrupt controller.

@mhorne Thanks for the review! I have taken care of your comments. Will be posting new patch shortly.

Jan 10 2024, 1:38 PM · riscv

Jan 9 2024

mhorne requested changes to D43293: RISCV: Introduce support for APLIC interrupt controller.
Jan 9 2024, 7:35 PM · riscv
mhorne added a comment to D43293: RISCV: Introduce support for APLIC interrupt controller.

Thanks a lot for submitting this!

Jan 9 2024, 7:35 PM · riscv

Jan 7 2024

jrtc27 added reviewers for D43293: RISCV: Introduce support for APLIC interrupt controller: jrtc27, riscv.
Jan 7 2024, 12:33 AM · riscv
jrtc27 added a comment to D43293: RISCV: Introduce support for APLIC interrupt controller.

FYI I intend to give this a more proper review this week, now that I've returned from my travels over the holidays

Jan 7 2024, 12:32 AM · riscv

Jan 6 2024

himanshu_thechauhan.dev updated the diff for D43293: RISCV: Introduce support for APLIC interrupt controller.

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 6 2024, 5:32 PM · riscv

Jan 4 2024

himanshu_thechauhan.dev updated the diff for D43293: RISCV: Introduce support for APLIC interrupt controller.

v3 changes:

  • Removed duplicated defines
  • Added comments to some of the structures and defines
  • Cosmetic changes.
Jan 4 2024, 3:38 PM · riscv
br added inline comments to D43293: RISCV: Introduce support for APLIC interrupt controller.
Jan 4 2024, 1:18 PM · riscv
himanshu_thechauhan.dev added inline comments to D43293: RISCV: Introduce support for APLIC interrupt controller.
Jan 4 2024, 11:25 AM · riscv
jrtc27 added a comment to D43293: RISCV: Introduce support for APLIC interrupt controller.

tools/build/checkstyle9.pl will check most common style issues

Jan 4 2024, 11:05 AM · riscv
himanshu_thechauhan.dev updated the diff for D43293: RISCV: Introduce support for APLIC interrupt controller.

Took care of formatting and other comments.

Jan 4 2024, 6:37 AM · riscv
himanshu_thechauhan.dev added inline comments to D43293: RISCV: Introduce support for APLIC interrupt controller.
Jan 4 2024, 3:45 AM · riscv
himanshu_thechauhan.dev added inline comments to D43293: RISCV: Introduce support for APLIC interrupt controller.
Jan 4 2024, 3:38 AM · riscv

Jan 3 2024

br added inline comments to D43293: RISCV: Introduce support for APLIC interrupt controller.
Jan 3 2024, 7:57 PM · riscv
himanshu_thechauhan.dev added a comment to D43293: RISCV: Introduce support for APLIC interrupt controller.

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?

Jan 3 2024, 4:47 PM · riscv
himanshu_thechauhan.dev added inline comments to D43293: RISCV: Introduce support for APLIC interrupt controller.
Jan 3 2024, 4:41 PM · riscv
jrtc27 added a comment to D43293: RISCV: Introduce support for APLIC interrupt controller.

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?

Jan 3 2024, 4:36 PM · riscv
himanshu_thechauhan.dev added a comment to D43293: RISCV: Introduce support for APLIC interrupt controller.

Time to teach my emacs the style(9) KNF. I will take care of these suggestions. Thanks!

Jan 3 2024, 4:10 PM · riscv
br added inline comments to D43293: RISCV: Introduce support for APLIC interrupt controller.
Jan 3 2024, 12:15 PM · riscv
br added a comment to D43293: RISCV: Introduce support for APLIC interrupt controller.

Note that some lines don't fit 80 chars per style (9) and some have too much whitespace after wrap.

Jan 3 2024, 12:12 PM · riscv
br added a comment to D43293: RISCV: Introduce support for APLIC interrupt controller.

Interesting!

Jan 3 2024, 12:10 PM · riscv
himanshu_thechauhan.dev added a reviewer for D43293: RISCV: Introduce support for APLIC interrupt controller: mhorne.
Jan 3 2024, 10:15 AM · riscv
himanshu_thechauhan.dev requested review of D43293: RISCV: Introduce support for APLIC interrupt controller.
Jan 3 2024, 10:13 AM · riscv
himanshu_thechauhan.dev added a watcher for riscv: himanshu_thechauhan.dev.
Jan 3 2024, 8:34 AM

Jul 4 2023

markj added a comment to D39884: kinst: port to riscv.

This provider can trigger what appears to be a QEMU/TCG bug. The test case:

  • boot a riscv VM with more than one vCPU
  • run dtrace -q -n 'kinst::riscv_cpu_intr:', i.e., trace all instructions in riscv_cpu_intr()

Seems I was a bit slow to report my findings, but I did observe some of the same kinds of panics on real hardware that I saw in QEMU. I will update to the committed version and provide a more detailed answer of what is still not working.

Can you recompile kinst with this patch applied? https://reviews.freebsd.org/P592
If we run it with a single trampoline per page, the crashes seem to go away.

Is it just a case of needing to smp_rendezvous a fence_i since it's not broadcast by the hardware like on arm64?

Jul 4 2023, 5:03 PM · riscv, DTrace
christos added a comment to D39884: kinst: port to riscv.

Is it just a case of needing to smp_rendezvous a fence_i since it's not broadcast by the hardware like on arm64?

Jul 4 2023, 4:55 PM · riscv, DTrace
jrtc27 added a comment to D39884: kinst: port to riscv.

This provider can trigger what appears to be a QEMU/TCG bug. The test case:

  • boot a riscv VM with more than one vCPU
  • run dtrace -q -n 'kinst::riscv_cpu_intr:', i.e., trace all instructions in riscv_cpu_intr()

Seems I was a bit slow to report my findings, but I did observe some of the same kinds of panics on real hardware that I saw in QEMU. I will update to the committed version and provide a more detailed answer of what is still not working.

Can you recompile kinst with this patch applied? https://reviews.freebsd.org/P592
If we run it with a single trampoline per page, the crashes seem to go away.

Jul 4 2023, 4:40 PM · riscv, DTrace
christos added a comment to D39884: kinst: port to riscv.

This provider can trigger what appears to be a QEMU/TCG bug. The test case:

  • boot a riscv VM with more than one vCPU
  • run dtrace -q -n 'kinst::riscv_cpu_intr:', i.e., trace all instructions in riscv_cpu_intr()

Seems I was a bit slow to report my findings, but I did observe some of the same kinds of panics on real hardware that I saw in QEMU. I will update to the committed version and provide a more detailed answer of what is still not working.

Jul 4 2023, 4:11 PM · riscv, DTrace
markj added a comment to D39884: kinst: port to riscv.

This provider can trigger what appears to be a QEMU/TCG bug. The test case:

  • boot a riscv VM with more than one vCPU
  • run dtrace -q -n 'kinst::riscv_cpu_intr:', i.e., trace all instructions in riscv_cpu_intr()

Seems I was a bit slow to report my findings, but I did observe some of the same kinds of panics on real hardware that I saw in QEMU. I will update to the committed version and provide a more detailed answer of what is still not working.

Jul 4 2023, 3:58 PM · riscv, DTrace
mhorne added a comment to D39884: kinst: port to riscv.

This provider can trigger what appears to be a QEMU/TCG bug. The test case:

  • boot a riscv VM with more than one vCPU
  • run dtrace -q -n 'kinst::riscv_cpu_intr:', i.e., trace all instructions in riscv_cpu_intr()
Jul 4 2023, 3:56 PM · riscv, DTrace
christos closed D39884: kinst: port to riscv.
Jul 4 2023, 3:39 PM · riscv, DTrace
markj accepted D39884: kinst: port to riscv.
Jul 4 2023, 2:48 PM · riscv, DTrace
christos updated the diff for D39884: kinst: port to riscv.

Retain CDDL license.

Jul 4 2023, 2:47 PM · riscv, DTrace
markj accepted D39884: kinst: port to riscv.
Jul 4 2023, 2:37 PM · riscv, DTrace
christos updated the diff for D39884: kinst: port to riscv.

Restore original trampoline size.

Jul 4 2023, 1:58 PM · riscv, DTrace
markj accepted D39884: kinst: port to riscv.

Approved.

Jul 4 2023, 1:16 PM · riscv, DTrace
christos updated the diff for D39884: kinst: port to riscv.

Address comments, update LICENSE headers, split some changes to other PRs.

Jul 4 2023, 9:39 AM · riscv, DTrace

Jun 28 2023

markj added a comment to D39884: kinst: port to riscv.

This provider can trigger what appears to be a QEMU/TCG bug. The test case:

  • boot a riscv VM with more than one vCPU
  • run dtrace -q -n 'kinst::riscv_cpu_intr:', i.e., trace all instructions in riscv_cpu_intr()
Jun 28 2023, 8:44 PM · riscv, DTrace

Jun 27 2023

christos updated the diff for D39884: kinst: port to riscv.

Address comments, fix undefined behavior when working with potentially unaligned pointers.

Jun 27 2023, 12:06 PM · riscv, DTrace

Jun 25 2023

markj added inline comments to D39884: kinst: port to riscv.
Jun 25 2023, 10:39 PM · riscv, DTrace
markj added inline comments to D39884: kinst: port to riscv.
Jun 25 2023, 10:15 PM · riscv, DTrace

May 31 2023

christos retitled D39884: kinst: port to riscv from kinst: port to RISC-V to kinst: port to riscv.
May 31 2023, 8:24 PM · riscv, DTrace
christos updated the diff for D39884: kinst: port to riscv.

Address comments.

May 31 2023, 8:19 PM · riscv, DTrace
christos added inline comments to D39884: kinst: port to riscv.
May 31 2023, 7:31 PM · riscv, DTrace
markj added a comment to D39884: kinst: port to riscv.

I've been doing some testing in QEMU again. I'm occasionally able to trigger random "impossible" panics by running dtrace -n 'kinst::vm_fault:' -q & and running various programs in the foreground. top(1), running tests, etc.. It's rather difficult to reproduce though. :(

May 31 2023, 6:34 PM · riscv, DTrace
markj added a comment to D39884: kinst: port to riscv.

I've been doing some testing in QEMU again. I'm occasionally able to trigger random "impossible" panics by running dtrace -n 'kinst::vm_fault:' -q & and running various programs in the foreground. top(1), running tests, etc.. It's rather difficult to reproduce though. :(

May 31 2023, 1:51 PM · riscv, DTrace

May 30 2023

christos updated the diff for D39884: kinst: port to riscv.

Check for the function prologue.

May 30 2023, 3:32 PM · riscv, DTrace
christos added inline comments to D39884: kinst: port to riscv.
May 30 2023, 3:28 PM · riscv, DTrace

May 26 2023

christos updated the diff for D39884: kinst: port to riscv.

Do not use kinst_memcpy outside of probe context.

May 26 2023, 3:38 PM · riscv, DTrace
christos updated the diff for D39884: kinst: port to riscv.

Use kinst_memcpy() and also add kinst_md_excluded().

May 26 2023, 3:11 PM · riscv, DTrace
markj added inline comments to D39884: kinst: port to riscv.
May 26 2023, 1:35 PM · riscv, DTrace

May 25 2023

christos updated the diff for D39884: kinst: port to riscv.

Address comments.

May 25 2023, 4:26 PM · riscv, DTrace
christos added inline comments to D39884: kinst: port to riscv.
May 25 2023, 3:06 PM · riscv, DTrace
jrtc27 added inline comments to D39884: kinst: port to riscv.
May 25 2023, 3:01 PM · riscv, DTrace
christos added inline comments to D39884: kinst: port to riscv.
May 25 2023, 2:45 PM · riscv, DTrace
jrtc27 added inline comments to D39884: kinst: port to riscv.
May 25 2023, 2:36 PM · riscv, DTrace
christos added inline comments to D39884: kinst: port to riscv.
May 25 2023, 1:39 PM · riscv, DTrace
markj added inline comments to D39884: kinst: port to riscv.
May 25 2023, 1:32 PM · riscv, DTrace
christos added inline comments to D39884: kinst: port to riscv.
May 25 2023, 1:19 PM · riscv, DTrace

May 24 2023

jrtc27 added inline comments to D39884: kinst: port to riscv.
May 24 2023, 4:04 PM · riscv, DTrace
markj added inline comments to D39884: kinst: port to riscv.
May 24 2023, 3:56 PM · riscv, DTrace
jrtc27 added inline comments to D39884: kinst: port to riscv.
May 24 2023, 3:39 PM · riscv, DTrace
markj added inline comments to D39884: kinst: port to riscv.
May 24 2023, 3:35 PM · riscv, DTrace

May 23 2023

christos updated the diff for D39884: kinst: port to riscv.

Update tramp fill.

May 23 2023, 1:18 PM · riscv, DTrace

May 22 2023

christos closed D39894: riscv: do not duplicate sd of tp.
May 22 2023, 8:04 PM · riscv
markj added a comment to D39894: riscv: do not duplicate sd of tp.

Approved

May 22 2023, 7:55 PM · riscv

May 15 2023

christos updated the diff for D39884: kinst: port to riscv.

Fix LL/SC exclusion algorithm.

May 15 2023, 3:08 PM · riscv, DTrace

May 5 2023

christos added inline comments to D39884: kinst: port to riscv.
May 5 2023, 12:21 PM · riscv, DTrace