Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751109AbdGZJkT (ORCPT ); Wed, 26 Jul 2017 05:40:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58882 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750880AbdGZJkS (ORCPT ); Wed, 26 Jul 2017 05:40:18 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 38D966B246 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=cohuck@redhat.com Date: Wed, 26 Jul 2017 11:40:14 +0200 From: Cornelia Huck To: Martin Schwidefsky Cc: Heiko Carstens , Guenter Roeck , linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Subject: Re: Qemu problems in -next with 's390/spinlock: add niai spinlock hints' Message-ID: <20170726114014.1f3cc5d6@gondolin> In-Reply-To: <20170726074044.41bdc796@mschwideX1> References: <20170726011451.GA24947@roeck-us.net> <20170726050033.GA3218@osiris> <20170726074044.41bdc796@mschwideX1> Organization: Red Hat GmbH MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 26 Jul 2017 09:40:18 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1827 Lines: 37 On Wed, 26 Jul 2017 07:40:44 +0200 Martin Schwidefsky wrote: > On Wed, 26 Jul 2017 07:00:33 +0200 > Heiko Carstens wrote: > > > On Tue, Jul 25, 2017 at 06:14:51PM -0700, Guenter Roeck wrote: > > > Hi Martin, > > > > > > my s390 qemu tests in linux-next stopped working a few days ago. > > > Bisect points to commit 's390/spinlock: add niai spinlock hints'. > > > > > > Looking at the patch, this isn't really surprising; at least to me it looks > > > like the patch is making instructions mandatory which are only available in > > > Z14 CPUs. Does this mean that older s390 CPUs (such as the Z900 used in my > > > qemu tests) are no longer going to be supported in Linux ? > > > > No, that means that the patch has a bug. The NIAI instruction is only > > available if the execution-hint facility is installed. That facility came > > with zEC12. Luckily it uses the same facility indicator bit like the > > miscellaneous-instruction-extensions facility, which we already use anyway > > if the kernel gets compiled for zEC12. In that case we have early code > > which verifies if all required facilities to run the kernel are installed, > > and if not it will print a message to the console and stop the machine. > > > > So the easiest fix would be to generate the NIAI instruction only if the > > kernel gets compiled for zEC12 or newer. > > Hmm, I though that NIAI is a NOP on older machines. FWIW, the upcoming qemu 2.11 (in tcg mode) will support to activate stfle bit 49 and generate NOPs for NIAI and friends. If I read the PoP correctly, the only correct way is to check for stfle bit 49 before trying to use NIAI. While a real zEC12 or later probably will have the facility, you can withdraw the feature bit via the cpu model when running under qemu.