Re: [PATCH] Fix undefined operation VMXOFF during reboot and crash

2020-06-11 Thread Andy Lutomirski
On Thu, Jun 11, 2020 at 10:00 AM Sean Christopherson wrote: > > On Thu, Jun 11, 2020 at 12:33:20PM -0400, David P. Reed wrote: > > To respond to Thomas Gleixner's suggestion about exception masking mechanism > > - it may well be a better fix, but a) I used "BUG" as a model, and b) the > >

Re: [PATCH] Fix undefined operation VMXOFF during reboot and crash

2020-06-11 Thread Sean Christopherson
On Thu, Jun 11, 2020 at 12:33:20PM -0400, David P. Reed wrote: > To respond to Thomas Gleixner's suggestion about exception masking mechanism > - it may well be a better fix, but a) I used "BUG" as a model, and b) the > exception masking is undocumented anywhere I can find. These are "static >

Re: [PATCH] Fix undefined operation VMXOFF during reboot and crash

2020-06-10 Thread Andy Lutomirski
On Wed, Jun 10, 2020 at 5:00 PM Sean Christopherson wrote: > > On Wed, Jun 10, 2020 at 02:59:19PM -0700, Andy Lutomirski wrote: > > > > > > > On Jun 10, 2020, at 11:21 AM, David P. Reed wrote: > > > > > > If a panic/reboot occurs when CR4 has VMX enabled, a VMXOFF is > > > done on all CPUS, to

Re: [PATCH] Fix undefined operation VMXOFF during reboot and crash

2020-06-10 Thread Sean Christopherson
On Wed, Jun 10, 2020 at 02:59:19PM -0700, Andy Lutomirski wrote: > > > > On Jun 10, 2020, at 11:21 AM, David P. Reed wrote: > > > > If a panic/reboot occurs when CR4 has VMX enabled, a VMXOFF is > > done on all CPUS, to allow the INIT IPI to function, since > > INIT is suppressed when CPUs

Re: [PATCH] Fix undefined operation VMXOFF during reboot and crash

2020-06-10 Thread Thomas Gleixner
Sean Christopherson writes: > Gah, I typed too slow :-) Haha. I had the same thought. > On Wed, Jun 10, 2020 at 11:34:21PM +0200, Thomas Gleixner wrote: >> We have exception fixups to avoid exactly that kind of horrible >> workarounds all over the place. >> >> static inline int

Re: [PATCH] Fix undefined operation VMXOFF during reboot and crash

2020-06-10 Thread Andy Lutomirski
> On Jun 10, 2020, at 11:21 AM, David P. Reed wrote: > > If a panic/reboot occurs when CR4 has VMX enabled, a VMXOFF is > done on all CPUS, to allow the INIT IPI to function, since > INIT is suppressed when CPUs are in VMX root operation. > However, VMXOFF causes an undefined operation fault

Re: [PATCH] Fix undefined operation VMXOFF during reboot and crash

2020-06-10 Thread Sean Christopherson
Gah, I typed too slow :-) On Wed, Jun 10, 2020 at 11:34:21PM +0200, Thomas Gleixner wrote: > We have exception fixups to avoid exactly that kind of horrible > workarounds all over the place. > > static inline int cpu_vmxoff_safe(void) > { > int err; > > asm volatile("2: vmxoff;

Re: [PATCH] Fix undefined operation VMXOFF during reboot and crash

2020-06-10 Thread Sean Christopherson
On Wed, Jun 10, 2020 at 02:12:50PM -0400, David P. Reed wrote: > If a panic/reboot occurs when CR4 has VMX enabled, a VMXOFF is > done on all CPUS, to allow the INIT IPI to function, since > INIT is suppressed when CPUs are in VMX root operation. > However, VMXOFF causes an undefined operation

Re: [PATCH] Fix undefined operation VMXOFF during reboot and crash

2020-06-10 Thread Thomas Gleixner
"David P. Reed" writes: > +/* > + * Fix any unwanted undefined operation fault due to VMXOFF instruction that > + * is needed to ensure that CPU is not in VMX root operation at time of > + * a reboot/panic CPU reset. There is no safe and reliable way to know > + * if a processor is in VMX root

Re: [PATCH] Fix undefined operation VMXOFF during reboot and crash

2020-06-10 Thread Randy Dunlap
Hi David, If you happen to make a v2 of this patch, there are a few comments that begin with "/**" but they are not kernel-doc comments, so they should instead begin with just "/*". Please see below. (and you did not introduce this comment style here.) On 6/10/20 11:12 AM, David P. Reed wrote:

[PATCH] Fix undefined operation VMXOFF during reboot and crash

2020-06-10 Thread David P. Reed
If a panic/reboot occurs when CR4 has VMX enabled, a VMXOFF is done on all CPUS, to allow the INIT IPI to function, since INIT is suppressed when CPUs are in VMX root operation. However, VMXOFF causes an undefined operation fault if the CPU is not in VMX operation, that is, VMXON has not been