Re: [PATCH v2 06/11] iommu/arm-smmu-v3: Scan leaf TTD to sync hardware dirty log

2021-03-17 Thread Yi Sun
on: shall we add PASID as one parameter to make iommu know which address space to visit? For live migration, the pasid should not be necessary. But considering future extension, it may be required. BRs, Yi Sun

Re: [PATCH v2 04/11] iommu/arm-smmu-v3: Split block descriptor when start dirty log

2021-03-16 Thread Yi Sun
On 21-03-16 19:39:47, Keqian Zhu wrote: > Hi Yi, > > On 2021/3/16 17:17, Yi Sun wrote: > > On 21-03-10 17:06:07, Keqian Zhu wrote: > >> From: jiangkunkun > >> > >> Block descriptor is not a proper granule for dirty log tracking. > >> Take a

Re: [PATCH v2 04/11] iommu/arm-smmu-v3: Split block descriptor when start dirty log

2021-03-16 Thread Yi Sun
into one, e.g: int iommu_domain_set_hwdbm(struct iommu_domain *domain, bool enable, unsigned long iova, size_t size, int prot); Same comments to patch 5. BRs, Yi Sun > -- > 2.19.1

Re: [RFC PATCH 10/11] vfio/iommu_type1: Optimize dirty bitmap population based on iommu HWDBM

