From: Paolo Bonzini <pbonzini@redhat.com>
To: Vitaly Kuznetsov <vkuznets@redhat.com>, kvm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, "Radim Krčmář" <rkrcmar@redhat.com>,
"Sean Christopherson" <sean.j.christopherson@intel.com>,
"Jim Mattson" <jmattson@google.com>,
"Tianyu Lan" <Tianyu.Lan@microsoft.com>
Subject: Re: [PATCH v2] KVM: vmx: fix build warnings in hv_enable_direct_tlbflush() on i386
Date: Wed, 25 Sep 2019 15:31:29 +0200 [thread overview]
Message-ID: <ed9d9b67-0d2b-fc08-e5f3-5a8dcca0ef1c@redhat.com> (raw)
In-Reply-To: <20190925133035.7576-1-vkuznets@redhat.com>
On 25/09/19 15:30, Vitaly Kuznetsov wrote:
> The following was reported on i386:
>
> arch/x86/kvm/vmx/vmx.c: In function 'hv_enable_direct_tlbflush':
> arch/x86/kvm/vmx/vmx.c:503:10: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
>
> pr_debugs() in this function are more or less useless, let's just
> remove them. evmcs->hv_vm_id can use 'unsigned long' instead of 'u64'.
>
> Also, simplify the code a little bit.
>
> Reported-by: kbuild test robot <lkp@intel.com>
> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
> ---
> arch/x86/kvm/vmx/vmx.c | 14 +++++---------
> 1 file changed, 5 insertions(+), 9 deletions(-)
>
> diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
> index a7c9922e3905..d5b978068209 100644
> --- a/arch/x86/kvm/vmx/vmx.c
> +++ b/arch/x86/kvm/vmx/vmx.c
> @@ -495,23 +495,19 @@ static int hv_enable_direct_tlbflush(struct kvm_vcpu *vcpu)
> * Synthetic VM-Exit is not enabled in current code and so All
> * evmcs in singe VM shares same assist page.
> */
> - if (!*p_hv_pa_pg) {
> + if (!*p_hv_pa_pg)
> *p_hv_pa_pg = kzalloc(PAGE_SIZE, GFP_KERNEL);
> - if (!*p_hv_pa_pg)
> - return -ENOMEM;
> - pr_debug("KVM: Hyper-V: allocated PA_PG for %llx\n",
> - (u64)&vcpu->kvm);
> - }
> +
> + if (!*p_hv_pa_pg)
> + return -ENOMEM;
>
> evmcs = (struct hv_enlightened_vmcs *)to_vmx(vcpu)->loaded_vmcs->vmcs;
>
> evmcs->partition_assist_page =
> __pa(*p_hv_pa_pg);
> - evmcs->hv_vm_id = (u64)vcpu->kvm;
> + evmcs->hv_vm_id = (unsigned long)vcpu->kvm;
> evmcs->hv_enlightenments_control.nested_flush_hypercall = 1;
>
> - pr_debug("KVM: Hyper-V: enabled DIRECT flush for %llx\n",
> - (u64)vcpu->kvm);
> return 0;
> }
>
>
Queued, thanks.
Paolo
prev parent reply other threads:[~2019-09-25 13:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-25 13:30 Vitaly Kuznetsov
2019-09-25 13:31 ` Paolo Bonzini [this message]
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=ed9d9b67-0d2b-fc08-e5f3-5a8dcca0ef1c@redhat.com \
--to=pbonzini@redhat.com \
--cc=Tianyu.Lan@microsoft.com \
--cc=jmattson@google.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rkrcmar@redhat.com \
--cc=sean.j.christopherson@intel.com \
--cc=vkuznets@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
all inboxes | Powered by JetHome®