Re: (tiny) patch review: return if RTC diag fails

David Holland <[email protected]>
Newsgroups gmane.os.netbsd.devel.kernel
Message-ID <[email protected]>
On Thu, Feb 13, 2025 at 10:52:30PM +0100, Manuel Bouyer wrote:
 > In the case of the VM the problem is not that it's bad, but that it's not
 > present (and, I guess, there is another RTC provised by the hypervisor in
 > this case). but AFAIK we don't have a way to know if the RTC is
 > present or not.
 > 
 > Maybe a solution would be to not call startrtclock() at all in the VM
 > case. It's called from cpu_configure() and we're already checking
 > for VM_GUEST_XENPVH here.

The hypervisor is a platform like any other, and we ought to be able
to either probe the hardware or know what's there. Filling up driver
code with "if (vm)" is not much better than filling it up with tests
for specific motherboard models -- it might in some cases be the only
alternative but it should be the last choice.

(also it should be specific to the broken hypervisor concerned and not
applied to all hypervisors)

-- 
David A. Holland
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.