From patchwork Tue Apr 10 08:43:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 133063 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp1072379ljb; Tue, 10 Apr 2018 01:45:18 -0700 (PDT) X-Google-Smtp-Source: AIpwx49X31kfhNGsrhuR2vm9evliFIXKZuOUm0Eqe8ZzV6kdEG88Ct+184MvdX2Q5LZsy5dWI13T X-Received: by 10.98.150.75 with SMTP id c72mr2016610pfe.62.1523349918339; Tue, 10 Apr 2018 01:45:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523349918; cv=none; d=google.com; s=arc-20160816; b=F5RRkRt96PJQGxL1ntwDfUuJpTHKKzOHlxeTpxBCHWSHxK+cjqUNnaRnc+7lL3pWBp beYmpBe2lVoU9pJpczizEeLl/twprj8iyexsgH2BURA2M+ugnnMOyis6WCFiStQXSk2n Qd+jUGTp4CW50gmSdqXKpUTZT6jlQt8CQb8qMEf9Gv2qCIKsi2O+SUB6CNMV/6Pu61zC ERa9bp5NKvrWFkFHUvUr4temthLgjdrCL2w+LXVuSEjX6mOsJrovWYjaCczGRblDwt8P JlwAWYm3Zq1CZGbENKRkYRbhwbw+qKm7K+Aq6GKD8Zm+xJhVjeDFJxt/Fqh1PgdvK5p8 5Mbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=1TX1YndiaS15fY+DWCvrN3xAeeW0FR61OjthACHPB8I=; b=v46JrHuIYC0X3yQvtJZ3P718ttSJVytXSYSznmAohxKoPIuFRylHqu/Dh1Enx5DdRs XcqYQC+4d6uRiVnyw+aZhyMOaRx0AbV+bzsM0pxbkR+nvUPgJY4Bh3QmS5jbOewJe6Ac ByKoy839lIbOH9XJrvHaWOLGEqSC4bfcxlUv9ZKCZ+mYfuRCv/lUEcQlfLAsGI75yXz4 969/Mz87gKU02uPAHwO4CStrm50J238djb8bnBcMihvxyLR4IIKl3k/DvIUk1Vwg9Mzn GzluLncuS9Dgyeo3y5tPKu0CdfwoZ3lz0F6FqXRd1TnPvu34qqyPrfe6bg7bmFG++JLv Hq7Q== 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 1-v6si2171068plw.86.2018.04.10.01.45.17; Tue, 10 Apr 2018 01:45:18 -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; 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 S1752586AbeDJIpO (ORCPT + 29 others); Tue, 10 Apr 2018 04:45:14 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:52357 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751966AbeDJIpN (ORCPT ); Tue, 10 Apr 2018 04:45:13 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.129]) with ESMTPA (Nemesis) id 0La0Mr-1ecUjv0aCr-00ljKW; Tue, 10 Apr 2018 10:44:26 +0200 From: Arnd Bergmann To: Thomas Gleixner , Ingo Molnar , x86@kernel.org Cc: Arnd Bergmann , "H. Peter Anvin" , Andrew Morton , Dave Hansen , linux-kernel@vger.kernel.org Subject: [PATCH] x86: fix pgprotval_t format string Date: Tue, 10 Apr 2018 10:43:59 +0200 Message-Id: <20180410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UJeZ99t MptFeyP+o2dDrnSAdM4GPhVCmM7z3jdYn2VJsg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 32-bit builds, pgprotval_t can be either 32-bit or 64-bit wide depending on the page table layout. In the latter case, we now get a build warning: In file included from arch/x86/include/asm/bug.h:83, from include/linux/bug.h:5, from include/linux/crypto.h:23, from arch/x86/kernel/asm-offsets.c:9: arch/x86/include/asm/pgtable.h: In function 'check_pgprot': arch/x86/include/asm/pgtable.h:536:5: error: format '%lx' expects argument of type 'long unsigned int', but argument 2 has type 'pgprotval_t' {aka 'long long unsigned int'} [-Werror=format=] To work around the problem, we can always print the value as a u64, and add the respective cast. Fixes: 64c80759408f ("x86/mm: Do not auto-massage page protections") Signed-off-by: Arnd Bergmann --- arch/x86/include/asm/pgtable.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.9.0 Acked-by: Dave Hansen diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index 50b207289ae1..5f49b4ff0c24 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h @@ -533,11 +533,11 @@ static inline pgprotval_t check_pgprot(pgprot_t pgprot) /* mmdebug.h can not be included here because of dependencies */ #ifdef CONFIG_DEBUG_VM WARN_ONCE(pgprot_val(pgprot) != massaged_val, - "attempted to set unsupported pgprot: %016lx " - "bits: %016lx supported: %016lx\n", - pgprot_val(pgprot), - pgprot_val(pgprot) ^ massaged_val, - __supported_pte_mask); + "attempted to set unsupported pgprot: %016llx " + "bits: %016llx supported: %016llx\n", + (u64)pgprot_val(pgprot), + (u64)pgprot_val(pgprot) ^ massaged_val, + (u64)__supported_pte_mask); #endif return massaged_val;