Message ID | 20230112143825.704223863@infradead.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3923929wrt; Thu, 12 Jan 2023 06:54:07 -0800 (PST) X-Google-Smtp-Source: AMrXdXtrmrZU+CdI6QPBDb5peugyoMFl/M8tJhSBq6ONeqIooiNGRNkl2nkzE46G+7Hyv6CZ6eWy X-Received: by 2002:a17:906:7fc2:b0:838:9c66:cd2f with SMTP id r2-20020a1709067fc200b008389c66cd2fmr62235727ejs.74.1673535247181; Thu, 12 Jan 2023 06:54:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673535247; cv=none; d=google.com; s=arc-20160816; b=EnZ80Z/Yi+fP4w6jHr+36bm40JMW5FtEtoNHAkEhI1FkmxB9zpem6DpZrg+7h9O+oi pHwh6s+JYpTnU/v1IaR6hbTPnC8crJOq5S8jiCDkFzK4t62f/cP35Xv+1NaVzzs4R8Vs 9jaDUzmvdeFbc0kiYX5zuVmFG2Qa+iofeBpmKF9Z+WwQ65fsAuIVtXkEB9hoZO3BYZGA frzJY3jvS6Zcn+J1QKaTuq4mbDc8NJWVljO6iOzPg/4oA0NlGI0qFXKysAUjRe3Y5sKH I+iHOBmbiXm9YXcNjNtsLI3y5tAlQEaLKnpkAlatLkp5v2NnZwDteKbH9p4vV9n4aDAw 8+Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id:dkim-signature; bh=T4GElGxaw5tEx2Lk6kKh2cwaswlijZP7pkxV7zD03yo=; b=q5eHd3yplzB8y53sEvXvS18+zDQe+pkFlOM8B9f+glOjTv4OOTWJY1qX0PgHKMKaEb mJAYajB9AtW9t7wdqJaYMb4L6LD/7FUzMkCsmvxTXMZDPfvY/dQ/pMhdC0BfUrlUE8yc ME/rXqBraf0EulnD2ur4AHrI40y/sucsob9cpnUx9bGeSYbYNoEFFKEmIqSPbwM6zUiX ULS5Eyqwl3l3/gySuxq+/p0bawtpfQCJJOK9m8mNqnoRH+pj2Rsbv86d5HRvMVrNAqNc u5mFSBSMOoF1H3ik5wvi5BqqG/M3nfY6s3wnXnySl/Io67t/dm+JQMYQg4tatT3k9vZa y5cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=dWjbmZzw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id di15-20020a170906730f00b0078d805901b1si20196928ejc.489.2023.01.12.06.53.42; Thu, 12 Jan 2023 06:54:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=dWjbmZzw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240158AbjALOx1 (ORCPT <rfc822;zhuangel570@gmail.com> + 99 others); Thu, 12 Jan 2023 09:53:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239922AbjALOwu (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 12 Jan 2023 09:52:50 -0500 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 382FA61478 for <linux-kernel@vger.kernel.org>; Thu, 12 Jan 2023 06:39:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:MIME-Version:References: Subject:Cc:To:From:Date:Message-ID:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To; bh=T4GElGxaw5tEx2Lk6kKh2cwaswlijZP7pkxV7zD03yo=; b=dWjbmZzwf1WthR8TZ23ii1la+e yq8CeiWkZUYxPcP3zDoAdsjLQyUEFEwNBnojffsrWtXWwvZrVG3BvxUWfoXFoIemIzZBR3dchks7+ 30N+pLzv0Pq6fFF2X2CREioQEU6u9ZSI0QUhXVxyjoBTLRnevuU+BOKb90OE9rtHZxNFKkdIcFvCY 0iBTtIbHpzJidWwd/VU+wg+DB3e1nBkUqzz+681wC9mH4sjUCyB8tmW0qAnc1AaOtsfRWMMqx6gco h5cNcMDHwQrxlAKs+W9Qc14+/gh6t51ElNBLBGLZWjnaQvksAwmhxVjKsZ7qqyNZZupTDL6qmnpHt IQaqbR8A==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1pFyjS-0040tD-11; Thu, 12 Jan 2023 14:39:06 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id EC89A300C6F; Thu, 12 Jan 2023 15:39:12 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 0) id BAAF42CC8C6A1; Thu, 12 Jan 2023 15:39:12 +0100 (CET) Message-ID: <20230112143825.704223863@infradead.org> User-Agent: quilt/0.66 Date: Thu, 12 Jan 2023 15:31:44 +0100 From: Peter Zijlstra <peterz@infradead.org> To: x86@kernel.org, Joan Bruguera <joanbrugueram@gmail.com> Cc: linux-kernel@vger.kernel.org, peterz@infradead.org, Juergen Gross <jgross@suse.com>, "Rafael J. Wysocki" <rafael@kernel.org>, xen-devel <xen-devel@lists.xenproject.org>, Jan Beulich <jbeulich@suse.com>, Roger Pau Monne <roger.pau@citrix.com>, Kees Cook <keescook@chromium.org>, mark.rutland@arm.com Subject: [RFC][PATCH 3/6] x86/callthunk: No callthunk for restore_processor_state() References: <20230112143141.645645775@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754828895200885706?= X-GMAIL-MSGID: =?utf-8?q?1754828895200885706?= |
Series |
x86: Fix suspend vs retbleed=stuff
|
|
Commit Message
Peter Zijlstra
Jan. 12, 2023, 2:31 p.m. UTC
From: Joan Bruguera <joanbrugueram@gmail.com> When resuming from suspend we don't have coherent CPU state, trying to do callthunks here isn't going to work. Specifically GS isn't set yet. Signed-off-by: Joan Bruguera <joanbrugueram@gmail.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/20230109040531.7888-1-joanbrugueram@gmail.com --- arch/x86/kernel/callthunks.c | 5 +++++ arch/x86/power/cpu.c | 3 +++ 2 files changed, 8 insertions(+)
--- a/arch/x86/kernel/callthunks.c +++ b/arch/x86/kernel/callthunks.c @@ -7,6 +7,7 @@ #include <linux/memory.h> #include <linux/moduleloader.h> #include <linux/static_call.h> +#include <linux/suspend.h> #include <asm/alternative.h> #include <asm/asm-offsets.h> @@ -151,6 +152,10 @@ static bool skip_addr(void *dest) dest < (void*)hypercall_page + PAGE_SIZE) return true; #endif +#ifdef CONFIG_PM_SLEEP + if (dest == restore_processor_state) + return true; +#endif return false; }