Skip to contentSkip to conversation

about fully UMIP support in Xen

DISCUSSION Yu Zhang 3 participants 24 messages Apr 19, 2017 – Apr 20, 2017

lore
Share & tools
lore

Yu Zhang

author
#0 lore raw

Hi Jan,

I saw that commit 8c14e5f provides emulations for UMIP affected
instructions. But realized that xen does not have logic to expose UMIP feature to guests - you have sent out one in https://lists.xenproject.org/archives/html/xen-devel/2016-12/msg00552.html to emulate the cpuid leaf, but seems it was only a software solution and have not get merged yet.
So I wonder do you have any specific plan to fully support the UMIP,
i.e. in Xen 4.10? :-)

Thanks
Yu

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

#1 lore raw
Quoted 9 lines
Quoted 1 line
Quoted 1 line · On 19.04.17 at 10:48, <[email protected]> wrote:

I saw that commit 8c14e5f provides emulations for UMIP affected
instructions. But realized that xen does not have logic to expose UMIP feature to guests - you have sent out one in
https://lists.xenproject.org/archives/html/xen-devel/2016-12/msg00552.html
to emulate the cpuid leaf, but seems it was only a software solution and have not get merged yet.
So I wonder do you have any specific plan to fully support the UMIP,
i.e. in Xen 4.10? :-)

It would be nice, but I think there are caveats: While PV guests _shouldn't_ use any of the affected instructions, we can't blindly assume they don't. Hence we'd have to emulate them (producing to be determined data, e.g. all zeros). Luckily we don't have to care about VM86 mode, as for code running there emulating the instructions would be mandatory (as they're e.g. needed for CPU family detection, since the recommended approach to tell [iirc] 286 from 386 doesn't reliably work there).

For HVM guests the feature is of no interest to Xen itself anyway, i.e. all we'd need is allow them to enable the CR4 bit (which my emulation patch did as a side effect, but that patch has been deferred until after Andrew manages to put in some more CPUID work; that single hunk could certainly be split out if desired).

Jan

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

author
#2 lore raw
Quoted 9 lines · Jan Beulich
Quoted 9 lines
Quoted 1 line
Quoted 1 line · On 19.04.17 at 10:48, <[email protected]> wrote:

I saw that commit 8c14e5f provides emulations for UMIP affected
instructions. But realized that xen does not have logic to expose UMIP feature to guests - you have sent out one in
https://lists.xenproject.org/archives/html/xen-devel/2016-12/msg00552.html
to emulate the cpuid leaf, but seems it was only a software solution and have not get merged yet.
So I wonder do you have any specific plan to fully support the UMIP,
i.e. in Xen 4.10? :-)

Quoted 8 lines

It would be nice, but I think there are caveats: While PV guests _shouldn't_ use any of the affected instructions, we can't blindly assume they don't. Hence we'd have to emulate them (producing to be determined data, e.g. all zeros). Luckily we don't have to care about VM86 mode, as for code running there emulating the instructions would be mandatory (as they're e.g. needed for CPU family detection, since the recommended approach to tell [iirc] 286 from 386 doesn't reliably work there).

Thanks, Jan.
You mean if UMIP is enabled in xen, and dom0 triggers affected instructions, 0 should be returned? Does hypervisor need to differentiate dom0 kernel and its user space?

Quoted 5 lines

For HVM guests the feature is of no interest to Xen itself anyway, i.e. all we'd need is allow them to enable the CR4 bit (which my emulation patch did as a side effect, but that patch has been deferred until after Andrew manages to put in some more CPUID work; that single hunk could certainly be split out if desired).

By "CPUID work", I guess you changes needed in the xen/tools/gen-cpuid.py, not just emulating one to the guest, right?

Yu

Quoted 7 lines

Jan

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

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

#3 lore raw
Quoted 36 lines · Yu Zhang
Quoted 12 lines · Jan Beulich
Quoted 6 lines
Quoted 1 line
Quoted 1 line · On 19.04.17 at 10:48, <[email protected]> wrote:

I saw that commit 8c14e5f provides emulations for UMIP affected
instructions. But realized that xen does not have logic to expose UMIP feature to guests - you have sent out one in
https://lists.xenproject.org/archives/html/xen-devel/2016-12/msg00552.html

Quoted 6 lines

