xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [Xen-devel] [PATCH 14/30] x86/xen: Add missing annotation for xen_pte_lock()
       [not found] ` <20200214204741.94112-1-jbi.octave@gmail.com>
@ 2020-02-14 20:47   ` Jules Irenge
  2020-02-14 22:40     ` Boris Ostrovsky
  2020-02-14 20:47   ` [Xen-devel] [PATCH 15/30] x86/xen: Add missing annotation for xen_pte_unlock() Jules Irenge
  1 sibling, 1 reply; 4+ messages in thread
From: Jules Irenge @ 2020-02-14 20:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: Juergen Gross, Jules Irenge, Stefano Stabellini, boqun.feng,
	maintainer:X86 ARCHITECTURE 32-BIT AND 64-BIT, Ingo Molnar,
	Borislav Petkov, H. Peter Anvin,
	moderated list:XEN HYPERVISOR INTERFACE, Boris Ostrovsky,
	Thomas Gleixner

Sparse reports warning at xen_pte_lock()

warning: context imbalance in xen_pte_lock() - wrong count at exit

The root cause is the missing annotation at xen_pte_lock()
Add the missing __acquires(ptl) annotation

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 arch/x86/xen/mmu_pv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/xen/mmu_pv.c b/arch/x86/xen/mmu_pv.c
index bbba8b17829a..352f0c80cfcf 100644
--- a/arch/x86/xen/mmu_pv.c
+++ b/arch/x86/xen/mmu_pv.c
@@ -695,6 +695,7 @@ static int xen_pgd_walk(struct mm_struct *mm,
 /* If we're using split pte locks, then take the page's lock and
    return a pointer to it.  Otherwise return NULL. */
 static spinlock_t *xen_pte_lock(struct page *page, struct mm_struct *mm)
+	__acquires(ptl)
 {
 	spinlock_t *ptl = NULL;
 
-- 
2.24.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Xen-devel] [PATCH 15/30] x86/xen: Add missing annotation for xen_pte_unlock()
       [not found] ` <20200214204741.94112-1-jbi.octave@gmail.com>
  2020-02-14 20:47   ` [Xen-devel] [PATCH 14/30] x86/xen: Add missing annotation for xen_pte_lock() Jules Irenge
@ 2020-02-14 20:47   ` Jules Irenge
  1 sibling, 0 replies; 4+ messages in thread
From: Jules Irenge @ 2020-02-14 20:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: Juergen Gross, Jules Irenge, Stefano Stabellini, boqun.feng,
	maintainer:X86 ARCHITECTURE 32-BIT AND 64-BIT, Ingo Molnar,
	Borislav Petkov, H. Peter Anvin,
	moderated list:XEN HYPERVISOR INTERFACE, Boris Ostrovsky,
	Thomas Gleixner

Sparse reports warning at xen_pte_unlock()

warning: context imbalance in xen_pte_unlock() - unexpected unlock

The root cause is the missing annotation at xen_pte_unlock()
Add the missing __releases(ptl) annotation

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 arch/x86/xen/mmu_pv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/xen/mmu_pv.c b/arch/x86/xen/mmu_pv.c
index 352f0c80cfcf..777008f8c668 100644
--- a/arch/x86/xen/mmu_pv.c
+++ b/arch/x86/xen/mmu_pv.c
@@ -707,7 +707,7 @@ static spinlock_t *xen_pte_lock(struct page *page, struct mm_struct *mm)
 	return ptl;
 }
 
-static void xen_pte_unlock(void *v)
+static void xen_pte_unlock(void *v) __releases(ptl)
 {
 	spinlock_t *ptl = v;
 	spin_unlock(ptl);
-- 
2.24.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Xen-devel] [PATCH 14/30] x86/xen: Add missing annotation for xen_pte_lock()
  2020-02-14 20:47   ` [Xen-devel] [PATCH 14/30] x86/xen: Add missing annotation for xen_pte_lock() Jules Irenge
@ 2020-02-14 22:40     ` Boris Ostrovsky
  2020-02-15 21:13       ` Jules Irenge
  0 siblings, 1 reply; 4+ messages in thread
From: Boris Ostrovsky @ 2020-02-14 22:40 UTC (permalink / raw)
  To: Jules Irenge, linux-kernel
  Cc: Juergen Gross, Stefano Stabellini, boqun.feng,
	maintainer:X86 ARCHITECTURE 32-BIT AND 64-BIT, Ingo Molnar,
	Borislav Petkov, H. Peter Anvin,
	moderated list:XEN HYPERVISOR INTERFACE, Thomas Gleixner



On 2/14/20 3:47 PM, Jules Irenge wrote:
> Sparse reports warning at xen_pte_lock()
>
> warning: context imbalance in xen_pte_lock() - wrong count at exit
>
> The root cause is the missing annotation at xen_pte_lock()
> Add the missing __acquires(ptl) annotation
>
> Signed-off-by: Jules Irenge <jbi.octave@gmail.com>

Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

although I'd prefer this and the next patch to be merged into a single one.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Xen-devel] [PATCH 14/30] x86/xen: Add missing annotation for xen_pte_lock()
  2020-02-14 22:40     ` Boris Ostrovsky
@ 2020-02-15 21:13       ` Jules Irenge
  0 siblings, 0 replies; 4+ messages in thread
From: Jules Irenge @ 2020-02-15 21:13 UTC (permalink / raw)
  To: Boris Ostrovsky
  Cc: Juergen Gross, Jules Irenge, Stefano Stabellini, boqun.feng,
	maintainer:X86 ARCHITECTURE 32-BIT AND 64-BIT, linux-kernel,
	Ingo Molnar, Borislav Petkov, H. Peter Anvin,
	moderated list:XEN HYPERVISOR INTERFACE, Thomas Gleixner

Thanks for the feedback. I will send the merged version then if it s fine 
with you.
Regards,
Jules

On Fri, 14 Feb 2020, Boris Ostrovsky wrote:

> 
> 
> On 2/14/20 3:47 PM, Jules Irenge wrote:
> > Sparse reports warning at xen_pte_lock()
> >
> > warning: context imbalance in xen_pte_lock() - wrong count at exit
> >
> > The root cause is the missing annotation at xen_pte_lock()
> > Add the missing __acquires(ptl) annotation
> >
> > Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
> 
> Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> 
> although I'd prefer this and the next patch to be merged into a single one.
> 
> 
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-02-15 21:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <0/30>
     [not found] ` <20200214204741.94112-1-jbi.octave@gmail.com>
2020-02-14 20:47   ` [Xen-devel] [PATCH 14/30] x86/xen: Add missing annotation for xen_pte_lock() Jules Irenge
2020-02-14 22:40     ` Boris Ostrovsky
2020-02-15 21:13       ` Jules Irenge
2020-02-14 20:47   ` [Xen-devel] [PATCH 15/30] x86/xen: Add missing annotation for xen_pte_unlock() Jules Irenge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).