Project

General

Profile

Actions

Bug #6347

closed

microfind is somewhat less than ideal

Added by Robert Mustacchi almost 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Category:
kernel
Start date:
2015-10-17
Due date:
% Done:

100%

Estimated time:
Difficulty:
Hard
Tags:
Gerrit CR:
External Bug:

Description

The kernel has a function, tenmicrosec(), for generating a delay of around 10 microseconds using a spin loop. When this function is used early in boot, prior to the configuration of more modern timing services, this function uses a loop count (microdata) calibrated to take about 10 microseconds to complete.

The function that calibrates microdata for the machine's CPU, microfind(), is a bit rubbish. The function is quite rough around the edges, both in code and comments, and worst of all: it does not seem to work properly.

The failure becomes particularly pronounced when the OS is booted via iPXE in a VMware guest, when the OS panics most (but not all!) times this particular method of booting is attempted. Upon inspection, it seems that our use of the i8254 Programmable Interval Timer is itself not incorrect; nor is the emulated PIT malfunctioning in any detectable way.

In order to fix the problem a simpler, better documented replacement will be substituted for the existing microfind() implementation. The replacement function will make repeated trials of delay measurement in order to smooth out jitter in the scheduling of virtual machine guests.

Actions

Also available in: Atom PDF