Skip to content

An error about virtual bar write in pci virtualization #203

@liulog

Description

@liulog

I experiment pci virtualization on qemu-system-riscv64.

But I found zone1 can't boot successfully, because page-fault in mem64 region.

Image

It means 0x4_0000_0000 region isn't mapped in zone1 memoryset.

Then, I find 00:02.0 (virtio-blk-pci device) 's Memory is wrong, becasue there should be one memory region in 0x4_0000_0000 instead 0x4000_0000.

Image

After a period of investigation, I find zone0 read error bar4 related to 00:02.0. So I deep in code. There exists an error. Mmio bar4 read correct value but read bar4 returns an error value.

Image

And I find the first read is ok. But later reads after first write are wrong. The low 4bits is missing which are read-only. This is a serious error.

Image

I try to use the following code to fix it, it now works ok.

Image

I use two virtio-blk-pci devices. Now zone0 and zone1 can work.

Image

@ZhongkaiXu @dallasxy Please check it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingciGithub CIriscv64

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions