Skip to content

Fix invalid-guest-state entry by updating state when CR0.PG cleared. - #239

Merged
rn merged 1 commit into
moby:masterfrom
rn:fix-cr0-pg
Dec 24, 2018
Merged

rn merged 1 commit into
moby:masterfrom
rn:fix-cr0-pg

Conversation

@rn

@rn rn commented Dec 7, 2018

Copy link
Copy Markdown
Member

["cherry picked" from https://github.com/machyve/xhyve/commit/cc672d5363766e7c2bf10e02ca12efbeda74c487]

Recent Linux kernels (late 4.17) disable paging temporarily
when in long-mode. Handle this case by updating guest and VM
state to make sure they are in sync: EFER.LMA is cleared,
and the 'IA-32e mode guest' entry control is set to 0.

This is effectively the reverse operation to the existing case
when CR0.PG is set.

Signed-off-by: Rolf Neugebauer rn@rneugeba.io

Thanks to @grehan-freebsd for the pointer. This lets me boot a 4.19.7 kernel without issue.
resolves #226

@ijc ijc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I think we need @djs55 (or someone) to fix #235 to fix the CI though.

@rn

rn commented Dec 14, 2018

Copy link
Copy Markdown
Member Author

Since this seems to happen on almost every hyperkit PR, maybe we should a stage in Circle CI to ping @djs55 automatically

@djs55

djs55 commented Dec 23, 2018 •

Copy link
Copy Markdown
Collaborator

@rn #240

(edited to say: this is the fix for the CI, not a patch to the CI to make it ping me)

["cherry picked" from machyve/xhyve@cc672d5]

Recent Linux kernels (late 4.17) disable paging temporarily
when in long-mode. Handle this case by updating guest and VM
state to make sure they are in sync: EFER.LMA is cleared,
and the 'IA-32e mode guest' entry control is set to 0.

This is effectively the reverse operation to the existing case
when CR0.PG is set.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
@rn

rn commented Dec 24, 2018

Copy link
Copy Markdown
Member Author

rebased onto #240. Will merge on green

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hyperkit fails to boot 4.17 and 4.18 kernel (based on Linuxkit)

3 participants