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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2CDFC433F5 for ; Wed, 17 Nov 2021 09:03:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 803F461BC1 for ; Wed, 17 Nov 2021 09:03:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231527AbhKQJGq (ORCPT ); Wed, 17 Nov 2021 04:06:46 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:41841 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230064AbhKQJGq (ORCPT ); Wed, 17 Nov 2021 04:06:46 -0500 Received: from mail-wr1-f46.google.com ([209.85.221.46]) by mrelayeu.kundenserver.de (mreue011 [213.165.67.97]) with ESMTPSA (Nemesis) id 1MtO4E-1mX7eO42By-00uodY for ; Wed, 17 Nov 2021 10:03:47 +0100 Received: by mail-wr1-f46.google.com with SMTP id d27so3193352wrb.6 for ; Wed, 17 Nov 2021 01:03:46 -0800 (PST) X-Gm-Message-State: AOAM530lYkovpFOo2hct/Jw7IdkT6w/KXAJGEnqoTdmQFjgYH3BDwq9s ropM57ekqI4PGhHIcSb9VzO4lQDVtaNZEnszVqI= X-Google-Smtp-Source: ABdhPJyZ82B8sSfeqa/TtX/Pu/WgS8dWF75L248Ix9mceRxYb/w+jueVIOtVLiM0OncmzyFdrW6JDUWi5mOjzd/fsB0= X-Received: by 2002:adf:f088:: with SMTP id n8mr17873835wro.411.1637139826630; Wed, 17 Nov 2021 01:03:46 -0800 (PST) MIME-Version: 1.0 References: <20211115111816.3911213-1-ardb@kernel.org> <20211115111816.3911213-8-ardb@kernel.org> In-Reply-To: From: Arnd Bergmann Date: Wed, 17 Nov 2021 10:03:30 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 7/7] ARM: implement support for vmap'ed stacks To: Tony Lindgren Cc: Ard Biesheuvel , "Russell King (Oracle)" , Guillaume Tucker , linux-omap , Linux ARM , Nicolas Pitre , Arnd Bergmann , Kees Cook , Keith Packard , Linus Walleij , Nick Desaulniers , "kernelci@groups.io" Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:2yUIM5GS5YUamRgKIV8k/UrkYuqScsfU9Um3ysXAJUy67A5sIoa dzM9hKResgAvsl6YtAaKVNLESnS/CwFwranDNLnB+nKNCxa/95KyWsQkFTe2bdzGBfmQ2cQ WsTLB1QGvyLkJcUf1hYoxMpcJxHDDzELTRxe6b/BgSybVuefbhhaBb2y1w9Jj+d0nG/vv5W mDJYHQWNnBHgn9FriCm3g== X-UI-Out-Filterresults: notjunk:1;V03:K0:NCnmUsITBcU=:SsU711TScOnfSda85GVocl +48WES3GMpfQdeXexhZMT48rk8tWOmfEAEOctRBu+a/Gh00PQI+g36fEWVN15OftgE3QIrtkj EKu4Nu0YuCqYWoYmwzmbVSpVBq3hd4EKDGn/u5SrJbbHuTmyzNUBkyAGgwF374K3yXbG0BMLw cIycmdOeJK99rZ/7/78J+mi3UJQZR/0JGOCmNXAvDAr16XWFl+ME5eZa20dkXKCgsihmN+Yw1 z1Qxt6eEXxsxVg7qs7NSrGPi85P+A2Hg3RHZV630iDzUd78av4tpC5cbEW+PmsM9qXC0GYear BgzS6XPepFtIh6TzGblFsIk4dFY8XPGVS2yJS0pf28vWmESA5PmnP20JaZkCu+N0rCzEc9rEE BykJrQaZ/NRJjd7kpO673M6pURnJcf/Oqv+vD7J0gQPR5xZ9rABPGnBg094ITjZ3I7rF7l40l mWYIOuX/1B4G9nSzE1B1mEkfYBuHY70ib52wCp/ap53mYisdVOCCo6MQx4DONBKLwz92mEo9s MEkz9AH3uGT/j1nx9hnQYWqV5pds144ETIojSuUHpqI0VWVn7homnwzTQUcleYzfB1sMWbUwj lcjuYLLwP5bchoOObvit3RbLl2yasbd4eMt1mWOtMBUl9pUkPyCktdXNxQdBmUNSf45dna+7T vKla2WJuHPDerRLCnqQkD+lloIUpUGiU6gSNCI90Q1jzscFh5CAsVaef7c3WI/dehebokqC40 L3vnZbjAkcBZNqsJYR3TdGNVtbKaTM4ygGMK3M9bYnSX9Cm6aFZHhOsVQHAze9HjHWfqxESVD VHch4vwx+H00PosksoyG/5rSJNN9TRw0i+tNidU7cEfUNCU7KQ= Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org On Wed, Nov 17, 2021 at 9:36 AM Tony Lindgren wrote: > * Ard Biesheuvel [211117 08:29]: > > > > Thanks Tony, that is very helpful. I have a Beaglebone white somewhere > > so I'll try and reproduce it locally as well. > > I think with Beaglebone you may hit this only with suspend/resume if at > all. On am335x cpuidle is not shutting down the CPU. And only some models > will suspend to deeper idle states as it depends on the PMIC. > > If you have some test patch to try, just let me know. I looked at how the sleep code is called and found that cpu_suspend()/ __cpu_suspend() has interesting manipulation of the stack pointer to call the platform specific function with a simple 1:1 page table, I would expect the problem somewhere in there, haven't pinpointed the exact line yet, but if any of that code tries to local the physical address of the stack using virt_to_phys or its asm equivalent, this fails for a vmap stack. Arnd 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E465CC433EF for ; Wed, 17 Nov 2021 09:06:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AA1AA61BF8 for ; Wed, 17 Nov 2021 09:06:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AA1AA61BF8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arndb.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3np7TWTnKmkIZzUSw2zzXBVizs7kbuUlEcNHT3e6N+s=; b=BqWhWkYG1lYWsh nzOxyeahsXJgJW/5fdmK+wGEEPdyuYGJoGFYSBzhj2aYEda6tGq/7GPLoH4GlDXf1GFJVdQnIAqJ6 WsxPb9XeL0zbtRg6tkELlbf8z0QFsvKoghbGjUwxcHcnpKY08v2Q1+ychVMUA0aY/nyOFRSF8w1l6 CtXVz2qjAHnZW6FZX4M659EQrAz8bgDoP7VIWBc/HMRB+DajbLYr077Sird40m49+ELi/1sA93Jrt +eOaO64GQM0g3zHCT9le+7cFnrewRJzqgvOszll94nKLwo7pPmjxhpr6GOuo9LKKH6x6BP3hUe5XH 3NIMZ78b8MVzrZVq9xOg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mnGs4-0045CE-Ua; Wed, 17 Nov 2021 09:04:49 +0000 Received: from mout.kundenserver.de ([212.227.17.10]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mnGr7-0044eN-Fm for linux-arm-kernel@lists.infradead.org; Wed, 17 Nov 2021 09:03:51 +0000 Received: from mail-wr1-f41.google.com ([209.85.221.41]) by mrelayeu.kundenserver.de (mreue106 [213.165.67.113]) with ESMTPSA (Nemesis) id 1MHnZQ-1mrAai4Bk6-00EsGo for ; Wed, 17 Nov 2021 10:03:47 +0100 Received: by mail-wr1-f41.google.com with SMTP id b12so3208163wrh.4 for ; Wed, 17 Nov 2021 01:03:46 -0800 (PST) X-Gm-Message-State: AOAM531v9SS+sL274SYlqiKOljvW6V1nLWEsbaxG7N+CNYRmeLwyZz7w WVKJEJrNNUQb6mCtGmU6MOVZ3I233Q/Dx/DOJkc= X-Google-Smtp-Source: ABdhPJyZ82B8sSfeqa/TtX/Pu/WgS8dWF75L248Ix9mceRxYb/w+jueVIOtVLiM0OncmzyFdrW6JDUWi5mOjzd/fsB0= X-Received: by 2002:adf:f088:: with SMTP id n8mr17873835wro.411.1637139826630; Wed, 17 Nov 2021 01:03:46 -0800 (PST) MIME-Version: 1.0 References: <20211115111816.3911213-1-ardb@kernel.org> <20211115111816.3911213-8-ardb@kernel.org> In-Reply-To: From: Arnd Bergmann Date: Wed, 17 Nov 2021 10:03:30 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 7/7] ARM: implement support for vmap'ed stacks To: Tony Lindgren Cc: Ard Biesheuvel , "Russell King (Oracle)" , Guillaume Tucker , linux-omap , Linux ARM , Nicolas Pitre , Arnd Bergmann , Kees Cook , Keith Packard , Linus Walleij , Nick Desaulniers , "kernelci@groups.io" X-Provags-ID: V03:K1:uIFDqbwjofkIAmZ3VVcA5M6Gj3qR2nklDHOIfvauyLyZKXBUhoS rEC2wNCDSysRPkKYGm0lrmc3Wd6kG7/rwx7Geh/QnauszTUTq0bR3q8vpHdS7J9e6mNrhEB 1tHJ9SZAclIhrq8yydiPITt/jMrqC9Ndhh0CeGG1BHw9mfySoj0GgqRdXMe7Hp0vmkQa9rB nA6CSjRW9K87LHKXdQxdg== X-UI-Out-Filterresults: notjunk:1;V03:K0:rLiKjx2Bt64=:uTa4Xkz2LOoYzY+FJcD3DB 38+9nwsypLsHZT4sYSHMXYvnt4CIAFaVLcg3dWbCZ9uvfaC1Qqr7TNE1OTRp8FK4vcnu0ygMk 4IzSZtwCjZPWJR4vapkdlkKor6FMacoiPEWLDtmkuMxW0VQMlRVOlBQzWivDYCR0aiAtixkC2 V4Qicp/Uy3UiIrMrEy06m2TTDaFNd7SfiMvQUGnG9moD++EJYFhG29Yr1tV0nEkeTd15DNFZq 0r2Ldk3S/18UYYrEoOhnEVrspla9HQ4jHBqNOPqQrRqoA0H7a/ZosmPD8SMcbRq4eJDJHVxTN +ORWiJXT07ArqtQ5Dp4IaHgVWlKh0HGjyYrt5DR3UWIDhaNPUDqfkPa/DD6btHk+nZbnCu0ID bT7BML2Ju/jfsS/ti9lSS2xieDbUMFc0LQImztRYet26khIS3Fgm73E9OI4fqu97GlBG+uzMc 1JOnLfAIjNZU4CUJmZRA3HDzI90nH09DMzNJLfIrAwS25WTDndJ+W7kvWcJqzWmfgGtyXHuxY kkyAN2xe/2WlhtsebCVhfYfeVw+5pKwtbA1t9SLnjbIQh910oJh6h+z57JEudnKXJgXmyReCB nwG268xZctpZL7aT2ng8aVqvPat3n60UwJW+hU9AKga8KpPoNDDjoG7w4W5bTVOvQ0hAWoB1n A87/RkVO5JY1XplcsKT0x7RD7wzyXtjTk//jdYTKxw78aLDIxkjn8hczGLBC7pHXLkZkpzsEG aHsi2d3Q8JkjTXLAf58uEe6lceUmyiqLJFrBVNRVsJar6t1VwCiThG86WjrcU8no76ccN5VH1 1KSaYYjPyCcq5aum5UoV069GzhNIEf/QTlwAgbvIgd6XvPvOV8= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211117_010349_863390_E91C03FA X-CRM114-Status: GOOD ( 18.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Nov 17, 2021 at 9:36 AM Tony Lindgren wrote: > * Ard Biesheuvel [211117 08:29]: > > > > Thanks Tony, that is very helpful. I have a Beaglebone white somewhere > > so I'll try and reproduce it locally as well. > > I think with Beaglebone you may hit this only with suspend/resume if at > all. On am335x cpuidle is not shutting down the CPU. And only some models > will suspend to deeper idle states as it depends on the PMIC. > > If you have some test patch to try, just let me know. I looked at how the sleep code is called and found that cpu_suspend()/ __cpu_suspend() has interesting manipulation of the stack pointer to call the platform specific function with a simple 1:1 page table, I would expect the problem somewhere in there, haven't pinpointed the exact line yet, but if any of that code tries to local the physical address of the stack using virt_to_phys or its asm equivalent, this fails for a vmap stack. Arnd _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel