WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ia64-devel

Re: [Xen-ia64-devel] [PATCH] remove warnings in replace_grant_host_mappi

To: Alex Williamson <alex.williamson@xxxxxx>
Subject: Re: [Xen-ia64-devel] [PATCH] remove warnings in replace_grant_host_mapping()
From: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Date: Tue, 13 May 2008 12:16:54 +0900
Cc: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 12 May 2008 20:17:10 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <1210648015.7714.6.camel@lappy>
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20080513025625.GR7053%yamahata@xxxxxxxxxxxxx> <1210648015.7714.6.camel@lappy>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.6i
On Mon, May 12, 2008 at 09:06:55PM -0600, Alex Williamson wrote:
> On Tue, 2008-05-13 at 11:56 +0900, Isaku Yamahata wrote:
> > [IA64] remove warnings in replace_grant_host_mapping()
> 
> > diff -r b52e75f2416a xen/arch/ia64/xen/mm.c
> > --- a/xen/arch/ia64/xen/mm.c        Mon May 12 16:23:54 2008 +0900
> > +++ b/xen/arch/ia64/xen/mm.c        Mon May 12 16:30:46 2008 +0900
> > @@ -2191,7 +2191,7 @@
> >      struct page_info* page = mfn_to_page(mfn);
> >      struct page_info* new_page = NULL;
> >      volatile pte_t* new_page_pte = NULL;
> > -    unsigned long new_page_mfn;
> > +    unsigned long new_page_mfn = INVALID_MFN;
> >  
> >      if (new_gpaddr) {
> >          new_page_pte = lookup_noalloc_domain_pte_none(d, new_gpaddr);
> > @@ -2211,7 +2211,7 @@
> >                               "new_gpaddr 0x%lx mfn 0x%lx\n",
> >                               __func__, gpaddr, mfn, new_gpaddr, 
> > new_page_mfn);
> >                      new_page = NULL; /* prevent domain_put_page() */
> > -                    goto out;
> > +                    goto out_nomsg;
> 
> These could really just be 'return GNTST_general_error;' since there's
> no other cleanup, then you could avoid a goto.

Yes, attached the updated one.

[IA64] remove warnings in replace_grant_host_mapping()

This patch removes warnings in replace_grant_host_mapping().
> mm.c: In function 'replace_grant_host_mapping':
> mm.c:2194: warning: 'new_page_mfn' may be used uninitialized in this function
> mm.c:2190: warning: 'old_pte.pte' may be used uninitialized in this function
> mm.c:2188: warning: 'cur_pte.pte' may be used uninitialized in this function

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>

diff -r 410e8579a69b xen/arch/ia64/xen/mm.c
--- a/xen/arch/ia64/xen/mm.c    Tue May 13 11:25:54 2008 +0900
+++ b/xen/arch/ia64/xen/mm.c    Tue May 13 12:10:55 2008 +0900
@@ -2191,7 +2191,7 @@
     struct page_info* page = mfn_to_page(mfn);
     struct page_info* new_page = NULL;
     volatile pte_t* new_page_pte = NULL;
-    unsigned long new_page_mfn;
+    unsigned long new_page_mfn = INVALID_MFN;
 
     if (new_gpaddr) {
         new_page_pte = lookup_noalloc_domain_pte_none(d, new_gpaddr);
@@ -2211,7 +2211,7 @@
                              "new_gpaddr 0x%lx mfn 0x%lx\n",
                              __func__, gpaddr, mfn, new_gpaddr, new_page_mfn);
                     new_page = NULL; /* prevent domain_put_page() */
-                    goto out;
+                    return GNTST_general_error;
                 }
 
                 /*
@@ -2228,7 +2228,7 @@
                                  "new_gpaddr 0x%lx mfn 0x%lx\n",
                                  __func__, gpaddr, mfn,
                                  new_gpaddr, new_page_mfn);
-                        goto out;
+                        return GNTST_general_error;
                     }
                 }
                 domain_put_page(d, new_gpaddr, new_page_pte, new_pte, 0);
@@ -2246,7 +2246,7 @@
     if (pte == NULL) {
         gdprintk(XENLOG_INFO, "%s: gpaddr 0x%lx mfn 0x%lx\n",
                 __func__, gpaddr, mfn);
-        goto out;
+        return GNTST_general_error;
     }
 
  again:
@@ -2256,10 +2256,11 @@
         (page_get_owner(page) == d && get_gpfn_from_mfn(mfn) == gpfn)) {
         gdprintk(XENLOG_INFO, "%s: gpaddr 0x%lx mfn 0x%lx cur_pte 0x%lx\n",
                 __func__, gpaddr, mfn, pte_val(cur_pte));
-        goto out;
+        return GNTST_general_error;
     }
 
     if (new_page) {
+        BUG_ON(new_page_mfn == INVALID_MFN);
         set_gpfn_from_mfn(new_page_mfn, gpfn);
         /* smp_mb() isn't needed because assign_domain_pge_cmpxchg_rel()
            has release semantics. */
@@ -2270,6 +2271,7 @@
             goto again;
         }
         if (new_page) {
+            BUG_ON(new_page_mfn == INVALID_MFN);
             set_gpfn_from_mfn(new_page_mfn, INVALID_M2P_ENTRY);
             domain_put_page(d, new_gpaddr, new_page_pte, new_pte, 1);
         }


-- 
yamahata

Attachment: fix_replace_grant_host_mapping.patch
Description: Text Data

_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
<Prev in Thread] Current Thread [Next in Thread>