Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2298865pxa; Mon, 3 Aug 2020 12:28:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRbRMyW9yD8Kibnpco77l6BznZiYu+7m6KpoOI3HCQRnbmIUyKFfp8vEbyORkp7I5SGyHx X-Received: by 2002:a17:906:c1d8:: with SMTP id bw24mr17770762ejb.91.1596482922868; Mon, 03 Aug 2020 12:28:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596482922; cv=none; d=google.com; s=arc-20160816; b=rk4IT4NO28QdbAPYVWXmxN25/CoaYwGhotz6B4q+Q30c+WiD5tqDzarPjjjeqiNU5V ZOgrj9jagTqzqCNsO58QMtviY//lmBJc5VI2BQWZrRXlymLBqRYRUsjV1k4CVwthrxgm 66CEvvV4B5QUYxf1kGWOGS3Xk9+MhHmJiY4ApIUK1N5/R4lzYGxOoUkmZyI8y7JNmj0n Nlpw4pgpAbve1KcO8LHGUCKmT5Pr3uFLh913L4CKq0myNP8jVdYZxAb23FnYdX1vugux cpliFHZlO/bJYb/p9a/fhtWYtpNCBGrOv30Rdkvo4rxeuxjxjlz5y9wpJtbG4H9eJTUt HPVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=bIfZVkgl4VVuKMo3PbC45J6WLkq9PVh31LMaoA7XSuQ=; b=wxmfNyyY//Dp01IamjUKxkxfMvEXKTrz7EFZxumHG2GaMQmpl9OV35fujnpgrWV6BI +2CuxT6jWbIbW7DChfVG8Br3yZ/WI4Gbr/Of1t4gLWIxaEXL48y1DmoL1qbMXTnqS0kR CXpFiW9XkPGznZf2jAmJ5oVCPXQ/HS+AsqSOqOfIMVXe4/2KkI/UKYYGmxl80SGKAJx6 sl0YPXPUb7TSA3a8eBaMyNB0f2SHa2+bjUxnnvR1SchnrnL6ywz3YYYu7YWPCOtkiB32 k3MBVTUKDbUWuRgBk0Lu71F7sq7yWOuUneUPIIcM/sz9aOAbvfPCxD9C+BKeUggoWOww /Sdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=yDsb61D0; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=VVXBx0Zb; 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=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k2si10905300edl.300.2020.08.03.12.28.18; Mon, 03 Aug 2020 12:28:42 -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=@linutronix.de header.s=2020 header.b=yDsb61D0; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=VVXBx0Zb; 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=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728081AbgHCT1o (ORCPT + 99 others); Mon, 3 Aug 2020 15:27:44 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:39108 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726889AbgHCT1j (ORCPT ); Mon, 3 Aug 2020 15:27:39 -0400 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1596482857; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bIfZVkgl4VVuKMo3PbC45J6WLkq9PVh31LMaoA7XSuQ=; b=yDsb61D0T2KVHL5+3IJvxPV7KgR6nyu3+1ZZpStsvdyU1xJv1JFNg4N12sumVDtBD4kD6s uVBbtCic+cw+eomU0RRogZYEhEkbyHpiwkjRVxv0gHs1s70xgh5iOG6okre1hOerCbzxZq GvlYAJFoJsRFO7/mSyW6OqVOusIaceUbAssm6IGADpx3fl9xrRtEfbBnjoHzWjhEUUQTXA yCFXTiucU7Il6u6SKWDIaKdzQPwrK0eU0u1/uJaD6KUrkKgxbiqbUb2M4Fb3dQW1fhSIx2 cNKI4ITsRE0rxj5g6nZclUHtmzHxRsDR+06GMAdDMVo4TsRHZ1WyaB/8FwHxWg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1596482857; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bIfZVkgl4VVuKMo3PbC45J6WLkq9PVh31LMaoA7XSuQ=; b=VVXBx0Zb0yel+Ld4MM02i6YTCyXdJqnmQzhhpnM8prGzxCuogsjeeG9TmCKzR+cvd0kY6Y vcH55OKZuzzX+vCQ== To: Heiko Carstens Cc: Sven Schnelle , Vincenzo Frascino , linux-kernel@vger.kernel.org, Peter Zijlstra , linux-s390@vger.kernel.org Subject: Re: [PATCH 2/2] s390: convert to GENERIC_VDSO In-Reply-To: <20200803184428.GA3973@osiris> References: <20200803055645.79042-1-svens@linux.ibm.com> <20200803055645.79042-3-svens@linux.ibm.com> <87ft93ncaa.fsf@nanos.tec.linutronix.de> <87a6zbn29n.fsf@nanos.tec.linutronix.de> <20200803184428.GA3973@osiris> Date: Mon, 03 Aug 2020 21:27:36 +0200 Message-ID: <873653mswn.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Heiko Carstens writes: > On Mon, Aug 03, 2020 at 06:05:24PM +0200, Thomas Gleixner wrote: >> +/** >> + * vdso_update_begin - Start of a VDSO update section >> + * >> + * Allows architecture code to safely update the architecture specific VDSO >> + * data. >> + */ >> +void vdso_update_begin(void) >> +{ >> + struct vdso_data *vdata = __arch_get_k_vdso_data(); >> + >> + raw_spin_lock(&timekeeper_lock); >> + vdso_write_begin(vdata); >> +} > > I would assume that this only works if vdso_update_begin() is called > with irqs disabled, otherwise it could deadlock, no? Yes. > Maybe something like: > > void vdso_update_begin(unsigned long *flags) > { > struct vdso_data *vdata = __arch_get_k_vdso_data(); > > raw_spin_lock_irqsave(&timekeeper_lock, *flags); > vdso_write_begin(vdata); Shudder. Why not returning flags? > } > > void vdso_update_end(unsigned long *flags) Ditto, why pointer and not value? > { > struct vdso_data *vdata = __arch_get_k_vdso_data(); > > vdso_write_end(vdata); > __arch_sync_vdso_data(vdata); > raw_spin_unlock_irqrestore(&timekeeper_lock, *flags); > } > > ? Just wondering. Thought about that briefly, but then hated the flags thing and delegated it to the caller. Lockdep will yell if that lock is taken with interrupts enabled :) But aside of the pointer vs. value thing, I'm fine with doing it in the functions. Thanks, tglx