Skip to content

Conversation

@yechao-w
Copy link
Contributor

合入kvm支持smstateen特性补丁,包括了两个fix补丁(补丁6和补丁7)

验证方法:

  1. 使用qemu仿真环境进行验证,qemu仿真环境的版本为:
/usr/bin/qemu-system-riscv64 --version
QEMU emulator version 10.0.0 (qemu-10.0.0-6)
Copyright (c) 2003-2025 Fabrice Bellard and the QEMU Project developers

仿真环境的内核版本为合入此系列补丁的内核。

[root@localhost vms]# uname -a
Linux localhost.localdomain 6.6.0+ #3 SMP Mon Jul 14 09:12:01 CST 2025 riscv64 riscv64 riscv64 GNU/Linux
  1. qemu-kvm虚拟机使用的qemu版本依然是上述1中的版本,qemu-kvm虚拟机的内核版本为olk-6.6。

kvm虚拟机启动命令:

/usr/bin/qemu-system-riscv64 \
        -nographic -enable-kvm \
        -machine virt,pflash0=pflash0,pflash1=pflash1,acpi=off,accel=kvm \
        -blockdev node-name=pflash0,driver=file,read-only=on,filename="./RISCV_VIRT_CODE.fd" \
        -blockdev node-name=pflash1,driver=file,filename="./riscv_test_VARS.fd" \
        -smp 4,sockets=2,dies=1,clusters=1,cores=2,threads=1 \
        -m 4G \
        -kernel /boot/vmlinuz-6.6.0+ \
        -initrd /boot/initramfs-6.6.0+.img \
        -append "root=UUID=fce3cee6-e5eb-4694-85f3-48a369464c19 console=tty0 console=ttyS0 selinux=0 cgroup_disable=files apparmor=0" \
        -drive file="./openEuler-24.03-LTS-riscv64.qcow2",format=qcow2,id=hd0,if=none \
        -object rng-random,filename=/dev/urandom,id=rng0 \
        -device virtio-rng-device,rng=rng0 \
        -device virtio-blk-device,drive=hd0,bootindex=1 \
        -device virtio-net-pci,netdev=net1 \
        -netdev tap,id=net1,ifname=vnet1,script=no,downscript=no \
        -cpu host\
        -device qemu-xhci \
        -usb -device usb-kbd \
        -device usb-tablet \
        -chardev socket,id=qmp,path=/var/lib/libvirt/qemu/riscv-test,server=on,wait=off \
        -mon mode=control,chardev=qmp \
        -serial stdio

登陆虚拟机后使用cat /proc/cpuinfo查看cpu特性包含smstateen

Welcome to 6.6.0+

System information as of time:  Sat Apr 20 02:25:13 PM UTC 2024

System load:    2.36
Memory used:    1.7%
Swap used:      0.0%
Usage On:       5%
IP address:     192.168.125.2
Users online:   1

[root@localhost ~]# uname -a
Linux localhost.localdomain 6.6.0+ #3 SMP Mon Jul 14 09:12:01 CST 2025 riscv64 riscv64 riscv64 GNU/Linux
[root@localhost ~]# cat /proc/cpuinfo 
processor       : 0
hart            : 0
isa             : rv64imafdc_zicbom_zicboz_zicntr_zicsr_zifencei_zihintpause_zihpm_zca_zcd_zba_zbb_zbs_smstateen_sstc_svinval_svnapot_svpbmt
mmu             : sv39
mvendorid       : 0x0
marchid         : 0x0
mimpid          : 0x0

processor       : 1
hart            : 1
isa             : rv64imafdc_zicbom_zicboz_zicntr_zicsr_zifencei_zihintpause_zihpm_zca_zcd_zba_zbb_zbs_smstateen_sstc_svinval_svnapot_svpbmt
mmu             : sv39
mvendorid       : 0x0
marchid         : 0x0
mimpid          : 0x0

processor       : 2
hart            : 2
isa             : rv64imafdc_zicbom_zicboz_zicntr_zicsr_zifencei_zihintpause_zihpm_zca_zcd_zba_zbb_zbs_smstateen_sstc_svinval_svnapot_svpbmt
mmu             : sv39
mvendorid       : 0x0
marchid         : 0x0
mimpid          : 0x0

processor       : 3
hart            : 3
isa             : rv64imafdc_zicbom_zicboz_zicntr_zicsr_zifencei_zihintpause_zihpm_zca_zcd_zba_zbb_zbs_smstateen_sstc_svinval_svnapot_svpbmt
mmu             : sv39
mvendorid       : 0x0
marchid         : 0x0
mimpid          : 0x0

Icenowy and others added 30 commits June 5, 2025 17:51
The cursor should be placed at (x + hot_x, y + hot_y) to allow partial
display of a cursor.

Signed-off-by: Icenowy Zheng <[email protected]>
Signed-off-by: Han Gao <[email protected]>
Signed-off-by: Mingzheng Xing <[email protected]>
Fixes cursor disappearing when using rotated screen.

Signed-off-by: Icenowy Zheng <[email protected]>
Signed-off-by: Han Gao <[email protected]>
Signed-off-by: Mingzheng Xing <[email protected]>
Signed-off-by: Icenowy Zheng <[email protected]>
Signed-off-by: Han Gao <[email protected]>
Signed-off-by: Mingzheng Xing <[email protected]>
Otherwise IN_FORMATS blob is corrupted.

Signed-off-by: Icenowy Zheng <[email protected]>
Signed-off-by: Han Gao <[email protected]>
Signed-off-by: Mingzheng Xing <[email protected]>
Signed-off-by: Han Gao <[email protected]>
Signed-off-by: Han Gao <[email protected]>
Signed-off-by: Mingzheng Xing <[email protected]>
Based on the current openeuler_defconfig for riscv, use the following
commands to generate the new openeuler_defconfig:

cp arch/riscv/configs/openeuler_defconfig .config
cat arch/riscv/configs/sg2042_defconfig >> .config
make save_oedefconfig
make update_oedefconfig

Build and boot testing passed.

Signed-off-by: Mingzheng Xing <[email protected]>
The SSWI device provides supervisor-level IPI functionality for a
set of HARTs on a RISC-V platform. It provides a register to set
an IPI (SETSSIP) for each HART connected to the SSWI device.

The patch utilizes the feature to optimize IPI handling by avoiding
Linux calls into firmware runtime, thus minimizing context switching
expenses and removing the dependency on sbi-ipi.

Co-developed-by: Xiaoguang Xing <[email protected]>
Signed-off-by: Xiaoguang Xing <[email protected]>
Signed-off-by: Guo Ren <[email protected]>
Signed-off-by: Guo Ren <[email protected]>
Signed-off-by: Mingzheng Xing <[email protected]>
While working with the T-Head 1520 LicheePi4A SoC, certain conditions
arose that allowed me to reproduce a race issue in the sdhci code.

To reproduce the bug, you need to enable the sdio1 controller in the
device tree file
`arch/riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi` as follows:

&sdio1 {
	bus-width = <4>;
	max-frequency = <100000000>;
	no-sd;
	no-mmc;
	broken-cd;
	cap-sd-highspeed;
	post-power-on-delay-ms = <50>;
	status = "okay";
	wakeup-source;
	keep-power-in-suspend;
};

When resetting the SoC using the reset button, the following messages
appear in the dmesg log:

[    8.164898] mmc2: Got command interrupt 0x00000001 even though no
command operation was in progress.
[    8.174054] mmc2: sdhci: ============ SDHCI REGISTER DUMP ===========
[    8.180503] mmc2: sdhci: Sys addr:  0x00000000 | Version:  0x00000005
[    8.186950] mmc2: sdhci: Blk size:  0x00000000 | Blk cnt:  0x00000000
[    8.193395] mmc2: sdhci: Argument:  0x00000000 | Trn mode: 0x00000000
[    8.199841] mmc2: sdhci: Present:   0x03da0000 | Host ctl: 0x00000000
[    8.206287] mmc2: sdhci: Power:     0x0000000f | Blk gap:  0x00000000
[    8.212733] mmc2: sdhci: Wake-up:   0x00000000 | Clock:    0x0000decf
[    8.219178] mmc2: sdhci: Timeout:   0x00000000 | Int stat: 0x00000000
[    8.225622] mmc2: sdhci: Int enab:  0x00ff1003 | Sig enab: 0x00ff1003
[    8.232068] mmc2: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000
[    8.238513] mmc2: sdhci: Caps:      0x3f69c881 | Caps_1:   0x08008177
[    8.244959] mmc2: sdhci: Cmd:       0x00000502 | Max curr: 0x00191919
[    8.254115] mmc2: sdhci: Resp[0]:   0x00001009 | Resp[1]:  0x00000000
[    8.260561] mmc2: sdhci: Resp[2]:   0x00000000 | Resp[3]:  0x00000000
[    8.267005] mmc2: sdhci: Host ctl2: 0x00001000
[    8.271453] mmc2: sdhci: ADMA Err:  0x00000000 | ADMA Ptr:
0x0000000000000000
[    8.278594] mmc2: sdhci: ============================================

I also enabled some traces to better understand the problem:

     kworker/3:1-62      [003] .....     8.163538: mmc_request_start:
mmc2: start struct mmc_request[000000000d30cc0c]: cmd_opcode=5
cmd_arg=0x0 cmd_flags=0x2e1 cmd_retries=0 stop_opcode=0 stop_arg=0x0
stop_flags=0x0 stop_retries=0 sbc_opcode=0 sbc_arg=0x0 sbc_flags=0x0
sbc_retires=0 blocks=0 block_size=0 blk_addr=0 data_flags=0x0 tag=0
can_retune=0 doing_retune=0 retune_now=0 need_retune=0 hold_retune=1
retune_period=0
          <idle>-0       [000] d.h2.     8.164816: sdhci_cmd_irq:
hw_name=ffe70a0000.mmc quirks=0x2008008 quirks2=0x8 intmask=0x10000
intmask_p=0x18000
     irq/24-mmc2-96      [000] .....     8.164840: sdhci_thread_irq:
msg=
     irq/24-mmc2-96      [000] d.h2.     8.164896: sdhci_cmd_irq:
hw_name=ffe70a0000.mmc quirks=0x2008008 quirks2=0x8 intmask=0x1
intmask_p=0x1
     irq/24-mmc2-96      [000] .....     8.285142: mmc_request_done:
mmc2: end struct mmc_request[000000000d30cc0c]: cmd_opcode=5
cmd_err=-110 cmd_resp=0x0 0x0 0x0 0x0 cmd_retries=0 stop_opcode=0
stop_err=0 stop_resp=0x0 0x0 0x0 0x0 stop_retries=0 sbc_opcode=0
sbc_err=0 sbc_resp=0x0 0x0 0x0 0x0 sbc_retries=0 bytes_xfered=0
data_err=0 tag=0 can_retune=0 doing_retune=0 retune_now=0 need_retune=0
hold_retune=1 retune_period=0

Here's what happens: the __mmc_start_request function is called with
opcode 5. Since the power to the Wi-Fi card, which resides on this SDIO
bus, is initially off after the reset, an interrupt SDHCI_INT_TIMEOUT is
triggered. Immediately after that, a second interrupt SDHCI_INT_RESPONSE
is triggered. Depending on the exact timing, these conditions can
trigger the following race problem:

1) The sdhci_cmd_irq top half handles the command as an error. It sets
   host->cmd to NULL and host->pending_reset to true.
2) The sdhci_thread_irq bottom half is scheduled next and executes faster
   than the second interrupt handler for SDHCI_INT_RESPONSE. It clears
   host->pending_reset before the SDHCI_INT_RESPONSE handler runs.
3) The pending interrupt SDHCI_INT_RESPONSE handler gets called, triggering
   a code path that prints: "mmc2: Got command interrupt 0x00000001 even
   though no command operation was in progress."

To solve this issue, we need to clear pending interrupts when resetting
host->pending_reset. This ensures that after sdhci_threaded_irq restores
interrupts, there are no pending stale interrupts.

The behavior observed here is non-compliant with the SDHCI standard.
Place the code in the sdhci-of-dwcmshc driver to account for a
hardware-specific quirk instead of the core SDHCI code.

Signed-off-by: Michal Wilczynski <[email protected]>
Acked-by: Adrian Hunter <[email protected]>
Fixes: 43658a542ebf ("mmc: sdhci-of-dwcmshc: Add support for T-Head TH1520")
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Ulf Hansson <[email protected]>
Signed-off-by: Mingzheng Xing <[email protected]>
Enable CONFIG_DRM_ETNAVIV=m
Update CONFIG_AIC_FW_PATH="/lib/firmware/aic8800"
And generate the new openeuler_defconfig.

Signed-off-by: Mingzheng Xing <[email protected]>
Due to a known bug found during the testing of video_memory, disable it
until the issue is resolved.

