Skip to contentSkip to conversation

Nested EPT flushes on p2m change?

DISCUSSION Tim Deegan 4 participants 6 messages Mar 26, 2015 – May 14, 2015

lore
Share & tools
lore

Tim Deegan

author
#0 lore raw

Hi, VMX maintainers,

I was looking at the nested EPT code while following up on Ed's email about altp2m design, and I can't see where nested-EPT entries get removed when a host EPT entry is removed/changed.

On nested NPT, this is handled in hap_write_p2m_entry(), which detects that the domain has nested p2ms and calls p2m_flush_nestedp2m() if necessary.

But nested EPT doesn't use the ->write_p2m_entry() hook to update entries, it uses atomic_write_ept_entry() instead. AFAICS the only flushing done on that path is ept_sync_domain(), which doesn't do anything about nested p2ms.

Am I forgetting something?

Cheers,

Tim.

#1 lore raw
Quoted 13 lines

From: Tim Deegan [mailto:[email protected]]
Sent: Thursday, March 26, 2015 7:10 PM

Hi, VMX maintainers,

I was looking at the nested EPT code while following up on Ed's email about altp2m design, and I can't see where nested-EPT entries get removed when a host EPT entry is removed/changed.

On nested NPT, this is handled in hap_write_p2m_entry(), which detects that the domain has nested p2ms and calls p2m_flush_nestedp2m() if necessary.

Quoted 7 lines

But nested EPT doesn't use the ->write_p2m_entry() hook to update entries, it uses atomic_write_ept_entry() instead. AFAICS the only flushing done on that path is ept_sync_domain(), which doesn't do anything about nested p2ms.

Am I forgetting something?

Add Yang who understands that detail better than me. :-)

Thanks
Kevin

#2 lore raw

Tian, Kevin wrote on 2015-04-03:

Quoted 13 lines
Quoted 13 lines

From: Tim Deegan [mailto:[email protected]]
Sent: Thursday, March 26, 2015 7:10 PM

Hi, VMX maintainers,

I was looking at the nested EPT code while following up on Ed's email about altp2m design, and I can't see where nested-EPT entries get removed when a host EPT entry is removed/changed.

On nested NPT, this is handled in hap_write_p2m_entry(), which detects that the domain has nested p2ms and calls p2m_flush_nestedp2m() if necessary.

Quoted 6 lines
Quoted 6 lines

But nested EPT doesn't use the ->write_p2m_entry() hook to update entries, it uses atomic_write_ept_entry() instead. AFAICS the only flushing done on that path is ept_sync_domain(), which doesn't do anything about nested p2ms.

Am I forgetting something?

It looks like you are right. The original nested EPT doesn't consider it.

CC Xiantao who is the author of the nested EPT.

Quoted 6 lines
Quoted 1 line

Add Yang who understands that detail better than me. :-)

Thanks
Kevin

Best regards,
Yang

author
#3 lore raw
Quoted 19 lines · Yang Z

Tian, Kevin wrote on 2015-04-03:

Quoted 18 lines
Quoted 18 lines

From: Tim Deegan [mailto:[email protected]]
Sent: Thursday, March 26, 2015 7:10 PM

Hi, VMX maintainers,

I was looking at the nested EPT code while following up on Ed's email about altp2m design, and I can't see where nested-EPT entries get removed when a host EPT entry is removed/changed.

On nested NPT, this is handled in hap_write_p2m_entry(), which detects that the domain has nested p2ms and calls p2m_flush_nestedp2m() if necessary.

But nested EPT doesn't use the ->write_p2m_entry() hook to update entries, it uses atomic_write_ept_entry() instead. AFAICS the only flushing done on that path is ept_sync_domain(), which doesn't do anything about nested p2ms.

Quoted 5 lines
Quoted 1 line
Quoted 1 line

Am I forgetting something?

It looks like you are right. The original nested EPT doesn't consider it.

CC Xiantao who is the author of the nested EPT.

Any progress? AFAICT nested VMX is not safe to use until this is fixed.

Tim.

author
#4 lore raw
Quoted 20 lines · Tim Deegan
Quoted 19 lines · Yang Z

Tian, Kevin wrote on 2015-04-03:

Quoted 18 lines
Quoted 18 lines

From: Tim Deegan [mailto:[email protected]]
Sent: Thursday, March 26, 2015 7:10 PM

Hi, VMX maintainers,

I was looking at the nested EPT code while following up on Ed's email about altp2m design, and I can't see where nested-EPT entries get removed when a host EPT entry is removed/changed.

On nested NPT, this is handled in hap_write_p2m_entry(), which detects that the domain has nested p2ms and calls p2m_flush_nestedp2m() if necessary.

But nested EPT doesn't use the ->write_p2m_entry() hook to update entries, it uses atomic_write_ept_entry() instead. AFAICS the only flushing done on that path is ept_sync_domain(), which doesn't do anything about nested p2ms.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line

Am I forgetting something?

It looks like you are right. The original nested EPT doesn't consider it.

CC Xiantao who is the author of the nested EPT.

Any progress? AFAICT nested VMX is not safe to use until this is fixed.

Ping...

Tim.

#5 lore raw
In reply to Zhang, Yang Z
Quoted 14 lines

Tian, Kevin wrote on 2015-04-03:

Quoted 13 lines
Quoted 13 lines

From: Tim Deegan [mailto:[email protected]]
Sent: Thursday, March 26, 2015 7:10 PM

Hi, VMX maintainers,

I was looking at the nested EPT code while following up on Ed's email about altp2m design, and I can't see where nested-EPT entries get removed when a host EPT entry is removed/changed.

On nested NPT, this is handled in hap_write_p2m_entry(), which detects that the domain has nested p2ms and calls p2m_flush_nestedp2m() if necessary.

Quoted 9 lines
Quoted 6 lines
Quoted 6 lines

But nested EPT doesn't use the ->write_p2m_entry() hook to update entries, it uses atomic_write_ept_entry() instead. AFAICS the only flushing done on that path is ept_sync_domain(), which doesn't do anything about nested p2ms.

Am I forgetting something?

It looks like you are right. The original nested EPT doesn't consider it.

I will take a look. If it's an issue, I will try to fix it.

Liang

Quoted 12 lines

CC Xiantao who is the author of the nested EPT.

Quoted 6 lines
Quoted 1 line

Add Yang who understands that detail better than me. :-)

Thanks
Kevin

Best regards,
Yang