Page MenuHomeFreeBSD

Move lock of uart frontend to uart backend in bhyve
ClosedPublic

Authored by aokblast on Apr 25 2024, 4:05 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 10, 7:44 AM
Unknown Object (File)
Mon, Nov 4, 5:51 AM
Unknown Object (File)
Oct 4 2024, 2:12 PM
Unknown Object (File)
Oct 4 2024, 7:08 AM
Unknown Object (File)
Oct 4 2024, 3:28 AM
Unknown Object (File)
Oct 1 2024, 10:58 PM
Unknown Object (File)
Oct 1 2024, 9:24 PM
Unknown Object (File)
Sep 29 2024, 1:49 AM

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 Not Applicable
Unit
Tests Not Applicable

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.Apr 25 2024, 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.Apr 26 2024, 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.