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 <sparse@xxxxxxxxxxx> 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 <sparse@xxxxxxxxxxx> --- 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