From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966016AbdDZWFN (ORCPT ); Wed, 26 Apr 2017 18:05:13 -0400 Received: from mail.skyhub.de ([5.9.137.197]:36740 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935817AbdDZWEw (ORCPT ); Wed, 26 Apr 2017 18:04:52 -0400 Date: Thu, 27 Apr 2017 00:04:48 +0200 From: Borislav Petkov To: Juergen Gross Cc: linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, x86@kernel.org, boris.ostrovsky@oracle.com, hpa@zytor.com, tglx@linutronix.de, mingo@redhat.com Subject: Re: [PATCH] x86/amd: don't set X86_BUG_SYSRET_SS_ATTRS if forced to zero Message-ID: <20170426220448.sjsg4f7odacb2uz3@pd.tnic> References: <20170425180014.7533-1-jgross@suse.com> <20170425182443.3ab75tkfosol2yk4@pd.tnic> <20170425191809.uvdt4jimnbvqbyf2@pd.tnic> <24b7ab61-69e6-192e-5bb7-2ef5cdaa28c3@suse.com> <20170426063556.vc2zmns3uscubuim@pd.tnic> <88dfeccc-61e9-20a7-e188-c3e5cb0f55d3@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <88dfeccc-61e9-20a7-e188-c3e5cb0f55d3@suse.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 26, 2017 at 08:24:12PM +0200, Juergen Gross wrote: > I'm not feeling strong about it. So if you want to test for > X86_FEATURE_XENPV to avoid setting X86_BUG_SYSRET_SS_ATTRS I'm fine > with it. > > Will send V2 with that change. And remove the corresponding clear_cpu_bug(c, X86_BUG_SYSRET_SS_ATTRS); in xen_set_cpu_features(). So that we can set it once, only on !XENPV feature set. /me looks again at the code... Gah, except that we do set_cpu_cap(c, X86_FEATURE_XENPV); and that runs as part of init_hypervisor() and it runs *after* c_init(). So, back to square one. :-\ So lemme try to explain again what I mean: I'd like to have a generic way of detecting whether I'm running as a xen guest at ->c_init() time and depending on the result of that detection, to set X86_BUG_SYSRET_SS_ATTRS or not set it. Does that make more sense? Thanks. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.