kernel icon indicating copy to clipboard operation
kernel copied to clipboard

fix(x86_64): don't set `CR0Flags::TASK_SWITCHED`

Open sarahspberrypi opened this issue 1 year ago • 3 comments

As previously mentioned, the manual setting of this flag seems to be unnecessary, so I propose to remove it from the code.

sarahspberrypi avatar Dec 06 '24 15:12 sarahspberrypi

We should accept the PR. I have the same opinion like @sarahspberrypi

stlankes avatar Dec 15 '24 09:12 stlankes

@sarahspberrypi I talked to @mkroening We would like to set TASK_SWITCHED flag. Do you really need to remove the flag?

stlankes avatar Dec 16 '24 14:12 stlankes

@sarahspberrypi I talked to @mkroening We would like to set TASK_SWITCHED flag. Do you really need to remove the flag?

@stlankes The flag is set later during switch_to_task() call anyways (see here ), so I don't really see why we need to have it pre-enabled? With SEV enabled, this apparently triggers an immediate hardware interrupt that cannot be masked. This interrupt can only be handled by hermit later when the IDT is loaded. But I'll talk with @mkroening in the new year about this.

sarahspberrypi avatar Dec 29 '24 13:12 sarahspberrypi

This is not relevant anymore.

sarahspberrypi avatar Nov 17 '25 09:11 sarahspberrypi