to emulate the cpuid leaf, but seems it was only a software solution and
have not get merged yet.
So I wonder do you have any specific plan to fully support the
UMIP,
i.e. in Xen 4.10? :-)

Quoted 8 lines

It would be nice, but I think there are caveats: While PV guests _shouldn't_ use any of the affected instructions, we can't blindly assume they don't. Hence we'd have to emulate them (producing to be determined data, e.g. all zeros). Luckily we don't have to care about VM86 mode, as for code running there emulating the instructions would be mandatory (as they're e.g. needed for CPU family detection, since the recommended approach to tell [iirc] 286 from 386 doesn't reliably work there).

Thanks, Jan.
You mean if UMIP is enabled in xen, and dom0 triggers affected instructions, 0 should
be returned? Does hypervisor need to differentiate dom0 kernel and its user space?

Quoted 5 lines

For HVM guests the feature is of no interest to Xen itself anyway, i.e. all we'd need is allow them to enable the CR4 bit (which my emulation patch did as a side effect, but that patch has been deferred until after Andrew manages to put in some more CPUID work; that single hunk could certainly be split out if desired).

Quoted 3 lines

By "CPUID work", I guess you changes needed in the xen/tools/gen-cpuid.py,
not just emulating one to the guest, right?

There are two angles here.

The easy part of CPUID work is to expose it to PV and HVM guests, and this has yet to be done but shouldn't be hard.

The more complicated part, which needs the toolstack CPUID modifications I want to do, is to be able to fake up UMIP to HVM guests on non-UMIP capable hardware.

~Andrew

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

author
#4 lore raw
Quoted 37 lines · Andrew Cooper
Quoted 28 lines · Yu Zhang
Quoted 12 lines · Jan Beulich
Quoted 6 lines
Quoted 1 line
Quoted 1 line · On 19.04.17 at 10:48, <[email protected]> wrote:

I saw that commit 8c14e5f provides emulations for UMIP affected
instructions. But realized that xen does not have logic to expose UMIP feature to guests - you have sent out one in
https://lists.xenproject.org/archives/html/xen-devel/2016-12/msg00552.html

Quoted 6 lines

to emulate the cpuid leaf, but seems it was only a software solution and
have not get merged yet.
So I wonder do you have any specific plan to fully support the
UMIP,
i.e. in Xen 4.10? :-)

Quoted 8 lines

It would be nice, but I think there are caveats: While PV guests _shouldn't_ use any of the affected instructions, we can't blindly assume they don't. Hence we'd have to emulate them (producing to be determined data, e.g. all zeros). Luckily we don't have to care about VM86 mode, as for code running there emulating the instructions would be mandatory (as they're e.g. needed for CPU family detection, since the recommended approach to tell [iirc] 286 from 386 doesn't reliably work there).

Thanks, Jan.
You mean if UMIP is enabled in xen, and dom0 triggers affected instructions, 0 should
be returned? Does hypervisor need to differentiate dom0 kernel and its user space?

Quoted 8 lines
Quoted 5 lines

For HVM guests the feature is of no interest to Xen itself anyway, i.e. all we'd need is allow them to enable the CR4 bit (which my emulation patch did as a side effect, but that patch has been deferred until after Andrew manages to put in some more CPUID work; that single hunk could certainly be split out if desired).

By "CPUID work", I guess you changes needed in the xen/tools/gen-cpuid.py,
not just emulating one to the guest, right?

Quoted 8 lines

There are two angles here.

The easy part of CPUID work is to expose it to PV and HVM guests, and this has yet to be done but shouldn't be hard.

The more complicated part, which needs the toolstack CPUID modifications I want to do, is to be able to fake up UMIP to HVM guests on non-UMIP capable hardware.

Thanks, Andrew.
Our expectation is to get this feature into xen upstream in this year. Considering the xen release schedule, I guess it means to get the easy part accepted in xen 4.10.

So I wonder, do you have plan to do this? Any assistance needed from Intel? :)

Yu

Quoted 6 lines

~Andrew

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

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

#5 lore raw
In reply to Yu Zhang
Quoted 20 lines
Quoted 1 line
Quoted 1 line · On 19.04.17 at 11:48, <[email protected]> wrote:
Quoted 9 lines · Jan Beulich
Quoted 9 lines
Quoted 1 line
Quoted 1 line · On 19.04.17 at 10:48, <[email protected]> wrote:

