Received: from eggs.gnu.org ([2001:4830:134:3::10]:52366) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxMwk-0007Oj-LU for qemu-devel@nongnu.org; Tue, 26 May 2015 18:03:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YxMwe-0007AJ-Jd for qemu-devel@nongnu.org; Tue, 26 May 2015 18:03:38 -0400 Received: from hall.aurel32.net ([2001:bc8:30d7:101::1]:51771) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxMwe-00078F-Dw for qemu-devel@nongnu.org; Tue, 26 May 2015 18:03:32 -0400 Date: Wed, 27 May 2015 00:03:29 +0200 From: Aurelien Jarno Message-ID: <20150526220329.GB12677@aurel32.net> References: <1432511251-22515-1-git-send-email-aurelien@aurel32.net> <1432511251-22515-9-git-send-email-aurelien@aurel32.net> <5563AB72.3070601@twiddle.net> <20150526060313.GC29207@aurel32.net> <556498A2.3050601@twiddle.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <556498A2.3050601@twiddle.net> Subject: Re: [Qemu-devel] [PATCH 08/10] target-s390x: implement STFLE instruction List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel@nongnu.org, Alexander Graf On 2015-05-26 09:00, Richard Henderson wrote: > On 05/25/2015 11:03 PM, Aurelien Jarno wrote: > > On 2015-05-25 16:08, Richard Henderson wrote: > >> On 05/24/2015 04:47 PM, Aurelien Jarno wrote: > >>> Cc: Alexander Graf > >>> Cc: Richard Henderson > >>> Signed-off-by: Aurelien Jarno > >> > >> Sadly, implementing this breaks current kernels. > >> I did this about two years ago and havn't figured > >> out what to do about it. > >> > >> The silly code in head.S doesn't check for just the > >> facilities that it needs, it checks for all facilities > >> that specific processors provide. > >> > >> If we don't e.g. pretend that we have HFP, despite the > >> fact that no one uses it, the kernel won't boot. > > > > How does it breaks? This patch only enable bits corresponding to > > facility that we fully implement (that's a reason why the patchset > > doesn't enable LD facility for example). So it should not be a problem, > > at least I have been able to boot kernels successfully. > > > > Unless the facilities provided are a strict superset of those required by the > kernel, it aborts the boot. Extremely early in the process. As Alex said, > it's possible to compile a kernel without this, but none of the vendor-built > kernels do so. Which raises the bar to what a user needs to do to install. > > See linux/arch/s390/kernel/head.S, Ok, I understand now. That said I don't see how implementing STFLE will break that. I think it will actually improve things by enabling more facilities and thus making the kernel happier (but maybe not enough). > # List of facilities that are required. If not all facilities are present > # the kernel will crash. Format is number of facility words with bits set, > # followed by the facility words. > > #if defined(CONFIG_MARCH_Z13) > .long 3, 0xc100eff2, 0xf46ce800, 0x00400000 > #elif defined(CONFIG_MARCH_ZEC12) > .long 3, 0xc100eff2, 0xf46ce800, 0x00400000 > #elif defined(CONFIG_MARCH_Z196) > .long 2, 0xc100eff2, 0xf46c0000 > #elif defined(CONFIG_MARCH_Z10) > .long 2, 0xc100eff2, 0xf0680000 > #elif defined(CONFIG_MARCH_Z9_109) > .long 1, 0xc100efc2 This one looks a bit complicated to reach. Basically we need to implement STFLE, MSA, HFP and ETF2, 3 and 3e. But I guess that's something doable on the medium term > #elif defined(CONFIG_MARCH_Z990) > .long 1, 0xc0002000 For this one we only miss one instruction in the LD facility. I have it on my TODO list, though it might take a few weeks until it goes to the top. > #elif defined(CONFIG_MARCH_Z900) > .long 1, 0xc0000000 This corresponds to the current value we provide. CONFIG_MARCH_Z900 also correspond to the configuration of the Debian kernel, that's why I am able to boot kernels. -- Aurelien Jarno GPG: 4096R/1DDD8C9B aurelien@aurel32.net http://www.aurel32.net