-
Notifications
You must be signed in to change notification settings - Fork 27
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
Implement PCI emulation #9
Conversation
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.
Split the proposed changes into two pull requests: one is for PCI emulation, and another is the basis of virtio-blk.
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.
Rework the git commit messages. In order to make it informative, you should mention the following:
- Summarize the proposed changes: at least Virtio shall be addressed.
- Describe the functionalities of PCI specific changes and the limitation.
- How further virtio-blk makes use of the work.
See https://cbea.ms/git-commit/
e386f2c
to
a205896
Compare
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.
Improve your English writing:
There is only a PCI functionality be implemented, which is mapping internal space to io space or mmio space through BAR.
Fix grammar mistakes. Grammarly can help.
It is not worthy to mention "Virtio is a specification of para-virtualization" since the project assumes people know KVM. Instead, you should express the rationale between the proposed change and further pull requests which hopefully build up usable virtio-blk. |
serial_handle(&v->serial, run); | ||
} else { | ||
for (int i = 0; i < run->io.count; i++) { | ||
bus_handle_io(&v->io_bus, data, is_write, addr, run->io.size); |
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.
Is it make sense to also register serial UART as an io_bus
object? So the emulated hardware with read and write method could be implemented on the same abstraction.
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.
Yes, I suppose so.
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.
@RinHizakura, I tend to merge this pull request and then think of further abstractions. Can you create a new issue which consolidates serial UART refactoring?
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.
Sure, I'll create an issue that mentions this later.
2c23bb0
to
0641c20
Compare
Emulate the mechanism to access PCI config spaces on port 0xCF8/0xCFC. There is only a PCI functionality implemented, which is mapping internal space to io space or mmio space through BAR. Each virtio-pci device has its own PCI config space and virtio config space. The PCI config space can be registered to PCI bus by pci_register_dev(). After the PCI device initialization, Guest Linux can access the virtio config space. Our virtio-blk devices is based on virtio-pci. Without option "pci=conf1", the kernel doesn't find a PCI bus and therefore also doesn't find the virtio-blk devices.
Thank @ray90514 for contributing! |
This commit implements PCI emulation.