[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 7/8] xen/arm: Set foreign page type to p2m_map_foreign





On 12/05/2013 04:34 PM, Ian Campbell wrote:
On Thu, 2013-12-05 at 15:42 +0000, Julien Grall wrote:
Xen needs to know that the current page belongs to another domain. Also take
the refcount to this page.

Signed-off-by: Julien Grall <julien.grall@xxxxxxxxxx>
---
  xen/arch/arm/mm.c |   14 +++++++++-----
  1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 960c872..bf383a7 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -977,6 +977,7 @@ static int xenmem_add_to_physmap_one(
  {
      unsigned long mfn = 0;
      int rc;
+    p2m_type_t t = p2m_ram_rw;

Can we set this explicitly on a per-mapspace basis please, so the
compiler will complain about an uninitialised variable if we forget to
add the type for a new map space, instead of silently creating writable
ram mappings.

Actually, GCC compiler won't complain if t is not set in one of the case.
If have tried this following dummy function on several version of GCC (the most recent is 4.8.2) and they don't emit any warning.

=================================================================
int f (int a)
{
    int b;

    switch (a)
    {
    case 1:
        b = 1;
        break;
    case 2:
        /* b is unset */
        break;
    }

    return b;
}
====================================================================

I have also tried clang, and I effectively get an error. But we don't yet support clang for Xen ARM port.

I have found a bug report opened in 2004 for this kind of bug, but never fixed... (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18501).

--
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.