Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1464396ybl; Thu, 5 Dec 2019 01:43:54 -0800 (PST) X-Google-Smtp-Source: APXvYqwFgt0uI6zwbB00bmxmKKtWSSICvzQCJGaNBrOZF4uKNEfcY92q418MBAE3GHnEVTu8nC5n X-Received: by 2002:a9d:1b4e:: with SMTP id l72mr5976819otl.345.1575539034427; Thu, 05 Dec 2019 01:43:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575539034; cv=none; d=google.com; s=arc-20160816; b=mj5cEncj01Qssbe9NQCsE6+ExBIVY95NllQa59pudoMvI5dBhOgQ/dJL69oRf8R5yu 4CLaO/+Nouh7HV3HWBqg5LmkyH5H+UAUdoz2vvT8hef4gZ8Ixl9EkOgfP8u6Av36V+pR T3lTdDQk2p0+BxyhVd7+ujOVAG6kFCBaFWtT0oVluhq3gn1cGKfqz5KnuUkeVawZR3Xi dWxpvQ7wWoGKIx5kNmClwZkjVKvqM3CypsM4VNwFecIvZDVlzkPaRdHwTt9HFvS3z3m/ 43m3wf08YBHQurYS7pHRBZtURqfddccTrF7iOiZsRoKFMAPmu1joPrHbsXQIDFSpnB2X IZLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=oz29yDAijnMxqeeP/ANeD3gYyzEDIeRkmjbTy/5gPeo=; b=qwAZnQaEnNdNe2nqrmAmPG7oe4UCvmECIF6QmMOttEmIjGRL8IIVx+817WU2O3xmsj AMo2w0lNMUpMlrTx86nH8kwgwYD0yr5XBTxzF3h0MSgElbp8F9FTODp1MymED0eE2Ch6 tEjIozV9Zy2WzfNr8MKrgiXhSZkvrGRI85h5p1gYCyWSZjuYZllqqiKhulc5lAhMJAgk Wcg5syWRxtsoE9DgmRrRWLCcUnjHPm4yUC9Ugr5fuAcZqz6esjr182XlzuVmOqQNKooA NOnC1HRP33nvFli1M6bFdYZ84k6SQ31QLKQQ4eV5XwWDUvpV7i3xLNgAV2/YxPJAy29O i6hA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g6si4369204otb.231.2019.12.05.01.43.42; Thu, 05 Dec 2019 01:43:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729169AbfLEJmx convert rfc822-to-8bit (ORCPT + 99 others); Thu, 5 Dec 2019 04:42:53 -0500 Received: from mail-yw1-f65.google.com ([209.85.161.65]:40982 "EHLO mail-yw1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726239AbfLEJmw (ORCPT ); Thu, 5 Dec 2019 04:42:52 -0500 Received: by mail-yw1-f65.google.com with SMTP id l22so944168ywc.8; Thu, 05 Dec 2019 01:42:51 -0800 (PST) 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:content-transfer-encoding; bh=kEo6iDTk72UPkuZt6wUZlPDmPtU2DQIfzehH/YGLNyo=; b=GHepMebT9XToFw9eC1u3ojJY7qk38u5TOQWVeNCZcWFrIdZgCI1ZVPFZaqF0egLlOC Ht5QRBBy5443ObKm8hgNMkbggolpX3boR/MoQox5B6oAsu9fDA2RZSl9KPLalqRnDSRK TOWFr9nEAUQLwt7P6QVnFUdDjJIVH8qW67q7xnmqKQPTYbqWrFw//TGKfsu0PmN7Q/12 WZ49ouvW3Dj++2VKlbTQ4NbHr24X1vLdm77yUODybu7thZSfwcefsR9ad5p4fu41y4aI QbggRwjWaKQiTKEDRzZ7WRI+eZFrU7JcgeTNspB1wckXs9tJJ5y88gXWz1niiR/zoioC iVLw== X-Gm-Message-State: APjAAAVy16xwBZ2dRWfdEQ4C9QP+fkd26uZPISEQEMZeultQo2cDDp5s GeGuBVofwaDRuvQ3T73nHbbDLh/Zd1sNaJrN78c= X-Received: by 2002:a81:98c6:: with SMTP id p189mr5176776ywg.443.1575538971148; Thu, 05 Dec 2019 01:42:51 -0800 (PST) MIME-Version: 1.0 References: <20190621095252.32307-1-vincenzo.frascino@arm.com> <20190621095252.32307-17-vincenzo.frascino@arm.com> <20191204135159.GA7210@roeck-us.net> <6cdf4734-4065-09c1-8623-1bf523b38c1b@arm.com> <20191204161641.GA28130@roeck-us.net> In-Reply-To: From: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= Date: Thu, 5 Dec 2019 10:42:40 +0100 Message-ID: Subject: Re: [PATCH v7 16/25] arm: Add support for generic vDSO (causing crash) To: Vincenzo Frascino Cc: Guenter Roeck , linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, open list , "open list:BROADCOM NVRAM DRIVER" , linux-kselftest@vger.kernel.org, Catalin Marinas , Will Deacon , Arnd Bergmann , Russell King , Ralf Baechle , Paul Burton , Daniel Lezcano , Thomas Gleixner , Mark Salyzyn , Peter Collingbourne , Shuah Khan , Dmitry Safonov <0x7f454c46@gmail.com>, Rasmus Villemoes , Huw Davies , Shijith Thotton , Andre Przywara Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 4, 2019 at 6:23 PM Vincenzo Frascino wrote: > On 12/4/19 4:16 PM, Guenter Roeck wrote: [...] > --->8--- > > Author: Vincenzo Frascino > Date: Wed Dec 4 16:58:55 2019 +0000 > > arm: Fix __arch_get_hw_counter() access to CNTVCT > > __arch_get_hw_counter() should check clock_mode to see if it can access > CNTVCT. With the conversion to unified vDSO this check has been left out. > > This causes on imx v6 and v7 (imx_v6_v7_defconfig) and other platforms to > hang at boot during the execution of the init process as per below: > > [ 19.976852] Run /sbin/init as init process > [ 20.044931] Kernel panic - not syncing: Attempted to kill init! > exitcode=0x00000004 > > Fix the problem verifying that clock_mode is set coherently before > accessing CNTVCT. > > Cc: Russell King > Reported-by: Guenter Roeck > Investigated-by: Arnd Bergmann There are only 2 "Investigated-by" vs 7k+ "Suggested-by"... Is there a real difference? > Signed-off-by: Vincenzo Frascino > > diff --git a/arch/arm/include/asm/vdso/gettimeofday.h > b/arch/arm/include/asm/vdso/gettimeofday.h > index 5b879ae7afc1..0ad2429c324f 100644 > --- a/arch/arm/include/asm/vdso/gettimeofday.h > +++ b/arch/arm/include/asm/vdso/gettimeofday.h > @@ -75,6 +75,9 @@ static __always_inline u64 __arch_get_hw_counter(int clock_mode) > #ifdef CONFIG_ARM_ARCH_TIMER > u64 cycle_now; > > + if (!clock_mode) > + return -EINVAL; > + Reviewed-by: Philippe Mathieu-Daudé > isb(); > cycle_now = read_sysreg(CNTVCT); > >