All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Bill Wendling <morbo@google.com>,
	kvm@vger.kernel.org, alexandru.elisei@arm.com, thuth@redhat.com
Cc: jmattson@google.com
Subject: Re: [kvm-unit-tests v2 PATCH 2/2] x86: don't compare two global objects' addrs for inequality
Date: Mon, 21 Oct 2019 17:33:36 +0200	[thread overview]
Message-ID: <1bdb4560-3abf-1494-060b-e462d48f551e@redhat.com> (raw)
In-Reply-To: <20191015204603.47845-3-morbo@google.com>

On 15/10/19 22:46, Bill Wendling wrote:
> Two global objects can't have the same address in C. Clang uses this
> fact to omit the check on the first iteration of the loop in
> check_exception_table. Avoid compariting inequality by using less-than.
> 
> Signed-off-by: Bill Wendling <morbo@google.com>
> ---
>  lib/x86/desc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/x86/desc.c b/lib/x86/desc.c
> index 451f504..4002203 100644
> --- a/lib/x86/desc.c
> +++ b/lib/x86/desc.c
> @@ -113,7 +113,7 @@ static void check_exception_table(struct ex_regs *regs)
>  		(((regs->rflags >> 16) & 1) << 8);
>      asm("mov %0, %%gs:4" : : "r"(ex_val));
>  
> -    for (ex = &exception_table_start; ex != &exception_table_end; ++ex) {
> +    for (ex = &exception_table_start; ex < &exception_table_end; ++ex) {
>          if (ex->rip == regs->rip) {
>              regs->rip = ex->handler;
>              return;
> 

Queued, thanks.

Paolo

  parent reply	other threads:[~2019-10-21 15:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-12  7:44 [kvm-unit-tests PATCH 1/2] Use a status enum for reporting pass/fail Bill Wendling
2019-10-12  7:44 ` [kvm-unit-tests PATCH 2/2] x86: use pointer for end of exception table Bill Wendling
2019-10-13  7:18   ` [kvm-unit-tests PATCH 1/1] " Bill Wendling
2019-10-15  7:41     ` Thomas Huth
2019-10-15  8:06       ` Bill Wendling
2019-10-12  8:20 ` [kvm-unit-tests PATCH 2/2] Use a status enum for reporting pass/fail Bill Wendling
2019-10-14 16:26 ` [kvm-unit-tests PATCH 1/2] " Sean Christopherson
2019-10-14 18:23   ` Bill Wendling
2019-10-15 20:46 ` [kvm-unit-tests v2 PATCH 0/2] Clang compilation fixes Bill Wendling
2019-10-15 20:46   ` [kvm-unit-tests v2 PATCH 1/2] lib: use a status enum for reporting pass/fail Bill Wendling
2019-10-15 20:46   ` [kvm-unit-tests v2 PATCH 2/2] x86: don't compare two global objects' addrs for inequality Bill Wendling
2019-10-16  5:53     ` Thomas Huth
2019-10-21 15:33     ` Paolo Bonzini [this message]
2019-10-21 15:32 ` [kvm-unit-tests PATCH 1/2] Use a status enum for reporting pass/fail Paolo Bonzini
2019-10-29 18:51   ` Bill Wendling

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=1bdb4560-3abf-1494-060b-e462d48f551e@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=alexandru.elisei@arm.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=morbo@google.com \
    --cc=thuth@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.