Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1005788pxb; Sun, 11 Apr 2021 04:36:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7DkJFz8MTdL0ReKmfzmn+ZwMQP4Gyg8/Aunqlu7G3az1fy/MBSphlIWruotAAxoNhoGMG X-Received: by 2002:a17:907:629e:: with SMTP id nd30mr23263321ejc.407.1618141015718; Sun, 11 Apr 2021 04:36:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618141015; cv=none; d=google.com; s=arc-20160816; b=SaO1q5Irxs5AIxpfRvOxvOFCDRnUOZzxd6z1vTcPS6nK8LGITzl+CJ9mxUtPktxdki tA/2i7c+NZ/9yR72XhE2aAqqPU+S9hEjxZcuvHKa6e54UQxCV/dveAQFHtMeFGk1wy/s 6Ax/Q4MJ7EN6bA1Hy2kCG4ZcG1BapiDsTv28PIiCSagHAyGk5qLrrEKaEMSJItpA7W+r g8qQR49oEu7AaJdnIXcc3rUwvyAIB/fRzrQTnMi9jn4Iywpq8SnLpcU2iZK2zpVrlW2n ZpYwjCOMDovzKLQOVtK61dLCL4lj/EiqZkmg4sb08kdZVn6HWsstNSJQHPQa82T2sfqX kGGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=CZfsIKtOzdFy9xLsaT/zRBenU3ANxTtT10bF+wBe3SM=; b=s60Dl7r8DM7b4Ej/wvEJ7vIpOak4jxcTk3vqWeV5wyxrxCwZGT/CSwiVzFaTYpFcb+ kcGxZa8Zl9N4HfP4GG5CkMEWEmFeppRtlcMcGs6McYb9FYQJakjeiqnyelgDiGo9IALj OneEB9xOp6SUvBGYBuSoJEebbFd8Mwj4tWoRfmUsTDG/3U7NIeMJwEUOoJzam/RCX20R Kr4E33cOqdM4FkYzkLgUvFGKG+rwvWYKiPBeOKEgZhRpw6QUZSprwT0ctHf3E2DzVYDt Vsq3GlOD+aewBx3DSES7OR7K+bkF5dnwykg3zizBlyA85CrMZke9nRN2vxLCtBwbah7N 16lg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cw8si4742424ejc.338.2021.04.11.04.36.32; Sun, 11 Apr 2021 04:36:55 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235234AbhDKLWc (ORCPT + 99 others); Sun, 11 Apr 2021 07:22:32 -0400 Received: from mail.ispras.ru ([83.149.199.84]:41428 "EHLO mail.ispras.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233696AbhDKLWc (ORCPT ); Sun, 11 Apr 2021 07:22:32 -0400 Received: from monopod.intra.ispras.ru (unknown [10.10.3.121]) by mail.ispras.ru (Postfix) with ESMTPS id 2C31940D3BFF; Sun, 11 Apr 2021 11:22:14 +0000 (UTC) Date: Sun, 11 Apr 2021 14:22:14 +0300 (MSK) From: Alexander Monakov To: Paul Menzel cc: Joerg Roedel , Suravee Suthikulpanit , iommu@lists.linux-foundation.org, LKML Subject: Re: [PATCH] iommu/amd: Fix extended features logging In-Reply-To: Message-ID: References: <20210410211152.1938-1-amonakov@ispras.ru> User-Agent: Alpine 2.20.13 (LNX 116 2015-12-14) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 11 Apr 2021, Paul Menzel wrote: > > The second line is emitted via 'pr_cont', which causes it to have a > > different ('warn') loglevel compared to the previous line ('info'). > > > > Commit 9a295ff0ffc9 attempted to rectify this by removing the newline > > from the pci_info format string, but this doesn't work, as pci_info > > calls implicitly append a newline anyway. > > Hmm, did I really screw that up during my testing? I am sorry about that. > > I tried to wrap my head around, where the newline is implicitly appended, and > only found the definitions below. > > include/linux/pci.h:#define pci_info(pdev, fmt, arg...) > dev_info(&(pdev)->dev, fmt, ##arg) > > include/linux/dev_printk.h:#define dev_info(dev, fmt, ...) > \ > include/linux/dev_printk.h: _dev_info(dev, dev_fmt(fmt), > ##__VA_ARGS__) > > include/linux/dev_printk.h:__printf(2, 3) __cold > include/linux/dev_printk.h:void _dev_info(const struct device *dev, const > char *fmt, ...); > > include/linux/compiler_attributes.h:#define __printf(a, b) > __attribute__((__format__(printf, a, b))) Yeah, it's not obvious: it happens in kernel/printk/printk.c:vprintk_store where it does if (dev_info) lflags |= LOG_NEWLINE; It doesn't seem to be documented; I think it prevents using pr_cont with "rich" printk facilities that go via _dev_info. I suspect it quietly changed in commit c313af145b9bc ("printk() - isolate KERN_CONT users from ordinary complete lines"). > In the discussion *smpboot: CPU numbers printed as warning* [1] John wrote: > > > It is supported to provide loglevels for CONT messages. The loglevel is > > then only used if the append fails: > > > > pr_cont(KERN_INFO "message part"); > > > > I don't know if we want to go down that path. But it is supported. Yeah, I saw that, but decided to go with the 'pr_info("")' solution, because it is less magic, and already used in two other drivers. pr_info("") will also prepend 'AMD-Vi:' to the feature list, which is nice. Best regards, Alexander