From: Paolo Bonzini <pbonzini@redhat.com>
To: "Toralf Förster" <toralf.foerster@gmx.de>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH] arch/x86/kvm/x86.c: remove a superfluous test for !X86_64
Date: Sun, 27 Apr 2014 17:40:41 +0200 [thread overview]
Message-ID: <535D24F9.7080605@redhat.com> (raw)
In-Reply-To: <1398612730-6684-1-git-send-email-toralf.foerster@gmx.de>
Il 27/04/2014 17:32, Toralf Förster ha scritto:
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 8b8fc0b..a6ca7e0 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -5680,15 +5680,17 @@ int kvm_hv_hypercall(struct kvm_vcpu *vcpu)
> kvm_x86_ops->get_cs_db_l_bits(vcpu, &cs_db, &cs_l);
> longmode = is_long_mode(vcpu) && cs_l == 1;
>
> +#ifdef CONFIG_X86_64
> if (!longmode) {
> +#endif
This is ugly...
> param = ((u64)kvm_register_read(vcpu, VCPU_REGS_RDX) << 32) |
> (kvm_register_read(vcpu, VCPU_REGS_RAX) & 0xffffffff);
> ingpa = ((u64)kvm_register_read(vcpu, VCPU_REGS_RBX) << 32) |
> (kvm_register_read(vcpu, VCPU_REGS_RCX) & 0xffffffff);
> outgpa = ((u64)kvm_register_read(vcpu, VCPU_REGS_RDI) << 32) |
> (kvm_register_read(vcpu, VCPU_REGS_RSI) & 0xffffffff);
> - }
> #ifdef CONFIG_X86_64
... can you just remove this #ifdef instead? It will be dead code, but
the compiler will detect it as such and remove it.
Paolo
> + }
> else {
> param = kvm_register_read(vcpu, VCPU_REGS_RCX);
> ingpa = kvm_register_read(vcpu, VCPU_REGS_RDX);
next prev parent reply other threads:[~2014-04-27 15:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-27 15:32 [PATCH] arch/x86/kvm/x86.c: remove a superfluous test for !X86_64 Toralf Förster
2014-04-27 15:40 ` Paolo Bonzini [this message]
2014-04-27 17:01 ` Toralf Förster
2014-04-28 8:41 ` 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=535D24F9.7080605@redhat.com \
--to=pbonzini@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=toralf.foerster@gmx.de \
/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