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

Emile `iMil' Heitor <[email protected]>
Newsgroups gmane.os.netbsd.devel.kernel
Message-ID <[email protected]>
On Fri, 14 Feb 2025, Manuel Bouyer wrote:

>> (also it should be specific to the broken hypervisor concerned and not
>> applied to all hypervisors)
>
> that's what VM_GUEST_* is for

This behavior is specific to the microvm machine type in QEMU, which
sets rtc=off by default, we can't just have a condition on the
hypervisor.

As a matter of fact we do have a validity/presence test in
sys/arch/x86/isa/rtc.c rtcget():

if ((mc146818_read(NULL, MC_REGD) & MC_REGD_VRT) == 0)
 	return (-1);

ref https://www.scs.stanford.edu/23wi-cs212/pintos/specs/mc146818a.pdf
page 16 (thanks khorben@ for the hint).

Can't we just move this test to startrtclock()?

------------------------------------------------------------------------
Emile `iMil' Heitor <imil@{home.imil.net,NetBSD.org}> | https://imil.net
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.