Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp750192imm; Fri, 3 Aug 2018 10:51:36 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfmabQx4Pt26xHKXzpeo904WYw++LT7Q/d4wVOQKSlRxdagmsaryEQbvjm4g/bZ3FE4gU76 X-Received: by 2002:a65:60cd:: with SMTP id r13-v6mr4784706pgv.232.1533318696504; Fri, 03 Aug 2018 10:51:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533318696; cv=none; d=google.com; s=arc-20160816; b=UiPGI556zUXkIpf8Ly+ymeb0r6MC8w4qJQacTdL/c5yz+iDNCrokKEGzFw/8sL2mI+ 8wL6fdTnKxH5BGTQCmOC4gVr0Vs10Q6AasntB5k7qChBwVhn7xCBj2XoNYXAN/GpP4+j Jw1RberhCiJL7OErQvBpv3A6/TBA0U5cusHGTWhuw2D2XRUA+jzWgdUOLZQeKvuIQbsL KCONU6GPkabtVolfeBasZUp5Q77yJ1raihXc+7E7++OIjlkxOnu8MC+xU/LOPM1FvfoM pP2IkHLHUyYiBg5Sbo4TyIZ3U336/YKYHK7EH4knFX7jmMob+nDaLtxAXcz3jYR2hyD6 BTgw== 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 :dkim-signature:arc-authentication-results; bh=kMO8+EcrM9o+SBp4k6k3wddtkk+1DxpVGbVk0vB3aw0=; b=W742rHN7nwhlRJXzNWLjmRTE7Us/z8W/MGCm4UlDIh7U+xBBPAx/ajaOe+z3mEUiud wGp/4wYOZU55BmD5PSAgIOhG4xKzB5CdY8NX+BInJZj5Q6ttyKZI8eqZjCI13qk+/78w i10a+iofA785/ml8AZPnZdLVqWZXVZ3/0/mBgShKsc6qzCfN05F87bfkWd8ZieMJwhTR E+ouKIHLik3tuRL42qUL7TnH3udeuxMlvQrBbpPMjDf7tAiw4oOiV6eGUKNIhEv+8ipx 4KPQjrRIy2I1pwIX36JCqJFRjZtbWgEvwLWCzrWnHnUtqnRmIKi+kYJ3XQFrQyGZxsI3 93CA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=phqOH9PN; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s5-v6si4258901pgn.306.2018.08.03.10.51.21; Fri, 03 Aug 2018 10:51:36 -0700 (PDT) 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; dkim=pass header.i=@google.com header.s=20161025 header.b=phqOH9PN; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728794AbeHCTrV (ORCPT + 99 others); Fri, 3 Aug 2018 15:47:21 -0400 Received: from mail-io0-f193.google.com ([209.85.223.193]:39312 "EHLO mail-io0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727377AbeHCTrV (ORCPT ); Fri, 3 Aug 2018 15:47:21 -0400 Received: by mail-io0-f193.google.com with SMTP id o22-v6so5672651ioh.6 for ; Fri, 03 Aug 2018 10:50:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=kMO8+EcrM9o+SBp4k6k3wddtkk+1DxpVGbVk0vB3aw0=; b=phqOH9PNYKIzWDPHugxOP07ipKZjNAlq+ll0ttfCaL2VxfpgXZbJvGToYEGzMOci2e cvn80v3wDSdllt77uYy2+A/FpzIF6QjRslHFgg35efbtDhNW6/APjUNaH7X8PQ8XJGY7 nMLzzgAsXDDIBJL5YmOdpaUMRIoJTePzpVw/K9yR/mgMo1wWYedYYjGey58WvuzBKpoZ T4myELic9+4Ua9SVTukKtw4zAloXKw9o8DUIMulwGzRolgb/GbF8qBX73z27gAdCMrq6 MXNpLQ0voRWAekFjmsnZlBIqkrC4Doo9wnc78TpaiVHrQBxI1AxSZ6208lyUto+BNI+D PE3A== 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=kMO8+EcrM9o+SBp4k6k3wddtkk+1DxpVGbVk0vB3aw0=; b=Be7VwGxt9MtZ7wL3IZCIjBe7s0NHJGtj27RTg2bLyEKMVvAzUQZBe1KB8Ke+3D0NSZ cdmaIdtiLjHKxjPmzDD0RkWFPkR3mtYUl369bfj8I7LyEJQd1L16UTanYqlwT5RDvA6i /GZXnlANpIG+qpzb9SICwISSSnASQUk/TRBc3o9bKs5ykT5BH0dQsWVJzXwwETzBjELu URGDHGPAK/KP8dDUE67qGqKUW+WAynzrzrR+KyQsNSLlhbc0tnzyT9SjpXQRJ/hQ6nrt jBvbrQUBhA1fqpuw+8x7BtyhB1XbogZAVhOKXJKTlFMwqZnS5II7rzimzhGpYR7o/uRL xZhw== X-Gm-Message-State: AOUpUlFOGZ4NvPls86saYJg/jntYD+1dVK/JaWdhKJryr33hbVi7FH3W amcih6jgyfO1mgyE5iVP5mebeUulT2c5UDZZdXebVA== X-Received: by 2002:a6b:ac03:: with SMTP id v3-v6mr6928920ioe.71.1533318602031; Fri, 03 Aug 2018 10:50:02 -0700 (PDT) MIME-Version: 1.0 References: <20180803151035.238a19d2@endymion> In-Reply-To: From: Alistair Strachan Date: Fri, 3 Aug 2018 10:49:51 -0700 Message-ID: Subject: Re: native_save_fl() causes a warning To: Nick Desaulniers Cc: jdelvare@suse.de, linux-kernel@vger.kernel.org, mka@chromium.org, Arnd Bergmann , hpa@zytor.com, tstellar@redhat.com, sedat.dilek@gmail.com, jgross@suse.com, mingo@kernel.org, David.Laight@aculab.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 3, 2018 at 9:38 AM Nick Desaulniers w= rote: > > On Fri, Aug 3, 2018 at 6:10 AM Jean Delvare wrote: > > > > Hi Nick, > > > > It seems that this linux kernel commit of yours: > > > > commit d0a8d9378d16eb3c69bd8e6d23779fbdbee3a8c7 > > Author: Nick Desaulniers > > Date: Thu Jun 21 09:23:24 2018 -0700 > > > > x86/paravirt: Make native_save_fl() extern inline > > > > introduced a new warning (with W=3D1): > > > > ./arch/x86/include/asm/irqflags.h:16:29: warning: no previous prototype= for =E2=80=98native_save_fl=E2=80=99 [-Wmissing-prototypes] > > extern inline unsigned long native_save_fl(void) > > ^ > > > > Please fix it. > > Hi Jean, thanks for the report. David Laight also reported this > warning; he tested a patch I sent him overnight. > > Let me guess, you're using a version of GCC < 4.9? It seems that GCC > < 4.9 will produce that warning for extern inline functions without > previous declarations. > > I'll add your Reported-By tag to the patch that I will send out in a > few minutes. > > > Secondly, I am quite curious why you changed only native_save_fl() from > > static inline to extern inline, when native_restore_fl(), > > native_irq_disable() and native_irq_enable() are equally referenced by > > address in arch/x86/kernel/paravirt.c and thus should suffer from the > > same problem. Can you explain? > > This is a good point. With native_save_fl, we were not able to boot > the kernel at all. Maybe this was called from the boot sequence > (maybe Juergen knows more)? It seems that the other functions aren't > preventing us from booting, but maybe exercising other paths in > paravirt would expose such an issue? Or maybe paravirt doesn't have > the same calling convention requirements for those functions? The core issue these patches worked around was the automatic/heuristic generation of stack guard code by clang, which ended up clobbering %ecx/%rcx in a way not expected by the contract of the paravirt code. The only function affected by this problem was native_save_fl(), because only it has a C stack (and thus, has a stack that requires guarding). The other functions could have been converted at the same time, and they will have to be converted if (down the line) somebody adds C stack variables to them. But, for now, the patch series seems to correctly work around this issue. > Is there a standard testing procedure for paravirt? I'd be happy to > try it to see if we can expose more things that should have the same > cleanup. This bug was so obvious you just enabled CONFIG_PARAVIRT, built with CC=3Dclang, and booted the x86_64 bzImage on any qemu. The minute the paravirt alternatives were patched in, it exploded. > -- > Thanks, > ~Nick Desaulniers