Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1121477imm; Fri, 8 Jun 2018 10:20:19 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI7k/59esduvE7qmwFb5Qy9t7Nzf0efAWBAB48QSEdl3t02UhCxpGiSPtY7awSlwPN8/pFs X-Received: by 2002:a17:902:ab8d:: with SMTP id f13-v6mr7556572plr.81.1528478419568; Fri, 08 Jun 2018 10:20:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528478419; cv=none; d=google.com; s=arc-20160816; b=HR9pbAB6z80vL1AZKBOWLF8q5GRhPv0bebJ4gYXg/lxXya2Yf/tS59V1PpR0Z1uvCH XdSskvfI0ItaGXUQKS2XwaLiK47Qdw97qcQkywJn8J5udI2CexYPNMtw2jhwY/L7ErbN rrgJGgtBAau2d9n1zT9HS8zN+cZhJqebsmBEOdWDxcECtLj+I3NGTgC5GGOpvjzuoJpE 8wPFCNc2HWrB8VjmXs48kqyO+lGsoteFgqwwmP5ZZeIaP5XlxUEngswiDbt15FTbJ0/d 9U6c96kXSnU+a8posqYlQTUSJc8ns3K7O5ggUbt5X+JDAGo8eaRT+LUf92IX/o5VMCUP LURQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=GQ1bIW2JPOnIyaWlmNW0ftKFcaCKJuRcKotV/xy7bpU=; b=hYtLPkSJDe1vM0vxdthS7QRqABLwtIY9H4bx/+1pTmw4CjoezLWxDwn/dvpuXLa1pA y1RVGZ8ypjub9R9etb/EL6ORzlSQIjE4X2iCkfTZqekAwnY3ky79aUu3Fgm1XNFjROno 87awu7Uxv3yMSh2xqKr9H04BCUnNwptmucUvzZ3C5jjiSvDJshc+8r8zr/atJd+0UhkE zYEFsypK7tyNsxla24R4vScfl+9LuVgEsnUyETngjeRg91xZ35E9vUd3LL4gZGYnIGoM 1rYPZZX3Zp6at/Umz5hIeG/SEi0aVobyRHSP93vsZ7m99NNL8uomrNQL0keoeXzNhpM3 DDEQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bg2-v6si31857611plb.243.2018.06.08.10.20.00; Fri, 08 Jun 2018 10:20:19 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752976AbeFHRT2 (ORCPT + 99 others); Fri, 8 Jun 2018 13:19:28 -0400 Received: from mga05.intel.com ([192.55.52.43]:29354 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752953AbeFHRT0 (ORCPT ); Fri, 8 Jun 2018 13:19:26 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jun 2018 10:19:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,490,1520924400"; d="scan'208";a="231034808" Received: from nzou1-mobl1.ccr.corp.intel.com (HELO localhost) ([10.249.254.60]) by orsmga005.jf.intel.com with ESMTP; 08 Jun 2018 10:19:20 -0700 From: Jarkko Sakkinen To: x86@kernel.org, platform-driver-x86@vger.kernel.org Cc: dave.hansen@intel.com, sean.j.christopherson@intel.com, nhorman@redhat.com, npmccallum@redhat.com, Christopher Li , linux-sparse@vger.kernel.org (open list:SPARSE CHECKER), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v11 01/13] compiler.h, kasan: add __SANITIZE_ADDRESS__ check for __no_kasan_or_inline Date: Fri, 8 Jun 2018 19:09:36 +0200 Message-Id: <20180608171216.26521-2-jarkko.sakkinen@linux.intel.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180608171216.26521-1-jarkko.sakkinen@linux.intel.com> References: <20180608171216.26521-1-jarkko.sakkinen@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sean Christopherson Add 'defined(__SANITIZE_ADDRESS__)' to check to determine whether __no_kasan_or_inline should be 'no_kasan' or 'inline'. Files that compile with KASAN disabled may not link to KASAN, in which case the __maybe_unused attribute added in the 'no_kasan' option can cause linker errors due to unused functions that manually invoke KASAN functions, e.g. read_word_at_a_time(), not being discarded. Signed-off-by: Sean Christopherson --- include/linux/compiler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/compiler.h b/include/linux/compiler.h index ab4711c63601..e7a863a3ac8c 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -188,7 +188,7 @@ void __read_once_size(const volatile void *p, void *res, int size) __READ_ONCE_SIZE; } -#ifdef CONFIG_KASAN +#if defined(CONFIG_KASAN) && defined(__SANITIZE_ADDRESS__) /* * We can't declare function 'inline' because __no_sanitize_address confilcts * with inlining. Attempt to inline it may cause a build failure. -- 2.17.0