From patchwork Tue Jun 27 17:21:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Li X-Patchwork-Id: 9812827 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7A76960351 for ; Tue, 27 Jun 2017 17:21:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DA0D281F9 for ; Tue, 27 Jun 2017 17:21:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 525362858E; Tue, 27 Jun 2017 17:21:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM,T_DKIM_INVALID,T_TVD_MIME_EPI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ABA5A281F9 for ; Tue, 27 Jun 2017 17:21:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752042AbdF0RVq (ORCPT ); Tue, 27 Jun 2017 13:21:46 -0400 Received: from mail-io0-f181.google.com ([209.85.223.181]:34898 "EHLO mail-io0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751579AbdF0RVp (ORCPT ); Tue, 27 Jun 2017 13:21:45 -0400 Received: by mail-io0-f181.google.com with SMTP id h134so21712100iof.2 for ; Tue, 27 Jun 2017 10:21:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:from:date:message-id:subject:to:cc; bh=zPdNY7LaBpmUNXgB9SrrL52xQSaEsiXn8unn6iyRGfM=; b=o2CKCpOiYxGhZB959Cm6sRObdcj5eU5CVyW2yOGFOQbMh5cZWu3sXvtyWmzVSXLWt/ h2gwmkurHoWmRFgfy5jL36OBqsCU0Xt+fRUtIh4B9Gwib15pjhcRb3SMXr6Rjlf2zMxt dJklYggtolCj3PT3gB/ou8MdBjFYqXJIiaqvIQltJ2V1CnenSkPF2ZO4upuieCTzBnAT LU4vOBY9HMeQhqCnKqHBcWUDmyD/xAkhXKjgJAc+qmHFSkPwa8s1WrcYRFa/u1GjbBdh JGHgb/ybD+w2OTNj+frfs3PTYqGd3OUWlX8oJ1iByr9RPJX0Zpb5poAJKYfjzMOZgV87 eRIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:from:date:message-id:subject :to:cc; bh=zPdNY7LaBpmUNXgB9SrrL52xQSaEsiXn8unn6iyRGfM=; b=TXW9T0tqa9wgq9SBLzebOLJVjwZPXYMPic3tZ+ghP9EY2l3qAp3F/HKEw0UWMFgCJq W+GJkSc8CGTzKkcg/otIkaktjJJVdOaXP4SACKl7/ztGLyYYKtu65T38JXhyAqH/FpOr qgT0iodONF5tDcnCdhLK4AmWRIuJhiNyQ2EayJdznQjyQQuUMEOo8K03BwKINSK0G/Fh iBycoDF+yNBdUPBbwYJkBYwCx7e/vFBPRFJdRizzwJPl36k/uDytOayqgi3YKFdzeYGr /FWztr/fpb+XVX+Ak8t9gtNvfiuJ5rYRnNRLOYysZnQfYjEItmwB4N+9eIXedM4K9jT8 RVqQ== X-Gm-Message-State: AKS2vOyN5PiwObYy0Mzkjdg2RaTNbsQvlNH6Ps2YjybfhwNRPLL3apMn 7mJpNS61EnEmsVtY1zmStwvLeFfP0g== X-Received: by 10.107.153.140 with SMTP id b134mr7258419ioe.200.1498584104468; Tue, 27 Jun 2017 10:21:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.5.5 with HTTP; Tue, 27 Jun 2017 10:21:43 -0700 (PDT) From: Christopher Li Date: Tue, 27 Jun 2017 10:21:43 -0700 X-Google-Sender-Auth: 25BpZmz0ZdGfmU7EbRC-zH1QVDs Message-ID: Subject: [PATCH] Adding ignored attribute optimize To: Linux-Sparse Cc: Luc Van Oostenryck Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP I notice this unknow attribute "__optimize__"when I am looking sparse checking result on the recent kernel compile. Chris From d8925f125ee8b1cc6eb29f43312b81f3f859374d Mon Sep 17 00:00:00 2001 From: Christopher Li Date: Fri, 23 Jun 2017 17:13:17 -0700 Subject: [PATCH] Adding ignored attribute optimize It was used in kvm/vmx.c Signed-of-By: Christopher Li --- parse.c | 6 ++++-- validation/attr-optimize.c | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 validation/attr-optimize.c diff --git a/parse.c b/parse.c index 2145479..f665f05 100644 --- a/parse.c +++ b/parse.c @@ -607,6 +607,8 @@ static const char *ignored_attributes[] = { "__naked__", "no_instrument_function", "__no_instrument_function__", + "no_sanitize_address", + "__no_sanitize_address__", "noclone", "__noclone", "__noclone__", @@ -618,6 +620,8 @@ static const char *ignored_attributes[] = { "nothrow", "__nothrow", "__nothrow__", + "optimize", + "__optimize__", "regparm", "__regparm__", "section", @@ -646,8 +650,6 @@ static const char *ignored_attributes[] = { "__warning__", "weak", "__weak__", - "no_sanitize_address", - "__no_sanitize_address__", }; diff --git a/validation/attr-optimize.c b/validation/attr-optimize.c new file mode 100644 index 0000000..c45cbe8 --- /dev/null +++ b/validation/attr-optimize.c @@ -0,0 +1,16 @@ + +#define __noclone __attribute__((__noclone__, __optimize__("no-tracer"))) + +struct kvm_vcpu; + +static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu) +{ + __asm__(""); +} + +extern void *run; +void *run = vmx_vcpu_run; + +/* + * check-name: optimize attributes + */ -- 2.9.4