Christoph Egger
2010-Aug-12 09:22 UTC
[Xen-devel] [PATCH] xen svm: fix PAUSE instruction intercept
Hi! Attached patch moves PAUSE instruction intercept handling into svm_vmexit_do_pause() analogous to the other instruction intercepts. In svm_vmexit_do_pause() update the instruction pointer. This fixes strange PAUSE intercepts on UP guests. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> P.S.: This bug has been found with nested virtualization. -- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Einsteinring 24, 85609 Dornach b. Muenchen Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jan Beulich
2010-Aug-12 10:07 UTC
Re: [Xen-devel] [PATCH] xen svm: fix PAUSE instruction intercept
>>> On 12.08.10 at 11:22, Christoph Egger <Christoph.Egger@amd.com> wrote: > In svm_vmexit_do_pause() update the instruction pointer. > This fixes strange PAUSE intercepts on UP guests.This won''t work when the instruction needs to actually be decoded: __get_instruction_length_from_list() strips all prefix bytes from the byte stream being decoded, and since ''pause'' uses a prefix the actual opcode comparison will never produce a match. Even in the case that CPUs supporting the pause filter would always support nextrip I think that the special case minimally deserves a code comment to that effect, but perhaps even warrants an ASSERT() or BUG_ON(). Jan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Christoph Egger
2010-Aug-12 12:50 UTC
Re: [Xen-devel] [PATCH] xen svm: fix PAUSE instruction intercept
On Thursday 12 August 2010 12:07:54 Jan Beulich wrote:> >>> On 12.08.10 at 11:22, Christoph Egger <Christoph.Egger@amd.com> wrote: > > > > In svm_vmexit_do_pause() update the instruction pointer. > > This fixes strange PAUSE intercepts on UP guests. > > This won''t work when the instruction needs to actually be decoded: > __get_instruction_length_from_list() strips all prefix bytes from > the byte stream being decoded, and since ''pause'' uses a prefix the > actual opcode comparison will never produce a match.Thank you for pointing this out. New attached version fixes this. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>> Even in the case that CPUs supporting the pause filter would always > support nextrip I think that the special case minimally deserves a > code comment to that effect, but perhaps even warrants an > ASSERT() or BUG_ON().This is true for real hardware but not necessarily when it comes to nested virtualization, because you emulate SVM features in software. Christoph -- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Einsteinring 24, 85609 Dornach b. Muenchen Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel