Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1405619pxk; Fri, 4 Sep 2020 08:36:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjnq1aptm7BpaxxJtTn8DkKdpeOPR19ZWrDvTgAbELd5/b+iiIf2acYieKIL380LpIs2Dt X-Received: by 2002:a50:e70e:: with SMTP id a14mr8872623edn.93.1599233776400; Fri, 04 Sep 2020 08:36:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599233776; cv=none; d=google.com; s=arc-20160816; b=Dx10lNU1sbyEOf0/mg23ZSDOhl1dEXdkAxWVLQbPlBbWtMObDtuSfI7aQ0w2sg+LYi FwT3H6fdjbqMDSj8HHvDAWa7pqj3JGsnX00c7qQLjUrYzSzlHDFyi2qboEUG51kC84p/ kcVlqDa9THHwNjS59g329U/Vo9EGC4RyAaNNkFqpjWiFfxuyPwipORMW2OX9lqvR+uBh B2KsLehIWPzT+z8cLE8hFqBBhezYpj3Na0JrMR4BXPHAaUznejbqlN6wZ70Ooio+pnDC FjuU2YeJmRW2XQhve3YoEk/pbagSN7asZQza2ZiuPTQHpb8lZUD7mXGGd1qiUGc4lHx6 lVKQ== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=WtSQORr6+6yYCkCLTXJ5IatuumCAr49mZj4nyHMqJcM=; b=hsQF9G3rHdBLUYEHlKmY0r3Y8saKol0cNXGUvYW0sSjrvvdAMRrGa0/4DUsPRVZot3 Q9fqdyY9ehP4hpV59vdFZYO8bg/nXjUAO+Y9iHqAxIIMzeFjgjZP5yo4OvbJ5SPMBUD5 2Z0gMpIkHmyE80hEJ8RKiCP0DBeZatNXHtTg4fukHkJmpk4HozbWCV45Y3xCSu6xkClb 46nSe5M9+Ylpgq0A2R48duim3AbEF1hGjxHlKERlSzGqpNzZ0CFaOqdxRW3zsXohCIER t7AhWQJzmoXCnyUGpu0KQFvF7d1v+Bc8xB3kkH2TQavrhEvVo41BnXif1a2pIAhWsigk ytxw== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m1si4630345ejj.381.2020.09.04.08.35.53; Fri, 04 Sep 2020 08:36:16 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726319AbgIDPey (ORCPT + 99 others); Fri, 4 Sep 2020 11:34:54 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:44768 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726111AbgIDPev (ORCPT ); Fri, 4 Sep 2020 11:34:51 -0400 Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-456-mw9RuvctPhCiT8gwiGfWPQ-1; Fri, 04 Sep 2020 11:34:49 -0400 X-MC-Unique: mw9RuvctPhCiT8gwiGfWPQ-1 Received: by mail-ed1-f71.google.com with SMTP id m88so2883417ede.0 for ; Fri, 04 Sep 2020 08:34:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WtSQORr6+6yYCkCLTXJ5IatuumCAr49mZj4nyHMqJcM=; b=SvS3yywOHqGeS06xV7R2ay8g22UXyjoN5nm5OgD3bxS0vs1nVUINFf9xvtleyWZe69 N8VIEJdjZmU++VFICSA1ludNzqrgvZRRN4Vb0OwNfDafFOd7jeY4P8RDESipb4dIhTpo yTa544E5HEa5pJPpNwAf/G7444uVYsokTUZ7N3fRRiqhlsV5z/n0wA6+N1Gp3WkTZPdI x3JkhHKe98FUOdzAqgOXKYX4VNE1Yin4tF8FtAkcfxRuH4LVhpQSbLK6p60GeO0D/8k4 LfC6B8BBsJxS9NrRt33zi93qATLmHU/Xeec0mlN395ug25T7dluMPSOrQo4PDNi9qcMD +Qkg== X-Gm-Message-State: AOAM533mQtxYNEu+Wl8Kf3GFTo8J9OO4gQ9V2fJ4Ra5WbfUZHhdN3iq0 pPV+hXqkn9LyDZVfMwHocfvsfNBcMj8dKeR/k13JWdLgjjknaEErNSaOyOGEXItPKultM0uYv8s gSLhgqu2HUTJ2Iy+uXQ2Olv+j X-Received: by 2002:a17:906:7746:: with SMTP id o6mr7801729ejn.113.1599233687737; Fri, 04 Sep 2020 08:34:47 -0700 (PDT) X-Received: by 2002:a17:906:7746:: with SMTP id o6mr7801706ejn.113.1599233687562; Fri, 04 Sep 2020 08:34:47 -0700 (PDT) Received: from redfedo.redhat.com ([2a01:cb14:499:3d00:cd47:f651:9d80:157a]) by smtp.gmail.com with ESMTPSA id e11sm6159055edu.23.2020.09.04.08.34.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Sep 2020 08:34:47 -0700 (PDT) From: Julien Thierry To: linux-kernel@vger.kernel.org Cc: jpoimboe@redhat.com, peterz@infradead.org, mbenes@suse.cz, raphael.gault@arm.com, benh@kernel.crashing.org, Julien Thierry Subject: [PATCH v3 08/10] objtool: Only include valid definitions depending on source file type Date: Fri, 4 Sep 2020 16:30:26 +0100 Message-Id: <20200904153028.32676-9-jthierry@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200904153028.32676-1-jthierry@redhat.com> References: <20200904153028.32676-1-jthierry@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Header include/linux/objtool.h contains both C and assembly definition that are visible regardless of the file including them. Place definition under conditional __ASSEMBLY__. Reviewed-by: Miroslav Benes Signed-off-by: Julien Thierry --- include/linux/objtool.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/linux/objtool.h b/include/linux/objtool.h index 358175c9c2b5..15e9997a9fb4 100644 --- a/include/linux/objtool.h +++ b/include/linux/objtool.h @@ -3,6 +3,8 @@ #define _LINUX_OBJTOOL_H #ifdef CONFIG_STACK_VALIDATION + +#ifndef __ASSEMBLY__ /* * This macro marks the given function's stack frame as "non-standard", which * tells objtool to ignore the function when doing stack metadata validation. @@ -15,6 +17,8 @@ static void __used __section(.discard.func_stack_frame_non_standard) \ *__func_stack_frame_non_standard_##func = func +#else /* __ASSEMBLY__ */ + /* * This macro indicates that the following intra-function call is valid. * Any non-annotated intra-function call will cause objtool to issue a warning. @@ -25,6 +29,8 @@ .long 999b; \ .popsection; +#endif /* __ASSEMBLY__ */ + #else /* !CONFIG_STACK_VALIDATION */ #define STACK_FRAME_NON_STANDARD(func) -- 2.21.3