rust-vmm / vm-superio

Emulation for legacy devices
Apache License 2.0
30 stars 25 forks source link

[RFC] Add initial support for FCR register #96

Open jinankjain opened 1 year ago

jinankjain commented 1 year ago

Summary of the PR

The goal of this pull request is to add enough FCR support to satisfy the requirement of FreeBSD. Thus, only adding support for clearing RX and TX queue while omitting other features such as Fifo enable/disable.

I would like to get the community feedback on:

Requirements

Before submitting your PR, please make sure you addressed the following requirements:

andreeaflorescu commented 1 year ago

@cperciva is this something that would help with the FreeBsd use case?

cperciva commented 1 year ago

@andreeaflorescu We have a workaround in FreeBSD right now, but yes it would be good to have the FCR fixed so we don't need the workaround.

andreeaflorescu commented 1 year ago

@andreeaflorescu We have a workaround in FreeBSD right now, but yes it would be good to have the FCR fixed so we don't need the workaround.

Yap, I remember that you had a workaround, I was wondering if this would help with removing the workaround 😄

cperciva commented 1 year ago

Yap, I remember that you had a workaround, I was wondering if this would help with removing the workaround 😄

This particular workaround is fairly lightweight -- we check if flushing the FIFO resulted in the queue being empty, and if not we drain it byte by byte -- so we'll probably keep it around for a bit in case it helps with other systems. I've seen the printf triggered on some EC2 instances too, so (unless you can tell me that Nitro uses rust-vmm in its firmware?) it's probably going to be useful to keep it there anyway.

cperciva commented 1 year ago

But if you mean "will this make the workaround path stop being used when FreeBSD boots on Firecracker", I think the answer is yes. :-)