From: Sean Christopherson <seanjc@google.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, Sean Christopherson <seanjc@google.com>,
Bill Wendling <morbo@google.com>
Subject: [kvm-unit-tests PATCH v3 2/7] lib: define the "noinline" macro
Date: Thu, 9 Sep 2021 11:32:02 -0700 [thread overview]
Message-ID: <20210909183207.2228273-3-seanjc@google.com> (raw)
In-Reply-To: <20210909183207.2228273-1-seanjc@google.com>
From: Bill Wendling <morbo@google.com>
Define "noline" macro to reduce the amount of typing for functions using
the "noinline" attribute. Opportunsitically convert existing users.
Signed-off-by: Bill Wendling <morbo@google.com>
[sean: put macro in compiler.h instead of libcflat.h]
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
lib/linux/compiler.h | 1 +
x86/pmu_lbr.c | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/linux/compiler.h b/lib/linux/compiler.h
index 5d9552a..5937b7b 100644
--- a/lib/linux/compiler.h
+++ b/lib/linux/compiler.h
@@ -46,6 +46,7 @@
#define barrier() asm volatile("" : : : "memory")
#define __always_inline inline __attribute__((always_inline))
+#define noinline __attribute__((noinline))
static __always_inline void __read_once_size(const volatile void *p, void *res, int size)
{
diff --git a/x86/pmu_lbr.c b/x86/pmu_lbr.c
index 3bd9e9f..5ff805a 100644
--- a/x86/pmu_lbr.c
+++ b/x86/pmu_lbr.c
@@ -16,14 +16,14 @@
volatile int count;
-static __attribute__((noinline)) int compute_flag(int i)
+static noinline int compute_flag(int i)
{
if (i % 10 < 4)
return i + 1;
return 0;
}
-static __attribute__((noinline)) int lbr_test(void)
+static noinline int lbr_test(void)
{
int i;
int flag;
--
2.33.0.309.g3052b89438-goog
next prev parent reply other threads:[~2021-09-09 18:32 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-09 18:32 [kvm-unit-tests PATCH v3 0/7] x86: Fix duplicate symbols w/ clang Sean Christopherson
2021-09-09 18:32 ` [kvm-unit-tests PATCH v3 1/7] lib: Drop x86/processor.h's barrier() in favor of compiler.h version Sean Christopherson
2021-09-09 18:41 ` Jim Mattson
2021-09-09 18:32 ` Sean Christopherson [this message]
2021-09-09 18:42 ` [kvm-unit-tests PATCH v3 2/7] lib: define the "noinline" macro Jim Mattson
2021-09-09 18:32 ` [kvm-unit-tests PATCH v3 3/7] lib: Move __unused attribute macro to compiler.h Sean Christopherson
2021-09-09 18:43 ` Jim Mattson
2021-09-09 18:32 ` [kvm-unit-tests PATCH v3 4/7] x86: realmode: mark exec_in_big_real_mode as noinline Sean Christopherson
2021-09-09 18:45 ` Jim Mattson
2021-09-09 18:32 ` [kvm-unit-tests PATCH v3 5/7] x86: svm: mark test_run " Sean Christopherson
2021-09-09 18:46 ` Jim Mattson
2021-09-09 18:32 ` [kvm-unit-tests PATCH v3 6/7] x86: umip: mark do_ring3 " Sean Christopherson
2021-09-09 18:47 ` Jim Mattson
2021-09-09 18:32 ` [kvm-unit-tests PATCH v3 7/7] x86: vmx: mark some test_* functions " Sean Christopherson
2021-09-09 18:52 ` Jim Mattson
2021-09-20 13:31 ` [kvm-unit-tests PATCH v3 0/7] x86: Fix duplicate symbols w/ clang Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210909183207.2228273-3-seanjc@google.com \
--to=seanjc@google.com \
--cc=kvm@vger.kernel.org \
--cc=morbo@google.com \
--cc=pbonzini@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox