tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

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



On Fri, Feb 14, 2025 at 02:39:17AM +0000, David Holland wrote:
> 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.

startrtclock() is called before drivers are attached AFAIK. But we can
move the check to cpu_configure()

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

that's what VM_GUEST_* is for

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index