3 ms·
First, the OS can't hide that because it's not a middleman in the execution of program code. When a program is running on a CPU it has access to the instruction
by pmjordan 7y ago
First, the OS can't hide that because it's not a middleman in the execution of program code. When a program is running on a CPU it has access to the instructions that tell it what CPU it is.
Technically, it could, using virtualisation extensions to x86. CPUID can be trapped by a hypervisor, and the hypervisor can supply whatever result it likes. This is how Qemu/KVM simulates different CPU models.
Mainstream OSes don’t use virtualisation extensions for regular processes of course, and hypercalls would be even more expensive than regular syscall based context switches, so this is probably not something that is going to change in the short to medium term.