I saw that commit 8c14e5f provides emulations for UMIP affected
instructions. But realized that xen does not have logic to expose UMIP feature to guests - you have sent out one in
https://lists.xenproject.org/archives/html/xen-devel/2016-12/msg00552.html
to emulate the cpuid leaf, but seems it was only a software solution and have not get merged yet.
So I wonder do you have any specific plan to fully support the UMIP,
i.e. in Xen 4.10? :-)

Quoted 8 lines

It would be nice, but I think there are caveats: While PV guests _shouldn't_ use any of the affected instructions, we can't blindly assume they don't. Hence we'd have to emulate them (producing to be determined data, e.g. all zeros). Luckily we don't have to care about VM86 mode, as for code running there emulating the instructions would be mandatory (as they're e.g. needed for CPU family detection, since the recommended approach to tell [iirc] 286 from 386 doesn't reliably work there).

Quoted 4 lines

Thanks, Jan.
You mean if UMIP is enabled in xen, and dom0 triggers affected instructions, 0 should
be returned?

Yes.

Quoted 2 lines

Does hypervisor need to differentiate dom0 kernel and its user space?

If we want to para-virtualize the feature, then yes. Otherwise we can't assume the guest kernel would deal with user mode faults, so we'd have to. Arguably there could be a non-default mode in which we don't (forcing such applications to get a signal or crash).

Jan

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

author
#6 lore raw
Quoted 23 lines · Jan Beulich
Quoted 19 lines
Quoted 1 line
Quoted 1 line · On 19.04.17 at 11:48, <[email protected]> wrote:
Quoted 9 lines · Jan Beulich
Quoted 9 lines
Quoted 1 line
Quoted 1 line · On 19.04.17 at 10:48, <[email protected]> wrote:

I saw that commit 8c14e5f provides emulations for UMIP affected
instructions. But realized that xen does not have logic to expose UMIP feature to guests - you have sent out one in
https://lists.xenproject.org/archives/html/xen-devel/2016-12/msg00552.html
to emulate the cpuid leaf, but seems it was only a software solution and have not get merged yet.
So I wonder do you have any specific plan to fully support the UMIP,
i.e. in Xen 4.10? :-)

Quoted 8 lines

It would be nice, but I think there are caveats: While PV guests _shouldn't_ use any of the affected instructions, we can't blindly assume they don't. Hence we'd have to emulate them (producing to be determined data, e.g. all zeros). Luckily we don't have to care about VM86 mode, as for code running there emulating the instructions would be mandatory (as they're e.g. needed for CPU family detection, since the recommended approach to tell [iirc] 286 from 386 doesn't reliably work there).

Quoted 4 lines

Thanks, Jan.
You mean if UMIP is enabled in xen, and dom0 triggers affected instructions, 0 should
be returned?

Quoted 8 lines

Yes.

Quoted 2 lines

Does hypervisor need to differentiate dom0 kernel and its user space?

If we want to para-virtualize the feature, then yes. Otherwise we can't assume the guest kernel would deal with user mode faults, so we'd have to. Arguably there could be a non-default mode in which we don't (forcing such applications to get a signal or crash).

Thanks, Jan.
For UMIP is to be para-virtualized, is it OK to give dom0 kernel the physical value if instructions are triggered in the kernel?

And if the instructions are triggered in dom0 user space, the spec requires a #GP fault, and we can return 0 to the application in the #GP fault handler, is it OK?

Yu

Quoted 7 lines

Jan

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

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

#7 lore raw
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 19.04.17 at 13:44, <[email protected]> wrote:
Quoted 3 lines · Jan Beulich
Quoted 3 lines
Quoted 1 line
Quoted 1 line · On 19.04.17 at 11:48, <[email protected]> wrote:

Does hypervisor need to differentiate dom0 kernel and its user space?

Quoted 8 lines
Quoted 4 lines

If we want to para-virtualize the feature, then yes. Otherwise we can't assume the guest kernel would deal with user mode faults, so we'd have to. Arguably there could be a non-default mode in which we don't (forcing such applications to get a signal or crash).

For UMIP is to be para-virtualized, is it OK to give dom0 kernel the physical value
if instructions are triggered in the kernel?

Why would you want to special case Dom0 here? I don't see anything wrong with giving Dom0 the real values, but since you'll have to not give DomU-s the real values, you'd then add more code to treat Dom0 specially. Simply give everyone fake values.

Quoted 4 lines

