Re: [PATCH 08/12] KVM: x86: save/load state on SMM switch

2015-05-25 Thread Paolo Bonzini
On 22/05/2015 16:17, Radim Krčmář wrote: > Btw. I had a good laugh on Intel's response to a similar question: > https://software.intel.com/en-us/forums/topic/305672 Duh... the question is dumb (because he's not doing IRET in SMM), and the answer is dumber... Paolo -- To unsubscribe from this li

Re: [PATCH 08/12] KVM: x86: save/load state on SMM switch

2015-05-22 Thread Radim Krčmář
2015-05-21 23:21+0200, Paolo Bonzini: > On 21/05/2015 19:00, Radim Krčmář wrote: >> Potentially, an NMI could be latched (while in SMM or upon exit) and >> serviced upon exit [...] >> >> This "Potentially" could be in the sense that the whole 3rd paragraph is >> only applicable to some ancient

Re: [PATCH 08/12] KVM: x86: save/load state on SMM switch

2015-05-22 Thread Radim Krčmář
2015-05-21 22:24+0200, Paolo Bonzini: > On 21/05/2015 18:33, Radim Krčmář wrote: > >> > Check the AMD architecture manual. > > I must be blind, is there more than Table 10-2? > > There's Table 10-1! :DDD :D I think I understand ... 10-1 says that amd64 doesn't shift the segment's attributes (th

Re: [PATCH 08/12] KVM: x86: save/load state on SMM switch

2015-05-21 Thread Paolo Bonzini
On 21/05/2015 19:00, Radim Krčmář wrote: > Potentially, an NMI could be latched (while in SMM or upon exit) and > serviced upon exit [...] > > This "Potentially" could be in the sense that the whole 3rd paragraph is > only applicable to some ancient SMM design :) It could also be in the sen

Re: [PATCH 08/12] KVM: x86: save/load state on SMM switch

2015-05-21 Thread Paolo Bonzini
On 21/05/2015 18:33, Radim Krčmář wrote: >> > Check the AMD architecture manual. > I must be blind, is there more than Table 10-2? There's Table 10-1! :DDD Paolo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More

Re: [PATCH 08/12] KVM: x86: save/load state on SMM switch

2015-05-21 Thread Radim Krčmář
2015-05-21 18:23+0200, Paolo Bonzini: > On 21/05/2015 18:20, Radim Krčmář wrote: >> 2. NMI -> SMI -> IRET -> RSM -> NMI >> NMI is injected; I think it shouldn't be ... have you based this >> behavior on the 3rd paragraph of SDM 34.8 NMI HANDLING WHILE IN SMM >> ("A special case [...]")? > > Yes.

Re: [PATCH 08/12] KVM: x86: save/load state on SMM switch

2015-05-21 Thread Radim Krčmář
2015-05-21 18:21+0200, Paolo Bonzini: > On 21/05/2015 18:20, Radim Krčmář wrote: > > > >> > +set_desc_base(&desc, get_smstate(u32, smbase, offset + 8)); > >> > +set_desc_limit(&desc, get_smstate(u32, smbase, offset + 4)); > >> > +rsm_set_desc_flags(&desc, get_smsta

Re: [PATCH 08/12] KVM: x86: save/load state on SMM switch

2015-05-21 Thread Paolo Bonzini
On 21/05/2015 18:20, Radim Krčmář wrote: > 2. NMI -> SMI -> IRET -> RSM -> NMI > NMI is injected; I think it shouldn't be ... have you based this > behavior on the 3rd paragraph of SDM 34.8 NMI HANDLING WHILE IN SMM > ("A special case [...]")? Yes. > Why I think we should restore NMI mask on R

Re: [PATCH 08/12] KVM: x86: save/load state on SMM switch

2015-05-21 Thread Paolo Bonzini
On 21/05/2015 18:20, Radim Krčmář wrote: > >> > + set_desc_base(&desc, get_smstate(u32, smbase, offset + 8)); >> > + set_desc_limit(&desc, get_smstate(u32, smbase, offset + 4)); >> > + rsm_set_desc_flags(&desc, get_smstate(u32, smbase, offset)); > (There wan't a layout where this wou

Re: [PATCH 08/12] KVM: x86: save/load state on SMM switch

2015-05-21 Thread Radim Krčmář
2015-05-08 13:20+0200, Paolo Bonzini: > The big ugly one. This patch adds support for switching in and out of > system management mode, respectively upon receiving KVM_REQ_SMI and upon > executing a RSM instruction. Both 32- and 64-bit formats are supported > for the SMM state save area. > > Sig