From: Tianyu Lan <Tianyu.Lan@microsoft.com>
To: "Michael Kelley (EOSG)" <Michael.H.Kelley@microsoft.com>,
Tianyu Lan <Tianyu.Lan@microsoft.com>
Cc: KY Srinivasan <kys@microsoft.com>,
Haiyang Zhang <haiyangz@microsoft.com>,
Stephen Hemminger <sthemmin@microsoft.com>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"mingo@redhat.com" <mingo@redhat.com>,
"hpa@zytor.com" <hpa@zytor.com>,
"x86@kernel.org" <x86@kernel.org>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"rkrcmar@redhat.com" <rkrcmar@redhat.com>,
"devel@linuxdriverproject.org" <devel@linuxdriverproject.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"vkuznets@redhat.com" <vkuznets@redhat.com>
Subject: Re: [RFC Patch 1/3] X86/Hyper-V: Add flush HvFlushGuestPhysicalAddressSpace hypercall support
Date: Wed, 6 Jun 2018 05:36:29 +0000 [thread overview]
Message-ID: <46d5e9d3-9891-07b0-7af9-95f016dc7a10@microsoft.com> (raw)
In-Reply-To: <SN6PR2101MB11204AF2E43FF4C91B326FFDDC660@SN6PR2101MB1120.namprd21.prod.outlook.com>
Hi Michael:
Thanks for your review.
On 6/6/2018 12:59 AM, Michael Kelley (EOSG) wrote:
>> -----Original Message-----
>> From: linux-kernel-owner@vger.kernel.org <linux-kernel-owner@vger.kernel.org> On Behalf
>> Of Tianyu Lan
>> Sent: Monday, June 4, 2018 2:08 AM
>> Cc: Tianyu Lan <Tianyu.Lan@microsoft.com>; KY Srinivasan <kys@microsoft.com>; Haiyang
>> Zhang <haiyangz@microsoft.com>; Stephen Hemminger <sthemmin@microsoft.com>;
>> tglx@linutronix.de; mingo@redhat.com; hpa@zytor.com; x86@kernel.org;
>> pbonzini@redhat.com; rkrcmar@redhat.com; devel@linuxdriverproject.org; linux-
>> kernel@vger.kernel.org; kvm@vger.kernel.org; vkuznets@redhat.com
>> Subject: [RFC Patch 1/3] X86/Hyper-V: Add flush HvFlushGuestPhysicalAddressSpace hypercall
>> support
>>
>> Hyper-V provides a pv hypercall HvFlushGuestPhysicalAddressSpace to flush
>> nested VM address space mapping in l1 hypervisor and it's to reduce overhead
>> of flushing ept tlb among vcpus. This patch is to implement it.
>>
>> Signed-off-by: Lan Tianyu <Tianyu.Lan@microsoft.com>
>> ---
>> diff --git a/arch/x86/hyperv/nested.c b/arch/x86/hyperv/nested.c
>> new file mode 100644
>> index 000000000000..17f7c288eccc
>> --- /dev/null
>> +++ b/arch/x86/hyperv/nested.c
>> +#include <linux/types.h>
>> +#include <asm/hyperv-tlfs.h>
>> +#include <asm/mshyperv.h>
>> +#include <asm/tlbflush.h>
>> +
>> +int hyperv_flush_guest_mapping(u64 as)
>> +{
>> + struct hv_guest_mapping_flush **flush_pcpu;
>> + struct hv_guest_mapping_flush *flush;
>> + u64 status = U64_MAX;
>
> Initializing status to U64_MAX doesn't seem necessary.
>
>> + unsigned long flags;
>> + int ret = -EFAULT;
>> +
>> + if (!hv_hypercall_pg)
>> + goto fault;
>> +
>> + local_irq_save(flags);
>> +
>> + flush_pcpu = (struct hv_guest_mapping_flush **)
>> + this_cpu_ptr(hyperv_pcpu_input_arg);
>> +
>> + flush = *flush_pcpu;
>> +
>> + if (unlikely(!flush)) {
>> + local_irq_restore(flags);
>> + goto fault;
>> + }
>> +
>> + flush->address_space = as;
>> + flush->flags = 0;
>> +
>> + status = hv_do_hypercall(HVCALL_FLUSH_GUEST_PHYSICAL_ADDRESS_SPACE,
>> + flush, NULL);
>> + local_irq_restore(flags);
>> +
>> + if (!(status & HV_HYPERCALL_RESULT_MASK))
>> + ret = 0;
>> +
>> +fault:
>> + return ret;
>> +}
>> +EXPORT_SYMBOL_GPL(hyperv_flush_guest_mapping);
>> diff --git a/arch/x86/include/asm/hyperv-tlfs.h b/arch/x86/include/asm/hyperv-tlfs.h
>> index b8c89265baf0..53bbeb08faea 100644
>> --- a/arch/x86/include/asm/hyperv-tlfs.h
>> +++ b/arch/x86/include/asm/hyperv-tlfs.h
>> @@ -309,6 +309,7 @@ struct ms_hyperv_tsc_page {
>> #define HV_X64_MSR_REENLIGHTENMENT_CONTROL 0x40000106
>>
>> /* Nested features (CPUID 0x4000000A) EAX */
>> +#define HV_X64_NESTED_GUSET_MAPPING_FLUSH BIT(18)
>
> The #define name is misspelled. "_GUSET_" should be "_GUEST_".
> And the matching usage in patch 3/3 will need to be updated as well.
>
> Michael
>
Nice catch! Will update.
next prev parent reply other threads:[~2018-06-06 5:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-04 9:08 [RFC Patch 0/3] KVM/x86/hyper-V: Introduce PV guest address space mapping flush support Tianyu Lan
2018-06-04 9:08 ` [RFC Patch 1/3] X86/Hyper-V: Add flush HvFlushGuestPhysicalAddressSpace hypercall support Tianyu Lan
2018-06-05 16:59 ` Michael Kelley (EOSG)
2018-06-06 5:36 ` Tianyu Lan [this message]
2018-06-04 9:08 ` [RFC Patch 2/3] KVM: Add tlb remote flush callback in kvm_x86_ops Tianyu Lan
2018-06-04 9:08 ` [RFC Patch 3/3] KVM/x86: Add tlb_remote_flush callback support for vmcs Tianyu Lan
2018-06-12 15:05 ` Vitaly Kuznetsov
2018-06-12 15:12 ` Vitaly Kuznetsov
2018-06-14 10:13 ` Tianyu Lan
2018-06-14 10:33 ` Vitaly Kuznetsov
2018-06-14 14:52 ` Tianyu Lan
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=46d5e9d3-9891-07b0-7af9-95f016dc7a10@microsoft.com \
--to=tianyu.lan@microsoft.com \
--cc=Michael.H.Kelley@microsoft.com \
--cc=devel@linuxdriverproject.org \
--cc=haiyangz@microsoft.com \
--cc=hpa@zytor.com \
--cc=kvm@vger.kernel.org \
--cc=kys@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@redhat.com \
--cc=sthemmin@microsoft.com \
--cc=tglx@linutronix.de \
--cc=vkuznets@redhat.com \
--cc=x86@kernel.org \
/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®