And if the instructions are triggered in dom0 user space, the spec requires a #GP
fault, and we can return 0 to the application in the #GP fault handler, is it OK?

Yes, I think so. But the fundamental rule is - make it match what native Linux does in that case.

Jan

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

#8 lore raw
Quoted 17 lines · Jan Beulich
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 19.04.17 at 13:44, <[email protected]> wrote:
Quoted 3 lines · Jan Beulich
Quoted 3 lines
Quoted 1 line
Quoted 1 line · On 19.04.17 at 11:48, <[email protected]> wrote:

Does hypervisor need to differentiate dom0 kernel and its user space?

Quoted 7 lines
Quoted 4 lines

If we want to para-virtualize the feature, then yes. Otherwise we can't assume the guest kernel would deal with user mode faults, so we'd have to. Arguably there could be a non-default mode in which we don't (forcing such applications to get a signal or crash).

For UMIP is to be para-virtualized, is it OK to give dom0 kernel the physical value
if instructions are triggered in the kernel?

Why would you want to special case Dom0 here? I don't see anything wrong with giving Dom0 the real values, but since you'll have to not give DomU-s the real values, you'd then add more code to treat Dom0 specially. Simply give everyone fake values.

Quoted 6 lines
Quoted 4 lines

And if the instructions are triggered in dom0 user space, the spec requires a #GP
fault, and we can return 0 to the application in the #GP fault handler, is it OK?

Yes, I think so. But the fundamental rule is - make it match what native Linux does in that case.

The attack scenario for PV guests is different. The point of UMIP there is to protect Xen against guests, including guest kernels.

If a PV kernel is aware of UMIP and turns UMIP on, #GPs from userspace should be bounced to the kernel, and #GPs from kernel space (as it is ring-deprivileged) must be emulated and execute successfully.

If Xen is using UMIP to protect itself, it needs to emulate and fake up the information to both guest userspace and kernelspace.

If both Xen and the PV kernel turn on UMIP, Xen needs to bounce userspace #GPs to the guest kernel, and fake up information for the guest kernel.

~Andrew

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

#9 lore raw
Quoted 11 lines
Quoted 1 line
Quoted 1 line · On 19.04.17 at 15:49, <[email protected]> wrote:

If a PV kernel is aware of UMIP and turns UMIP on, #GPs from userspace should be bounced to the kernel, and #GPs from kernel space (as it is ring-deprivileged) must be emulated and execute successfully.

If Xen is using UMIP to protect itself, it needs to emulate and fake up the information to both guest userspace and kernelspace.

If both Xen and the PV kernel turn on UMIP, Xen needs to bounce userspace #GPs to the guest kernel, and fake up information for the guest kernel.

I disagree in one point: If the guest kernel enabled UMIP, it being PV it should take care not to execute any of the covered insns (it has no use for them anyway). I see no reason to emulate anything in that case - emulation is needed only to keep _unaware_ environments working.

Jan

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

#10 lore raw
Quoted 8 lines · Jan Beulich
Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 19.04.17 at 15:49, <[email protected]> wrote:

If a PV kernel is aware of UMIP and turns UMIP on, #GPs from userspace should be bounced to the kernel, and #GPs from kernel space (as it is ring-deprivileged) must be emulated and execute successfully.

If Xen is using UMIP to protect itself, it needs to emulate and fake up the information to both guest userspace and kernelspace.

Quoted 8 lines
Quoted 3 lines

If both Xen and the PV kernel turn on UMIP, Xen needs to bounce userspace #GPs to the guest kernel, and fake up information for the guest kernel.

I disagree in one point: If the guest kernel enabled UMIP, it being PV it should take care not to execute any of the covered insns (it has no use for them anyway). I see no reason to emulate anything in that case - emulation is needed only to keep _unaware_ environments working.

That will involve someone ensuring that new PVops get introduced and used.

Amongst other things, the current Linux doublefault handler uses sgdt.

~Andrew

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

#11 lore raw
Quoted 19 lines
Quoted 1 line
Quoted 1 line · On 19.04.17 at 16:17, <[email protected]> wrote:
Quoted 8 lines · Jan Beulich
Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 19.04.17 at 15:49, <[email protected]> wrote:

If a PV kernel is aware of UMIP and turns UMIP on, #GPs from userspace should be bounced to the kernel, and #GPs from kernel space (as it is ring-deprivileged) must be emulated and execute successfully.

