Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3157838pxk; Tue, 15 Sep 2020 11:31:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+RbMBfmr6vT/Cp8jbmgKZiNgWWoFly8jfsjl6i/1WyuTc/AxdiMYQ0Jx8f9++cSzYplW3 X-Received: by 2002:a17:906:3553:: with SMTP id s19mr20867573eja.178.1600194665042; Tue, 15 Sep 2020 11:31:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600194665; cv=none; d=google.com; s=arc-20160816; b=z+NvNLhOgLYoKDtmObmKmAkTH8yrOlkgWcbZitDszaQCMcM6Mb59tZQbTR01GY6k8U Koq2cjO9KG1vmK9/+wgiITVazWwHVlBdNUTpHObpvffqJujZapBemW8hbZHWCcLmHUnX S8AxveDexv/rqu1rcsu9T3HQsHTT7TV0fbkaruyJYpwg/tmV83PmLLOfKkb61bnYFVL5 /N1Ir+yjMb9pi73ZDh9uAwZDldcrAl+Www5eemj3UpWn1wWyHtHYSq73n1Xeox7co9fm O95qjD618g6H9WXs/Y/sfFXR7z90JHb3SwDS0ZJyUEZ3k2V2oZmbzJQGgQ0/AIz1MsiL sHSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=0HOksYl7KYGb0/Z/aOYhjWUD/dWuDEx2ok3TnQFcapw=; b=czBdjdAjR3lwMAeMi0G7I/K7GShW+7P+RC9hpU4Jh7r9mefu9GT77fDlmjgPpvaUg8 WB/IKatVDEPciYd4t3EgMCxVIkQ96J7GxhIZnMvX7XgZOKEQ04KMk7peDqzxidAnV7qQ jazzu6RyOLcv2ldyDpCkq8jpCd/aVYFZFr/vXbY6tP6dHsNqQrFQOtPPwb23UwVuqukb IqnCs+l9qKAJiK+DrnlAYFsUCCEMM9EONlj27COGYAfnVWGgmSOIoc5ErMw1WcGo7fFb sVA5sotNrZ9ZTDGW35yZhzIDI+Vr4/mdrE4Z7dB83+8wO/T1/VO/4uIzOYeAoN3uTRFQ XPkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=GOkFdSk4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id de17si10450991edb.89.2020.09.15.11.30.42; Tue, 15 Sep 2020 11:31:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=GOkFdSk4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728048AbgIOS1z (ORCPT + 99 others); Tue, 15 Sep 2020 14:27:55 -0400 Received: from mail.skyhub.de ([5.9.137.197]:53664 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727903AbgIOS1h (ORCPT ); Tue, 15 Sep 2020 14:27:37 -0400 Received: from zn.tnic (p200300ec2f0e42009474dca2b756bdd4.dip0.t-ipconnect.de [IPv6:2003:ec:2f0e:4200:9474:dca2:b756:bdd4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 1E8A91EC0246; Tue, 15 Sep 2020 20:27:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1600194452; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=0HOksYl7KYGb0/Z/aOYhjWUD/dWuDEx2ok3TnQFcapw=; b=GOkFdSk4VlXMHIJ+DBri4YMGuULYonokg+5IB9cp2PJrMzRazhKpCctRJGLsfqYm+xon6S wFMLm9SeTSoL9UTf3Tmofk1U1s5ERbMFYdE5q3zQvkxCV047mrq+IMV5ZJYROunEKmBiO3 WsF/BDtlC4XOlMtOPeIunnfzYywUweE= Date: Tue, 15 Sep 2020 20:27:30 +0200 From: Borislav Petkov To: Roman Kiryanov Cc: rjw@rjwysocki.net, pavel@ucw.cz, Thomas Gleixner , mingo@redhat.com, x86@kernel.org, linux-pm@vger.kernel.org, Greg KH , Nick Desaulniers , Alistair Delva , Haitao Shan , lkml Subject: Re: [PATCH] arch: x86: power: cpu: init %gs before __restore_processor_state (clang) Message-ID: <20200915182730.GW14436@zn.tnic> References: <20200915172658.1432732-1-rkir@google.com> <20200915174643.GT14436@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 15, 2020 at 10:57:16AM -0700, Roman Kiryanov wrote: > I believe the kernel makes a questionable assumption on how clang > uses registers (gs will not be used if stack protection is disabled). > Both kernel and clang behaves unfortunate here. If the kernel is at fault here and this same thing happens with GCC, sure, but this is a clang-specific fix. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette