diff mbox series

[kvm-unit-tests,7/7] x86: VMX: the "noclone" attribute is gcc-specific

Message ID 20200226074427.169684-8-morbo@google.com (mailing list archive)
State New, archived
Headers show
Series Fixes for clang builds | expand

Commit Message

Bill Wendling Feb. 26, 2020, 7:44 a.m. UTC
From: Bill Wendling <morbo@google.com>

Don't use the "noclone" attribute for clang as it's not supported.

Signed-off-by: Bill Wendling <morbo@google.com>
---
 x86/vmx_tests.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Oliver Upton Feb. 26, 2020, 8:21 a.m. UTC | #1
On Tue, Feb 25, 2020 at 11:45 PM <morbo@google.com> wrote:
>
> From: Bill Wendling <morbo@google.com>
>
> Don't use the "noclone" attribute for clang as it's not supported.
>
> Signed-off-by: Bill Wendling <morbo@google.com>
Signed-off-by: Oliver Upton <oupton@google.com>
> ---
>  x86/vmx_tests.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c
> index ad8c002..ec88016 100644
> --- a/x86/vmx_tests.c
> +++ b/x86/vmx_tests.c
> @@ -4976,7 +4976,10 @@ extern unsigned char test_mtf1;
>  extern unsigned char test_mtf2;
>  extern unsigned char test_mtf3;
>
> -__attribute__((noclone)) static void test_mtf_guest(void)
> +#ifndef __clang__
> +__attribute__((noclone))
> +#endif
> +static void test_mtf_guest(void)
>  {
>         asm ("vmcall;\n\t"
>              "out %al, $0x80;\n\t"
> --
> 2.25.0.265.gbab2e86ba0-goog
>
Oliver Upton Feb. 26, 2020, 8:22 a.m. UTC | #2
Blech...

On Wed, Feb 26, 2020 at 12:21 AM Oliver Upton <oupton@google.com> wrote:
>
> On Tue, Feb 25, 2020 at 11:45 PM <morbo@google.com> wrote:
> >
> > From: Bill Wendling <morbo@google.com>
> >
> > Don't use the "noclone" attribute for clang as it's not supported.
> >
> > Signed-off-by: Bill Wendling <morbo@google.com>
> Signed-off-by: Oliver Upton <oupton@google.com>

s/Signed-off-by/Reviewed-by/

> > ---
> >  x86/vmx_tests.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c
> > index ad8c002..ec88016 100644
> > --- a/x86/vmx_tests.c
> > +++ b/x86/vmx_tests.c
> > @@ -4976,7 +4976,10 @@ extern unsigned char test_mtf1;
> >  extern unsigned char test_mtf2;
> >  extern unsigned char test_mtf3;
> >
> > -__attribute__((noclone)) static void test_mtf_guest(void)
> > +#ifndef __clang__
> > +__attribute__((noclone))
> > +#endif
> > +static void test_mtf_guest(void)
> >  {
> >         asm ("vmcall;\n\t"
> >              "out %al, $0x80;\n\t"
> > --
> > 2.25.0.265.gbab2e86ba0-goog
> >
diff mbox series

Patch

diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c
index ad8c002..ec88016 100644
--- a/x86/vmx_tests.c
+++ b/x86/vmx_tests.c
@@ -4976,7 +4976,10 @@  extern unsigned char test_mtf1;
 extern unsigned char test_mtf2;
 extern unsigned char test_mtf3;
 
-__attribute__((noclone)) static void test_mtf_guest(void)
+#ifndef __clang__
+__attribute__((noclone))
+#endif
+static void test_mtf_guest(void)
 {
 	asm ("vmcall;\n\t"
 	     "out %al, $0x80;\n\t"