Skip to contentSkip to conversation

"Tried to do a paging op on itself"

DISCUSSION Alina 4 participants 4 messages Aug 8, 2016

lore
Share & tools
lore

Alina

author
#0 lore raw

Hello,

When I try to enable shadow page table features using the shadow_control function, I get this message in the hypervisor logs: "Tried to do a paging op on itself". After backtracking to the source of this message, I discovered it comes from the condition: "if ( unlikely(d == current->domain) )", which means that the hypervisor does not consider the current domain as the same domain I give as parameter, even though I checked and their domain_id is the same.

Does anyone have any idea why the hypervisor does not see them as being equal?

Thank you,
Alina

--
View this message in context: http://xen.1045712.n5.nabble.com/Tried-to-do-a-paging-op-on-itself-tp5733245.html
Sent from the Xen - Dev mailing list archive at Nabble.com.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#1 lore raw

Hello,

Quoted 10 lines

When I try to enable shadow page table features using the shadow_control function, I get this message in the hypervisor logs: "Tried to do a paging op on itself". After backtracking to the source of this message, I discovered it comes from the condition: "if ( unlikely(d == current->domain) )", which means that the hypervisor does not consider the current domain as the same domain I give as parameter, even though I checked and their domain_id is the same.

Does anyone have any idea why the hypervisor does not see them as being equal?

On the contrary, that's exactly how the hypervisor sees them (as the message states: "paging op _on_itself_").

You're probably mistakenly thinking of the "unlikely()" as some sort of NOT, but that's not the case. Unlikely() is merely being used for optimization purposes (so the statements says that the developer thinks that d will be equal to current->domain very rarely).

Cheers,
Razvan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#2 lore raw
In reply to Alina
Quoted 10 lines · On Mon, 8 Aug 2016 13:35:42 -0700 (MST) Alina wrote:

When I try to enable shadow page table features using the shadow_control function, I get this message in the hypervisor logs: "Tried to do a paging op on itself". After backtracking to the source of this message, I discovered it comes from the condition: "if ( unlikely(d == current->domain) )", which means that the hypervisor does not consider the current domain as the same domain I give as parameter, even though I checked and their domain_id is the same.

Does anyone have any idea why the hypervisor does not see them as being equal?

You are misreading the code: a domain cannot call xc_shadow_control() on itself. I've never played with shadow paging, but you'd probably have more luck running your code from dom0 against a user domain.

Signature · 6 lines
Mihai Donțu

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#3 lore raw
In reply to Alina
Quoted 9 lines · Alina

Hello,

When I try to enable shadow page table features using the shadow_control function, I get this message in the hypervisor logs: "Tried to do a paging op on itself". After backtracking to the source of this message, I discovered it comes from the condition: "if ( unlikely(d == current->domain) )", which means that the hypervisor does not consider the current domain as the same domain I give as parameter, even though I checked and their domain_id is the same.

unlikely($X) is an optimisation, which causes the compiler to reorder the jumps to avoid branch misprediction penalties, based on the programmers assertion of which case is more likely.

Quoted 3 lines

Does anyone have any idea why the hypervisor does not see them as being equal?

They are equal, and that is the problem.

I presume you are trying to enable logdirty mode (you haven't specified which shadow_control you are trying to enable), but it is not permitted for a domain to make such adjustments to itself.

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel