Page MenuHomeFreeBSD

Move lock of uart frontend to uart backend in bhyve
ClosedPublic

Authored by aokblast on Thu, Apr 25, 4:05 PM.
Tags
None
Referenced Files
F84183310: D44947.diff
Mon, May 20, 12:54 PM
Unknown Object (File)
Sat, May 11, 2:42 PM
Unknown Object (File)
Sat, May 11, 2:42 PM
Unknown Object (File)
Sat, May 11, 2:42 PM
Unknown Object (File)
Sat, May 11, 2:42 PM
Unknown Object (File)
Wed, May 8, 1:30 PM
Unknown Object (File)
Wed, May 1, 3:49 PM
Unknown Object (File)
Wed, May 1, 1:02 PM

Details

Summary

Currently, lock of uart in bhyve is placed in frontend. There are some problems about it:

  1. If every frontend should has a lock, why not move it inside backend as they all have same uart_softc.
  2. If backend needs to modify the information of uart after initialize, it will be impossible as backend cannot use lock. For example, if we want implement a telnet support for uart in backend, It should wait for connection when initialize. After some remote process connect it, it needs to modify rfd and wfd in backend.

So I decide to move it to backend.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 57385
Build 54273: arc lint + arc unit

Event Timeline

aokblast retitled this revision from Move lock of uart frontend to uartbackend to Move lock of uart frontend to uart backend in bhyve.Thu, Apr 25, 4:12 PM
aokblast edited the summary of this revision. (Show Details)
aokblast added reviewers: markj, lwhsu.
aokblast added subscribers: lwhsu, markj.
aokblast removed subscribers: markj, lwhsu.
corvink added inline comments.
usr.sbin/bhyve/uart_backend.c
330–336
aokblast edited the summary of this revision. (Show Details)

Check the result of calloc

This revision is now accepted and ready to land.Fri, Apr 26, 7:20 AM
jhb added a subscriber: jhb.
jhb added inline comments.
usr.sbin/bhyve/uart_backend.h
54–56
This revision was automatically updated to reflect the committed changes.