If Xen is using UMIP to protect itself, it needs to emulate and fake up the information to both guest userspace and kernelspace.

Quoted 8 lines
Quoted 3 lines

If both Xen and the PV kernel turn on UMIP, Xen needs to bounce userspace #GPs to the guest kernel, and fake up information for the guest kernel.

I disagree in one point: If the guest kernel enabled UMIP, it being PV it should take care not to execute any of the covered insns (it has no use for them anyway). I see no reason to emulate anything in that case - emulation is needed only to keep _unaware_ environments working.

Quoted 3 lines

That will involve someone ensuring that new PVops get introduced and used.

Amongst other things, the current Linux doublefault handler uses sgdt.

But a PV guest would never get to see a #DF.

Jan

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

#12 lore raw
Quoted 18 lines · Jan Beulich
Quoted 18 lines
Quoted 1 line
Quoted 1 line · On 19.04.17 at 16:17, <[email protected]> wrote:
Quoted 16 lines · Jan Beulich
Quoted 11 lines
Quoted 1 line
Quoted 1 line · On 19.04.17 at 15:49, <[email protected]> wrote:

If a PV kernel is aware of UMIP and turns UMIP on, #GPs from userspace should be bounced to the kernel, and #GPs from kernel space (as it is ring-deprivileged) must be emulated and execute successfully.

If Xen is using UMIP to protect itself, it needs to emulate and fake up the information to both guest userspace and kernelspace.

If both Xen and the PV kernel turn on UMIP, Xen needs to bounce userspace #GPs to the guest kernel, and fake up information for the guest kernel.

I disagree in one point: If the guest kernel enabled UMIP, it being PV it should take care not to execute any of the covered insns (it has no use for them anyway). I see no reason to emulate anything in that case - emulation is needed only to keep _unaware_ environments working.

Quoted 4 lines
Quoted 3 lines

That will involve someone ensuring that new PVops get introduced and used.

Amongst other things, the current Linux doublefault handler uses sgdt.

But a PV guest would never get to see a #DF.

It currently doesn’t, but that is a mishap of the current PV ABI behaviour. A PV guest *should* see things like #NP for missing entries in its virtual IDT or non-present segments, rather than the current domain_crash() it gets, and with that comes the expectation of faults combining to inject #DF.

~Andrew

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

author
#13 lore raw
In reply to Jan Beulich
Quoted 9 lines · Jan Beulich
Quoted 9 lines
Quoted 1 line
Quoted 1 line · On 19.04.17 at 13:44, <[email protected]> wrote:
Quoted 7 lines · Jan Beulich
Quoted 3 lines
Quoted 1 line
Quoted 1 line · On 19.04.17 at 11:48, <[email protected]> wrote:

Does hypervisor need to differentiate dom0 kernel and its user space?

If we want to para-virtualize the feature, then yes. Otherwise we can't assume the guest kernel would deal with user mode faults, so we'd have to. Arguably there could be a non-default mode in which we don't (forcing such applications to get a signal or crash).

Quoted 7 lines
Quoted 3 lines

For UMIP is to be para-virtualized, is it OK to give dom0 kernel the physical value
if instructions are triggered in the kernel?

Why would you want to special case Dom0 here? I don't see anything wrong with giving Dom0 the real values, but since you'll have to not give DomU-s the real values, you'd then add more code to treat Dom0 specially. Simply give everyone fake values.

Oh. So in such case should return 0 to the dom0 kernel I guess?

Here come a dumb question: does other pv domain also run in ring 3 in vmx root mode, or simply in vmx non-root ring 0? :)

Thanks
Yu

Quoted 7 lines
Quoted 4 lines

And if the instructions are triggered in dom0 user space, the spec requires a #GP
fault, and we can return 0 to the application in the #GP fault handler, is it OK?

Yes, I think so. But the fundamental rule is - make it match what native Linux does in that case.

Quoted 7 lines

Jan

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

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

#14 lore raw
Quoted 20 lines · Yu Zhang
Quoted 9 lines · Jan Beulich
Quoted 9 lines
Quoted 1 line
Quoted 1 line · On 19.04.17 at 13:44, <[email protected]> wrote:
Quoted 7 lines · Jan Beulich
Quoted 3 lines
Quoted 1 line
Quoted 1 line · On 19.04.17 at 11:48, <[email protected]> wrote:

