From mboxrd@z Thu Jan 1 00:00:00 1970 From: Suraj Jitindar Singh Subject: Re: [kvm-unit-tests PATCH V2 4/4] powerpc/tm: Add a test for H_CEDE while tm suspended Date: Fri, 12 Aug 2016 16:36:58 +1000 Message-ID: <1470983818.4695.25.camel@gmail.com> References: <1470794377-14427-1-git-send-email-sjitindarsingh@gmail.com> <1470794377-14427-4-git-send-email-sjitindarsingh@gmail.com> <283e64dd-54f0-e1c1-0b63-385b51d7dd10@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Cc: pbonzini@redhat.com, rkrcmar@redhat.com, kvm-ppc@vger.kernel.org, lvivier@redhat.com, drjones@redhat.com To: Thomas Huth , kvm@vger.kernel.org Return-path: Received: from mail-pa0-f68.google.com ([209.85.220.68]:36068 "EHLO mail-pa0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751556AbcHLGhF (ORCPT ); Fri, 12 Aug 2016 02:37:05 -0400 In-Reply-To: <283e64dd-54f0-e1c1-0b63-385b51d7dd10@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, 2016-08-10 at 13:33 +0200, Thomas Huth wrote: > On 10.08.2016 03:59, Suraj Jitindar Singh wrote: > > > > On Power machines if a guest cedes while a tm transaction is in the > > suspended state then the checkpointed state of the vcpu may be lost > > and we > > lose the cpu in the host. > > > > Add a file for tm tests "powerpc/tm.c" and add a test to check if > > the fix > > has been applied to the host kernel. If this fix hasn't been > > applied then > > the test will never complete and the cpu will be lost. Otherwise > > the test > > should succeed. Since this has the ability to mess things up in the > > host > > mark this test as don't run by default. > > > > Based on initial work done by: Cyril Bur > > > > Signed-off-by: Suraj Jitindar Singh > > --- > [...] > > > > + /* > > +  * Begin a transaction and guarantee we are in the suspend > > state > > +  * before continuing > > +  */ > > + asm volatile ( "1: tbegin.\n\t" > > + "beq 2f\n\t" > > + "tsuspend.\n\t" > > + "2: tcheck cr0\n\t" > > + "bf 2,1b" : > > + : > > + : "cr0" > > +      ); > I now also tried to compile your patches, and looks like my standard > GCC > cross-compiler does not know about these mnemonics yet: > > /tmp/ccGEtgIa.s: Assembler messages: > /tmp/ccGEtgIa.s:96: Error: unrecognized opcode: `tbegin.' > /tmp/ccGEtgIa.s:98: Error: unrecognized opcode: `tsuspend.' > /tmp/ccGEtgIa.s:99: Error: unrecognized opcode: `tcheck' > > That's happening with the standard cross-compiler which is shipping > with > RHEL 7.2 (GCC 4.8.1 20130717). Could you please use ".long 0x..." > statements with the corresponding opcode values here instead, so that > it > also compiles with such older versions of GCC? I'll fix this up, thanks for the catch > >  Thanks, >   Thomas >