```
[  +0.701834] BUG: Bad page state in process Media  pfn:0c7d2
[  +0.005632] page:000000008ee78948 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0xc7d2
[  +0.009300] flags: 0xfffc00000004000(reserved|node=0|zone=0|lastcpupid=0x3fff)
[  +0.007277] page_type: 0xffffffff()
[  +0.003548] raw: 0fffc00000004000 0000000000000000 0000000000000122 0000000000000000
[  +0.007774] raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
[  +0.007795] page dumped because: PAGE_FLAGS_CHECK_AT_FREE flag(s) set
...
[  +0.008629] Hardware name: Sipeed Lichee Pi 4A 16G (DT)
[  +0.005227] Call Trace:
[  +0.002447] [<ffffffff800069ba>] dump_backtrace+0x28/0x30
[  +0.005409] [<ffffffff80a2f8aa>] show_stack+0x38/0x44
[  +0.005057] [<ffffffff80a3d652>] dump_stack_lvl+0x44/0x5c
[  +0.005403] [<ffffffff80a3d682>] dump_stack+0x18/0x20
[  +0.005053] [<ffffffff802567aa>] bad_page+0x11a/0x162
[  +0.005056] [<ffffffff80256ede>] free_page_is_bad_report+0x42/0xa2
[  +0.006183] [<ffffffff802575b0>] free_unref_page_prepare+0x13e/0x24a
[  +0.006363] [<ffffffff8025a11c>] free_unref_page+0x5a/0x1c0
[  +0.005574] [<ffffffff8025a48e>] __free_pages+0x106/0x10c
[  +0.005402] [<ffffffff0263f502>] free_memblk_pages+0x76/0x26c [vidmem]
[  +0.006627] [<ffffffff0263f9a6>] GFP_Free+0xae/0x150 [vidmem]
[  +0.005832] [<ffffffff026400c2>] vidalloc_ioctl+0x4ba/0x870 [vidmem]
[  +0.006437] [<ffffffff802dc506>] __riscv_sys_ioctl+0x96/0xc2
[  +0.005668] [<ffffffff80a3e18a>] do_trap_ecall_u+0x138/0x14a
[  +0.005661] [<ffffffff80a49510>] ret_from_exception+0x0/0x64
[  +0.005730] Disabling lock debugging due to kernel taint
```

Signed-off-by: Mingzheng Xing <[email protected]>
fix: Error: unrecognized opcode cbo.clean (a0)
KUnit test error:
  arch/riscv/mm/dma-noncoherent.c:54:
    Error: unrecognized opcode cbo.clean (a0)', extension zicbom' required

Signed-off-by: Yafen Fang <[email protected]>
mainline inclusion
commit de1ff306dcf4546d6a8863b1f956335e0d3fbb9b
category: cleanup
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/1

--------------------------------

Now that the GIC-v3 callback can handle invocation with a fwspec parameter
count of 0 lift the restriction in the core code and invoke select()
unconditionally when the domain provides it.

Preparatory change for per device MSI domains.

Signed-off-by: Thomas Gleixner <[email protected]>
Signed-off-by: Anup Patel <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hangfan Li <[email protected]>
mainline inclusion
commit ac81e94ab001c2882e89c9b61417caea64b800df
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/1

--------------------------------

Supporting per device MSI domains on ARM64, RISC-V and the zoo of
interrupt mechanisms needs a bit more information than what the
initial x86 implementation provides.

Add the following fields:

  - required_flags: 	The flags which a parent domain requires to be set
  - bus_select_token:	The bus token of the parent domain for select()
  - bus_select_mask:	A bitmask of supported child domain bus types

This allows to provide library functions which can be shared between
various interrupt chip implementations and avoids replicating mostly
similar code all over the place.

Signed-off-by: Thomas Gleixner <[email protected]>
Signed-off-by: Anup Patel <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hangfan Li <[email protected]>
mainline inclusion
commit 6516d5a295356f8fd5827a1c0954d7ed5b2324dd
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/1

--------------------------------

Add a new domain bus token to prepare for device MSI which aims to replace
the existing platform MSI maze.

Signed-off-by: Thomas Gleixner <[email protected]>
Signed-off-by: Anup Patel <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hangfan Li <[email protected]>
mainline inclusion
commit c88f9110bfbca5975a8dee4c9792ba12684c7bca
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/1

--------------------------------

Provide functions to create and remove per device MSI domains which replace
the platform-MSI domains. The new model is that each of the devices which
utilize platform-MSI gets now its private MSI domain which is "customized"
in size and with a device specific function to write the MSI message into
the device.

This is the same functionality as platform-MSI but it avoids all the down
sides of platform MSI, i.e. the extra ID book keeping, the special data
structure in the msi descriptor. Further the domains are only created when
the devices are really in use, so the burden is on the usage and not on the
infrastructure.

Fill in the domain template and provide two functions to init/allocate and
remove a per device MSI domain.

Until all users and parent domain providers are converted, the init/alloc
function invokes the original platform-MSI code when the irqdomain which is
associated to the device does not provide MSI parent functionality yet.

Signed-off-by: Thomas Gleixner <[email protected]>
Signed-off-by: Anup Patel <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hangfan Li <[email protected]>
mainline inclusion
commit 14fd06c776b5289a43c91cdc64bac3bdbc7b397e
category: cleanup
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/1

--------------------------------

Switch all the users of the platform MSI domain over to invoke the new
interfaces which branch to the original platform MSI functions when the
irqdomain associated to the caller device does not yet provide MSI parent
functionality.

No functional change.

Signed-off-by: Thomas Gleixner <[email protected]>
Signed-off-by: Anup Patel <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hangfan Li <[email protected]>
mainline inclusion
commit 1a4671ff7a903e87e4e76213e200bb8bcfa942e4
category: cleanup
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/1

--------------------------------

Signed-off-by: Thomas Gleixner <[email protected]>
Signed-off-by: Hangfan Li <[email protected]>
mainline inclusion
commit 9c78c1a85c04bdfbccc5a50588e001087d942b08
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/1

--------------------------------

irq_create_fwspec_mapping() requires translation of the firmware spec to a
hardware interrupt number and the trigger type information.

Wired interrupts which are connected to a wire to MSI bridge, like MBIGEN
are allocated that way. So far MBIGEN provides a regular irqdomain which
then hooks backwards into the MSI infrastructure. That's an unholy mess and
will be replaced with per device MSI domains which are regular MSI domains.

Interrupts on MSI domains are not supported by irq_create_fwspec_mapping(),
but for making the wire to MSI bridges sane it makes sense to provide a
special allocation/free interface in the MSI infrastructure. That avoids
the backdoors into the core MSI allocation code and just shares all the
regular MSI infrastructure.

Provide an optional translation callback in msi_domain_ops which can be
utilized by these wire to MSI bridges. No other MSI domain should provide a
translation callback. The default translation callback of the MSI
irqdomains will warn when it is invoked on a non-prepared MSI domain.

Signed-off-by: Thomas Gleixner <[email protected]>
Signed-off-by: Anup Patel <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hangfan Li <[email protected]>
mainline inclusion
commit 5aa3c0cf5bba6437c9e63a56f684f61de8b503d6
category: bugfix
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/1

--------------------------------

Users of the IRQCHIP_PLATFORM_DRIVER_{BEGIN,END} helpers rely on a fwspec
containing only the fwnode (and crucially a number of parameters set to 0)
together with a DOMAIN_BUS_ANY token to check whether a parent irqchip has
probed and registered a domain.

