* [PATCH] selftests: kvm: remove reassignment of non-absolute variables @ 2020-12-10 4:36 Bill Wendling 2020-12-11 0:50 ` Sean Christopherson 0 siblings, 1 reply; 10+ messages in thread From: Bill Wendling @ 2020-12-10 4:36 UTC (permalink / raw) To: Paolo Bonzini, linux-kselftest, kvm Cc: Benjamin Herrenschmidt, Shuah Khan, Bill Wendling, Jian Cai Clang's integrated assembler does not allow symbols with non-absolute values to be reassigned. Modify the interrupt entry loop macro to be compatible with IAS by using a label and an offset. Cc: Jian Cai <caij2003@gmail.com> Signed-off-by: Bill Wendling <morbo@google.com> References: https://lore.kernel.org/lkml/20200714233024.1789985-1-caij2003@gmail.com/ --- tools/testing/selftests/kvm/lib/x86_64/handlers.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/kvm/lib/x86_64/handlers.S b/tools/testing/selftests/kvm/lib/x86_64/handlers.S index aaf7bc7d2ce1..3f9181e9a0a7 100644 --- a/tools/testing/selftests/kvm/lib/x86_64/handlers.S +++ b/tools/testing/selftests/kvm/lib/x86_64/handlers.S @@ -54,9 +54,9 @@ idt_handlers: .align 8 /* Fetch current address and append it to idt_handlers. */ - current_handler = . +0 : .pushsection .rodata -.quad current_handler + .quad 0b .popsection .if ! \has_error -- 2.29.2.576.ga3fc446d84-goog ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH] selftests: kvm: remove reassignment of non-absolute variables 2020-12-10 4:36 [PATCH] selftests: kvm: remove reassignment of non-absolute variables Bill Wendling @ 2020-12-11 0:50 ` Sean Christopherson 2020-12-11 1:04 ` Bill Wendling 0 siblings, 1 reply; 10+ messages in thread From: Sean Christopherson @ 2020-12-11 0:50 UTC (permalink / raw) To: Bill Wendling Cc: Paolo Bonzini, linux-kselftest, kvm, Benjamin Herrenschmidt, Shuah Khan, Jian Cai On Wed, Dec 09, 2020, Bill Wendling wrote: > Clang's integrated assembler does not allow symbols with non-absolute > values to be reassigned. Modify the interrupt entry loop macro to be > compatible with IAS by using a label and an offset. > > Cc: Jian Cai <caij2003@gmail.com> > Signed-off-by: Bill Wendling <morbo@google.com> > References: https://lore.kernel.org/lkml/20200714233024.1789985-1-caij2003@gmail.com/ > --- > tools/testing/selftests/kvm/lib/x86_64/handlers.S | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/tools/testing/selftests/kvm/lib/x86_64/handlers.S b/tools/testing/selftests/kvm/lib/x86_64/handlers.S > index aaf7bc7d2ce1..3f9181e9a0a7 100644 > --- a/tools/testing/selftests/kvm/lib/x86_64/handlers.S > +++ b/tools/testing/selftests/kvm/lib/x86_64/handlers.S > @@ -54,9 +54,9 @@ idt_handlers: > .align 8 > > /* Fetch current address and append it to idt_handlers. */ > - current_handler = . > +0 : > .pushsection .rodata > -.quad current_handler > + .quad 0b Bit of a silly nit: can we use a named label, or at least a non-zero shorthand? It's really easy to misread "0b" as zeroing out the value, at least for me. > .popsection > > .if ! \has_error > -- > 2.29.2.576.ga3fc446d84-goog > ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] selftests: kvm: remove reassignment of non-absolute variables 2020-12-11 0:50 ` Sean Christopherson @ 2020-12-11 1:04 ` Bill Wendling 2020-12-11 1:07 ` Sean Christopherson 2020-12-11 1:36 ` [PATCH] " Jim Mattson 0 siblings, 2 replies; 10+ messages in thread From: Bill Wendling @ 2020-12-11 1:04 UTC (permalink / raw) To: Sean Christopherson Cc: Paolo Bonzini, linux-kselftest, kvm list, Benjamin Herrenschmidt, Shuah Khan, Jian Cai On Thu, Dec 10, 2020 at 4:50 PM Sean Christopherson <seanjc@google.com> wrote: > > On Wed, Dec 09, 2020, Bill Wendling wrote: > > Clang's integrated assembler does not allow symbols with non-absolute > > values to be reassigned. Modify the interrupt entry loop macro to be > > compatible with IAS by using a label and an offset. > > > > Cc: Jian Cai <caij2003@gmail.com> > > Signed-off-by: Bill Wendling <morbo@google.com> > > References: https://lore.kernel.org/lkml/20200714233024.1789985-1-caij2003@gmail.com/ > > --- > > tools/testing/selftests/kvm/lib/x86_64/handlers.S | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/tools/testing/selftests/kvm/lib/x86_64/handlers.S b/tools/testing/selftests/kvm/lib/x86_64/handlers.S > > index aaf7bc7d2ce1..3f9181e9a0a7 100644 > > --- a/tools/testing/selftests/kvm/lib/x86_64/handlers.S > > +++ b/tools/testing/selftests/kvm/lib/x86_64/handlers.S > > @@ -54,9 +54,9 @@ idt_handlers: > > .align 8 > > > > /* Fetch current address and append it to idt_handlers. */ > > - current_handler = . > > +0 : > > .pushsection .rodata > > -.quad current_handler > > + .quad 0b > > Bit of a silly nit: can we use a named label, or at least a non-zero shorthand? > It's really easy to misread "0b" as zeroing out the value, at least for me. > I don't believe that will work. If I rename "0 :" to something more concrete, like ".Lcurrent :", then the label's redefined because of the ".rept". If I assign the "0b" to something, we're back with the unmodified code, which clang issues an error for: <instantiation>:3500:6: error: invalid reassignment of non-absolute variable 'x' x = 0b ^ <instantiation>:2:2: note: while in macro instantiation .rept 255 - 18 + 1 ^ > > .popsection > > > > .if ! \has_error > > -- > > 2.29.2.576.ga3fc446d84-goog > > ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] selftests: kvm: remove reassignment of non-absolute variables 2020-12-11 1:04 ` Bill Wendling @ 2020-12-11 1:07 ` Sean Christopherson 2020-12-11 1:10 ` Bill Wendling 2020-12-11 1:36 ` [PATCH] " Jim Mattson 1 sibling, 1 reply; 10+ messages in thread From: Sean Christopherson @ 2020-12-11 1:07 UTC (permalink / raw) To: Bill Wendling Cc: Paolo Bonzini, linux-kselftest, kvm list, Benjamin Herrenschmidt, Shuah Khan, Jian Cai On Thu, Dec 10, 2020, Bill Wendling wrote: > On Thu, Dec 10, 2020 at 4:50 PM Sean Christopherson <seanjc@google.com> wrote: > > > > On Wed, Dec 09, 2020, Bill Wendling wrote: > > > Clang's integrated assembler does not allow symbols with non-absolute > > > values to be reassigned. Modify the interrupt entry loop macro to be > > > compatible with IAS by using a label and an offset. > > > > > > Cc: Jian Cai <caij2003@gmail.com> > > > Signed-off-by: Bill Wendling <morbo@google.com> > > > References: https://lore.kernel.org/lkml/20200714233024.1789985-1-caij2003@gmail.com/ > > > --- > > > tools/testing/selftests/kvm/lib/x86_64/handlers.S | 4 ++-- > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > diff --git a/tools/testing/selftests/kvm/lib/x86_64/handlers.S b/tools/testing/selftests/kvm/lib/x86_64/handlers.S > > > index aaf7bc7d2ce1..3f9181e9a0a7 100644 > > > --- a/tools/testing/selftests/kvm/lib/x86_64/handlers.S > > > +++ b/tools/testing/selftests/kvm/lib/x86_64/handlers.S > > > @@ -54,9 +54,9 @@ idt_handlers: > > > .align 8 > > > > > > /* Fetch current address and append it to idt_handlers. */ > > > - current_handler = . > > > +0 : > > > .pushsection .rodata > > > -.quad current_handler > > > + .quad 0b > > > > Bit of a silly nit: can we use a named label, or at least a non-zero shorthand? > > It's really easy to misread "0b" as zeroing out the value, at least for me. > > > I don't believe that will work. If I rename "0 :" to something more > concrete, like ".Lcurrent :", then the label's redefined because of > the ".rept". If I assign the "0b" to something, we're back with the > unmodified code, which clang issues an error for: > > <instantiation>:3500:6: error: invalid reassignment of non-absolute variable 'x' > x = 0b > ^ > <instantiation>:2:2: note: while in macro instantiation > .rept 255 - 18 + 1 Boo. I assume 1: and 1b work? Or my KVM favorite "666:" :-) That's enough to at least make me pause and actually read the code. > ^ > > > > .popsection > > > > > > .if ! \has_error > > > -- > > > 2.29.2.576.ga3fc446d84-goog > > > ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] selftests: kvm: remove reassignment of non-absolute variables 2020-12-11 1:07 ` Sean Christopherson @ 2020-12-11 1:10 ` Bill Wendling 2020-12-11 1:19 ` Sean Christopherson 0 siblings, 1 reply; 10+ messages in thread From: Bill Wendling @ 2020-12-11 1:10 UTC (permalink / raw) To: Sean Christopherson Cc: Paolo Bonzini, linux-kselftest, kvm list, Benjamin Herrenschmidt, Shuah Khan, Jian Cai On Thu, Dec 10, 2020 at 5:07 PM Sean Christopherson <seanjc@google.com> wrote: > On Thu, Dec 10, 2020, Bill Wendling wrote: > > On Thu, Dec 10, 2020 at 4:50 PM Sean Christopherson <seanjc@google.com> wrote: > > > On Wed, Dec 09, 2020, Bill Wendling wrote: > > > > Clang's integrated assembler does not allow symbols with non-absolute > > > > values to be reassigned. Modify the interrupt entry loop macro to be > > > > compatible with IAS by using a label and an offset. > > > > > > > > Cc: Jian Cai <caij2003@gmail.com> > > > > Signed-off-by: Bill Wendling <morbo@google.com> > > > > References: https://lore.kernel.org/lkml/20200714233024.1789985-1-caij2003@gmail.com/ > > > > --- > > > > tools/testing/selftests/kvm/lib/x86_64/handlers.S | 4 ++-- > > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > > > diff --git a/tools/testing/selftests/kvm/lib/x86_64/handlers.S b/tools/testing/selftests/kvm/lib/x86_64/handlers.S > > > > index aaf7bc7d2ce1..3f9181e9a0a7 100644 > > > > --- a/tools/testing/selftests/kvm/lib/x86_64/handlers.S > > > > +++ b/tools/testing/selftests/kvm/lib/x86_64/handlers.S > > > > @@ -54,9 +54,9 @@ idt_handlers: > > > > .align 8 > > > > > > > > /* Fetch current address and append it to idt_handlers. */ > > > > - current_handler = . > > > > +0 : > > > > .pushsection .rodata > > > > -.quad current_handler > > > > + .quad 0b > > > > > > Bit of a silly nit: can we use a named label, or at least a non-zero shorthand? > > > It's really easy to misread "0b" as zeroing out the value, at least for me. > > > > > I don't believe that will work. If I rename "0 :" to something more > > concrete, like ".Lcurrent :", then the label's redefined because of > > the ".rept". If I assign the "0b" to something, we're back with the > > unmodified code, which clang issues an error for: > > > > <instantiation>:3500:6: error: invalid reassignment of non-absolute variable 'x' > > x = 0b > > ^ > > <instantiation>:2:2: note: while in macro instantiation > > .rept 255 - 18 + 1 > > Boo. I assume 1: and 1b work? Or my KVM favorite "666:" :-) That's enough to > at least make me pause and actually read the code. > Ah! I missed the second part of your message (about the non-zero shorthand). That should work. Sorry about that. :-) Should I submit a new version of this patch? -bw ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] selftests: kvm: remove reassignment of non-absolute variables 2020-12-11 1:10 ` Bill Wendling @ 2020-12-11 1:19 ` Sean Christopherson 2020-12-11 1:23 ` [PATCH v2] " Bill Wendling 0 siblings, 1 reply; 10+ messages in thread From: Sean Christopherson @ 2020-12-11 1:19 UTC (permalink / raw) To: Bill Wendling Cc: Paolo Bonzini, linux-kselftest, kvm list, Benjamin Herrenschmidt, Shuah Khan, Jian Cai On Thu, Dec 10, 2020, Bill Wendling wrote: > On Thu, Dec 10, 2020 at 5:07 PM Sean Christopherson <seanjc@google.com> wrote: > > On Thu, Dec 10, 2020, Bill Wendling wrote: > > > On Thu, Dec 10, 2020 at 4:50 PM Sean Christopherson <seanjc@google.com> wrote: > > > > On Wed, Dec 09, 2020, Bill Wendling wrote: > > > > > Clang's integrated assembler does not allow symbols with non-absolute > > > > > values to be reassigned. Modify the interrupt entry loop macro to be > > > > > compatible with IAS by using a label and an offset. > > > > > > > > > > Cc: Jian Cai <caij2003@gmail.com> > > > > > Signed-off-by: Bill Wendling <morbo@google.com> > > > > > References: https://lore.kernel.org/lkml/20200714233024.1789985-1-caij2003@gmail.com/ > > > > > --- > > > > > tools/testing/selftests/kvm/lib/x86_64/handlers.S | 4 ++-- > > > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > > > > > diff --git a/tools/testing/selftests/kvm/lib/x86_64/handlers.S b/tools/testing/selftests/kvm/lib/x86_64/handlers.S > > > > > index aaf7bc7d2ce1..3f9181e9a0a7 100644 > > > > > --- a/tools/testing/selftests/kvm/lib/x86_64/handlers.S > > > > > +++ b/tools/testing/selftests/kvm/lib/x86_64/handlers.S > > > > > @@ -54,9 +54,9 @@ idt_handlers: > > > > > .align 8 > > > > > > > > > > /* Fetch current address and append it to idt_handlers. */ > > > > > - current_handler = . > > > > > +0 : > > > > > .pushsection .rodata > > > > > -.quad current_handler > > > > > + .quad 0b > > > > > > > > Bit of a silly nit: can we use a named label, or at least a non-zero shorthand? > > > > It's really easy to misread "0b" as zeroing out the value, at least for me. > > > > > > > I don't believe that will work. If I rename "0 :" to something more > > > concrete, like ".Lcurrent :", then the label's redefined because of > > > the ".rept". If I assign the "0b" to something, we're back with the > > > unmodified code, which clang issues an error for: > > > > > > <instantiation>:3500:6: error: invalid reassignment of non-absolute variable 'x' > > > x = 0b > > > ^ > > > <instantiation>:2:2: note: while in macro instantiation > > > .rept 255 - 18 + 1 > > > > Boo. I assume 1: and 1b work? Or my KVM favorite "666:" :-) That's enough to > > at least make me pause and actually read the code. > > > Ah! I missed the second part of your message (about the non-zero > shorthand). That should work. Sorry about that. :-) Should I submit a > new version of this patch? That'd probably be easiest. This is trivial enought to fixup when applying, but we might as well save a few of Paolo's cycles for other things. Thanks! ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2] selftests: kvm: remove reassignment of non-absolute variables 2020-12-11 1:19 ` Sean Christopherson @ 2020-12-11 1:23 ` Bill Wendling 2021-05-03 18:37 ` Jim Mattson 0 siblings, 1 reply; 10+ messages in thread From: Bill Wendling @ 2020-12-11 1:23 UTC (permalink / raw) To: Paolo Bonzini, linux-kselftest, kvm, Sean Christopherson Cc: Benjamin Herrenschmidt, Shuah Khan, Bill Wendling, Jian Cai Clang's integrated assembler does not allow symbols with non-absolute values to be reassigned. Modify the interrupt entry loop macro to be compatible with IAS by using a label and an offset. Cc: Jian Cai <caij2003@gmail.com> Signed-off-by: Bill Wendling <morbo@google.com> References: https://lore.kernel.org/lkml/20200714233024.1789985-1-caij2003@gmail.com/ --- tools/testing/selftests/kvm/lib/x86_64/handlers.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/kvm/lib/x86_64/handlers.S b/tools/testing/selftests/kvm/lib/x86_64/handlers.S index aaf7bc7d2ce1..7629819734af 100644 --- a/tools/testing/selftests/kvm/lib/x86_64/handlers.S +++ b/tools/testing/selftests/kvm/lib/x86_64/handlers.S @@ -54,9 +54,9 @@ idt_handlers: .align 8 /* Fetch current address and append it to idt_handlers. */ - current_handler = . +666 : .pushsection .rodata -.quad current_handler + .quad 666b .popsection .if ! \has_error -- 2.29.2.576.ga3fc446d84-goog ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v2] selftests: kvm: remove reassignment of non-absolute variables 2020-12-11 1:23 ` [PATCH v2] " Bill Wendling @ 2021-05-03 18:37 ` Jim Mattson 2021-05-04 7:22 ` Paolo Bonzini 0 siblings, 1 reply; 10+ messages in thread From: Jim Mattson @ 2021-05-03 18:37 UTC (permalink / raw) To: Bill Wendling Cc: Paolo Bonzini, open list:KERNEL SELFTEST FRAMEWORK, kvm list, Sean Christopherson, Benjamin Herrenschmidt, Shuah Khan, Jian Cai On Thu, Dec 10, 2020 at 7:58 PM Bill Wendling <morbo@google.com> wrote: > > Clang's integrated assembler does not allow symbols with non-absolute > values to be reassigned. Modify the interrupt entry loop macro to be > compatible with IAS by using a label and an offset. > > Cc: Jian Cai <caij2003@gmail.com> > Signed-off-by: Bill Wendling <morbo@google.com> > References: https://lore.kernel.org/lkml/20200714233024.1789985-1-caij2003@gmail.com/ Reviewed-by: Jim Mattson <jmattson@google.com> ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2] selftests: kvm: remove reassignment of non-absolute variables 2021-05-03 18:37 ` Jim Mattson @ 2021-05-04 7:22 ` Paolo Bonzini 0 siblings, 0 replies; 10+ messages in thread From: Paolo Bonzini @ 2021-05-04 7:22 UTC (permalink / raw) To: Jim Mattson, Bill Wendling Cc: open list:KERNEL SELFTEST FRAMEWORK, kvm list, Sean Christopherson, Benjamin Herrenschmidt, Shuah Khan, Jian Cai On 03/05/21 20:37, Jim Mattson wrote: > On Thu, Dec 10, 2020 at 7:58 PM Bill Wendling <morbo@google.com> wrote: >> >> Clang's integrated assembler does not allow symbols with non-absolute >> values to be reassigned. Modify the interrupt entry loop macro to be >> compatible with IAS by using a label and an offset. >> >> Cc: Jian Cai <caij2003@gmail.com> >> Signed-off-by: Bill Wendling <morbo@google.com> >> References: https://lore.kernel.org/lkml/20200714233024.1789985-1-caij2003@gmail.com/ > Reviewed-by: Jim Mattson <jmattson@google.com> > Queued, thanks. Paolo ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] selftests: kvm: remove reassignment of non-absolute variables 2020-12-11 1:04 ` Bill Wendling 2020-12-11 1:07 ` Sean Christopherson @ 2020-12-11 1:36 ` Jim Mattson 1 sibling, 0 replies; 10+ messages in thread From: Jim Mattson @ 2020-12-11 1:36 UTC (permalink / raw) To: Bill Wendling Cc: Sean Christopherson, Paolo Bonzini, open list:KERNEL SELFTEST FRAMEWORK, kvm list, Benjamin Herrenschmidt, Shuah Khan, Jian Cai By non-zero, I think Sean means something like: 666: .pushsection .rodata .quad 666b On Thu, Dec 10, 2020 at 5:34 PM Bill Wendling <morbo@google.com> wrote: > > On Thu, Dec 10, 2020 at 4:50 PM Sean Christopherson <seanjc@google.com> wrote: > > > > On Wed, Dec 09, 2020, Bill Wendling wrote: > > > Clang's integrated assembler does not allow symbols with non-absolute > > > values to be reassigned. Modify the interrupt entry loop macro to be > > > compatible with IAS by using a label and an offset. > > > > > > Cc: Jian Cai <caij2003@gmail.com> > > > Signed-off-by: Bill Wendling <morbo@google.com> > > > References: https://lore.kernel.org/lkml/20200714233024.1789985-1-caij2003@gmail.com/ > > > --- > > > tools/testing/selftests/kvm/lib/x86_64/handlers.S | 4 ++-- > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > diff --git a/tools/testing/selftests/kvm/lib/x86_64/handlers.S b/tools/testing/selftests/kvm/lib/x86_64/handlers.S > > > index aaf7bc7d2ce1..3f9181e9a0a7 100644 > > > --- a/tools/testing/selftests/kvm/lib/x86_64/handlers.S > > > +++ b/tools/testing/selftests/kvm/lib/x86_64/handlers.S > > > @@ -54,9 +54,9 @@ idt_handlers: > > > .align 8 > > > > > > /* Fetch current address and append it to idt_handlers. */ > > > - current_handler = . > > > +0 : > > > .pushsection .rodata > > > -.quad current_handler > > > + .quad 0b > > > > Bit of a silly nit: can we use a named label, or at least a non-zero shorthand? > > It's really easy to misread "0b" as zeroing out the value, at least for me. > > > I don't believe that will work. If I rename "0 :" to something more > concrete, like ".Lcurrent :", then the label's redefined because of > the ".rept". If I assign the "0b" to something, we're back with the > unmodified code, which clang issues an error for: > > <instantiation>:3500:6: error: invalid reassignment of non-absolute variable 'x' > x = 0b > ^ > <instantiation>:2:2: note: while in macro instantiation > .rept 255 - 18 + 1 > ^ > > > > .popsection > > > > > > .if ! \has_error > > > -- > > > 2.29.2.576.ga3fc446d84-goog > > > ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2021-05-04 7:22 UTC | newest] Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2020-12-10 4:36 [PATCH] selftests: kvm: remove reassignment of non-absolute variables Bill Wendling 2020-12-11 0:50 ` Sean Christopherson 2020-12-11 1:04 ` Bill Wendling 2020-12-11 1:07 ` Sean Christopherson 2020-12-11 1:10 ` Bill Wendling 2020-12-11 1:19 ` Sean Christopherson 2020-12-11 1:23 ` [PATCH v2] " Bill Wendling 2021-05-03 18:37 ` Jim Mattson 2021-05-04 7:22 ` Paolo Bonzini 2020-12-11 1:36 ` [PATCH] " Jim Mattson
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).