Does hypervisor need to differentiate dom0 kernel and its user space?

If we want to para-virtualize the feature, then yes. Otherwise we can't assume the guest kernel would deal with user mode faults, so we'd have to. Arguably there could be a non-default mode in which we don't (forcing such applications to get a signal or crash).

Quoted 7 lines
Quoted 3 lines

For UMIP is to be para-virtualized, is it OK to give dom0 kernel the physical value
if instructions are triggered in the kernel?

Why would you want to special case Dom0 here? I don't see anything wrong with giving Dom0 the real values, but since you'll have to not give DomU-s the real values, you'd then add more code to treat Dom0 specially. Simply give everyone fake values.

Quoted 5 lines

Oh. So in such case should return 0 to the dom0 kernel I guess?

Here come a dumb question: does other pv domain also run in ring 3 in vmx root mode,
or simply in vmx non-root ring 0? :)

PV guests execute exclusively in non-root mode.

32bit PV guest kernels execute in ring 1.
64bit PV guest kernels execute in ring 3.

~Andrew

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

#15 lore raw
Quoted 22 lines
Quoted 1 line
Quoted 1 line · On 19.04.17 at 15:58, <[email protected]> wrote:
Quoted 20 lines · Yu Zhang
Quoted 16 lines · Jan Beulich
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 19.04.17 at 13:44, <[email protected]> wrote:
Quoted 3 lines · Jan Beulich
Quoted 3 lines
Quoted 1 line
Quoted 1 line · On 19.04.17 at 11:48, <[email protected]> wrote:

Does hypervisor need to differentiate dom0 kernel and its user space?

Quoted 7 lines
Quoted 4 lines

If we want to para-virtualize the feature, then yes. Otherwise we can't assume the guest kernel would deal with user mode faults, so we'd have to. Arguably there could be a non-default mode in which we don't (forcing such applications to get a signal or crash).

For UMIP is to be para-virtualized, is it OK to give dom0 kernel the physical value
if instructions are triggered in the kernel?

Why would you want to special case Dom0 here? I don't see anything wrong with giving Dom0 the real values, but since you'll have to not give DomU-s the real values, you'd then add more code to treat Dom0 specially. Simply give everyone fake values.

Quoted 7 lines
Quoted 5 lines

Oh. So in such case should return 0 to the dom0 kernel I guess?

Here come a dumb question: does other pv domain also run in ring 3 in vmx root mode,
or simply in vmx non-root ring 0? :)

PV guests execute exclusively in non-root mode.

In root mode, you mean.

Jan

Quoted 4 lines

32bit PV guest kernels execute in ring 1.
64bit PV guest kernels execute in ring 3.

~Andrew

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

#16 lore raw
Quoted 20 lines · Jan Beulich
Quoted 20 lines
Quoted 1 line
Quoted 1 line · On 19.04.17 at 15:58, <[email protected]> wrote:
Quoted 18 lines · Yu Zhang
Quoted 16 lines · Jan Beulich
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 19.04.17 at 13:44, <[email protected]> wrote:
Quoted 3 lines · Jan Beulich
Quoted 3 lines
Quoted 1 line
Quoted 1 line · On 19.04.17 at 11:48, <[email protected]> wrote:

Does hypervisor need to differentiate dom0 kernel and its user space?

Quoted 7 lines
Quoted 4 lines

If we want to para-virtualize the feature, then yes. Otherwise we can't assume the guest kernel would deal with user mode faults, so we'd have to. Arguably there could be a non-default mode in which we don't (forcing such applications to get a signal or crash).

For UMIP is to be para-virtualized, is it OK to give dom0 kernel the physical value
if instructions are triggered in the kernel?

Why would you want to special case Dom0 here? I don't see anything wrong with giving Dom0 the real values, but since you'll have to not give DomU-s the real values, you'd then add more code to treat Dom0 specially. Simply give everyone fake values.

Quoted 7 lines
Quoted 6 lines
Quoted 5 lines

Oh. So in such case should return 0 to the dom0 kernel I guess?

Here come a dumb question: does other pv domain also run in ring 3 in vmx root mode,
or simply in vmx non-root ring 0? :)

PV guests execute exclusively in non-root mode.

In root mode, you mean.

I do. (oops. Sorry.)

~Andrew

Quoted 9 lines

Jan

Quoted 4 lines

32bit PV guest kernels execute in ring 1.
64bit PV guest kernels execute in ring 3.

~Andrew

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

author
#17 lore raw
Quoted 20 lines · Andrew Cooper
Quoted 19 lines · Jan Beulich
Quoted 19 lines
Quoted 1 line
Quoted 1 line · On 19.04.17 at 15:58, <[email protected]> wrote:
Quoted 17 lines · Yu Zhang
Quoted 16 lines · Jan Beulich
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 19.04.17 at 13:44, <[email protected]> wrote:
Quoted 3 lines · Jan Beulich
Quoted 3 lines
Quoted 1 line
Quoted 1 line · On 19.04.17 at 11:48, <[email protected]> wrote:

Does hypervisor need to differentiate dom0 kernel and its user space?

Quoted 7 lines
Quoted 4 lines

If we want to para-virtualize the feature, then yes. Otherwise we can't assume the guest kernel would deal with user mode faults, so we'd have to. Arguably there could be a non-default mode in which we don't (forcing such applications to get a signal or crash).

For UMIP is to be para-virtualized, is it OK to give dom0 kernel the physical value
if instructions are triggered in the kernel?

Why would you want to special case Dom0 here? I don't see anything wrong with giving Dom0 the real values, but since you'll have to not give DomU-s the real values, you'd then add more code to treat Dom0 specially. Simply give everyone fake values.

Quoted 8 lines
Quoted 7 lines
Quoted 6 lines
Quoted 5 lines

Oh. So in such case should return 0 to the dom0 kernel I guess?

Here come a dumb question: does other pv domain also run in ring 3 in vmx root mode,
or simply in vmx non-root ring 0? :)

PV guests execute exclusively in non-root mode.

In root mode, you mean.

I do. (oops. Sorry.)

Thanks a lot, Andrew & Jan.
And back to the schedule of this feature, are you working on it? Or any specific plan? Is there anything we can do here in Intel?

B.R.
Yu

Quoted 10 lines

~Andrew

Quoted 7 lines

Jan

Quoted 4 lines

32bit PV guest kernels execute in ring 1.
64bit PV guest kernels execute in ring 3.

~Andrew

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

#18 lore raw
Quoted 3 lines
Quoted 1 line
Quoted 1 line · On 20.04.17 at 09:15, <[email protected]> wrote:

And back to the schedule of this feature, are you working on it? Or any specific plan?

Well, the HVM side is basically ready (as said, the single hunk needed to support UMIP when hardware supports it could be easily split off of my emulation patch). For the PV side I don't currently have any plans to do any work.

Quoted 1 line

Is there anything we can do here in Intel?

Traditionally PV hasn't been of much interest to Intel, but if you mean to support that (with or without exposure to the guest) then that's certainly something you may want to look into.

Jan

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

author
#19 lore raw
Quoted 7 lines · Jan Beulich
Quoted 3 lines
Quoted 1 line
Quoted 1 line · On 20.04.17 at 09:15, <[email protected]> wrote:

And back to the schedule of this feature, are you working on it? Or any specific plan?

Well, the HVM side is basically ready (as said, the single hunk needed to support UMIP when hardware supports it could be easily split off of my emulation patch). For the PV side I don't currently have any plans to do any work.

Thanks, Jan. So do you have plan to push the HVM support in Xen 4.10?

Quoted 4 lines
Quoted 1 line

Is there anything we can do here in Intel?

Traditionally PV hasn't been of much interest to Intel, but if you mean to support that (with or without exposure to the guest) then that's certainly something you may want to look into.

Well, we have not planed to support the PV yet. But we can have an evaluation internally, and see if we have resource to do so.

Yu

Quoted 7 lines

Jan

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

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

#20 lore raw
Quoted 11 lines
Quoted 1 line
Quoted 1 line · On 20.04.17 at 11:53, <[email protected]> wrote:
Quoted 7 lines · Jan Beulich
Quoted 3 lines
Quoted 1 line
Quoted 1 line · On 20.04.17 at 09:15, <[email protected]> wrote:

And back to the schedule of this feature, are you working on it? Or any specific plan?

Well, the HVM side is basically ready (as said, the single hunk needed to support UMIP when hardware supports it could be easily split off of my emulation patch). For the PV side I don't currently have any plans to do any work.

Thanks, Jan. So do you have plan to push the HVM support in Xen 4.10?

