From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66262C54EBC for ; Thu, 12 Jan 2023 14:53:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240149AbjALOx2 (ORCPT ); Thu, 12 Jan 2023 09:53:28 -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 ); 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 ; 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 To: x86@kernel.org, Joan Bruguera Cc: linux-kernel@vger.kernel.org, peterz@infradead.org, Juergen Gross , "Rafael J. Wysocki" , xen-devel , Jan Beulich , Roger Pau Monne , Kees Cook , 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Joan Bruguera 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 Signed-off-by: Peter Zijlstra (Intel) 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 #include #include +#include #include #include @@ -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; }