2021-02-09 Thread Yi Sun
On 21-02-09 11:16:08, Robin Murphy wrote: > On 2021-02-07 09:56, Yi Sun wrote: > >Hi, > > > >On 21-01-28 23:17:41, Keqian Zhu wrote: > > > >[...] > > > >>+static void vfio_dma_dirty_log_start(struct vfio_iommu *iommu, > >>+

Re: [RFC PATCH 10/11] vfio/iommu_type1: Optimize dirty bitmap population based on iommu HWDBM

2021-02-09 Thread Yi Sun
On 21-02-07 18:40:36, Keqian Zhu wrote: > Hi Yi, > > On 2021/2/7 17:56, Yi Sun wrote: > > Hi, > > > > On 21-01-28 23:17:41, Keqian Zhu wrote: > > > > [...] > > > >> +static void vfio_dma_dirty_log_start(struct vfio_iommu *iommu, >

Re: [RFC PATCH 10/11] vfio/iommu_type1: Optimize dirty bitmap population based on iommu HWDBM

2021-02-07 Thread Yi Sun
Hi, On 21-01-28 23:17:41, Keqian Zhu wrote: [...] > +static void vfio_dma_dirty_log_start(struct vfio_iommu *iommu, > + struct vfio_dma *dma) > +{ > + struct vfio_domain *d; > + > + list_for_each_entry(d, >domain_list, next) { > + /* Go

[PATCH v2 2/2] iommu/vt-d: Fix a bug for PDP check in prq_event_thread

2020-10-29 Thread Yi Sun
From: "Liu, Yi L" In prq_event_thread(), the QI_PGRP_PDP is wrongly set by 'req->pasid_present' which should be replaced to 'req->priv_data_present'. Fixes: 5b438f4ba315 ("iommu/vt-d: Support page request in scalable mode") Signed-off-by: Liu, Yi L Signed-off-by:

[PATCH v2 1/2] iommu/vt-d: Fix sid not set issue in intel_svm_bind_gpasid()

2020-10-29 Thread Yi Sun
From: Liu Yi L Should get correct sid and set it into sdev. Because we execute 'sdev->sid != req->rid' in the loop of prq_event_thread(). Fixes: eb8d93ea3c1d ("iommu/vt-d: Report page request faults for guest SVA") Signed-off-by: Liu Yi L Signed-off-by: Yi Sun --- drivers/i

[PATCH v2 0/2] iommu: Fix a few issues related to PRQ

2020-10-29 Thread Yi Sun
We found a few issues about PRQ. So, two patches are cooked to fix them. Please have a review. Thanks! Changes from v1: - Modify subject of patch 1 to make it more accurate. - Move get_domain_info() up to the sanity check part in patch 1. - Remove v1 patch 2 which is not

Re: [PATCH v1 2/3] iommu: Fix an issue in iommu_page_response() flags check

2020-10-29 Thread Yi Sun
On 20-10-28 10:13:56, Jean-Philippe Brucker wrote: > Hi, > > On Wed, Oct 28, 2020 at 09:36:57AM +0800, Yi Sun wrote: > > From: Jacob Pan > > > > original code fails when LAST_PAGE is set in flags. > > LAST_PAGE is not documented to be a valid flags for

Re: [PATCH 15/17] x86/hyperv: Make hv_vcpu_is_preempted visible

2019-03-26 Thread Yi Sun
44 > --- a/arch/x86/hyperv/hv_spinlock.c > +++ b/arch/x86/hyperv/hv_spinlock.c > @@ -56,7 +56,7 @@ static void hv_qlock_wait(u8 *byte, u8 val) > /* > * Hyper-V does not support this so far. > */ > -bool hv_vcpu_is_preempted(int vcpu) > +__visible bool hv_vcpu_is_

Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-11-04 Thread Yi Sun
On 18-11-01 08:59:08, Waiman Long wrote: > On 10/31/2018 11:20 PM, Yi Sun wrote: > > On 18-10-31 18:15:39, Peter Zijlstra wrote: > >> On Wed, Oct 31, 2018 at 11:07:22AM -0400, Waiman Long wrote: > >>> On 10/31/2018 10:10 AM, Peter Zijlstra wrote: > >>>>

Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-11-04 Thread Yi Sun
On 18-11-01 08:59:08, Waiman Long wrote: > On 10/31/2018 11:20 PM, Yi Sun wrote: > > On 18-10-31 18:15:39, Peter Zijlstra wrote: > >> On Wed, Oct 31, 2018 at 11:07:22AM -0400, Waiman Long wrote: > >>> On 10/31/2018 10:10 AM, Peter Zijlstra wrote: > >>>>

Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-10-31 Thread Yi Sun
On 18-10-31 18:15:39, Peter Zijlstra wrote: > On Wed, Oct 31, 2018 at 11:07:22AM -0400, Waiman Long wrote: > > On 10/31/2018 10:10 AM, Peter Zijlstra wrote: > > > On Wed, Oct 31, 2018 at 09:54:17AM +0800, Yi Sun wrote: > > >> On 18-10-23 17:33:28, Yi Sun wrote: >

Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-10-31 Thread Yi Sun
On 18-10-31 18:15:39, Peter Zijlstra wrote: > On Wed, Oct 31, 2018 at 11:07:22AM -0400, Waiman Long wrote: > > On 10/31/2018 10:10 AM, Peter Zijlstra wrote: > > > On Wed, Oct 31, 2018 at 09:54:17AM +0800, Yi Sun wrote: > > >> On 18-10-23 17:33:28, Yi Sun wrote: >

Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-10-30 Thread Yi Sun
After syncing with Hyper-V team, we have got answers as below. On 18-10-24 16:53:00, Michael Kelley wrote: > From: Yi Sun Sent: Friday, October 19, 2018 6:14 > AM > > > > The HvNotifyLongSpinWait hypercall (HVCALL_NOTIFY_LONG_SPIN_WAIT) > > is used by a guest OS

Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-10-30 Thread Yi Sun
After syncing with Hyper-V team, we have got answers as below. On 18-10-24 16:53:00, Michael Kelley wrote: > From: Yi Sun Sent: Friday, October 19, 2018 6:14 > AM > > > > The HvNotifyLongSpinWait hypercall (HVCALL_NOTIFY_LONG_SPIN_WAIT) > > is used by a guest OS

Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-10-30 Thread Yi Sun
On 18-10-23 17:33:28, Yi Sun wrote: > On 18-10-23 10:51:27, Peter Zijlstra wrote: > > On Tue, Oct 23, 2018 at 10:57:40AM +0800, Yi Sun wrote: > > > On 18-10-22 19:15:16, Peter Zijlstra wrote: > > > > > > > >>>> +#if defined(CONFIG_X86_64) &

Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-10-30 Thread Yi Sun
On 18-10-23 17:33:28, Yi Sun wrote: > On 18-10-23 10:51:27, Peter Zijlstra wrote: > > On Tue, Oct 23, 2018 at 10:57:40AM +0800, Yi Sun wrote: > > > On 18-10-22 19:15:16, Peter Zijlstra wrote: > > > > > > > >>>> +#if defined(CONFIG_X86_64) &

Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-10-24 Thread Yi Sun
Hi, Michael, Thanks a lot for the review and comments! Let us sync with Hyper-V team to confirm these suspicious points. BRs, Sun Yi On 18-10-24 16:53:00, Michael Kelley wrote: > From: Yi Sun Sent: Friday, October 19, 2018 6:14 > AM > > > > The HvNotifyLong

Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-10-24 Thread Yi Sun
Hi, Michael, Thanks a lot for the review and comments! Let us sync with Hyper-V team to confirm these suspicious points. BRs, Sun Yi On 18-10-24 16:53:00, Michael Kelley wrote: > From: Yi Sun Sent: Friday, October 19, 2018 6:14 > AM > > > > The HvNotifyLong

Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-10-23 Thread Yi Sun
On 18-10-23 10:51:27, Peter Zijlstra wrote: > On Tue, Oct 23, 2018 at 10:57:40AM +0800, Yi Sun wrote: > > On 18-10-22 19:15:16, Peter Zijlstra wrote: > > > > > >>>> +#if defined(CONFIG_X86_64) && defined(CONFIG_PARAVIRT_SPINLOCK

Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-10-23 Thread Yi Sun
On 18-10-23 10:51:27, Peter Zijlstra wrote: > On Tue, Oct 23, 2018 at 10:57:40AM +0800, Yi Sun wrote: > > On 18-10-22 19:15:16, Peter Zijlstra wrote: > > > > > >>>> +#if defined(CONFIG_X86_64) && defined(CONFIG_PARAVIRT_SPINLOCK

Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-10-22 Thread Yi Sun
8 at 12:31:45PM -0400, Waiman Long wrote: > > On 10/22/2018 03:32 AM, Juergen Gross wrote: > > > On 22/10/2018 03:53, Yi Sun wrote: > > >> On 18-10-19 16:20:52, Juergen Gross wrote: > > >>> On 19/10/2018 15:13, Yi Sun wrote: > > >> [...] > &g

Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-10-22 Thread Yi Sun
8 at 12:31:45PM -0400, Waiman Long wrote: > > On 10/22/2018 03:32 AM, Juergen Gross wrote: > > > On 22/10/2018 03:53, Yi Sun wrote: > > >> On 18-10-19 16:20:52, Juergen Gross wrote: > > >>> On 19/10/2018 15:13, Yi Sun wrote: > > >> [...] > &g

Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-10-21 Thread Yi Sun
On 18-10-19 16:20:52, Juergen Gross wrote: > On 19/10/2018 15:13, Yi Sun wrote: [...] > > diff --git a/kernel/locking/qspinlock_paravirt.h > > b/kernel/locking/qspinlock_paravirt.h > > index 0130e48..9e88c7e 100644 > > --- a/kernel/locking/qspinlock_paravirt

Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-10-21 Thread Yi Sun
On 18-10-19 16:20:52, Juergen Gross wrote: > On 19/10/2018 15:13, Yi Sun wrote: [...] > > diff --git a/kernel/locking/qspinlock_paravirt.h > > b/kernel/locking/qspinlock_paravirt.h > > index 0130e48..9e88c7e 100644 > > --- a/kernel/locking/qspinlock_paravirt

[PATCH v1 1/2] x86/hyperv: get spinlock retry number on Hyper-V

2018-10-19 Thread Yi Sun
EBX of Implementation Recommendations MSR (0x4004) indicates recommended number of attempts to retry a spinlock failure before notifying the hypervisor about the failures. 0x indicates never to retry. Signed-off-by: Yi Sun Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang C

[PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-10-19 Thread Yi Sun
improves the scalability of VMs with more than one virtual processor on Hyper-V. Per MSFT TLFS, the retry number (SpinWaitInfo) is sent to hypervisor only when the retry number exceeds the recommended number. If recommended number is 0x, never retry. Signed-off-by: Yi Sun Cc: "K. Y. Srini

[PATCH v1 0/2] Enable HvNotifyLongSpinWait for Hyper-V

2018-10-19 Thread Yi Sun
). This patch set bases on latest tip branch because below patch set has not been merged into main branch. [PATCH v4 0/2] Enable PV qspinlock for Hyper-V Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: Thomas Gleixner Cc: Michael Kelley (EOSG) Cc: Juergen Gross

[PATCH v1 1/2] x86/hyperv: get spinlock retry number on Hyper-V

2018-10-19 Thread Yi Sun
EBX of Implementation Recommendations MSR (0x4004) indicates recommended number of attempts to retry a spinlock failure before notifying the hypervisor about the failures. 0x indicates never to retry. Signed-off-by: Yi Sun Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang C

[PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-10-19 Thread Yi Sun
improves the scalability of VMs with more than one virtual processor on Hyper-V. Per MSFT TLFS, the retry number (SpinWaitInfo) is sent to hypervisor only when the retry number exceeds the recommended number. If recommended number is 0x, never retry. Signed-off-by: Yi Sun Cc: "K. Y. Srini

[PATCH v1 0/2] Enable HvNotifyLongSpinWait for Hyper-V

2018-10-19 Thread Yi Sun
). This patch set bases on latest tip branch because below patch set has not been merged into main branch. [PATCH v4 0/2] Enable PV qspinlock for Hyper-V Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: Thomas Gleixner Cc: Michael Kelley (EOSG) Cc: Juergen Gross

Re: [PATCH v4 2/2] locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V

2018-10-10 Thread Yi Sun
On 18-10-10 07:50:26, Ingo Molnar wrote: > > * Yi Sun wrote: > > > On 18-10-09 12:54:27, Ingo Molnar wrote: > > > > > > * Yi Sun wrote: > > > > > > > Follow PV spinlock mechanism to implement the callback functions > > &

Re: [PATCH v4 2/2] locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V

2018-10-10 Thread Yi Sun
On 18-10-10 07:50:26, Ingo Molnar wrote: > > * Yi Sun wrote: > > > On 18-10-09 12:54:27, Ingo Molnar wrote: > > > > > > * Yi Sun wrote: > > > > > > > Follow PV spinlock mechanism to implement the callback functions > > &

Re: [PATCH v4 2/2] locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V

2018-10-09 Thread Yi Sun
On 18-10-09 12:54:27, Ingo Molnar wrote: > > * Yi Sun wrote: > > > Follow PV spinlock mechanism to implement the callback functions > > to allow the CPU idling and kicking operations on Hyper-V. > > > +#if defined(CONFIG_SMP) > > + smp_ops.smp_prepar

Re: [PATCH v4 2/2] locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V

2018-10-09 Thread Yi Sun
On 18-10-09 12:54:27, Ingo Molnar wrote: > > * Yi Sun wrote: > > > Follow PV spinlock mechanism to implement the callback functions > > to allow the CPU idling and kicking operations on Hyper-V. > > > +#if defined(CONFIG_SMP) > > + smp_ops.smp_prepar

[tip:x86/paravirt] x86/hyperv: Enable PV qspinlock for Hyper-V

2018-10-09 Thread tip-bot for Yi Sun
Commit-ID: 3a025de64bf89c84a79909069e3c24ad9e710d27 Gitweb: https://git.kernel.org/tip/3a025de64bf89c84a79909069e3c24ad9e710d27 Author: Yi Sun AuthorDate: Mon, 8 Oct 2018 16:29:34 +0800 Committer: Thomas Gleixner CommitDate: Tue, 9 Oct 2018 14:21:39 +0200 x86/hyperv: Enable PV

[tip:x86/paravirt] x86/hyperv: Enable PV qspinlock for Hyper-V

2018-10-09 Thread tip-bot for Yi Sun
Commit-ID: 3a025de64bf89c84a79909069e3c24ad9e710d27 Gitweb: https://git.kernel.org/tip/3a025de64bf89c84a79909069e3c24ad9e710d27 Author: Yi Sun AuthorDate: Mon, 8 Oct 2018 16:29:34 +0800 Committer: Thomas Gleixner CommitDate: Tue, 9 Oct 2018 14:21:39 +0200 x86/hyperv: Enable PV

[tip:x86/paravirt] x86/hyperv: Add GUEST_IDLE_MSR support

2018-10-09 Thread tip-bot for Yi Sun
Commit-ID: f726c4620df39055f060537a8ed183c18a2c504b Gitweb: https://git.kernel.org/tip/f726c4620df39055f060537a8ed183c18a2c504b Author: Yi Sun AuthorDate: Thu, 27 Sep 2018 14:01:43 +0800 Committer: Thomas Gleixner CommitDate: Tue, 9 Oct 2018 14:14:49 +0200 x86/hyperv: Add

[tip:x86/paravirt] x86/hyperv: Add GUEST_IDLE_MSR support

2018-10-09 Thread tip-bot for Yi Sun
Commit-ID: f726c4620df39055f060537a8ed183c18a2c504b Gitweb: https://git.kernel.org/tip/f726c4620df39055f060537a8ed183c18a2c504b Author: Yi Sun AuthorDate: Thu, 27 Sep 2018 14:01:43 +0800 Committer: Thomas Gleixner CommitDate: Tue, 9 Oct 2018 14:14:49 +0200 x86/hyperv: Add

[tip:x86/hyperv] x86/hyperv: Enable PV qspinlock for Hyper-V

2018-10-09 Thread tip-bot for Yi Sun
Commit-ID: b36bcb7ce0b353bd4889e06b61e036744b02ca51 Gitweb: https://git.kernel.org/tip/b36bcb7ce0b353bd4889e06b61e036744b02ca51 Author: Yi Sun AuthorDate: Mon, 8 Oct 2018 16:29:34 +0800 Committer: Thomas Gleixner CommitDate: Tue, 9 Oct 2018 11:26:31 +0200 x86/hyperv: Enable PV

[tip:x86/hyperv] x86/hyperv: Enable PV qspinlock for Hyper-V

2018-10-09 Thread tip-bot for Yi Sun
Commit-ID: b36bcb7ce0b353bd4889e06b61e036744b02ca51 Gitweb: https://git.kernel.org/tip/b36bcb7ce0b353bd4889e06b61e036744b02ca51 Author: Yi Sun AuthorDate: Mon, 8 Oct 2018 16:29:34 +0800 Committer: Thomas Gleixner CommitDate: Tue, 9 Oct 2018 11:26:31 +0200 x86/hyperv: Enable PV

[PATCH v4 1/2] X86/Hyper-V: Add Guest IDLE MSR support

2018-10-08 Thread Yi Sun
Hemminger Signed-off-by: Yi Sun Reviewed-by: Michael Kelley --- arch/x86/include/asm/hyperv-tlfs.h | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/x86/include/asm/hyperv-tlfs.h b/arch/x86/include/asm/hyperv-tlfs.h index 00e01d2..4139f76 100644 --- a/arch/x86/include/asm/hyperv-tl

[PATCH v4 2/2] locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V

2018-10-08 Thread Yi Sun
Follow PV spinlock mechanism to implement the callback functions to allow the CPU idling and kicking operations on Hyper-V. Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: Thomas Gleixner Cc: Michael Kelley (EOSG) Cc: Juergen Gross Signed-off-by: Yi Sun

[PATCH v4 1/2] X86/Hyper-V: Add Guest IDLE MSR support

2018-10-08 Thread Yi Sun
Hemminger Signed-off-by: Yi Sun Reviewed-by: Michael Kelley --- arch/x86/include/asm/hyperv-tlfs.h | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/x86/include/asm/hyperv-tlfs.h b/arch/x86/include/asm/hyperv-tlfs.h index 00e01d2..4139f76 100644 --- a/arch/x86/include/asm/hyperv-tl

[PATCH v4 2/2] locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V

2018-10-08 Thread Yi Sun
Follow PV spinlock mechanism to implement the callback functions to allow the CPU idling and kicking operations on Hyper-V. Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: Thomas Gleixner Cc: Michael Kelley (EOSG) Cc: Juergen Gross Signed-off-by: Yi Sun

[PATCH v4 0/2] Enable PV qspinlock for Hyper-V

2018-10-08 Thread Yi Sun
ce so far. Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: Jonathan Corbet Cc: Thomas Gleixner Cc: Michael Kelley (EOSG) Cc: Juergen Gross Yi Sun (2): X86/Hyper-V: Add Guest IDLE MSR support locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V Doc

[PATCH v4 0/2] Enable PV qspinlock for Hyper-V

2018-10-08 Thread Yi Sun
ce so far. Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: Jonathan Corbet Cc: Thomas Gleixner Cc: Michael Kelley (EOSG) Cc: Juergen Gross Yi Sun (2): X86/Hyper-V: Add Guest IDLE MSR support locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V Doc

Re: [tip:x86/hyperv] x86/hyperv: Enable PV qspinlock for Hyper-V

2018-10-08 Thread Yi Sun
dmsr result in a hang? > > I believe the correct way would be to: > > - disable interrupts before above READ_ONCE() and restore them > after the rdmsrl() > > - return early if in_nmi() > > similar as the kvm specific variant is doing it. > > > Juergen Thank you for the suggestion! That is a possible case. I will submit a new version in soon. BRs, Yi Sun

Re: [tip:x86/hyperv] x86/hyperv: Enable PV qspinlock for Hyper-V

2018-10-08 Thread Yi Sun
dmsr result in a hang? > > I believe the correct way would be to: > > - disable interrupts before above READ_ONCE() and restore them > after the rdmsrl() > > - return early if in_nmi() > > similar as the kvm specific variant is doing it. > > > Juergen Thank you for the suggestion! That is a possible case. I will submit a new version in soon. BRs, Yi Sun

[tip:x86/hyperv] x86/hyperv: Add GUEST_IDLE_MSR support

2018-10-02 Thread tip-bot for Yi Sun
Commit-ID: 10d02e13385ce1e90abb49ef1e9a366a5d968157 Gitweb: https://git.kernel.org/tip/10d02e13385ce1e90abb49ef1e9a366a5d968157 Author: Yi Sun AuthorDate: Thu, 27 Sep 2018 14:01:43 +0800 Committer: Thomas Gleixner CommitDate: Tue, 2 Oct 2018 13:21:52 +0200 x86/hyperv: Add

[tip:x86/hyperv] x86/hyperv: Add GUEST_IDLE_MSR support

2018-10-02 Thread tip-bot for Yi Sun
Commit-ID: 10d02e13385ce1e90abb49ef1e9a366a5d968157 Gitweb: https://git.kernel.org/tip/10d02e13385ce1e90abb49ef1e9a366a5d968157 Author: Yi Sun AuthorDate: Thu, 27 Sep 2018 14:01:43 +0800 Committer: Thomas Gleixner CommitDate: Tue, 2 Oct 2018 13:21:52 +0200 x86/hyperv: Add

[tip:x86/hyperv] x86/hyperv: Enable PV qspinlock for Hyper-V

2018-10-02 Thread tip-bot for Yi Sun
Commit-ID: aaa7fc34c003bd8133a49f7634480cef6288ad55 Gitweb: https://git.kernel.org/tip/aaa7fc34c003bd8133a49f7634480cef6288ad55 Author: Yi Sun AuthorDate: Thu, 27 Sep 2018 14:01:44 +0800 Committer: Thomas Gleixner CommitDate: Tue, 2 Oct 2018 13:22:06 +0200 x86/hyperv: Enable PV

[tip:x86/hyperv] x86/hyperv: Enable PV qspinlock for Hyper-V

2018-10-02 Thread tip-bot for Yi Sun
Commit-ID: aaa7fc34c003bd8133a49f7634480cef6288ad55 Gitweb: https://git.kernel.org/tip/aaa7fc34c003bd8133a49f7634480cef6288ad55 Author: Yi Sun AuthorDate: Thu, 27 Sep 2018 14:01:44 +0800 Committer: Thomas Gleixner CommitDate: Tue, 2 Oct 2018 13:22:06 +0200 x86/hyperv: Enable PV

[PATCH v3 2/2] locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V

2018-09-27 Thread Yi Sun
Follow PV spinlock mechanism to implement the callback functions to allow the CPU idling and kicking operations on Hyper-V. Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: Thomas Gleixner Cc: Michael Kelley (EOSG) Signed-off-by: Yi Sun --- v2->v3: -

[PATCH v3 2/2] locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V

2018-09-27 Thread Yi Sun
Follow PV spinlock mechanism to implement the callback functions to allow the CPU idling and kicking operations on Hyper-V. Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: Thomas Gleixner Cc: Michael Kelley (EOSG) Signed-off-by: Yi Sun --- v2->v3: -

[PATCH v3 1/2] X86/Hyper-V: Add Guest IDLE MSR support

2018-09-27 Thread Yi Sun
Hemminger Reviewed-by: Michael Kelley Signed-off-by: Yi Sun --- arch/x86/include/asm/hyperv-tlfs.h | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/x86/include/asm/hyperv-tlfs.h b/arch/x86/include/asm/hyperv-tlfs.h index 00e01d2..4139f76 100644 --- a/arch/x86/include/asm/hyperv-tl

[PATCH v3 0/2] Enable PV qspinlock for Hyper-V

2018-09-27 Thread Yi Sun
use Hyper-V does not provide such interface so far. Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: Jonathan Corbet Cc: Thomas Gleixner Cc: Michael Kelley (EOSG) Yi Sun (2): X86/Hyper-V: Add Guest IDLE MSR support locking/pvqspinlock, hv: Enable PV qspinlock for Hyp

[PATCH v3 1/2] X86/Hyper-V: Add Guest IDLE MSR support

2018-09-27 Thread Yi Sun
Hemminger Reviewed-by: Michael Kelley Signed-off-by: Yi Sun --- arch/x86/include/asm/hyperv-tlfs.h | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/x86/include/asm/hyperv-tlfs.h b/arch/x86/include/asm/hyperv-tlfs.h index 00e01d2..4139f76 100644 --- a/arch/x86/include/asm/hyperv-tl

[PATCH v3 0/2] Enable PV qspinlock for Hyper-V

2018-09-27 Thread Yi Sun
use Hyper-V does not provide such interface so far. Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: Jonathan Corbet Cc: Thomas Gleixner Cc: Michael Kelley (EOSG) Yi Sun (2): X86/Hyper-V: Add Guest IDLE MSR support locking/pvqspinlock, hv: Enable PV qspinlock for Hyp

Re: [PATCH v2 2/2] locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V

2018-09-25 Thread Yi Sun
On 18-09-21 17:02:54, Michael Kelley (EOSG) wrote: > From: Yi Sun Sent: Friday, September 21, 2018 > 12:25 AM > > + > > +#define pr_fmt(fmt) "hv: " fmt > > Other Hyper-V messages use "Hyper-V: " as the prefix, not "hv: ". Take > a q

Re: [PATCH v2 2/2] locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V

2018-09-25 Thread Yi Sun
On 18-09-21 17:02:54, Michael Kelley (EOSG) wrote: > From: Yi Sun Sent: Friday, September 21, 2018 > 12:25 AM > > + > > +#define pr_fmt(fmt) "hv: " fmt > > Other Hyper-V messages use "Hyper-V: " as the prefix, not "hv: ". Take > a q

[PATCH v2 0/2] Enable PV qspinlock for Hyper-V

2018-09-21 Thread Yi Sun
cpu exit idle state. In vcpu_is_preempted callback function, return false directly because Hyper-V does not provide such interface so far. Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: Jonathan Corbet Cc: Thomas Gleixner Yi Sun (2): X86/Hyper-V: Add Guest IDL

[PATCH v2 2/2] locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V

2018-09-21 Thread Yi Sun
Follow PV spinlock mechanism to implement the callback functions to allow the CPU idling and kicking operations on Hyper-V. Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: Thomas Gleixner Signed-off-by: Yi Sun --- v1->v2: - compile hv_spinloc

[PATCH v2 1/2] X86/Hyper-V: Add Guest IDLE MSR support

2018-09-21 Thread Yi Sun
Hemminger Signed-off-by: Yi Sun --- arch/x86/include/asm/hyperv-tlfs.h | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/x86/include/asm/hyperv-tlfs.h b/arch/x86/include/asm/hyperv-tlfs.h index e977b6b..2a2fa17 100644 --- a/arch/x86/include/asm/hyperv-tlfs.h +++ b/arch/x86/include/

[PATCH v2 0/2] Enable PV qspinlock for Hyper-V

2018-09-21 Thread Yi Sun
cpu exit idle state. In vcpu_is_preempted callback function, return false directly because Hyper-V does not provide such interface so far. Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: Jonathan Corbet Cc: Thomas Gleixner Yi Sun (2): X86/Hyper-V: Add Guest IDL

[PATCH v2 2/2] locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V

2018-09-21 Thread Yi Sun
Follow PV spinlock mechanism to implement the callback functions to allow the CPU idling and kicking operations on Hyper-V. Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: Thomas Gleixner Signed-off-by: Yi Sun --- v1->v2: - compile hv_spinloc

[PATCH v2 1/2] X86/Hyper-V: Add Guest IDLE MSR support

2018-09-21 Thread Yi Sun
Hemminger Signed-off-by: Yi Sun --- arch/x86/include/asm/hyperv-tlfs.h | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/x86/include/asm/hyperv-tlfs.h b/arch/x86/include/asm/hyperv-tlfs.h index e977b6b..2a2fa17 100644 --- a/arch/x86/include/asm/hyperv-tlfs.h +++ b/arch/x86/include/

Re: [PATCH v1 2/3] locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V

2018-09-19 Thread Yi Sun
Hi, On 18-09-17 20:54:52, Yi Sun wrote: > On 18-09-14 12:42:33, Thomas Gleixner wrote: > > On Fri, 14 Sep 2018, Yi Sun wrote: > > > > > +static void hv_notify_long_spin_wait(void) > > > > > +{ > > > > > + u64 input = spin_wait_info |

Re: [PATCH v1 2/3] locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V

2018-09-19 Thread Yi Sun
Hi, On 18-09-17 20:54:52, Yi Sun wrote: > On 18-09-14 12:42:33, Thomas Gleixner wrote: > > On Fri, 14 Sep 2018, Yi Sun wrote: > > > > > +static void hv_notify_long_spin_wait(void) > > > > > +{ > > > > > + u64 input = spin_wait_info |

Re: [PATCH v1 0/3] Enable PV qspinlock for Hyper-V

2018-09-17 Thread Yi Sun
On 18-09-15 23:43:12, Michael Kelley (EOSG) wrote: > >From Yi Sun Sent: Thursday, September 13, 2018 2:13 AM > > > This patch adds the necessary Hyper-V specific code to allow > > PV qspinlock work on Hyper-V. > > > > Have you done any performance measurements

Re: [PATCH v1 0/3] Enable PV qspinlock for Hyper-V

2018-09-17 Thread Yi Sun
On 18-09-15 23:43:12, Michael Kelley (EOSG) wrote: > >From Yi Sun Sent: Thursday, September 13, 2018 2:13 AM > > > This patch adds the necessary Hyper-V specific code to allow > > PV qspinlock work on Hyper-V. > > > > Have you done any performance measurements

Re: [PATCH v1 2/3] locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V

2018-09-17 Thread Yi Sun
On 18-09-14 12:42:33, Thomas Gleixner wrote: > On Fri, 14 Sep 2018, Yi Sun wrote: > > > > +static void hv_notify_long_spin_wait(void) > > > > +{ > > > > + u64 input = spin_wait_info | 0x; > > > > > > What? The resul

Re: [PATCH v1 2/3] locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V

2018-09-17 Thread Yi Sun
On 18-09-14 12:42:33, Thomas Gleixner wrote: > On Fri, 14 Sep 2018, Yi Sun wrote: > > > > +static void hv_notify_long_spin_wait(void) > > > > +{ > > > > + u64 input = spin_wait_info | 0x; > > > > > > What? The resul

Re: [PATCH v1 2/3] locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V

2018-09-14 Thread Yi Sun
On 18-09-13 13:24:07, Thomas Gleixner wrote: > On Thu, 13 Sep 2018, Yi Sun wrote: > > +++ b/arch/x86/hyperv/hv_spinlock.c > > @@ -0,0 +1,99 @@ > > +// SPDX-License-Identifier: GPL-2.0 > > + > > +/* > > + * Hyper-V specific spinlock code. > &g

Re: [PATCH v1 2/3] locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V

2018-09-14 Thread Yi Sun
On 18-09-13 13:24:07, Thomas Gleixner wrote: > On Thu, 13 Sep 2018, Yi Sun wrote: > > +++ b/arch/x86/hyperv/hv_spinlock.c > > @@ -0,0 +1,99 @@ > > +// SPDX-License-Identifier: GPL-2.0 > > + > > +/* > > + * Hyper-V specific spinlock code. > &g

Re: [PATCH v1 2/3] locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V

2018-09-14 Thread Yi Sun
On 18-09-13 13:06:13, Thomas Gleixner wrote: > On Thu, 13 Sep 2018, Yi Sun wrote: > > +#include > > > > /* representing HT siblings of each logical CPU */ > > DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_sibling_map); > > @@ -1335,6 +1336,7 @@ void __init

Re: [PATCH v1 2/3] locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V

2018-09-14 Thread Yi Sun
On 18-09-13 13:06:13, Thomas Gleixner wrote: > On Thu, 13 Sep 2018, Yi Sun wrote: > > +#include > > > > /* representing HT siblings of each logical CPU */ > > DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_sibling_map); > > @@ -1335,6 +1336,7 @@ void __init

[PATCH v1 2/3] locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V

2018-09-13 Thread Yi Sun
that is potentially held by another virtual processor within the same partition. This scheduling hint improves the scalability of partitions with more than one virtual processor. Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Signed-off-by: Yi Sun --- arch/x86/hyperv/Makefile

[PATCH v1 1/3] X86/Hyper-V: Add Guest IDLE MSR support

2018-09-13 Thread Yi Sun
Hemminger Signed-off-by: Yi Sun --- arch/x86/include/asm/hyperv-tlfs.h | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/x86/include/asm/hyperv-tlfs.h b/arch/x86/include/asm/hyperv-tlfs.h index e977b6b..2a2fa17 100644 --- a/arch/x86/include/asm/hyperv-tlfs.h +++ b/arch/x86/include/

[PATCH v1 3/3] hv: add description for hv_nopvspin

2018-09-13 Thread Yi Sun
hv_nopvspin is a command line parameter used to disable Hyper-V PV spinlock. Cc: Jonathan Corbet Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Signed-off-by: Yi Sun --- Documentation/admin-guide/kernel-parameters.txt | 5 + 1 file changed, 5 insertions(+)

[PATCH v1 2/3] locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V

2018-09-13 Thread Yi Sun
that is potentially held by another virtual processor within the same partition. This scheduling hint improves the scalability of partitions with more than one virtual processor. Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Signed-off-by: Yi Sun --- arch/x86/hyperv/Makefile

[PATCH v1 1/3] X86/Hyper-V: Add Guest IDLE MSR support

2018-09-13 Thread Yi Sun
Hemminger Signed-off-by: Yi Sun --- arch/x86/include/asm/hyperv-tlfs.h | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/x86/include/asm/hyperv-tlfs.h b/arch/x86/include/asm/hyperv-tlfs.h index e977b6b..2a2fa17 100644 --- a/arch/x86/include/asm/hyperv-tlfs.h +++ b/arch/x86/include/

[PATCH v1 3/3] hv: add description for hv_nopvspin

2018-09-13 Thread Yi Sun
hv_nopvspin is a command line parameter used to disable Hyper-V PV spinlock. Cc: Jonathan Corbet Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Signed-off-by: Yi Sun --- Documentation/admin-guide/kernel-parameters.txt | 5 + 1 file changed, 5 insertions(+)

[PATCH v1 0/3] Enable PV qspinlock for Hyper-V

2018-09-13 Thread Yi Sun
han Corbet Yi Sun (3): X86/Hyper-V: Add Guest IDLE MSR support locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V hv: add description for hv_nopvspin Documentation/admin-guide/kernel-parameters.txt | 5 ++ arch/x86/hyperv/Makefile| 2 +- arch/x86/hyperv/hv_

[PATCH v1 0/3] Enable PV qspinlock for Hyper-V

2018-09-13 Thread Yi Sun
han Corbet Yi Sun (3): X86/Hyper-V: Add Guest IDLE MSR support locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V hv: add description for hv_nopvspin Documentation/admin-guide/kernel-parameters.txt | 5 ++ arch/x86/hyperv/Makefile| 2 +- arch/x86/hyperv/hv_