Since de1ff306dcf4 ("genirq/irqdomain: Remove the param count restriction
from select()"), ops->select() is called unconditionally, meaning that
irqchips implementing select() now need to handle ANY as a match.

Instead of adding more esoteric checks to the individual drivers, add that
condition to irq_find_matching_fwspec(), and let it handle the corner case,
as per the comment in the function.

This restores the functionality of the above helpers.

Fixes: de1ff306dcf4 ("genirq/irqdomain: Remove the param count restriction from select()")
Reported-by: Dmitry Baryshkov <[email protected]>
Reported-by: Biju Das <[email protected]>
Signed-off-by: Marc Zyngier <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Tested-by: Dmitry Baryshkov <[email protected]>
Tested-by: Biju Das <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hangfan Li <[email protected]>
mainline inclusion
commit 3095cc0d5b2c246ddfcb18f54ed5557640224b6a
category: cleanup
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/1

--------------------------------

In preparation for providing a special allocation function for wired
interrupts which are connected to a wire to MSI bridge, split the inner
workings of msi_domain_alloc_irq_at() out into a helper function so the
code can be shared.

No functional change.

Signed-off-by: Thomas Gleixner <[email protected]>
Signed-off-by: Anup Patel <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hangfan Li <[email protected]>
mainline inclusion
commit 2d566a498d6483ba986dadc496f64a20b032608f
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/1

--------------------------------

Provide a domain bus token for the upcoming support for wire to MSI device
domains so the domain can be distinguished from regular device MSI domains.

Signed-off-by: Thomas Gleixner <[email protected]>
Signed-off-by: Anup Patel <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hangfan Li <[email protected]>
mainline inclusion
commit 9d1c58c8004653b37721dd7b16f4360216778c94
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/1

--------------------------------

To support wire to MSI domains via the MSI infrastructure it is required to
use the firmware node of the device which implements this for creating the
MSI domain. Otherwise the existing firmware match mechanisms to find the
correct irqdomain for a wired interrupt which is connected to a wire to MSI
bridge would fail.

This cannot be used for the general case because not all devices provide
firmware nodes and all regular per device MSI domains are directly
associated to the device and have not be searched for.

Signed-off-by: Thomas Gleixner <[email protected]>
Signed-off-by: Anup Patel <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hangfan Li <[email protected]>
mainline inclusion
commit 0ee1578b00bcf5ef8e7955f0c6f02a624443eb29
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/1

--------------------------------

To support wire to MSI bridges proper in the MSI core infrastructure it is
required to have separate allocation/free interfaces which can be invoked
from the regular irqdomain allocaton/free functions.

The mechanism for allocation is:
  - Allocate the next free MSI descriptor index in the domain
  - Store the hardware interrupt number and the trigger type
    which was extracted by the irqdomain core from the firmware spec
    in the MSI descriptor device cookie so it can be retrieved by
    the underlying interrupt domain and interrupt chip
  - Use the regular MSI allocation mechanism for the newly allocated
    index which returns a fully initialized Linux interrupt on succes

This works because:
  - the domains have a fixed size
  - each hardware interrupt is only allocated once
  - the underlying domain does not care about the MSI index it only cares
    about the hardware interrupt number and the trigger type

The free function looks up the MSI index in the MSI descriptor of the
provided Linux interrupt number and uses the regular index based free
functions of the MSI core.

Signed-off-by: Thomas Gleixner <[email protected]>
Signed-off-by: Anup Patel <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hangfan Li <[email protected]>
mainline inclusion
commit e49312fe09df36cc4eae0cd6e1b08b563a91e1bc
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/1

--------------------------------

Reroute interrupt allocation in irq_create_fwspec_mapping() if the domain
is a MSI device domain. This is required to convert the support for wire
to MSI bridges to per device MSI domains.

Signed-off-by: Thomas Gleixner <[email protected]>
Signed-off-by: Anup Patel <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hangfan Li <[email protected]>
mainline inclusion
commit 9bbe13a5d414a7f8208dba64b54d2b6e4f7086bd
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/1

--------------------------------

Some platform-MSI implementations require that power management is
redirected to the underlying interrupt chip device. To make this work
with per device MSI domains provide a new feature flag and let the
core code handle the setup of dev->pm_dev when set during device MSI
domain creation.

Signed-off-by: Thomas Gleixner <[email protected]>
Signed-off-by: Anup Patel <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hangfan Li <[email protected]>
mainline inclusion
commit 9dbaf381008dfa2fad6225633004f7adb1bac252
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/1

--------------------------------

Extend the ISA string parsing to detect the Smstateen extension. If the
extension is enabled then access to certain 'state' such as AIA CSRs in
VS mode is controlled by *stateen0 registers.

Signed-off-by: Mayuresh Chitale <[email protected]>
Reviewed-by: Andrew Jones <[email protected]>
Signed-off-by: Anup Patel <[email protected]>
Signed-off-by: Hangfan Li <[email protected]>
mainline inclusion
commit a4f5f39849f39f62f5d4e88cbb600f95f927003d
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/1

--------------------------------

Add an entry for the Smstateen extension to the riscv,isa-extensions
property.

Signed-off-by: Mayuresh Chitale <[email protected]>
Reviewed-by: Andrew Jones <[email protected]>
Reviewed-by: Conor Dooley <[email protected]>
Signed-off-by: Anup Patel <[email protected]>
Signed-off-by: Hangfan Li <[email protected]>
@oervci
Copy link

oervci commented Jul 16, 2025

Kernel build success!

@oervci
Copy link

oervci commented Jul 16, 2025

@oervci oervci added lava_check_fail lava check fail and removed lava_checking labels Jul 16, 2025
@oervci
Copy link

oervci commented Jul 16, 2025

@oervci
Copy link

oervci commented Jul 16, 2025

@oervci
Copy link

oervci commented Jul 16, 2025

Lava check done! result url: https://lava.oerv.ac.cn/scheduler/job/292

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.