Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3172963pxk; Tue, 15 Sep 2020 11:58:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6cK+cx3+OxuCOcSbKG2MgDLayTk3AC7D72g0cbWUpvt+vjnjiwbGRsC1yu5KLl0GZx4/A X-Received: by 2002:a17:906:5046:: with SMTP id e6mr22770096ejk.449.1600196301077; Tue, 15 Sep 2020 11:58:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600196301; cv=none; d=google.com; s=arc-20160816; b=pq2PBshc+PNOsVbWD5qaP+7b3zm+fR0tL8l719YgSf+IUm2gVD1Zv66+MDOCtTZXjC 0r71+Y79p+0zovjrt9IEVl1Url7bVhvgxmMrfPLUQO73TzessZvVPEuXy93pDShjUQla nixmQ547xN8bNc5gPsUlPPP/XC1P2G58VknQPRUv9wawpTBVm2RKu5jPxVLXVN174Ib9 Pxr1kQmCBdI14HNTiM3Sx6OsOE2T9MCEH1+iTY6TUdzG5A1BluJ//6sYP6RC5bMSRDPl 0IVa75T9tralRnchfslxo3SnQPDEPcrSdye2Mdps2UYIKD0oYWUny4f9EIhqt/ra4V6B uHbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=FXsyDbVr5yEsb37wNopfWhpCBZv90Q/bsc2OJ00Cmiw=; b=kbtdhS/ZcDPpR+LgnSAQtK+ubFgS1TArIgyVzifUHAxMKrXCgj/oD7hF3QRgzNRFE7 ybdD+zX+tN+RNQDIySS2gr8Y2rnlFuQlUFtqeVZlp7hJ6V523LjXWzxQsbPXN4s5ZW6D Djzlyz7aWOxFMQGcndJqKDtOaSdBKTwLXh+/xrc2g2BVyevygnpQbt9JeIIZC4RHVNQV D09hvS05FGJpyLH6wu35knY0xtOpIWX5XwGZ6BmUFVzvuk2yJbjYLWhCvSdfm3EszGk8 xr9cgPRvLveuAlDCgkoxW4ogYTN9bdu1ak92Jbmx7sAMQ5OWY0LLoL+GuwmuGP22/cMD fd8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=tfc56KAY; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b12si2160280edq.127.2020.09.15.11.57.58; Tue, 15 Sep 2020 11:58:21 -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=@google.com header.s=20161025 header.b=tfc56KAY; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727540AbgIOS5U (ORCPT + 99 others); Tue, 15 Sep 2020 14:57:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727875AbgIOSzg (ORCPT ); Tue, 15 Sep 2020 14:55:36 -0400 Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79883C06178B for ; Tue, 15 Sep 2020 11:55:35 -0700 (PDT) Received: by mail-lf1-x144.google.com with SMTP id m5so4237583lfp.7 for ; Tue, 15 Sep 2020 11:55:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FXsyDbVr5yEsb37wNopfWhpCBZv90Q/bsc2OJ00Cmiw=; b=tfc56KAYUnr6MuSg1LOpNOvk677yL0xfXUFKSEWmhSp0iLOCMpKRw24XQ/uXi5WH2z OXnjyddTjvT93gML0OPEuCOCD0MFczZlHboO0q7qCzMEeYToXjrOWzuPv0Z677j//Pl5 0TAJ6WrdOacGo05o/EYFU8VA5o/XhZ6R+NKOjhCK2Yf4h2/4chJMF9OKQIxNcQ5b/xtl /ldi1rAWLWHQV+0BJrKusQBj1XBYcXzZYgJBxwKLJ4LODVJAtyCZL9XC6lifrNvBrSMS amFM3H5Wj2HpS9oS+Dzsyvd2F68bIP2iBDm3ygR7kI2yHXZe/rDD/AxJc/P5cdq0TLTb g4Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FXsyDbVr5yEsb37wNopfWhpCBZv90Q/bsc2OJ00Cmiw=; b=MFHQdgYUx6aftX+cnVvscFLsIuYfu2MGRC8Vx0bzMOz0/VIZbANLUu4Z99VZ0cRK1k geYqpj8TzK5k+w6aOfl801+ZMt1yb1d79FfQR9dSkCUAdW5MUr/qlzYHyKVh/bLF1zg/ iDp0oP8Vc072Lsiy81WGpA7DIfYStR61mvSTg7NZYlSWC9G6t/yt8ZMhm+r4Ak6KnuFg ZCBwbqRBueyp/P3hrCQpWsk77Xb0a1GqetPeI0HxdWBm7v0gP7OtaNjneFvoloABqpIN ayKqbGZh/OFvZz8eS5sHhJ8Ll7PZ2KxkbGFWLuG2MztuaE1RnpvkrpaX/LpKSVgl2Z+9 IjQQ== X-Gm-Message-State: AOAM532jIxM30ObIhEOLXPrnLFa/jOobxAOihW4FKjSEnHPdrXq4W2c3 ymf+thkqE8O9ItkgYGfBlCIjE3SieYJEInr+CRFEWQ== X-Received: by 2002:a19:a41a:: with SMTP id q26mr6357544lfc.121.1600196133555; Tue, 15 Sep 2020 11:55:33 -0700 (PDT) MIME-Version: 1.0 References: <20200915172658.1432732-1-rkir@google.com> <20200915174643.GT14436@zn.tnic> <20200915182730.GW14436@zn.tnic> <20200915185210.GY14436@zn.tnic> In-Reply-To: <20200915185210.GY14436@zn.tnic> From: Roman Kiryanov Date: Tue, 15 Sep 2020 11:55:22 -0700 Message-ID: Subject: Re: [PATCH] arch: x86: power: cpu: init %gs before __restore_processor_state (clang) To: Borislav Petkov 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 Content-Type: text/plain; charset="UTF-8" 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 11:52 AM Borislav Petkov wrote: > > On Tue, Sep 15, 2020 at 11:36:13AM -0700, Roman Kiryanov wrote: > > This is fair. Unfortunately I am not an x86 asm expert. I expect the proper > > fix should land into arch/x86/kernel/acpi/wakeup_64.S to init %gs > > (maybe some more registers) before "jmp restore_processor_state". > > ... because "LLVM appears to be inlining functions with stack protectors > into functions compiled with -fno-stack-protector" and now the *kernel* > needs to init %gs? > > How about LLVM stops doing those wrong inlining decisions? This will remove the issue for a while until clang/gcc/other decides to use %gs for other purposes before the kernel initializes it. Regards, Roman.