RE: [RFC PATCH 11/18] virt/mshv: set up synic pages for intercept messages

2021-03-11 Thread Michael Kelley via Virtualization
From: Nuno Das Neves Sent: Thursday, March 11, 2021 11:38 AM > > On 2/8/2021 11:47 AM, Michael Kelley wrote: > > From: Nuno Das Neves Sent: Friday, > > November > 20, 2020 4:31 PM > >> > >> Same idea as synic setup in drivers/hv/hv.c:hv_synic_enable_regs() > >> and hv_synic_disable_regs(). >

RE: [RFC PATCH 08/18] virt/mshv: map and unmap guest memory

2021-03-08 Thread Michael Kelley via Virtualization
From: Nuno Das Neves Sent: Monday, March 8, 2021 11:14 AM > > On 2/8/2021 11:45 AM, Michael Kelley wrote: > > From: Nuno Das Neves Sent: Friday, > > November > 20, 2020 4:30 PM > >> [snip] > >> @@ -245,16 +249,318 @@ hv_call_delete_partition(u64 partition_id) > >>return

RE: [RFC PATCH 06/18] virt/mshv: create, initialize, finalize, delete partition hypercalls

2021-03-04 Thread Michael Kelley via Virtualization
From: Nuno Das Neves Sent: Thursday, March 4, 2021 3:49 PM > > On 2/8/2021 11:42 AM, Michael Kelley wrote: > > From: Nuno Das Neves Sent: Friday, > > November > 20, 2020 4:30 PM > >> [snip] > >> + > >> +static int > >> +hv_call_create_partition( > >> + u64 flags, > >> +

RE: [RFC PATCH 16/18] virt/mshv: mmap vp register page

2021-02-08 Thread Michael Kelley via Virtualization
From: Nuno Das Neves Sent: Friday, November 20, 2020 4:31 PM > > Introduce mmap interface for a virtual processor, exposing a page for > setting and getting common registers while the VP is suspended. > > This provides a more performant and convenient way to get and set these > registers in

RE: [RFC PATCH 15/18] virt/mshv: get and set vp state ioctls

2021-02-08 Thread Michael Kelley via Virtualization
From: Nuno Das Neves Sent: Friday, November 20, 2020 4:31 PM > To: linux-hyp...@vger.kernel.org > Cc: virtualization@lists.linux-foundation.org; linux-ker...@vger.kernel.org; > Michael Kelley > ; virem...@linux.microsoft.com; Sunil Muthuswamy > ; nunodasne...@linux.microsoft.com; >

RE: [RFC PATCH 11/18] virt/mshv: set up synic pages for intercept messages

2021-02-08 Thread Michael Kelley via Virtualization
From: Nuno Das Neves Sent: Friday, November 20, 2020 4:31 PM > > Same idea as synic setup in drivers/hv/hv.c:hv_synic_enable_regs() > and hv_synic_disable_regs(). > Setting up synic registers in both vmbus driver and mshv would clobber > them, but the vmbus driver will not run in the root

RE: [RFC PATCH 10/18] virt/mshv: get and set vcpu registers ioctls

2021-02-08 Thread Michael Kelley via Virtualization
From: Nuno Das Neves Sent: Friday, November 20, 2020 4:30 PM > > Add ioctls for getting and setting virtual processor registers. > > Co-developed-by: Lillian Grassin-Drake > Signed-off-by: Lillian Grassin-Drake > Signed-off-by: Nuno Das Neves > --- > Documentation/virt/mshv/api.rst

RE: [RFC PATCH 08/18] virt/mshv: map and unmap guest memory

2021-02-08 Thread Michael Kelley via Virtualization
From: Nuno Das Neves Sent: Friday, November 20, 2020 4:30 PM > > Introduce ioctls for mapping and unmapping regions of guest memory. > > Uses a table of memory 'slots' similar to KVM, but the slot > number is not visible to userspace. > > For now, this simple implementation requires each new

RE: [RFC PATCH 07/18] virt/mshv: withdraw memory hypercall

2021-02-08 Thread Michael Kelley via Virtualization
From: Nuno Das Neves Sent: Friday, November 20, 2020 4:30 PM > > Withdraw the memory from a finalized partition and free the pages. > The partition is now cleaned up correctly when the fd is released. > > Co-developed-by: Lillian Grassin-Drake > Signed-off-by: Lillian Grassin-Drake >

RE: [RFC PATCH 06/18] virt/mshv: create, initialize, finalize, delete partition hypercalls

2021-02-08 Thread Michael Kelley via Virtualization
From: Nuno Das Neves Sent: Friday, November 20, 2020 4:30 PM > > Add hypercalls for fully setting up and mostly tearing down a guest > partition. > The teardown operation will generate an error as the deposited > memory has not been withdrawn. > This is fixed in the next patch. > >

RE: [RFC PATCH 04/18] virt/mshv: request version ioctl

2021-02-08 Thread Michael Kelley via Virtualization
From: Nuno Das Neves Sent: Friday, November 20, 2020 4:30 PM > > Reserve ioctl number in userpsace-api/ioctl/ioctl-number.rst > Introduce MSHV_REQUEST_VERSION ioctl. > Introduce documentation for /dev/mshv in Documentation/virt/mshv > > Signed-off-by: Nuno Das Neves > --- >

RE: [RFC PATCH 00/18] Microsoft Hypervisor root partition ioctl interface

2021-02-08 Thread Michael Kelley via Virtualization
From: Nuno Das Neves Sent: Friday, November 20, 2020 4:30 PM > > This patch series provides a userspace interface for creating and running > guest > virtual machines while running on the Microsoft Hypervisor [0]. > > Since managing guest machines can only be done when Linux is the root >

RE: [PATCH v6 15/16] x86/hyperv: implement an MSI domain for root partition

2021-02-04 Thread Michael Kelley via Virtualization
From: Wei Liu Sent: Thursday, February 4, 2021 9:57 AM > > On Thu, Feb 04, 2021 at 05:43:16PM +, Michael Kelley wrote: > [...] > > > remove_cpuhp_state: > > > diff --git a/arch/x86/hyperv/irqdomain.c b/arch/x86/hyperv/irqdomain.c > > > new file mode 100644 > > > index

RE: [PATCH v6 15/16] x86/hyperv: implement an MSI domain for root partition

2021-02-04 Thread Michael Kelley via Virtualization
From: Wei Liu Sent: Wednesday, February 3, 2021 7:05 AM > > When Linux runs as the root partition on Microsoft Hypervisor, its > interrupts are remapped. Linux will need to explicitly map and unmap > interrupts for hardware. > > Implement an MSI domain to issue the correct hypercalls. And

RE: [PATCH v6 16/16] iommu/hyperv: setup an IO-APIC IRQ remapping domain for root partition

2021-02-04 Thread Michael Kelley via Virtualization
From: Wei Liu Sent: Wednesday, February 3, 2021 7:05 AM > > Just like MSI/MSI-X, IO-APIC interrupts are remapped by Microsoft > Hypervisor when Linux runs as the root partition. Implement an IRQ > domain to handle mapping and unmapping of IO-APIC interrupts. > > Signed-off-by: Wei Liu > --- >

RE: [PATCH v6 13/16] asm-generic/hyperv: introduce hv_device_id and auxiliary structures

2021-02-04 Thread Michael Kelley via Virtualization
From: Wei Liu Sent: Wednesday, February 3, 2021 7:05 AM > > We will need to identify the device we want Microsoft Hypervisor to > manipulate. Introduce the data structures for that purpose. > > They will be used in a later patch. > > Signed-off-by: Sunil Muthuswamy > Co-Developed-by: Sunil

RE: [PATCH v6 09/16] x86/hyperv: provide a bunch of helper functions

2021-02-04 Thread Michael Kelley via Virtualization
From: Wei Liu Sent: Wednesday, February 3, 2021 7:04 AM > > They are used to deposit pages into Microsoft Hypervisor and bring up > logical and virtual processors. > > Signed-off-by: Lillian Grassin-Drake > Signed-off-by: Sunil Muthuswamy > Signed-off-by: Nuno Das Neves > Co-Developed-by:

RE: [PATCH v6 08/16] ACPI / NUMA: add a stub function for node_to_pxm()

2021-02-04 Thread Michael Kelley via Virtualization
From: Wei Liu Sent: Wednesday, February 3, 2021 7:04 AM > > There is already a stub function for pxm_to_node but conversion to the > other direction is missing. > > It will be used by Microsoft Hypervisor code later. > > Signed-off-by: Wei Liu > --- > v6: new > --- > include/acpi/acpi_numa.h

RE: [PATCH v6 06/16] x86/hyperv: extract partition ID from Microsoft Hypervisor if necessary

2021-02-04 Thread Michael Kelley via Virtualization
From: Wei Liu Sent: Wednesday, February 3, 2021 7:04 AM > > We will need the partition ID for executing some hypercalls later. > > Signed-off-by: Lillian Grassin-Drake > Co-Developed-by: Sunil Muthuswamy > Signed-off-by: Wei Liu > --- > v6: > 1. Use u64 status. > > v3: > 1. Make

RE: [PATCH v6 05/16] x86/hyperv: allocate output arg pages if required

2021-02-04 Thread Michael Kelley via Virtualization
From: Wei Liu Sent: Wednesday, February 3, 2021 7:04 AM > > When Linux runs as the root partition, it will need to make hypercalls > which return data from the hypervisor. > > Allocate pages for storing results when Linux runs as the root > partition. > > Signed-off-by: Lillian Grassin-Drake

RE: [PATCH v6 02/16] x86/hyperv: detect if Linux is the root partition

2021-02-04 Thread Michael Kelley via Virtualization
From: Wei Liu Sent: Wednesday, February 3, 2021 7:04 AM > > For now we can use the privilege flag to check. Stash the value to be > used later. > > Put in a bunch of defines for future use when we want to have more > fine-grained detection. > > Signed-off-by: Wei Liu > Reviewed-by: Pavel

RE: [PATCH v5 13/16] asm-generic/hyperv: introduce hv_device_id and auxiliary structures

2021-02-04 Thread Michael Kelley via Virtualization
From: Wei Liu Sent: Wednesday, February 3, 2021 6:09 AM > > On Wed, Feb 03, 2021 at 02:49:53PM +0100, Arnd Bergmann wrote: > > On Wed, Feb 3, 2021 at 2:26 PM Wei Liu wrote: > > > On Tue, Feb 02, 2021 at 05:02:48PM +, Wei Liu wrote: > > > > On Tue, Jan 26, 2021 at 01:26:52AM +, Michael

RE: [PATCH v5 16/16] iommu/hyperv: setup an IO-APIC IRQ remapping domain for root partition

2021-02-04 Thread Michael Kelley via Virtualization
From: Wei Liu Sent: Wednesday, February 3, 2021 4:47 AM > > On Wed, Jan 27, 2021 at 05:47:08AM +, Michael Kelley wrote: > > From: Wei Liu Sent: Wednesday, January 20, 2021 4:01 AM > > > > > > Just like MSI/MSI-X, IO-APIC interrupts are remapped by Microsoft > > > Hypervisor when Linux runs

RE: [PATCH v5 07/16] x86/hyperv: extract partition ID from Microsoft Hypervisor if necessary

2021-02-04 Thread Michael Kelley via Virtualization
From: Wei Liu Sent: Tuesday, February 2, 2021 7:04 AM > > On Tue, Jan 26, 2021 at 12:48:37AM +, Michael Kelley wrote: > > From: Wei Liu Sent: Wednesday, January 20, 2021 4:01 AM > > > > > > We will need the partition ID for executing some hypercalls later. > > > > > > Signed-off-by: Lillian

RE: [PATCH v5 15/16] x86/hyperv: implement an MSI domain for root partition

2021-02-02 Thread Michael Kelley via Virtualization
From: Wei Liu Sent: Tuesday, February 2, 2021 9:32 AM > > On Wed, Jan 27, 2021 at 05:47:04AM +, Michael Kelley wrote: > > From: Wei Liu Sent: Wednesday, January 20, 2021 4:01 AM > > > > > > When Linux runs as the root partition on Microsoft Hypervisor, its > > > interrupts are remapped.

RE: [PATCH v5 16/16] iommu/hyperv: setup an IO-APIC IRQ remapping domain for root partition

2021-01-26 Thread Michael Kelley via Virtualization
From: Wei Liu Sent: Wednesday, January 20, 2021 4:01 AM > > Just like MSI/MSI-X, IO-APIC interrupts are remapped by Microsoft > Hypervisor when Linux runs as the root partition. Implement an IRQ > domain to handle mapping and unmapping of IO-APIC interrupts. > > Signed-off-by: Wei Liu > --- >

RE: [PATCH v5 15/16] x86/hyperv: implement an MSI domain for root partition

2021-01-26 Thread Michael Kelley via Virtualization
From: Wei Liu Sent: Wednesday, January 20, 2021 4:01 AM > > When Linux runs as the root partition on Microsoft Hypervisor, its > interrupts are remapped. Linux will need to explicitly map and unmap > interrupts for hardware. > > Implement an MSI domain to issue the correct hypercalls. And

RE: [PATCH v5 12/16] asm-generic/hyperv: update hv_interrupt_entry

2021-01-25 Thread Michael Kelley via Virtualization
From: Wei Liu Sent: Wednesday, January 20, 2021 4:01 AM > > We will soon use the same structure to handle IO-APIC interrupts as > well. Introduce an enum to identify the source and a data structure for > IO-APIC RTE. > > While at it, update pci-hyperv.c to use the enum. > > No functional

RE: [PATCH v5 09/16] x86/hyperv: provide a bunch of helper functions

2021-01-25 Thread Michael Kelley via Virtualization
From: Wei Liu Sent: Wednesday, January 20, 2021 4:01 AM > > They are used to deposit pages into Microsoft Hypervisor and bring up > logical and virtual processors. > > Signed-off-by: Lillian Grassin-Drake > Signed-off-by: Sunil Muthuswamy > Signed-off-by: Nuno Das Neves > Co-Developed-by:

RE: [PATCH v5 10/16] x86/hyperv: implement and use hv_smp_prepare_cpus

2021-01-25 Thread Michael Kelley via Virtualization
From: Wei Liu Sent: Wednesday, January 20, 2021 4:01 AM > > Microsoft Hypervisor requires the root partition to make a few > hypercalls to setup application processors before they can be used. > > Signed-off-by: Lillian Grassin-Drake > Signed-off-by: Sunil Muthuswamy > Co-Developed-by:

RE: [PATCH v5 11/16] asm-generic/hyperv: update hv_msi_entry

2021-01-25 Thread Michael Kelley via Virtualization
From: Wei Liu Sent: Wednesday, January 20, 2021 4:01 AM > > We will soon need to access fields inside the MSI address and MSI data > fields. Introduce hv_msi_address_register and hv_msi_data_register. > > Fix up one user of hv_msi_entry in mshyperv.h. > > No functional change expected. > >

RE: [PATCH v5 06/16] x86/hyperv: allocate output arg pages if required

2021-01-25 Thread Michael Kelley via Virtualization
From: Wei Liu Sent: Wednesday, January 20, 2021 4:01 AM > > When Linux runs as the root partition, it will need to make hypercalls > which return data from the hypervisor. > > Allocate pages for storing results when Linux runs as the root > partition. > > Signed-off-by: Lillian Grassin-Drake

RE: [PATCH v5 14/16] asm-generic/hyperv: import data structures for mapping device interrupts

2021-01-25 Thread Michael Kelley via Virtualization
From: Wei Liu Sent: Wednesday, January 20, 2021 4:01 AM > > Signed-off-by: Sunil Muthuswamy > Co-Developed-by: Sunil Muthuswamy > Signed-off-by: Wei Liu > --- > arch/x86/include/asm/hyperv-tlfs.h | 13 +++ > include/asm-generic/hyperv-tlfs.h | 36 ++ > 2

RE: [PATCH v5 13/16] asm-generic/hyperv: introduce hv_device_id and auxiliary structures

2021-01-25 Thread Michael Kelley via Virtualization
From: Wei Liu Sent: Wednesday, January 20, 2021 4:01 AM > > We will need to identify the device we want Microsoft Hypervisor to > manipulate. Introduce the data structures for that purpose. > > They will be used in a later patch. > > Signed-off-by: Sunil Muthuswamy > Co-Developed-by: Sunil

RE: [PATCH v5 08/16] x86/hyperv: handling hypercall page setup for root

2021-01-25 Thread Michael Kelley via Virtualization
From: Wei Liu Sent: Wednesday, January 20, 2021 4:01 AM > > When Linux is running as the root partition, the hypercall page will > have already been setup by Hyper-V. Copy the content over to the > allocated page. > > Add checks to hv_suspend & co to bail early because they are not > supported

RE: [PATCH v5 07/16] x86/hyperv: extract partition ID from Microsoft Hypervisor if necessary

2021-01-25 Thread Michael Kelley via Virtualization
From: Wei Liu Sent: Wednesday, January 20, 2021 4:01 AM > > We will need the partition ID for executing some hypercalls later. > > Signed-off-by: Lillian Grassin-Drake > Co-Developed-by: Sunil Muthuswamy > Signed-off-by: Wei Liu > --- > v3: > 1. Make hv_get_partition_id static. > 2. Change

RE: [PATCH v5 01/16] asm-generic/hyperv: change HV_CPU_POWER_MANAGEMENT to HV_CPU_MANAGEMENT

2021-01-25 Thread Michael Kelley via Virtualization
From: Wei Liu Sent: Wednesday, January 20, 2021 4:01 AM > > This makes the name match Hyper-V TLFS. > > Signed-off-by: Wei Liu > Reviewed-by: Vitaly Kuznetsov > --- > include/asm-generic/hyperv-tlfs.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git

RE: [PATCH v5 05/16] clocksource/hyperv: use MSR-based access if running as root

2021-01-25 Thread Michael Kelley via Virtualization
From: Wei Liu Sent: Wednesday, January 20, 2021 4:01 AM > > When Linux runs as the root partition, the setup required for TSC page > is different. Luckily Linux also has access to the MSR based > clocksource. We can just disable the TSC page clocksource if Linux is > the root partition. > >

RE: [PATCH v5 04/16] iommu/hyperv: don't setup IRQ remapping when running as root

2021-01-25 Thread Michael Kelley via Virtualization
From: Wei Liu Sent: Wednesday, January 20, 2021 4:01 AM > > The IOMMU code needs more work. We're sure for now the IRQ remapping > hooks are not applicable when Linux is the root partition. > > Signed-off-by: Wei Liu > Acked-by: Joerg Roedel > Reviewed-by: Vitaly Kuznetsov > --- >

RE: [PATCH v5 03/16] Drivers: hv: vmbus: skip VMBus initialization if Linux is root

2021-01-25 Thread Michael Kelley via Virtualization
From: Wei Liu Sent: Wednesday, January 20, 2021 4:01 AM > > There is no VMBus and the other infrastructures initialized in > hv_acpi_init when Linux is running as the root partition. > > Signed-off-by: Wei Liu > --- > v3: Return 0 instead of -ENODEV. > --- > drivers/hv/vmbus_drv.c | 3 +++ >

RE: [PATCH v5 02/16] x86/hyperv: detect if Linux is the root partition

2021-01-25 Thread Michael Kelley via Virtualization
From: Wei Liu Sent: Wednesday, January 20, 2021 4:01 AM > > For now we can use the privilege flag to check. Stash the value to be > used later. > > Put in a bunch of defines for future use when we want to have more > fine-grained detection. > > Signed-off-by: Wei Liu > --- > v3: move

RE: [PATCH v4 07/15] x86/paravirt: switch time pvops functions to use static_call()

2021-01-24 Thread Michael Kelley via Virtualization
From: Juergen Gross Sent: Wednesday, January 20, 2021 5:56 AM > > The time pvops functions are the only ones left which might be > used in 32-bit mode and which return a 64-bit value. > > Switch them to use the static_call() mechanism instead of pvops, as > this allows quite some simplification

RE: [PATCH v3 06/15] x86/paravirt: switch time pvops functions to use static_call()

2020-12-17 Thread Michael Kelley via Virtualization
From: Juergen Gross Sent: Thursday, December 17, 2020 1:31 AM > The time pvops functions are the only ones left which might be > used in 32-bit mode and which return a 64-bit value. > > Switch them to use the static_call() mechanism instead of pvops, as > this allows quite some simplification

RE: [PATCH v3 4/9] x86/mm/tlb: Flush remote and local TLBs concurrently

2019-07-30 Thread Michael Kelley via Virtualization
From: Nadav Amit Sent: Thursday, July 18, 2019 5:59 PM > > To improve TLB shootdown performance, flush the remote and local TLBs > concurrently. Introduce flush_tlb_multi() that does so. Introduce > paravirtual versions of flush_tlb_multi() for KVM, Xen and hyper-v (Xen > and hyper-v are only