We're moving in circles, it feels. My patch depends on Andrew making progress. Breaking out the one mentioned hunk could of course be done at any time, if we have indication that UMIP hardware support will actually arrive and it becomes unlikely for the patch to be able to go in as a whole in time for 4.10.

Jan

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

author
#21 lore raw
Quoted 9 lines · Jan Beulich
Quoted 9 lines
Quoted 1 line
Quoted 1 line · On 20.04.17 at 11:53, <[email protected]> wrote:
Quoted 7 lines · Jan Beulich
Quoted 3 lines
Quoted 1 line
Quoted 1 line · On 20.04.17 at 09:15, <[email protected]> wrote:

And back to the schedule of this feature, are you working on it? Or any specific plan?

Well, the HVM side is basically ready (as said, the single hunk needed to support UMIP when hardware supports it could be easily split off of my emulation patch). For the PV side I don't currently have any plans to do any work.

Quoted 6 lines
Quoted 1 line

Thanks, Jan. So do you have plan to push the HVM support in Xen 4.10?

We're moving in circles, it feels. My patch depends on Andrew making progress. Breaking out the one mentioned hunk could of course be done at any time, if we have indication that UMIP hardware support will actually arrive and it becomes unlikely for the patch to be able to go in as a whole in time for 4.10.

I can understand. And please let me know if there's any help we can offer here in Intel. :-)

Yu

Quoted 2 lines

Jan

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

#22 lore raw
Quoted 14 lines · Yu Zhang
Quoted 11 lines · Jan Beulich
Quoted 11 lines
Quoted 1 line
Quoted 1 line · On 20.04.17 at 11:53, <[email protected]> wrote:
Quoted 8 lines · Jan Beulich
Quoted 4 lines
Quoted 1 line
Quoted 1 line · On 20.04.17 at 09:15, <[email protected]> wrote:

And back to the schedule of this feature, are you working on it? Or any
specific plan?

Well, the HVM side is basically ready (as said, the single hunk needed to support UMIP when hardware supports it could be easily split off of my emulation patch). For the PV side I don't currently have any plans to do any work.

Thanks, Jan. So do you have plan to push the HVM support in Xen 4.10?

Quoted 8 lines
Quoted 5 lines

We're moving in circles, it feels. My patch depends on Andrew making progress. Breaking out the one mentioned hunk could of course be done at any time, if we have indication that UMIP hardware support will actually arrive and it becomes unlikely for the patch to be able to go in as a whole in time for 4.10.

I can understand. And please let me know if there's any help we can offer here in Intel. :-)

I have no immediate plans to do any UMIP work, again because I lack any hardware to suitably test it on.

If Intel have time, exposing hardware UMIP support to HVM guests would be useful work, and hopefully trivial to do. (Ideally with an XTF regression test.)

~Andrew

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

author
#23 lore raw
Quoted 19 lines · Andrew Cooper
Quoted 18 lines · Yu Zhang
Quoted 16 lines · Jan Beulich
Quoted 11 lines
Quoted 1 line
Quoted 1 line · On 20.04.17 at 11:53, <[email protected]> wrote:
Quoted 8 lines · Jan Beulich
Quoted 4 lines
Quoted 1 line
Quoted 1 line · On 20.04.17 at 09:15, <[email protected]> wrote:

And back to the schedule of this feature, are you working on it? Or any
specific plan?

Well, the HVM side is basically ready (as said, the single hunk needed to support UMIP when hardware supports it could be easily split off of my emulation patch). For the PV side I don't currently have any plans to do any work.

Thanks, Jan. So do you have plan to push the HVM support in Xen 4.10?

We're moving in circles, it feels. My patch depends on Andrew making progress. Breaking out the one mentioned hunk could of course be done at any time, if we have indication that UMIP hardware support will actually arrive and it becomes unlikely for the patch to be able to go in as a whole in time for 4.10.

Quoted 8 lines
Quoted 2 lines

I can understand. And please let me know if there's any help we can offer here in Intel. :-)

I have no immediate plans to do any UMIP work, again because I lack any hardware to suitably test it on.

If Intel have time, exposing hardware UMIP support to HVM guests would be useful work, and hopefully trivial to do. (Ideally with an XTF regression test.)

Got it. We have simics to emulate the new cpu platform. So we can take over this part. As to the PV support, I'm not sure if we have time to do so in the short time, but it's not urgent for us. :)

Yu

Quoted 2 lines

~Andrew

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