From minios-devel-bounces@lists.xenproject.org Mon Jun 15 09:51:03 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 15 Jun 2015 09:51:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z4R2l-0000Fc-Uf
	for archives@lists.xenproject.org; Mon, 15 Jun 2015 09:51:03 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <lars.kurth.xen@gmail.com>)
	id 1Z4R2j-0000FJ-GN; Mon, 15 Jun 2015 09:51:01 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	DE/07-03371-400AE755; Mon, 15 Jun 2015 09:51:00 +0000
X-Env-Sender: lars.kurth.xen@gmail.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1434361859!18734806!1
X-Originating-IP: [209.85.212.181]
X-SpamReason: No, hits=0.3 required=7.0 tests=HTML_60_70,HTML_MESSAGE
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18166 invoked from network); 15 Jun 2015 09:50:59 -0000
Received: from mail-wi0-f181.google.com (HELO mail-wi0-f181.google.com)
	(209.85.212.181)
	by server-5.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Jun 2015 09:50:59 -0000
Received: by wibdq8 with SMTP id dq8so72005417wib.1;
	Mon, 15 Jun 2015 02:50:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:content-type:subject:date:message-id:cc:to:mime-version;
	bh=YsmdnaX2L+0I6XGqNcNRv5NNGGMBl/1thV1h8Uvrzf0=;
	b=D027Q5hSNxyAXNi87vZS3/1CeW6Is4RgBNGdapoRbcPO2lnyDnNGCDdxtTzPxZVWYS
	fvHQz6qM1Yl2mPnWePPmyN1dsC9s+XYm1/gNeOEhqmlZw3mdfh5GKasZEtl8e9yoDZKd
	HhpvYFnPlpNuG2ROZG2H7BZDSnU4xtOiVJpqQ+YgMqM4/Ydqs5fyOdiOwtRgIn6FYNzC
	XfJ4GJDUs++9+YUNCduiWSW8atoVVusWfwoT9YxkK4sc3vCTK8rUPyvh1h9tp4KrzNPl
	A9HcQPM+EyeX5ERix7uaeA6LNp4ccJtvdX6OBD3m/xvTin+CvZ5MzwO1D9F63+ypnyzF
	vH7Q==
X-Received: by 10.180.20.198 with SMTP id p6mr30265171wie.38.1434361859382;
	Mon, 15 Jun 2015 02:50:59 -0700 (PDT)
Received: from [192.168.0.12] (97e3cdda.skybroadband.com. [151.227.205.218])
	by mx.google.com with ESMTPSA id m4sm16670763wjb.37.2015.06.15.02.50.57
	(version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
	Mon, 15 Jun 2015 02:50:58 -0700 (PDT)
From: Lars Kurth <lars.kurth.xen@gmail.com>
Date: Mon, 15 Jun 2015 10:50:56 +0100
Message-Id: <AB64F02A-CE99-467A-AAA1-87DF646405CD@gmail.com>
To: minios-devel@lists.xenproject.org,
	xen-devel <xen-devel@lists.xenproject.org>, mirageos-devel@xenproject.org,
	xen-api@lists.xenproject.org, embedded-pv-devel@lists.xenproject.org
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\))
X-Mailer: Apple Mail (2.2098)
Cc: Wei Liu <wei.liu2@citrix.com>
Subject: [Minios-devel] minios-devel list is now live
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0477474498814364456=="
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org


--===============0477474498814364456==
Content-Type: multipart/alternative; boundary="Apple-Mail=_5905D8BD-F973-4DC4-A43C-1DB7909C84FB"


--Apple-Mail=_5905D8BD-F973-4DC4-A43C-1DB7909C84FB
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

Hi all,
as requested, we created a new mailing list for minios development. You =
can subscribe via=20

http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel =
<http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>

or by sending an email with subject line "subscribe" to =
minios-devel-request@lists.xenproject.org

Regards
Lars=

--Apple-Mail=_5905D8BD-F973-4DC4-A43C-1DB7909C84FB
Content-Transfer-Encoding: 7bit
Content-Type: text/html;
	charset=us-ascii

<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi all,<div class="">as requested, we created a new mailing list for minios development. You can subscribe via&nbsp;</div><div class=""><br class=""></div><div class=""><a href="http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel" class="">http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel</a></div><div class=""><br class=""></div><div class="">or by sending an email with subject line "subscribe" to&nbsp;<a href="mailto:minios-devel-request@lists.xenproject.org" class="">minios-devel-request@lists.xenproject.org</a></div><div class=""><br class=""></div><div class="">Regards</div><div class="">Lars</div></body></html>
--Apple-Mail=_5905D8BD-F973-4DC4-A43C-1DB7909C84FB--


--===============0477474498814364456==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel
--===============0477474498814364456==--


From minios-devel-bounces@lists.xenproject.org Mon Jun 15 09:51:03 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 15 Jun 2015 09:51:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z4R2l-0000Fc-Uf
	for archives@lists.xenproject.org; Mon, 15 Jun 2015 09:51:03 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <lars.kurth.xen@gmail.com>)
	id 1Z4R2j-0000FJ-GN; Mon, 15 Jun 2015 09:51:01 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	DE/07-03371-400AE755; Mon, 15 Jun 2015 09:51:00 +0000
X-Env-Sender: lars.kurth.xen@gmail.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1434361859!18734806!1
X-Originating-IP: [209.85.212.181]
X-SpamReason: No, hits=0.3 required=7.0 tests=HTML_60_70,HTML_MESSAGE
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18166 invoked from network); 15 Jun 2015 09:50:59 -0000
Received: from mail-wi0-f181.google.com (HELO mail-wi0-f181.google.com)
	(209.85.212.181)
	by server-5.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Jun 2015 09:50:59 -0000
Received: by wibdq8 with SMTP id dq8so72005417wib.1;
	Mon, 15 Jun 2015 02:50:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:content-type:subject:date:message-id:cc:to:mime-version;
	bh=YsmdnaX2L+0I6XGqNcNRv5NNGGMBl/1thV1h8Uvrzf0=;
	b=D027Q5hSNxyAXNi87vZS3/1CeW6Is4RgBNGdapoRbcPO2lnyDnNGCDdxtTzPxZVWYS
	fvHQz6qM1Yl2mPnWePPmyN1dsC9s+XYm1/gNeOEhqmlZw3mdfh5GKasZEtl8e9yoDZKd
	HhpvYFnPlpNuG2ROZG2H7BZDSnU4xtOiVJpqQ+YgMqM4/Ydqs5fyOdiOwtRgIn6FYNzC
	XfJ4GJDUs++9+YUNCduiWSW8atoVVusWfwoT9YxkK4sc3vCTK8rUPyvh1h9tp4KrzNPl
	A9HcQPM+EyeX5ERix7uaeA6LNp4ccJtvdX6OBD3m/xvTin+CvZ5MzwO1D9F63+ypnyzF
	vH7Q==
X-Received: by 10.180.20.198 with SMTP id p6mr30265171wie.38.1434361859382;
	Mon, 15 Jun 2015 02:50:59 -0700 (PDT)
Received: from [192.168.0.12] (97e3cdda.skybroadband.com. [151.227.205.218])
	by mx.google.com with ESMTPSA id m4sm16670763wjb.37.2015.06.15.02.50.57
	(version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
	Mon, 15 Jun 2015 02:50:58 -0700 (PDT)
From: Lars Kurth <lars.kurth.xen@gmail.com>
Date: Mon, 15 Jun 2015 10:50:56 +0100
Message-Id: <AB64F02A-CE99-467A-AAA1-87DF646405CD@gmail.com>
To: minios-devel@lists.xenproject.org,
	xen-devel <xen-devel@lists.xenproject.org>, mirageos-devel@xenproject.org,
	xen-api@lists.xenproject.org, embedded-pv-devel@lists.xenproject.org
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\))
X-Mailer: Apple Mail (2.2098)
Cc: Wei Liu <wei.liu2@citrix.com>
Subject: [Minios-devel] minios-devel list is now live
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0477474498814364456=="
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org


--===============0477474498814364456==
Content-Type: multipart/alternative; boundary="Apple-Mail=_5905D8BD-F973-4DC4-A43C-1DB7909C84FB"


--Apple-Mail=_5905D8BD-F973-4DC4-A43C-1DB7909C84FB
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

Hi all,
as requested, we created a new mailing list for minios development. You =
can subscribe via=20

http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel =
<http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>

or by sending an email with subject line "subscribe" to =
minios-devel-request@lists.xenproject.org

Regards
Lars=

--Apple-Mail=_5905D8BD-F973-4DC4-A43C-1DB7909C84FB
Content-Transfer-Encoding: 7bit
Content-Type: text/html;
	charset=us-ascii

<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi all,<div class="">as requested, we created a new mailing list for minios development. You can subscribe via&nbsp;</div><div class=""><br class=""></div><div class=""><a href="http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel" class="">http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel</a></div><div class=""><br class=""></div><div class="">or by sending an email with subject line "subscribe" to&nbsp;<a href="mailto:minios-devel-request@lists.xenproject.org" class="">minios-devel-request@lists.xenproject.org</a></div><div class=""><br class=""></div><div class="">Regards</div><div class="">Lars</div></body></html>
--Apple-Mail=_5905D8BD-F973-4DC4-A43C-1DB7909C84FB--


--===============0477474498814364456==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel
--===============0477474498814364456==--


From minios-devel-bounces@lists.xenproject.org Wed Jun 17 10:08:34 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 17 Jun 2015 10:08:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z5AGo-0000Jk-DY; Wed, 17 Jun 2015 10:08:34 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <talex5@gmail.com>) id 1Z5AGn-0000JU-FI
	for Minios-devel@lists.xenproject.org; Wed, 17 Jun 2015 10:08:33 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	1D/EF-30658-02741855; Wed, 17 Jun 2015 10:08:32 +0000
X-Env-Sender: talex5@gmail.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1434535711!24123781!1
X-Originating-IP: [209.85.212.171]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17534 invoked from network); 17 Jun 2015 10:08:31 -0000
Received: from mail-wi0-f171.google.com (HELO mail-wi0-f171.google.com)
	(209.85.212.171)
	by server-12.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	17 Jun 2015 10:08:31 -0000
Received: by wiwd19 with SMTP id d19so128265685wiw.0
	for <Minios-devel@lists.xenproject.org>;
	Wed, 17 Jun 2015 03:08:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=KFyNHJdf+fzYT0950kbZ4/1a+3czRJTEaNZhr+n6Q78=;
	b=k56j+UhvgXJgSW/Oz6ooN1kBSEpjp/ytAIZxa3k9zoT8o6LNsqxMKVOJSzZ5WY3YTS
	M4ZjsNu4Ft8e2jyDgMLjMomxMe0r8emSA/JF3ADEVSbYh+QkCDU59j4vx+TlLgR7csD9
	2bF0ix+gI5lYHnHkadfukzDZ4VIu3OMsXQgHOAcS2m4BvPDD9L3Lw8adikmRu6cnv4DV
	MW6yyax+VdSRKvhTge8luQ7vzzWieedkJOL40znhJ8L4v+gxvve7OIYA2TmXVFifAEC7
	2uHsTu/QLhqA8Cj7clC6mlie3J5QQh3luRVOIWUFZMOQi0F6evZ/6hmuuBdxLU+12fHB
	618g==
X-Received: by 10.194.234.40 with SMTP id ub8mr4444714wjc.21.1434535711162;
	Wed, 17 Jun 2015 03:08:31 -0700 (PDT)
Received: from cam.localdomain (82-69-101-169.dsl.in-addr.zen.co.uk.
	[82.69.101.169]) by mx.google.com with ESMTPSA id
	lz17sm6839581wic.24.2015.06.17.03.08.29
	(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
	Wed, 17 Jun 2015 03:08:30 -0700 (PDT)
From: Thomas Leonard <talex5@gmail.com>
To: Minios-devel@lists.xenproject.org
Date: Wed, 17 Jun 2015 11:08:20 +0100
Message-Id: <1434535700-26779-1-git-send-email-talex5@gmail.com>
X-Mailer: git-send-email 2.4.2
Cc: samuel.thibault@ens-lyon.org, Thomas Leonard <talex5@gmail.com>,
	Ian.Campbell@citrix.com, stefano.stabellini@eu.citrix.com
Subject: [Minios-devel] [PATCH v2] mini-os: enable compiler check for printk
	format types
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org

Signed-off-by: Thomas Leonard <talex5@gmail.com>
---
Note: This patch might flag up warnings in downstream projects that use
incorrect format codes. In particular, it doesn't include the patch to
Xen's vtpm_load_disk, since that's now in a separate repository. See:

http://lists.xenproject.org/archives/html/xen-devel/2014-10/msg00899.html
---
 arch/x86/mm.c     | 22 +++++++++++-----------
 arch/x86/sched.c  |  4 ++--
 arch/x86/traps.c  | 18 +++++++++---------
 blkfront.c        |  2 +-
 include/console.h |  4 ++--
 lib/sys.c         |  4 ++--
 lwip-arch.c       |  5 +++--
 minios.mk         |  2 +-
 mm.c              |  6 +++++-
 netfront.c        |  4 ++--
 sched.c           |  2 +-
 test.c            |  6 ++++--
 tpm_tis.c         |  8 ++++----
 xenbus/xenbus.c   |  4 ++--
 14 files changed, 49 insertions(+), 42 deletions(-)

diff --git a/arch/x86/mm.c b/arch/x86/mm.c
index 9c6d1b8..186659d 100644
--- a/arch/x86/mm.c
+++ b/arch/x86/mm.c
@@ -94,7 +94,7 @@ static void new_pt_frame(unsigned long *pt_pfn, unsigned long prev_l_mfn,
         break;
 #endif
     default:
-        printk("new_pt_frame() called with invalid level number %d\n", level);
+        printk("new_pt_frame() called with invalid level number %lu\n", level);
         do_exit();
         break;
     }
@@ -181,7 +181,7 @@ static int need_pt_frame(unsigned long va, int level)
         if ( level == L1_FRAME )
             return 1;
 
-    printk("ERROR: Unknown frame level %d, hypervisor %llx,%llx\n", 
+    printk("ERROR: Unknown frame level %d, hypervisor %lx,%lx\n", 
            level, hyp_virt_start, hyp_virt_end);
     return -1;
 }
@@ -206,11 +206,11 @@ static void build_pagetable(unsigned long *start_pfn, unsigned long *max_pfn)
     if ( *max_pfn >= virt_to_pfn(HYPERVISOR_VIRT_START) )
     {
         printk("WARNING: Mini-OS trying to use Xen virtual space. "
-               "Truncating memory from %dMB to ",
+               "Truncating memory from %luMB to ",
                ((unsigned long)pfn_to_virt(*max_pfn) -
                 (unsigned long)&_text)>>20);
         *max_pfn = virt_to_pfn(HYPERVISOR_VIRT_START - PAGE_SIZE);
-        printk("%dMB\n",
+        printk("%luMB\n",
                ((unsigned long)pfn_to_virt(*max_pfn) - 
                 (unsigned long)&_text)>>20);
     }
@@ -326,7 +326,7 @@ static void set_readonly(void *text, void *etext)
             count++;
         }
         else
-            printk("skipped %p\n", start_address);
+            printk("skipped %lx\n", start_address);
 
         start_address += PAGE_SIZE;
 
@@ -369,21 +369,21 @@ int mem_test(unsigned long *start_va, unsigned long *end_va, int verbose)
     /* write values and print page walks */
     if ( verbose && (((unsigned long)start_va) & 0xfffff) )
     {
-        printk("MemTest Start: 0x%lx\n", start_va);
+        printk("MemTest Start: 0x%p\n", start_va);
         page_walk((unsigned long)start_va);
     }
     for ( pointer = start_va; pointer < end_va; pointer++ )
     {
         if ( verbose && !(((unsigned long)pointer) & 0xfffff) )
         {
-            printk("Writing to %lx\n", pointer);
+            printk("Writing to %p\n", pointer);
             page_walk((unsigned long)pointer);
         }
         *pointer = (unsigned long)pointer & ~mask;
     }
     if ( verbose && (((unsigned long)end_va) & 0xfffff) )
     {
-        printk("MemTest End: %lx\n", end_va-1);
+        printk("MemTest End: %p\n", end_va-1);
         page_walk((unsigned long)end_va-1);
     }
  
@@ -516,7 +516,7 @@ void arch_init_demand_mapping_area(unsigned long cur_pfn)
 
     demand_map_area_start = (unsigned long) pfn_to_virt(cur_pfn);
     cur_pfn += DEMAND_MAP_PAGES;
-    printk("Demand map pfns at %lx-%lx.\n", 
+    printk("Demand map pfns at %lx-%p.\n", 
            demand_map_area_start, pfn_to_virt(cur_pfn));
 
 #ifdef HAVE_LIBC
@@ -619,7 +619,7 @@ void do_map_frames(unsigned long va,
                 if (err)
                     err[done * stride] = rc;
                 else {
-                    printk("Map %ld (%lx, ...) at %p failed: %d.\n",
+                    printk("Map %ld (%lx, ...) at %lx failed: %d.\n",
                            todo, mfns[done * stride] + done * incr, va, rc);
                     do_exit();
                 }
@@ -793,7 +793,7 @@ unsigned long alloc_contig_pages(int order, unsigned int addr_bits)
     out_frames = virt_to_pfn(in_va); /* PFNs to populate */
     ret = HYPERVISOR_memory_op(XENMEM_exchange, &exchange);
     if ( ret ) {
-        printk("mem exchanged order=0x%x failed with rc=%d, nr_exchanged=%d\n", 
+        printk("mem exchanged order=0x%x failed with rc=%d, nr_exchanged=%lu\n",
                order, ret, exchange.nr_exchanged);
         /* we still need to return the allocated pages above to the pool
          * ie. map them back into the 1:1 mapping etc. so we continue but 
diff --git a/arch/x86/sched.c b/arch/x86/sched.c
index e4a3dc2..ec13694 100644
--- a/arch/x86/sched.c
+++ b/arch/x86/sched.c
@@ -73,7 +73,7 @@ void dump_stack(struct thread *thread)
     printk("The stack for \"%s\"\n", thread->name);
     for(count = 0; count < 25 && pointer < bottom; count ++)
     {
-        printk("[0x%lx] 0x%lx\n", pointer, *pointer);
+        printk("[0x%p] 0x%lx\n", pointer, *pointer);
         pointer++;
     }
     
@@ -101,7 +101,7 @@ struct thread* arch_create_thread(char *name, void (*function)(void *),
     /* We can't use lazy allocation here since the trap handler runs on the stack */
     thread->stack = (char *)alloc_pages(STACK_SIZE_PAGE_ORDER);
     thread->name = name;
-    printk("Thread \"%s\": pointer: 0x%lx, stack: 0x%lx\n", name, thread, 
+    printk("Thread \"%s\": pointer: 0x%p, stack: 0x%p\n", name, thread, 
             thread->stack);
     
     thread->sp = (unsigned long)thread->stack + STACK_SIZE;
diff --git a/arch/x86/traps.c b/arch/x86/traps.c
index 516d133..6353718 100644
--- a/arch/x86/traps.c
+++ b/arch/x86/traps.c
@@ -34,14 +34,14 @@ void dump_regs(struct pt_regs *regs)
 {
     printk("Thread: %s\n", current->name);
 #ifdef __i386__    
-    printk("EIP: %x, EFLAGS %x.\n", regs->eip, regs->eflags);
-    printk("EBX: %08x ECX: %08x EDX: %08x\n",
+    printk("EIP: %lx, EFLAGS %lx.\n", regs->eip, regs->eflags);
+    printk("EBX: %08lx ECX: %08lx EDX: %08lx\n",
 	   regs->ebx, regs->ecx, regs->edx);
-    printk("ESI: %08x EDI: %08x EBP: %08x EAX: %08x\n",
+    printk("ESI: %08lx EDI: %08lx EBP: %08lx EAX: %08lx\n",
 	   regs->esi, regs->edi, regs->ebp, regs->eax);
-    printk("DS: %04x ES: %04x orig_eax: %08x, eip: %08x\n",
+    printk("DS: %04x ES: %04x orig_eax: %08lx, eip: %08lx\n",
 	   regs->xds, regs->xes, regs->orig_eax, regs->eip);
-    printk("CS: %04x EFLAGS: %08x esp: %08x ss: %04x\n",
+    printk("CS: %04x EFLAGS: %08lx esp: %08lx ss: %04x\n",
 	   regs->xcs, regs->eflags, regs->esp, regs->xss);
 #else
     printk("RIP: %04lx:[<%016lx>] ", regs->cs & 0xffff, regs->rip);
@@ -214,10 +214,10 @@ void do_page_fault(struct pt_regs *regs, unsigned long error_code)
     barrier();
 
 #if defined(__x86_64__)
-    printk("Page fault at linear address %p, rip %p, regs %p, sp %p, our_sp %p, code %lx\n",
+    printk("Page fault at linear address %lx, rip %lx, regs %p, sp %lx, our_sp %p, code %lx\n",
            addr, regs->rip, regs, regs->rsp, &addr, error_code);
 #else
-    printk("Page fault at linear address %p, eip %p, regs %p, sp %p, our_sp %p, code %lx\n",
+    printk("Page fault at linear address %lx, eip %lx, regs %p, sp %lx, our_sp %p, code %lx\n",
            addr, regs->eip, regs, regs->esp, &addr, error_code);
 #endif
 
@@ -243,9 +243,9 @@ void do_general_protection(struct pt_regs *regs, long error_code)
 {
     struct sched_shutdown sched_shutdown = { .reason = SHUTDOWN_crash };
 #ifdef __i386__
-    printk("GPF eip: %p, error_code=%lx\n", regs->eip, error_code);
+    printk("GPF eip: %lx, error_code=%lx\n", regs->eip, error_code);
 #else    
-    printk("GPF rip: %p, error_code=%lx\n", regs->rip, error_code);
+    printk("GPF rip: %lx, error_code=%lx\n", regs->rip, error_code);
 #endif
     dump_regs(regs);
 #if defined(__x86_64__)
diff --git a/blkfront.c b/blkfront.c
index 59e576f..bdb7765 100644
--- a/blkfront.c
+++ b/blkfront.c
@@ -236,7 +236,7 @@ done:
     }
     unmask_evtchn(dev->evtchn);
 
-    printk("%u sectors of %u bytes\n", dev->info.sectors, dev->info.sector_size);
+    printk("%lu sectors of %u bytes\n", (unsigned long) dev->info.sectors, dev->info.sector_size);
     printk("**************************\n");
 
     return dev;
diff --git a/include/console.h b/include/console.h
index 3755b66..a77f47f 100644
--- a/include/console.h
+++ b/include/console.h
@@ -64,8 +64,8 @@ struct consfront_dev {
 
 
 void print(int direct, const char *fmt, va_list args);
-void printk(const char *fmt, ...);
-void xprintk(const char *fmt, ...);
+void printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
+void xprintk(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
 
 #define tprintk(_fmt, _args...) printk("[%s] " _fmt, current->name, ##_args) 
 
diff --git a/lib/sys.c b/lib/sys.c
index 13e7e59..f8d7a7c 100644
--- a/lib/sys.c
+++ b/lib/sys.c
@@ -1319,7 +1319,7 @@ int clock_gettime(clockid_t clk_id, struct timespec *tp)
 	    break;
 	}
 	default:
-	    print_unsupported("clock_gettime(%d)", clk_id);
+	    print_unsupported("clock_gettime(%ld)", (long) clk_id);
 	    errno = EINVAL;
 	    return -1;
     }
@@ -1421,7 +1421,7 @@ void sparse(unsigned long data, size_t size)
         mfns[i] = virtual_to_mfn(data + i * PAGE_SIZE);
     }
 
-    printk("sparsing %ldMB at %lx\n", size >> 20, data);
+    printk("sparsing %ldMB at %lx\n", ((long) size) >> 20, data);
 
     munmap((void *) data, size);
     free_physical_pages(mfns, n);
diff --git a/lwip-arch.c b/lwip-arch.c
index e634ef4..154617b 100644
--- a/lwip-arch.c
+++ b/lwip-arch.c
@@ -236,8 +236,9 @@ sys_thread_t sys_thread_new(char *name, void (* thread)(void *arg), void *arg, i
 {
     struct thread *t;
     if (stacksize > STACK_SIZE) {
-	printk("Can't start lwIP thread: stack size %d is too large for our %d\n", stacksize, STACK_SIZE);
-	do_exit();
+        printk("Can't start lwIP thread: stack size %d is too large for our %lu\n",
+                stacksize, (unsigned long) STACK_SIZE);
+        do_exit();
     }
     lwip_thread = t = create_thread(name, thread, arg);
     return t;
diff --git a/minios.mk b/minios.mk
index b0d9f71..e042027 100644
--- a/minios.mk
+++ b/minios.mk
@@ -6,7 +6,7 @@ debug = y
 
 # Define some default flags.
 # NB. '-Wcast-qual' is nasty, so I omitted it.
-DEF_CFLAGS += -fno-builtin -Wall -Werror -Wredundant-decls -Wno-format -Wno-redundant-decls
+DEF_CFLAGS += -fno-builtin -Wall -Werror -Wredundant-decls -Wno-format -Wno-redundant-decls -Wformat
 DEF_CFLAGS += $(call cc-option,$(CC),-fno-stack-protector,)
 DEF_CFLAGS += $(call cc-option,$(CC),-fgnu89-inline)
 DEF_CFLAGS += -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline
diff --git a/mm.c b/mm.c
index 64b3292..31aaf83 100644
--- a/mm.c
+++ b/mm.c
@@ -379,7 +379,11 @@ void *sbrk(ptrdiff_t increment)
     unsigned long new_brk = old_brk + increment;
 
     if (new_brk > heap_end) {
-	printk("Heap exhausted: %p + %lx = %p > %p\n", old_brk, increment, new_brk, heap_end);
+	printk("Heap exhausted: %lx + %lx = %p > %p\n",
+			old_brk,
+			(unsigned long) increment,
+			(void *) new_brk,
+			(void *) heap_end);
 	return NULL;
     }
     
diff --git a/netfront.c b/netfront.c
index 42bb103..0eca5b5 100644
--- a/netfront.c
+++ b/netfront.c
@@ -325,8 +325,8 @@ struct netfront_dev *init_netfront(char *_nodename, void (*thenetif_rx)(unsigned
     dev->fd = -1;
 #endif
 
-    printk("net TX ring size %d\n", NET_TX_RING_SIZE);
-    printk("net RX ring size %d\n", NET_RX_RING_SIZE);
+    printk("net TX ring size %lu\n", (unsigned long) NET_TX_RING_SIZE);
+    printk("net RX ring size %lu\n", (unsigned long) NET_RX_RING_SIZE);
     init_SEMAPHORE(&dev->tx_sem, NET_TX_RING_SIZE);
     for(i=0;i<NET_TX_RING_SIZE;i++)
     {
diff --git a/sched.c b/sched.c
index d0c607e..1e843d9 100644
--- a/sched.c
+++ b/sched.c
@@ -276,7 +276,7 @@ void th_f2(void *data)
 {
     for(;;)
     {
-        printk("Thread OTHER executing, data 0x%lx\n", data);
+        printk("Thread OTHER executing, data 0x%p\n", data);
         schedule();
     }
 }
diff --git a/test.c b/test.c
index 0d7aba4..154af49 100644
--- a/test.c
+++ b/test.c
@@ -129,7 +129,7 @@ static void blk_read_completed(struct blkfront_aiocb *aiocb, int ret)
 {
     struct blk_req *req = aiocb->data;
     if (ret)
-        printk("got error code %d when reading at offset %ld\n", ret, aiocb->aio_offset);
+        printk("got error code %d when reading at offset %ld\n", ret, (long) aiocb->aio_offset);
     else
         blk_size_read += blk_info.sector_size;
     free(aiocb->aio_buf);
@@ -250,7 +250,9 @@ static void blkfront_thread(void *p)
         blkfront_aio_poll(blk_dev);
         gettimeofday(&tv, NULL);
         if (tv.tv_sec > lasttime + 10) {
-            printk("%llu read, %llu write\n", blk_size_read, blk_size_write);
+            printk("%llu read, %llu write\n",
+                    (unsigned long long) blk_size_read,
+                    (unsigned long long) blk_size_write);
             lasttime = tv.tv_sec;
         }
 
diff --git a/tpm_tis.c b/tpm_tis.c
index debcc43..98fe837 100644
--- a/tpm_tis.c
+++ b/tpm_tis.c
@@ -912,7 +912,7 @@ static ssize_t tpm_transmit(struct tpm_chip *chip, const uint8_t *buf,
    //down(&chip->tpm_mutex);
 
    if ((rc = tpm_tis_send(chip, (uint8_t *) buf, count)) < 0) {
-      printk("tpm_transmit: tpm_send: error %ld\n", rc);
+      printk("tpm_transmit: tpm_send: error %ld\n", (long) rc);
       goto out;
    }
 
@@ -944,7 +944,7 @@ static ssize_t tpm_transmit(struct tpm_chip *chip, const uint8_t *buf,
 
 out_recv:
    if((rc = tpm_tis_recv(chip, (uint8_t *) buf, bufsiz)) < 0) {
-      printk("tpm_transmit: tpm_recv: error %d\n", rc);
+      printk("tpm_transmit: tpm_recv: error %d\n", (int) rc);
    }
 out:
    //up(&chip->tpm_mutex);
@@ -983,7 +983,7 @@ int tpm_get_timeouts(struct tpm_chip *chip)
 
    if((rc = transmit_cmd(chip, &tpm_cmd, TPM_INTERNAL_RESULT_SIZE,
 	 "attempting to determine the timeouts")) != 0) {
-      printk("transmit failed %d\n", rc);
+      printk("transmit failed %d\n", (int) rc);
       goto duration;
    }
 
@@ -1145,7 +1145,7 @@ struct tpm_chip* init_tpm_tis(unsigned long baseaddr, int localities, unsigned i
       if(locality_enabled(tpm, i)) {
 	 /* Map the page in now */
 	 if((tpm->pages[i] = ioremap_nocache(addr, PAGE_SIZE)) == NULL) {
-	    printk("Unable to map iomem page a address %p\n", addr);
+	    printk("Unable to map iomem page a address %lx\n", addr);
 	    goto abort_egress;
 	 }
 
diff --git a/xenbus/xenbus.c b/xenbus/xenbus.c
index 934f23b..4613ed6 100644
--- a/xenbus/xenbus.c
+++ b/xenbus/xenbus.c
@@ -337,8 +337,8 @@ void init_xenbus(void)
 		      xenbus_evtchn_handler,
               NULL);
     unmask_evtchn(start_info.store_evtchn);
-    printk("xenbus initialised on irq %d mfn %#lx\n",
-	   err, start_info.store_mfn);
+    printk("xenbus initialised on irq %d mfn %#llx\n",
+	   err, (unsigned long long) start_info.store_mfn);
 }
 
 void fini_xenbus(void)
-- 
2.4.2


_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

From minios-devel-bounces@lists.xenproject.org Wed Jun 17 10:08:34 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 17 Jun 2015 10:08:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z5AGo-0000Jk-DY; Wed, 17 Jun 2015 10:08:34 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <talex5@gmail.com>) id 1Z5AGn-0000JU-FI
	for Minios-devel@lists.xenproject.org; Wed, 17 Jun 2015 10:08:33 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	1D/EF-30658-02741855; Wed, 17 Jun 2015 10:08:32 +0000
X-Env-Sender: talex5@gmail.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1434535711!24123781!1
X-Originating-IP: [209.85.212.171]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17534 invoked from network); 17 Jun 2015 10:08:31 -0000
Received: from mail-wi0-f171.google.com (HELO mail-wi0-f171.google.com)
	(209.85.212.171)
	by server-12.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	17 Jun 2015 10:08:31 -0000
Received: by wiwd19 with SMTP id d19so128265685wiw.0
	for <Minios-devel@lists.xenproject.org>;
	Wed, 17 Jun 2015 03:08:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=KFyNHJdf+fzYT0950kbZ4/1a+3czRJTEaNZhr+n6Q78=;
	b=k56j+UhvgXJgSW/Oz6ooN1kBSEpjp/ytAIZxa3k9zoT8o6LNsqxMKVOJSzZ5WY3YTS
	M4ZjsNu4Ft8e2jyDgMLjMomxMe0r8emSA/JF3ADEVSbYh+QkCDU59j4vx+TlLgR7csD9
	2bF0ix+gI5lYHnHkadfukzDZ4VIu3OMsXQgHOAcS2m4BvPDD9L3Lw8adikmRu6cnv4DV
	MW6yyax+VdSRKvhTge8luQ7vzzWieedkJOL40znhJ8L4v+gxvve7OIYA2TmXVFifAEC7
	2uHsTu/QLhqA8Cj7clC6mlie3J5QQh3luRVOIWUFZMOQi0F6evZ/6hmuuBdxLU+12fHB
	618g==
X-Received: by 10.194.234.40 with SMTP id ub8mr4444714wjc.21.1434535711162;
	Wed, 17 Jun 2015 03:08:31 -0700 (PDT)
Received: from cam.localdomain (82-69-101-169.dsl.in-addr.zen.co.uk.
	[82.69.101.169]) by mx.google.com with ESMTPSA id
	lz17sm6839581wic.24.2015.06.17.03.08.29
	(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
	Wed, 17 Jun 2015 03:08:30 -0700 (PDT)
From: Thomas Leonard <talex5@gmail.com>
To: Minios-devel@lists.xenproject.org
Date: Wed, 17 Jun 2015 11:08:20 +0100
Message-Id: <1434535700-26779-1-git-send-email-talex5@gmail.com>
X-Mailer: git-send-email 2.4.2
Cc: samuel.thibault@ens-lyon.org, Thomas Leonard <talex5@gmail.com>,
	Ian.Campbell@citrix.com, stefano.stabellini@eu.citrix.com
Subject: [Minios-devel] [PATCH v2] mini-os: enable compiler check for printk
	format types
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org

Signed-off-by: Thomas Leonard <talex5@gmail.com>
---
Note: This patch might flag up warnings in downstream projects that use
incorrect format codes. In particular, it doesn't include the patch to
Xen's vtpm_load_disk, since that's now in a separate repository. See:

http://lists.xenproject.org/archives/html/xen-devel/2014-10/msg00899.html
---
 arch/x86/mm.c     | 22 +++++++++++-----------
 arch/x86/sched.c  |  4 ++--
 arch/x86/traps.c  | 18 +++++++++---------
 blkfront.c        |  2 +-
 include/console.h |  4 ++--
 lib/sys.c         |  4 ++--
 lwip-arch.c       |  5 +++--
 minios.mk         |  2 +-
 mm.c              |  6 +++++-
 netfront.c        |  4 ++--
 sched.c           |  2 +-
 test.c            |  6 ++++--
 tpm_tis.c         |  8 ++++----
 xenbus/xenbus.c   |  4 ++--
 14 files changed, 49 insertions(+), 42 deletions(-)

diff --git a/arch/x86/mm.c b/arch/x86/mm.c
index 9c6d1b8..186659d 100644
--- a/arch/x86/mm.c
+++ b/arch/x86/mm.c
@@ -94,7 +94,7 @@ static void new_pt_frame(unsigned long *pt_pfn, unsigned long prev_l_mfn,
         break;
 #endif
     default:
-        printk("new_pt_frame() called with invalid level number %d\n", level);
+        printk("new_pt_frame() called with invalid level number %lu\n", level);
         do_exit();
         break;
     }
@@ -181,7 +181,7 @@ static int need_pt_frame(unsigned long va, int level)
         if ( level == L1_FRAME )
             return 1;
 
-    printk("ERROR: Unknown frame level %d, hypervisor %llx,%llx\n", 
+    printk("ERROR: Unknown frame level %d, hypervisor %lx,%lx\n", 
            level, hyp_virt_start, hyp_virt_end);
     return -1;
 }
@@ -206,11 +206,11 @@ static void build_pagetable(unsigned long *start_pfn, unsigned long *max_pfn)
     if ( *max_pfn >= virt_to_pfn(HYPERVISOR_VIRT_START) )
     {
         printk("WARNING: Mini-OS trying to use Xen virtual space. "
-               "Truncating memory from %dMB to ",
+               "Truncating memory from %luMB to ",
                ((unsigned long)pfn_to_virt(*max_pfn) -
                 (unsigned long)&_text)>>20);
         *max_pfn = virt_to_pfn(HYPERVISOR_VIRT_START - PAGE_SIZE);
-        printk("%dMB\n",
+        printk("%luMB\n",
                ((unsigned long)pfn_to_virt(*max_pfn) - 
                 (unsigned long)&_text)>>20);
     }
@@ -326,7 +326,7 @@ static void set_readonly(void *text, void *etext)
             count++;
         }
         else
-            printk("skipped %p\n", start_address);
+            printk("skipped %lx\n", start_address);
 
         start_address += PAGE_SIZE;
 
@@ -369,21 +369,21 @@ int mem_test(unsigned long *start_va, unsigned long *end_va, int verbose)
     /* write values and print page walks */
     if ( verbose && (((unsigned long)start_va) & 0xfffff) )
     {
-        printk("MemTest Start: 0x%lx\n", start_va);
+        printk("MemTest Start: 0x%p\n", start_va);
         page_walk((unsigned long)start_va);
     }
     for ( pointer = start_va; pointer < end_va; pointer++ )
     {
         if ( verbose && !(((unsigned long)pointer) & 0xfffff) )
         {
-            printk("Writing to %lx\n", pointer);
+            printk("Writing to %p\n", pointer);
             page_walk((unsigned long)pointer);
         }
         *pointer = (unsigned long)pointer & ~mask;
     }
     if ( verbose && (((unsigned long)end_va) & 0xfffff) )
     {
-        printk("MemTest End: %lx\n", end_va-1);
+        printk("MemTest End: %p\n", end_va-1);
         page_walk((unsigned long)end_va-1);
     }
  
@@ -516,7 +516,7 @@ void arch_init_demand_mapping_area(unsigned long cur_pfn)
 
     demand_map_area_start = (unsigned long) pfn_to_virt(cur_pfn);
     cur_pfn += DEMAND_MAP_PAGES;
-    printk("Demand map pfns at %lx-%lx.\n", 
+    printk("Demand map pfns at %lx-%p.\n", 
            demand_map_area_start, pfn_to_virt(cur_pfn));
 
 #ifdef HAVE_LIBC
@@ -619,7 +619,7 @@ void do_map_frames(unsigned long va,
                 if (err)
                     err[done * stride] = rc;
                 else {
-                    printk("Map %ld (%lx, ...) at %p failed: %d.\n",
+                    printk("Map %ld (%lx, ...) at %lx failed: %d.\n",
                            todo, mfns[done * stride] + done * incr, va, rc);
                     do_exit();
                 }
@@ -793,7 +793,7 @@ unsigned long alloc_contig_pages(int order, unsigned int addr_bits)
     out_frames = virt_to_pfn(in_va); /* PFNs to populate */
     ret = HYPERVISOR_memory_op(XENMEM_exchange, &exchange);
     if ( ret ) {
-        printk("mem exchanged order=0x%x failed with rc=%d, nr_exchanged=%d\n", 
+        printk("mem exchanged order=0x%x failed with rc=%d, nr_exchanged=%lu\n",
                order, ret, exchange.nr_exchanged);
         /* we still need to return the allocated pages above to the pool
          * ie. map them back into the 1:1 mapping etc. so we continue but 
diff --git a/arch/x86/sched.c b/arch/x86/sched.c
index e4a3dc2..ec13694 100644
--- a/arch/x86/sched.c
+++ b/arch/x86/sched.c
@@ -73,7 +73,7 @@ void dump_stack(struct thread *thread)
     printk("The stack for \"%s\"\n", thread->name);
     for(count = 0; count < 25 && pointer < bottom; count ++)
     {
-        printk("[0x%lx] 0x%lx\n", pointer, *pointer);
+        printk("[0x%p] 0x%lx\n", pointer, *pointer);
         pointer++;
     }
     
@@ -101,7 +101,7 @@ struct thread* arch_create_thread(char *name, void (*function)(void *),
     /* We can't use lazy allocation here since the trap handler runs on the stack */
     thread->stack = (char *)alloc_pages(STACK_SIZE_PAGE_ORDER);
     thread->name = name;
-    printk("Thread \"%s\": pointer: 0x%lx, stack: 0x%lx\n", name, thread, 
+    printk("Thread \"%s\": pointer: 0x%p, stack: 0x%p\n", name, thread, 
             thread->stack);
     
     thread->sp = (unsigned long)thread->stack + STACK_SIZE;
diff --git a/arch/x86/traps.c b/arch/x86/traps.c
index 516d133..6353718 100644
--- a/arch/x86/traps.c
+++ b/arch/x86/traps.c
@@ -34,14 +34,14 @@ void dump_regs(struct pt_regs *regs)
 {
     printk("Thread: %s\n", current->name);
 #ifdef __i386__    
-    printk("EIP: %x, EFLAGS %x.\n", regs->eip, regs->eflags);
-    printk("EBX: %08x ECX: %08x EDX: %08x\n",
+    printk("EIP: %lx, EFLAGS %lx.\n", regs->eip, regs->eflags);
+    printk("EBX: %08lx ECX: %08lx EDX: %08lx\n",
 	   regs->ebx, regs->ecx, regs->edx);
-    printk("ESI: %08x EDI: %08x EBP: %08x EAX: %08x\n",
+    printk("ESI: %08lx EDI: %08lx EBP: %08lx EAX: %08lx\n",
 	   regs->esi, regs->edi, regs->ebp, regs->eax);
-    printk("DS: %04x ES: %04x orig_eax: %08x, eip: %08x\n",
+    printk("DS: %04x ES: %04x orig_eax: %08lx, eip: %08lx\n",
 	   regs->xds, regs->xes, regs->orig_eax, regs->eip);
-    printk("CS: %04x EFLAGS: %08x esp: %08x ss: %04x\n",
+    printk("CS: %04x EFLAGS: %08lx esp: %08lx ss: %04x\n",
 	   regs->xcs, regs->eflags, regs->esp, regs->xss);
 #else
     printk("RIP: %04lx:[<%016lx>] ", regs->cs & 0xffff, regs->rip);
@@ -214,10 +214,10 @@ void do_page_fault(struct pt_regs *regs, unsigned long error_code)
     barrier();
 
 #if defined(__x86_64__)
-    printk("Page fault at linear address %p, rip %p, regs %p, sp %p, our_sp %p, code %lx\n",
+    printk("Page fault at linear address %lx, rip %lx, regs %p, sp %lx, our_sp %p, code %lx\n",
            addr, regs->rip, regs, regs->rsp, &addr, error_code);
 #else
-    printk("Page fault at linear address %p, eip %p, regs %p, sp %p, our_sp %p, code %lx\n",
+    printk("Page fault at linear address %lx, eip %lx, regs %p, sp %lx, our_sp %p, code %lx\n",
            addr, regs->eip, regs, regs->esp, &addr, error_code);
 #endif
 
@@ -243,9 +243,9 @@ void do_general_protection(struct pt_regs *regs, long error_code)
 {
     struct sched_shutdown sched_shutdown = { .reason = SHUTDOWN_crash };
 #ifdef __i386__
-    printk("GPF eip: %p, error_code=%lx\n", regs->eip, error_code);
+    printk("GPF eip: %lx, error_code=%lx\n", regs->eip, error_code);
 #else    
-    printk("GPF rip: %p, error_code=%lx\n", regs->rip, error_code);
+    printk("GPF rip: %lx, error_code=%lx\n", regs->rip, error_code);
 #endif
     dump_regs(regs);
 #if defined(__x86_64__)
diff --git a/blkfront.c b/blkfront.c
index 59e576f..bdb7765 100644
--- a/blkfront.c
+++ b/blkfront.c
@@ -236,7 +236,7 @@ done:
     }
     unmask_evtchn(dev->evtchn);
 
-    printk("%u sectors of %u bytes\n", dev->info.sectors, dev->info.sector_size);
+    printk("%lu sectors of %u bytes\n", (unsigned long) dev->info.sectors, dev->info.sector_size);
     printk("**************************\n");
 
     return dev;
diff --git a/include/console.h b/include/console.h
index 3755b66..a77f47f 100644
--- a/include/console.h
+++ b/include/console.h
@@ -64,8 +64,8 @@ struct consfront_dev {
 
 
 void print(int direct, const char *fmt, va_list args);
-void printk(const char *fmt, ...);
-void xprintk(const char *fmt, ...);
+void printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
+void xprintk(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
 
 #define tprintk(_fmt, _args...) printk("[%s] " _fmt, current->name, ##_args) 
 
diff --git a/lib/sys.c b/lib/sys.c
index 13e7e59..f8d7a7c 100644
--- a/lib/sys.c
+++ b/lib/sys.c
@@ -1319,7 +1319,7 @@ int clock_gettime(clockid_t clk_id, struct timespec *tp)
 	    break;
 	}
 	default:
-	    print_unsupported("clock_gettime(%d)", clk_id);
+	    print_unsupported("clock_gettime(%ld)", (long) clk_id);
 	    errno = EINVAL;
 	    return -1;
     }
@@ -1421,7 +1421,7 @@ void sparse(unsigned long data, size_t size)
         mfns[i] = virtual_to_mfn(data + i * PAGE_SIZE);
     }
 
-    printk("sparsing %ldMB at %lx\n", size >> 20, data);
+    printk("sparsing %ldMB at %lx\n", ((long) size) >> 20, data);
 
     munmap((void *) data, size);
     free_physical_pages(mfns, n);
diff --git a/lwip-arch.c b/lwip-arch.c
index e634ef4..154617b 100644
--- a/lwip-arch.c
+++ b/lwip-arch.c
@@ -236,8 +236,9 @@ sys_thread_t sys_thread_new(char *name, void (* thread)(void *arg), void *arg, i
 {
     struct thread *t;
     if (stacksize > STACK_SIZE) {
-	printk("Can't start lwIP thread: stack size %d is too large for our %d\n", stacksize, STACK_SIZE);
-	do_exit();
+        printk("Can't start lwIP thread: stack size %d is too large for our %lu\n",
+                stacksize, (unsigned long) STACK_SIZE);
+        do_exit();
     }
     lwip_thread = t = create_thread(name, thread, arg);
     return t;
diff --git a/minios.mk b/minios.mk
index b0d9f71..e042027 100644
--- a/minios.mk
+++ b/minios.mk
@@ -6,7 +6,7 @@ debug = y
 
 # Define some default flags.
 # NB. '-Wcast-qual' is nasty, so I omitted it.
-DEF_CFLAGS += -fno-builtin -Wall -Werror -Wredundant-decls -Wno-format -Wno-redundant-decls
+DEF_CFLAGS += -fno-builtin -Wall -Werror -Wredundant-decls -Wno-format -Wno-redundant-decls -Wformat
 DEF_CFLAGS += $(call cc-option,$(CC),-fno-stack-protector,)
 DEF_CFLAGS += $(call cc-option,$(CC),-fgnu89-inline)
 DEF_CFLAGS += -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline
diff --git a/mm.c b/mm.c
index 64b3292..31aaf83 100644
--- a/mm.c
+++ b/mm.c
@@ -379,7 +379,11 @@ void *sbrk(ptrdiff_t increment)
     unsigned long new_brk = old_brk + increment;
 
     if (new_brk > heap_end) {
-	printk("Heap exhausted: %p + %lx = %p > %p\n", old_brk, increment, new_brk, heap_end);
+	printk("Heap exhausted: %lx + %lx = %p > %p\n",
+			old_brk,
+			(unsigned long) increment,
+			(void *) new_brk,
+			(void *) heap_end);
 	return NULL;
     }
     
diff --git a/netfront.c b/netfront.c
index 42bb103..0eca5b5 100644
--- a/netfront.c
+++ b/netfront.c
@@ -325,8 +325,8 @@ struct netfront_dev *init_netfront(char *_nodename, void (*thenetif_rx)(unsigned
     dev->fd = -1;
 #endif
 
-    printk("net TX ring size %d\n", NET_TX_RING_SIZE);
-    printk("net RX ring size %d\n", NET_RX_RING_SIZE);
+    printk("net TX ring size %lu\n", (unsigned long) NET_TX_RING_SIZE);
+    printk("net RX ring size %lu\n", (unsigned long) NET_RX_RING_SIZE);
     init_SEMAPHORE(&dev->tx_sem, NET_TX_RING_SIZE);
     for(i=0;i<NET_TX_RING_SIZE;i++)
     {
diff --git a/sched.c b/sched.c
index d0c607e..1e843d9 100644
--- a/sched.c
+++ b/sched.c
@@ -276,7 +276,7 @@ void th_f2(void *data)
 {
     for(;;)
     {
-        printk("Thread OTHER executing, data 0x%lx\n", data);
+        printk("Thread OTHER executing, data 0x%p\n", data);
         schedule();
     }
 }
diff --git a/test.c b/test.c
index 0d7aba4..154af49 100644
--- a/test.c
+++ b/test.c
@@ -129,7 +129,7 @@ static void blk_read_completed(struct blkfront_aiocb *aiocb, int ret)
 {
     struct blk_req *req = aiocb->data;
     if (ret)
-        printk("got error code %d when reading at offset %ld\n", ret, aiocb->aio_offset);
+        printk("got error code %d when reading at offset %ld\n", ret, (long) aiocb->aio_offset);
     else
         blk_size_read += blk_info.sector_size;
     free(aiocb->aio_buf);
@@ -250,7 +250,9 @@ static void blkfront_thread(void *p)
         blkfront_aio_poll(blk_dev);
         gettimeofday(&tv, NULL);
         if (tv.tv_sec > lasttime + 10) {
-            printk("%llu read, %llu write\n", blk_size_read, blk_size_write);
+            printk("%llu read, %llu write\n",
+                    (unsigned long long) blk_size_read,
+                    (unsigned long long) blk_size_write);
             lasttime = tv.tv_sec;
         }
 
diff --git a/tpm_tis.c b/tpm_tis.c
index debcc43..98fe837 100644
--- a/tpm_tis.c
+++ b/tpm_tis.c
@@ -912,7 +912,7 @@ static ssize_t tpm_transmit(struct tpm_chip *chip, const uint8_t *buf,
    //down(&chip->tpm_mutex);
 
    if ((rc = tpm_tis_send(chip, (uint8_t *) buf, count)) < 0) {
-      printk("tpm_transmit: tpm_send: error %ld\n", rc);
+      printk("tpm_transmit: tpm_send: error %ld\n", (long) rc);
       goto out;
    }
 
@@ -944,7 +944,7 @@ static ssize_t tpm_transmit(struct tpm_chip *chip, const uint8_t *buf,
 
 out_recv:
    if((rc = tpm_tis_recv(chip, (uint8_t *) buf, bufsiz)) < 0) {
-      printk("tpm_transmit: tpm_recv: error %d\n", rc);
+      printk("tpm_transmit: tpm_recv: error %d\n", (int) rc);
    }
 out:
    //up(&chip->tpm_mutex);
@@ -983,7 +983,7 @@ int tpm_get_timeouts(struct tpm_chip *chip)
 
    if((rc = transmit_cmd(chip, &tpm_cmd, TPM_INTERNAL_RESULT_SIZE,
 	 "attempting to determine the timeouts")) != 0) {
-      printk("transmit failed %d\n", rc);
+      printk("transmit failed %d\n", (int) rc);
       goto duration;
    }
 
@@ -1145,7 +1145,7 @@ struct tpm_chip* init_tpm_tis(unsigned long baseaddr, int localities, unsigned i
       if(locality_enabled(tpm, i)) {
 	 /* Map the page in now */
 	 if((tpm->pages[i] = ioremap_nocache(addr, PAGE_SIZE)) == NULL) {
-	    printk("Unable to map iomem page a address %p\n", addr);
+	    printk("Unable to map iomem page a address %lx\n", addr);
 	    goto abort_egress;
 	 }
 
diff --git a/xenbus/xenbus.c b/xenbus/xenbus.c
index 934f23b..4613ed6 100644
--- a/xenbus/xenbus.c
+++ b/xenbus/xenbus.c
@@ -337,8 +337,8 @@ void init_xenbus(void)
 		      xenbus_evtchn_handler,
               NULL);
     unmask_evtchn(start_info.store_evtchn);
-    printk("xenbus initialised on irq %d mfn %#lx\n",
-	   err, start_info.store_mfn);
+    printk("xenbus initialised on irq %d mfn %#llx\n",
+	   err, (unsigned long long) start_info.store_mfn);
 }
 
 void fini_xenbus(void)
-- 
2.4.2


_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

From minios-devel-bounces@lists.xenproject.org Wed Jun 17 12:47:27 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 17 Jun 2015 12:47:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z5CkY-0000be-Qa; Wed, 17 Jun 2015 12:47:26 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <prvs=6035412ff=Ian.Campbell@citrix.com>)
	id 1Z5CkX-0000am-0X
	for Minios-devel@lists.xenproject.org; Wed, 17 Jun 2015 12:47:25 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	D4/E2-23832-C5C61855; Wed, 17 Jun 2015 12:47:24 +0000
X-Env-Sender: prvs=6035412ff=Ian.Campbell@citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1434545242!14694608!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n,
	received_headers: No Received headers
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21774 invoked from network); 17 Jun 2015 12:47:23 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-14.tower-31.messagelabs.com with RC4-SHA encrypted SMTP;
	17 Jun 2015 12:47:23 -0000
X-IronPort-AV: E=Sophos;i="5.13,632,1427760000"; d="scan'208";a="275719488"
Message-ID: <1434545240.13744.361.camel@citrix.com>
From: Ian Campbell <ian.campbell@citrix.com>
To: Thomas Leonard <talex5@gmail.com>
Date: Wed, 17 Jun 2015 13:47:20 +0100
In-Reply-To: <1434535700-26779-1-git-send-email-talex5@gmail.com>
References: <1434535700-26779-1-git-send-email-talex5@gmail.com>
X-Mailer: Evolution 3.12.9-1+b1 
MIME-Version: 1.0
X-DLP: MIA2
Cc: Minios-devel@lists.xenproject.org, samuel.thibault@ens-lyon.org,
	stefano.stabellini@eu.citrix.com
Subject: Re: [Minios-devel] [PATCH v2] mini-os: enable compiler check for
 printk format types
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org

On Wed, 2015-06-17 at 11:08 +0100, Thomas Leonard wrote:
> Signed-off-by: Thomas Leonard <talex5@gmail.com>
> ---
> Note: This patch might flag up warnings in downstream projects that use
> incorrect format codes. In particular, it doesn't include the patch to
> Xen's vtpm_load_disk, since that's now in a separate repository. See:
> 
> http://lists.xenproject.org/archives/html/xen-devel/2014-10/msg00899.html

Does such a fixup patch exist somewhere or are you intending to supply
one?

> ---
>  arch/x86/mm.c     | 22 +++++++++++-----------
>  arch/x86/sched.c  |  4 ++--
>  arch/x86/traps.c  | 18 +++++++++---------
>  blkfront.c        |  2 +-
>  include/console.h |  4 ++--
>  lib/sys.c         |  4 ++--
>  lwip-arch.c       |  5 +++--
>  minios.mk         |  2 +-
>  mm.c              |  6 +++++-
>  netfront.c        |  4 ++--
>  sched.c           |  2 +-
>  test.c            |  6 ++++--
>  tpm_tis.c         |  8 ++++----
>  xenbus/xenbus.c   |  4 ++--
>  14 files changed, 49 insertions(+), 42 deletions(-)
> 
> diff --git a/arch/x86/mm.c b/arch/x86/mm.c
> index 9c6d1b8..186659d 100644
> --- a/arch/x86/mm.c
> +++ b/arch/x86/mm.c
> @@ -94,7 +94,7 @@ static void new_pt_frame(unsigned long *pt_pfn, unsigned long prev_l_mfn,
>          break;
>  #endif
>      default:
> -        printk("new_pt_frame() called with invalid level number %d\n", level);
> +        printk("new_pt_frame() called with invalid level number %lu\n", level);
>          do_exit();
>          break;
>      }
> @@ -181,7 +181,7 @@ static int need_pt_frame(unsigned long va, int level)
>          if ( level == L1_FRAME )
>              return 1;
>  
> -    printk("ERROR: Unknown frame level %d, hypervisor %llx,%llx\n", 
> +    printk("ERROR: Unknown frame level %d, hypervisor %lx,%lx\n", 
>             level, hyp_virt_start, hyp_virt_end);
>      return -1;
>  }
> @@ -206,11 +206,11 @@ static void build_pagetable(unsigned long *start_pfn, unsigned long *max_pfn)
>      if ( *max_pfn >= virt_to_pfn(HYPERVISOR_VIRT_START) )
>      {
>          printk("WARNING: Mini-OS trying to use Xen virtual space. "
> -               "Truncating memory from %dMB to ",
> +               "Truncating memory from %luMB to ",
>                 ((unsigned long)pfn_to_virt(*max_pfn) -
>                  (unsigned long)&_text)>>20);
>          *max_pfn = virt_to_pfn(HYPERVISOR_VIRT_START - PAGE_SIZE);
> -        printk("%dMB\n",
> +        printk("%luMB\n",
>                 ((unsigned long)pfn_to_virt(*max_pfn) - 
>                  (unsigned long)&_text)>>20);
>      }
> @@ -326,7 +326,7 @@ static void set_readonly(void *text, void *etext)
>              count++;
>          }
>          else
> -            printk("skipped %p\n", start_address);
> +            printk("skipped %lx\n", start_address);
>  
>          start_address += PAGE_SIZE;
>  
> @@ -369,21 +369,21 @@ int mem_test(unsigned long *start_va, unsigned long *end_va, int verbose)
>      /* write values and print page walks */
>      if ( verbose && (((unsigned long)start_va) & 0xfffff) )
>      {
> -        printk("MemTest Start: 0x%lx\n", start_va);
> +        printk("MemTest Start: 0x%p\n", start_va);
>          page_walk((unsigned long)start_va);
>      }
>      for ( pointer = start_va; pointer < end_va; pointer++ )
>      {
>          if ( verbose && !(((unsigned long)pointer) & 0xfffff) )
>          {
> -            printk("Writing to %lx\n", pointer);
> +            printk("Writing to %p\n", pointer);
>              page_walk((unsigned long)pointer);
>          }
>          *pointer = (unsigned long)pointer & ~mask;
>      }
>      if ( verbose && (((unsigned long)end_va) & 0xfffff) )
>      {
> -        printk("MemTest End: %lx\n", end_va-1);
> +        printk("MemTest End: %p\n", end_va-1);
>          page_walk((unsigned long)end_va-1);
>      }
>   
> @@ -516,7 +516,7 @@ void arch_init_demand_mapping_area(unsigned long cur_pfn)
>  
>      demand_map_area_start = (unsigned long) pfn_to_virt(cur_pfn);
>      cur_pfn += DEMAND_MAP_PAGES;
> -    printk("Demand map pfns at %lx-%lx.\n", 
> +    printk("Demand map pfns at %lx-%p.\n", 
>             demand_map_area_start, pfn_to_virt(cur_pfn));
>  
>  #ifdef HAVE_LIBC
> @@ -619,7 +619,7 @@ void do_map_frames(unsigned long va,
>                  if (err)
>                      err[done * stride] = rc;
>                  else {
> -                    printk("Map %ld (%lx, ...) at %p failed: %d.\n",
> +                    printk("Map %ld (%lx, ...) at %lx failed: %d.\n",
>                             todo, mfns[done * stride] + done * incr, va, rc);
>                      do_exit();
>                  }
> @@ -793,7 +793,7 @@ unsigned long alloc_contig_pages(int order, unsigned int addr_bits)
>      out_frames = virt_to_pfn(in_va); /* PFNs to populate */
>      ret = HYPERVISOR_memory_op(XENMEM_exchange, &exchange);
>      if ( ret ) {
> -        printk("mem exchanged order=0x%x failed with rc=%d, nr_exchanged=%d\n", 
> +        printk("mem exchanged order=0x%x failed with rc=%d, nr_exchanged=%lu\n",
>                 order, ret, exchange.nr_exchanged);
>          /* we still need to return the allocated pages above to the pool
>           * ie. map them back into the 1:1 mapping etc. so we continue but 
> diff --git a/arch/x86/sched.c b/arch/x86/sched.c
> index e4a3dc2..ec13694 100644
> --- a/arch/x86/sched.c
> +++ b/arch/x86/sched.c
> @@ -73,7 +73,7 @@ void dump_stack(struct thread *thread)
>      printk("The stack for \"%s\"\n", thread->name);
>      for(count = 0; count < 25 && pointer < bottom; count ++)
>      {
> -        printk("[0x%lx] 0x%lx\n", pointer, *pointer);
> +        printk("[0x%p] 0x%lx\n", pointer, *pointer);
>          pointer++;
>      }
>      
> @@ -101,7 +101,7 @@ struct thread* arch_create_thread(char *name, void (*function)(void *),
>      /* We can't use lazy allocation here since the trap handler runs on the stack */
>      thread->stack = (char *)alloc_pages(STACK_SIZE_PAGE_ORDER);
>      thread->name = name;
> -    printk("Thread \"%s\": pointer: 0x%lx, stack: 0x%lx\n", name, thread, 
> +    printk("Thread \"%s\": pointer: 0x%p, stack: 0x%p\n", name, thread, 
>              thread->stack);
>      
>      thread->sp = (unsigned long)thread->stack + STACK_SIZE;
> diff --git a/arch/x86/traps.c b/arch/x86/traps.c
> index 516d133..6353718 100644
> --- a/arch/x86/traps.c
> +++ b/arch/x86/traps.c
> @@ -34,14 +34,14 @@ void dump_regs(struct pt_regs *regs)
>  {
>      printk("Thread: %s\n", current->name);
>  #ifdef __i386__    
> -    printk("EIP: %x, EFLAGS %x.\n", regs->eip, regs->eflags);
> -    printk("EBX: %08x ECX: %08x EDX: %08x\n",
> +    printk("EIP: %lx, EFLAGS %lx.\n", regs->eip, regs->eflags);
> +    printk("EBX: %08lx ECX: %08lx EDX: %08lx\n",
>  	   regs->ebx, regs->ecx, regs->edx);
> -    printk("ESI: %08x EDI: %08x EBP: %08x EAX: %08x\n",
> +    printk("ESI: %08lx EDI: %08lx EBP: %08lx EAX: %08lx\n",
>  	   regs->esi, regs->edi, regs->ebp, regs->eax);
> -    printk("DS: %04x ES: %04x orig_eax: %08x, eip: %08x\n",
> +    printk("DS: %04x ES: %04x orig_eax: %08lx, eip: %08lx\n",
>  	   regs->xds, regs->xes, regs->orig_eax, regs->eip);
> -    printk("CS: %04x EFLAGS: %08x esp: %08x ss: %04x\n",
> +    printk("CS: %04x EFLAGS: %08lx esp: %08lx ss: %04x\n",
>  	   regs->xcs, regs->eflags, regs->esp, regs->xss);
>  #else
>      printk("RIP: %04lx:[<%016lx>] ", regs->cs & 0xffff, regs->rip);
> @@ -214,10 +214,10 @@ void do_page_fault(struct pt_regs *regs, unsigned long error_code)
>      barrier();
>  
>  #if defined(__x86_64__)
> -    printk("Page fault at linear address %p, rip %p, regs %p, sp %p, our_sp %p, code %lx\n",
> +    printk("Page fault at linear address %lx, rip %lx, regs %p, sp %lx, our_sp %p, code %lx\n",
>             addr, regs->rip, regs, regs->rsp, &addr, error_code);
>  #else
> -    printk("Page fault at linear address %p, eip %p, regs %p, sp %p, our_sp %p, code %lx\n",
> +    printk("Page fault at linear address %lx, eip %lx, regs %p, sp %lx, our_sp %p, code %lx\n",
>             addr, regs->eip, regs, regs->esp, &addr, error_code);
>  #endif
>  
> @@ -243,9 +243,9 @@ void do_general_protection(struct pt_regs *regs, long error_code)
>  {
>      struct sched_shutdown sched_shutdown = { .reason = SHUTDOWN_crash };
>  #ifdef __i386__
> -    printk("GPF eip: %p, error_code=%lx\n", regs->eip, error_code);
> +    printk("GPF eip: %lx, error_code=%lx\n", regs->eip, error_code);
>  #else    
> -    printk("GPF rip: %p, error_code=%lx\n", regs->rip, error_code);
> +    printk("GPF rip: %lx, error_code=%lx\n", regs->rip, error_code);
>  #endif
>      dump_regs(regs);
>  #if defined(__x86_64__)
> diff --git a/blkfront.c b/blkfront.c
> index 59e576f..bdb7765 100644
> --- a/blkfront.c
> +++ b/blkfront.c
> @@ -236,7 +236,7 @@ done:
>      }
>      unmask_evtchn(dev->evtchn);
>  
> -    printk("%u sectors of %u bytes\n", dev->info.sectors, dev->info.sector_size);
> +    printk("%lu sectors of %u bytes\n", (unsigned long) dev->info.sectors, dev->info.sector_size);
>      printk("**************************\n");
>  
>      return dev;
> diff --git a/include/console.h b/include/console.h
> index 3755b66..a77f47f 100644
> --- a/include/console.h
> +++ b/include/console.h
> @@ -64,8 +64,8 @@ struct consfront_dev {
>  
> 
>  void print(int direct, const char *fmt, va_list args);
> -void printk(const char *fmt, ...);
> -void xprintk(const char *fmt, ...);
> +void printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
> +void xprintk(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
>  
>  #define tprintk(_fmt, _args...) printk("[%s] " _fmt, current->name, ##_args) 
>  
> diff --git a/lib/sys.c b/lib/sys.c
> index 13e7e59..f8d7a7c 100644
> --- a/lib/sys.c
> +++ b/lib/sys.c
> @@ -1319,7 +1319,7 @@ int clock_gettime(clockid_t clk_id, struct timespec *tp)
>  	    break;
>  	}
>  	default:
> -	    print_unsupported("clock_gettime(%d)", clk_id);
> +	    print_unsupported("clock_gettime(%ld)", (long) clk_id);
>  	    errno = EINVAL;
>  	    return -1;
>      }
> @@ -1421,7 +1421,7 @@ void sparse(unsigned long data, size_t size)
>          mfns[i] = virtual_to_mfn(data + i * PAGE_SIZE);
>      }
>  
> -    printk("sparsing %ldMB at %lx\n", size >> 20, data);
> +    printk("sparsing %ldMB at %lx\n", ((long) size) >> 20, data);
>  
>      munmap((void *) data, size);
>      free_physical_pages(mfns, n);
> diff --git a/lwip-arch.c b/lwip-arch.c
> index e634ef4..154617b 100644
> --- a/lwip-arch.c
> +++ b/lwip-arch.c
> @@ -236,8 +236,9 @@ sys_thread_t sys_thread_new(char *name, void (* thread)(void *arg), void *arg, i
>  {
>      struct thread *t;
>      if (stacksize > STACK_SIZE) {
> -	printk("Can't start lwIP thread: stack size %d is too large for our %d\n", stacksize, STACK_SIZE);
> -	do_exit();
> +        printk("Can't start lwIP thread: stack size %d is too large for our %lu\n",
> +                stacksize, (unsigned long) STACK_SIZE);
> +        do_exit();
>      }
>      lwip_thread = t = create_thread(name, thread, arg);
>      return t;
> diff --git a/minios.mk b/minios.mk
> index b0d9f71..e042027 100644
> --- a/minios.mk
> +++ b/minios.mk
> @@ -6,7 +6,7 @@ debug = y
>  
>  # Define some default flags.
>  # NB. '-Wcast-qual' is nasty, so I omitted it.
> -DEF_CFLAGS += -fno-builtin -Wall -Werror -Wredundant-decls -Wno-format -Wno-redundant-decls
> +DEF_CFLAGS += -fno-builtin -Wall -Werror -Wredundant-decls -Wno-format -Wno-redundant-decls -Wformat
>  DEF_CFLAGS += $(call cc-option,$(CC),-fno-stack-protector,)
>  DEF_CFLAGS += $(call cc-option,$(CC),-fgnu89-inline)
>  DEF_CFLAGS += -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline
> diff --git a/mm.c b/mm.c
> index 64b3292..31aaf83 100644
> --- a/mm.c
> +++ b/mm.c
> @@ -379,7 +379,11 @@ void *sbrk(ptrdiff_t increment)
>      unsigned long new_brk = old_brk + increment;
>  
>      if (new_brk > heap_end) {
> -	printk("Heap exhausted: %p + %lx = %p > %p\n", old_brk, increment, new_brk, heap_end);
> +	printk("Heap exhausted: %lx + %lx = %p > %p\n",
> +			old_brk,
> +			(unsigned long) increment,
> +			(void *) new_brk,
> +			(void *) heap_end);
>  	return NULL;
>      }
>      
> diff --git a/netfront.c b/netfront.c
> index 42bb103..0eca5b5 100644
> --- a/netfront.c
> +++ b/netfront.c
> @@ -325,8 +325,8 @@ struct netfront_dev *init_netfront(char *_nodename, void (*thenetif_rx)(unsigned
>      dev->fd = -1;
>  #endif
>  
> -    printk("net TX ring size %d\n", NET_TX_RING_SIZE);
> -    printk("net RX ring size %d\n", NET_RX_RING_SIZE);
> +    printk("net TX ring size %lu\n", (unsigned long) NET_TX_RING_SIZE);
> +    printk("net RX ring size %lu\n", (unsigned long) NET_RX_RING_SIZE);
>      init_SEMAPHORE(&dev->tx_sem, NET_TX_RING_SIZE);
>      for(i=0;i<NET_TX_RING_SIZE;i++)
>      {
> diff --git a/sched.c b/sched.c
> index d0c607e..1e843d9 100644
> --- a/sched.c
> +++ b/sched.c
> @@ -276,7 +276,7 @@ void th_f2(void *data)
>  {
>      for(;;)
>      {
> -        printk("Thread OTHER executing, data 0x%lx\n", data);
> +        printk("Thread OTHER executing, data 0x%p\n", data);
>          schedule();
>      }
>  }
> diff --git a/test.c b/test.c
> index 0d7aba4..154af49 100644
> --- a/test.c
> +++ b/test.c
> @@ -129,7 +129,7 @@ static void blk_read_completed(struct blkfront_aiocb *aiocb, int ret)
>  {
>      struct blk_req *req = aiocb->data;
>      if (ret)
> -        printk("got error code %d when reading at offset %ld\n", ret, aiocb->aio_offset);
> +        printk("got error code %d when reading at offset %ld\n", ret, (long) aiocb->aio_offset);
>      else
>          blk_size_read += blk_info.sector_size;
>      free(aiocb->aio_buf);
> @@ -250,7 +250,9 @@ static void blkfront_thread(void *p)
>          blkfront_aio_poll(blk_dev);
>          gettimeofday(&tv, NULL);
>          if (tv.tv_sec > lasttime + 10) {
> -            printk("%llu read, %llu write\n", blk_size_read, blk_size_write);
> +            printk("%llu read, %llu write\n",
> +                    (unsigned long long) blk_size_read,
> +                    (unsigned long long) blk_size_write);
>              lasttime = tv.tv_sec;
>          }
>  
> diff --git a/tpm_tis.c b/tpm_tis.c
> index debcc43..98fe837 100644
> --- a/tpm_tis.c
> +++ b/tpm_tis.c
> @@ -912,7 +912,7 @@ static ssize_t tpm_transmit(struct tpm_chip *chip, const uint8_t *buf,
>     //down(&chip->tpm_mutex);
>  
>     if ((rc = tpm_tis_send(chip, (uint8_t *) buf, count)) < 0) {
> -      printk("tpm_transmit: tpm_send: error %ld\n", rc);
> +      printk("tpm_transmit: tpm_send: error %ld\n", (long) rc);
>        goto out;
>     }
>  
> @@ -944,7 +944,7 @@ static ssize_t tpm_transmit(struct tpm_chip *chip, const uint8_t *buf,
>  
>  out_recv:
>     if((rc = tpm_tis_recv(chip, (uint8_t *) buf, bufsiz)) < 0) {
> -      printk("tpm_transmit: tpm_recv: error %d\n", rc);
> +      printk("tpm_transmit: tpm_recv: error %d\n", (int) rc);
>     }
>  out:
>     //up(&chip->tpm_mutex);
> @@ -983,7 +983,7 @@ int tpm_get_timeouts(struct tpm_chip *chip)
>  
>     if((rc = transmit_cmd(chip, &tpm_cmd, TPM_INTERNAL_RESULT_SIZE,
>  	 "attempting to determine the timeouts")) != 0) {
> -      printk("transmit failed %d\n", rc);
> +      printk("transmit failed %d\n", (int) rc);
>        goto duration;
>     }
>  
> @@ -1145,7 +1145,7 @@ struct tpm_chip* init_tpm_tis(unsigned long baseaddr, int localities, unsigned i
>        if(locality_enabled(tpm, i)) {
>  	 /* Map the page in now */
>  	 if((tpm->pages[i] = ioremap_nocache(addr, PAGE_SIZE)) == NULL) {
> -	    printk("Unable to map iomem page a address %p\n", addr);
> +	    printk("Unable to map iomem page a address %lx\n", addr);
>  	    goto abort_egress;
>  	 }
>  
> diff --git a/xenbus/xenbus.c b/xenbus/xenbus.c
> index 934f23b..4613ed6 100644
> --- a/xenbus/xenbus.c
> +++ b/xenbus/xenbus.c
> @@ -337,8 +337,8 @@ void init_xenbus(void)
>  		      xenbus_evtchn_handler,
>                NULL);
>      unmask_evtchn(start_info.store_evtchn);
> -    printk("xenbus initialised on irq %d mfn %#lx\n",
> -	   err, start_info.store_mfn);
> +    printk("xenbus initialised on irq %d mfn %#llx\n",
> +	   err, (unsigned long long) start_info.store_mfn);
>  }
>  
>  void fini_xenbus(void)



_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

From minios-devel-bounces@lists.xenproject.org Wed Jun 17 12:47:27 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 17 Jun 2015 12:47:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z5CkY-0000be-Qa; Wed, 17 Jun 2015 12:47:26 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <prvs=6035412ff=Ian.Campbell@citrix.com>)
	id 1Z5CkX-0000am-0X
	for Minios-devel@lists.xenproject.org; Wed, 17 Jun 2015 12:47:25 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	D4/E2-23832-C5C61855; Wed, 17 Jun 2015 12:47:24 +0000
X-Env-Sender: prvs=6035412ff=Ian.Campbell@citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1434545242!14694608!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n,
	received_headers: No Received headers
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21774 invoked from network); 17 Jun 2015 12:47:23 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-14.tower-31.messagelabs.com with RC4-SHA encrypted SMTP;
	17 Jun 2015 12:47:23 -0000
X-IronPort-AV: E=Sophos;i="5.13,632,1427760000"; d="scan'208";a="275719488"
Message-ID: <1434545240.13744.361.camel@citrix.com>
From: Ian Campbell <ian.campbell@citrix.com>
To: Thomas Leonard <talex5@gmail.com>
Date: Wed, 17 Jun 2015 13:47:20 +0100
In-Reply-To: <1434535700-26779-1-git-send-email-talex5@gmail.com>
References: <1434535700-26779-1-git-send-email-talex5@gmail.com>
X-Mailer: Evolution 3.12.9-1+b1 
MIME-Version: 1.0
X-DLP: MIA2
Cc: Minios-devel@lists.xenproject.org, samuel.thibault@ens-lyon.org,
	stefano.stabellini@eu.citrix.com
Subject: Re: [Minios-devel] [PATCH v2] mini-os: enable compiler check for
 printk format types
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org

On Wed, 2015-06-17 at 11:08 +0100, Thomas Leonard wrote:
> Signed-off-by: Thomas Leonard <talex5@gmail.com>
> ---
> Note: This patch might flag up warnings in downstream projects that use
> incorrect format codes. In particular, it doesn't include the patch to
> Xen's vtpm_load_disk, since that's now in a separate repository. See:
> 
> http://lists.xenproject.org/archives/html/xen-devel/2014-10/msg00899.html

Does such a fixup patch exist somewhere or are you intending to supply
one?

> ---
>  arch/x86/mm.c     | 22 +++++++++++-----------
>  arch/x86/sched.c  |  4 ++--
>  arch/x86/traps.c  | 18 +++++++++---------
>  blkfront.c        |  2 +-
>  include/console.h |  4 ++--
>  lib/sys.c         |  4 ++--
>  lwip-arch.c       |  5 +++--
>  minios.mk         |  2 +-
>  mm.c              |  6 +++++-
>  netfront.c        |  4 ++--
>  sched.c           |  2 +-
>  test.c            |  6 ++++--
>  tpm_tis.c         |  8 ++++----
>  xenbus/xenbus.c   |  4 ++--
>  14 files changed, 49 insertions(+), 42 deletions(-)
> 
> diff --git a/arch/x86/mm.c b/arch/x86/mm.c
> index 9c6d1b8..186659d 100644
> --- a/arch/x86/mm.c
> +++ b/arch/x86/mm.c
> @@ -94,7 +94,7 @@ static void new_pt_frame(unsigned long *pt_pfn, unsigned long prev_l_mfn,
>          break;
>  #endif
>      default:
> -        printk("new_pt_frame() called with invalid level number %d\n", level);
> +        printk("new_pt_frame() called with invalid level number %lu\n", level);
>          do_exit();
>          break;
>      }
> @@ -181,7 +181,7 @@ static int need_pt_frame(unsigned long va, int level)
>          if ( level == L1_FRAME )
>              return 1;
>  
> -    printk("ERROR: Unknown frame level %d, hypervisor %llx,%llx\n", 
> +    printk("ERROR: Unknown frame level %d, hypervisor %lx,%lx\n", 
>             level, hyp_virt_start, hyp_virt_end);
>      return -1;
>  }
> @@ -206,11 +206,11 @@ static void build_pagetable(unsigned long *start_pfn, unsigned long *max_pfn)
>      if ( *max_pfn >= virt_to_pfn(HYPERVISOR_VIRT_START) )
>      {
>          printk("WARNING: Mini-OS trying to use Xen virtual space. "
> -               "Truncating memory from %dMB to ",
> +               "Truncating memory from %luMB to ",
>                 ((unsigned long)pfn_to_virt(*max_pfn) -
>                  (unsigned long)&_text)>>20);
>          *max_pfn = virt_to_pfn(HYPERVISOR_VIRT_START - PAGE_SIZE);
> -        printk("%dMB\n",
> +        printk("%luMB\n",
>                 ((unsigned long)pfn_to_virt(*max_pfn) - 
>                  (unsigned long)&_text)>>20);
>      }
> @@ -326,7 +326,7 @@ static void set_readonly(void *text, void *etext)
>              count++;
>          }
>          else
> -            printk("skipped %p\n", start_address);
> +            printk("skipped %lx\n", start_address);
>  
>          start_address += PAGE_SIZE;
>  
> @@ -369,21 +369,21 @@ int mem_test(unsigned long *start_va, unsigned long *end_va, int verbose)
>      /* write values and print page walks */
>      if ( verbose && (((unsigned long)start_va) & 0xfffff) )
>      {
> -        printk("MemTest Start: 0x%lx\n", start_va);
> +        printk("MemTest Start: 0x%p\n", start_va);
>          page_walk((unsigned long)start_va);
>      }
>      for ( pointer = start_va; pointer < end_va; pointer++ )
>      {
>          if ( verbose && !(((unsigned long)pointer) & 0xfffff) )
>          {
> -            printk("Writing to %lx\n", pointer);
> +            printk("Writing to %p\n", pointer);
>              page_walk((unsigned long)pointer);
>          }
>          *pointer = (unsigned long)pointer & ~mask;
>      }
>      if ( verbose && (((unsigned long)end_va) & 0xfffff) )
>      {
> -        printk("MemTest End: %lx\n", end_va-1);
> +        printk("MemTest End: %p\n", end_va-1);
>          page_walk((unsigned long)end_va-1);
>      }
>   
> @@ -516,7 +516,7 @@ void arch_init_demand_mapping_area(unsigned long cur_pfn)
>  
>      demand_map_area_start = (unsigned long) pfn_to_virt(cur_pfn);
>      cur_pfn += DEMAND_MAP_PAGES;
> -    printk("Demand map pfns at %lx-%lx.\n", 
> +    printk("Demand map pfns at %lx-%p.\n", 
>             demand_map_area_start, pfn_to_virt(cur_pfn));
>  
>  #ifdef HAVE_LIBC
> @@ -619,7 +619,7 @@ void do_map_frames(unsigned long va,
>                  if (err)
>                      err[done * stride] = rc;
>                  else {
> -                    printk("Map %ld (%lx, ...) at %p failed: %d.\n",
> +                    printk("Map %ld (%lx, ...) at %lx failed: %d.\n",
>                             todo, mfns[done * stride] + done * incr, va, rc);
>                      do_exit();
>                  }
> @@ -793,7 +793,7 @@ unsigned long alloc_contig_pages(int order, unsigned int addr_bits)
>      out_frames = virt_to_pfn(in_va); /* PFNs to populate */
>      ret = HYPERVISOR_memory_op(XENMEM_exchange, &exchange);
>      if ( ret ) {
> -        printk("mem exchanged order=0x%x failed with rc=%d, nr_exchanged=%d\n", 
> +        printk("mem exchanged order=0x%x failed with rc=%d, nr_exchanged=%lu\n",
>                 order, ret, exchange.nr_exchanged);
>          /* we still need to return the allocated pages above to the pool
>           * ie. map them back into the 1:1 mapping etc. so we continue but 
> diff --git a/arch/x86/sched.c b/arch/x86/sched.c
> index e4a3dc2..ec13694 100644
> --- a/arch/x86/sched.c
> +++ b/arch/x86/sched.c
> @@ -73,7 +73,7 @@ void dump_stack(struct thread *thread)
>      printk("The stack for \"%s\"\n", thread->name);
>      for(count = 0; count < 25 && pointer < bottom; count ++)
>      {
> -        printk("[0x%lx] 0x%lx\n", pointer, *pointer);
> +        printk("[0x%p] 0x%lx\n", pointer, *pointer);
>          pointer++;
>      }
>      
> @@ -101,7 +101,7 @@ struct thread* arch_create_thread(char *name, void (*function)(void *),
>      /* We can't use lazy allocation here since the trap handler runs on the stack */
>      thread->stack = (char *)alloc_pages(STACK_SIZE_PAGE_ORDER);
>      thread->name = name;
> -    printk("Thread \"%s\": pointer: 0x%lx, stack: 0x%lx\n", name, thread, 
> +    printk("Thread \"%s\": pointer: 0x%p, stack: 0x%p\n", name, thread, 
>              thread->stack);
>      
>      thread->sp = (unsigned long)thread->stack + STACK_SIZE;
> diff --git a/arch/x86/traps.c b/arch/x86/traps.c
> index 516d133..6353718 100644
> --- a/arch/x86/traps.c
> +++ b/arch/x86/traps.c
> @@ -34,14 +34,14 @@ void dump_regs(struct pt_regs *regs)
>  {
>      printk("Thread: %s\n", current->name);
>  #ifdef __i386__    
> -    printk("EIP: %x, EFLAGS %x.\n", regs->eip, regs->eflags);
> -    printk("EBX: %08x ECX: %08x EDX: %08x\n",
> +    printk("EIP: %lx, EFLAGS %lx.\n", regs->eip, regs->eflags);
> +    printk("EBX: %08lx ECX: %08lx EDX: %08lx\n",
>  	   regs->ebx, regs->ecx, regs->edx);
> -    printk("ESI: %08x EDI: %08x EBP: %08x EAX: %08x\n",
> +    printk("ESI: %08lx EDI: %08lx EBP: %08lx EAX: %08lx\n",
>  	   regs->esi, regs->edi, regs->ebp, regs->eax);
> -    printk("DS: %04x ES: %04x orig_eax: %08x, eip: %08x\n",
> +    printk("DS: %04x ES: %04x orig_eax: %08lx, eip: %08lx\n",
>  	   regs->xds, regs->xes, regs->orig_eax, regs->eip);
> -    printk("CS: %04x EFLAGS: %08x esp: %08x ss: %04x\n",
> +    printk("CS: %04x EFLAGS: %08lx esp: %08lx ss: %04x\n",
>  	   regs->xcs, regs->eflags, regs->esp, regs->xss);
>  #else
>      printk("RIP: %04lx:[<%016lx>] ", regs->cs & 0xffff, regs->rip);
> @@ -214,10 +214,10 @@ void do_page_fault(struct pt_regs *regs, unsigned long error_code)
>      barrier();
>  
>  #if defined(__x86_64__)
> -    printk("Page fault at linear address %p, rip %p, regs %p, sp %p, our_sp %p, code %lx\n",
> +    printk("Page fault at linear address %lx, rip %lx, regs %p, sp %lx, our_sp %p, code %lx\n",
>             addr, regs->rip, regs, regs->rsp, &addr, error_code);
>  #else
> -    printk("Page fault at linear address %p, eip %p, regs %p, sp %p, our_sp %p, code %lx\n",
> +    printk("Page fault at linear address %lx, eip %lx, regs %p, sp %lx, our_sp %p, code %lx\n",
>             addr, regs->eip, regs, regs->esp, &addr, error_code);
>  #endif
>  
> @@ -243,9 +243,9 @@ void do_general_protection(struct pt_regs *regs, long error_code)
>  {
>      struct sched_shutdown sched_shutdown = { .reason = SHUTDOWN_crash };
>  #ifdef __i386__
> -    printk("GPF eip: %p, error_code=%lx\n", regs->eip, error_code);
> +    printk("GPF eip: %lx, error_code=%lx\n", regs->eip, error_code);
>  #else    
> -    printk("GPF rip: %p, error_code=%lx\n", regs->rip, error_code);
> +    printk("GPF rip: %lx, error_code=%lx\n", regs->rip, error_code);
>  #endif
>      dump_regs(regs);
>  #if defined(__x86_64__)
> diff --git a/blkfront.c b/blkfront.c
> index 59e576f..bdb7765 100644
> --- a/blkfront.c
> +++ b/blkfront.c
> @@ -236,7 +236,7 @@ done:
>      }
>      unmask_evtchn(dev->evtchn);
>  
> -    printk("%u sectors of %u bytes\n", dev->info.sectors, dev->info.sector_size);
> +    printk("%lu sectors of %u bytes\n", (unsigned long) dev->info.sectors, dev->info.sector_size);
>      printk("**************************\n");
>  
>      return dev;
> diff --git a/include/console.h b/include/console.h
> index 3755b66..a77f47f 100644
> --- a/include/console.h
> +++ b/include/console.h
> @@ -64,8 +64,8 @@ struct consfront_dev {
>  
> 
>  void print(int direct, const char *fmt, va_list args);
> -void printk(const char *fmt, ...);
> -void xprintk(const char *fmt, ...);
> +void printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
> +void xprintk(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
>  
>  #define tprintk(_fmt, _args...) printk("[%s] " _fmt, current->name, ##_args) 
>  
> diff --git a/lib/sys.c b/lib/sys.c
> index 13e7e59..f8d7a7c 100644
> --- a/lib/sys.c
> +++ b/lib/sys.c
> @@ -1319,7 +1319,7 @@ int clock_gettime(clockid_t clk_id, struct timespec *tp)
>  	    break;
>  	}
>  	default:
> -	    print_unsupported("clock_gettime(%d)", clk_id);
> +	    print_unsupported("clock_gettime(%ld)", (long) clk_id);
>  	    errno = EINVAL;
>  	    return -1;
>      }
> @@ -1421,7 +1421,7 @@ void sparse(unsigned long data, size_t size)
>          mfns[i] = virtual_to_mfn(data + i * PAGE_SIZE);
>      }
>  
> -    printk("sparsing %ldMB at %lx\n", size >> 20, data);
> +    printk("sparsing %ldMB at %lx\n", ((long) size) >> 20, data);
>  
>      munmap((void *) data, size);
>      free_physical_pages(mfns, n);
> diff --git a/lwip-arch.c b/lwip-arch.c
> index e634ef4..154617b 100644
> --- a/lwip-arch.c
> +++ b/lwip-arch.c
> @@ -236,8 +236,9 @@ sys_thread_t sys_thread_new(char *name, void (* thread)(void *arg), void *arg, i
>  {
>      struct thread *t;
>      if (stacksize > STACK_SIZE) {
> -	printk("Can't start lwIP thread: stack size %d is too large for our %d\n", stacksize, STACK_SIZE);
> -	do_exit();
> +        printk("Can't start lwIP thread: stack size %d is too large for our %lu\n",
> +                stacksize, (unsigned long) STACK_SIZE);
> +        do_exit();
>      }
>      lwip_thread = t = create_thread(name, thread, arg);
>      return t;
> diff --git a/minios.mk b/minios.mk
> index b0d9f71..e042027 100644
> --- a/minios.mk
> +++ b/minios.mk
> @@ -6,7 +6,7 @@ debug = y
>  
>  # Define some default flags.
>  # NB. '-Wcast-qual' is nasty, so I omitted it.
> -DEF_CFLAGS += -fno-builtin -Wall -Werror -Wredundant-decls -Wno-format -Wno-redundant-decls
> +DEF_CFLAGS += -fno-builtin -Wall -Werror -Wredundant-decls -Wno-format -Wno-redundant-decls -Wformat
>  DEF_CFLAGS += $(call cc-option,$(CC),-fno-stack-protector,)
>  DEF_CFLAGS += $(call cc-option,$(CC),-fgnu89-inline)
>  DEF_CFLAGS += -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline
> diff --git a/mm.c b/mm.c
> index 64b3292..31aaf83 100644
> --- a/mm.c
> +++ b/mm.c
> @@ -379,7 +379,11 @@ void *sbrk(ptrdiff_t increment)
>      unsigned long new_brk = old_brk + increment;
>  
>      if (new_brk > heap_end) {
> -	printk("Heap exhausted: %p + %lx = %p > %p\n", old_brk, increment, new_brk, heap_end);
> +	printk("Heap exhausted: %lx + %lx = %p > %p\n",
> +			old_brk,
> +			(unsigned long) increment,
> +			(void *) new_brk,
> +			(void *) heap_end);
>  	return NULL;
>      }
>      
> diff --git a/netfront.c b/netfront.c
> index 42bb103..0eca5b5 100644
> --- a/netfront.c
> +++ b/netfront.c
> @@ -325,8 +325,8 @@ struct netfront_dev *init_netfront(char *_nodename, void (*thenetif_rx)(unsigned
>      dev->fd = -1;
>  #endif
>  
> -    printk("net TX ring size %d\n", NET_TX_RING_SIZE);
> -    printk("net RX ring size %d\n", NET_RX_RING_SIZE);
> +    printk("net TX ring size %lu\n", (unsigned long) NET_TX_RING_SIZE);
> +    printk("net RX ring size %lu\n", (unsigned long) NET_RX_RING_SIZE);
>      init_SEMAPHORE(&dev->tx_sem, NET_TX_RING_SIZE);
>      for(i=0;i<NET_TX_RING_SIZE;i++)
>      {
> diff --git a/sched.c b/sched.c
> index d0c607e..1e843d9 100644
> --- a/sched.c
> +++ b/sched.c
> @@ -276,7 +276,7 @@ void th_f2(void *data)
>  {
>      for(;;)
>      {
> -        printk("Thread OTHER executing, data 0x%lx\n", data);
> +        printk("Thread OTHER executing, data 0x%p\n", data);
>          schedule();
>      }
>  }
> diff --git a/test.c b/test.c
> index 0d7aba4..154af49 100644
> --- a/test.c
> +++ b/test.c
> @@ -129,7 +129,7 @@ static void blk_read_completed(struct blkfront_aiocb *aiocb, int ret)
>  {
>      struct blk_req *req = aiocb->data;
>      if (ret)
> -        printk("got error code %d when reading at offset %ld\n", ret, aiocb->aio_offset);
> +        printk("got error code %d when reading at offset %ld\n", ret, (long) aiocb->aio_offset);
>      else
>          blk_size_read += blk_info.sector_size;
>      free(aiocb->aio_buf);
> @@ -250,7 +250,9 @@ static void blkfront_thread(void *p)
>          blkfront_aio_poll(blk_dev);
>          gettimeofday(&tv, NULL);
>          if (tv.tv_sec > lasttime + 10) {
> -            printk("%llu read, %llu write\n", blk_size_read, blk_size_write);
> +            printk("%llu read, %llu write\n",
> +                    (unsigned long long) blk_size_read,
> +                    (unsigned long long) blk_size_write);
>              lasttime = tv.tv_sec;
>          }
>  
> diff --git a/tpm_tis.c b/tpm_tis.c
> index debcc43..98fe837 100644
> --- a/tpm_tis.c
> +++ b/tpm_tis.c
> @@ -912,7 +912,7 @@ static ssize_t tpm_transmit(struct tpm_chip *chip, const uint8_t *buf,
>     //down(&chip->tpm_mutex);
>  
>     if ((rc = tpm_tis_send(chip, (uint8_t *) buf, count)) < 0) {
> -      printk("tpm_transmit: tpm_send: error %ld\n", rc);
> +      printk("tpm_transmit: tpm_send: error %ld\n", (long) rc);
>        goto out;
>     }
>  
> @@ -944,7 +944,7 @@ static ssize_t tpm_transmit(struct tpm_chip *chip, const uint8_t *buf,
>  
>  out_recv:
>     if((rc = tpm_tis_recv(chip, (uint8_t *) buf, bufsiz)) < 0) {
> -      printk("tpm_transmit: tpm_recv: error %d\n", rc);
> +      printk("tpm_transmit: tpm_recv: error %d\n", (int) rc);
>     }
>  out:
>     //up(&chip->tpm_mutex);
> @@ -983,7 +983,7 @@ int tpm_get_timeouts(struct tpm_chip *chip)
>  
>     if((rc = transmit_cmd(chip, &tpm_cmd, TPM_INTERNAL_RESULT_SIZE,
>  	 "attempting to determine the timeouts")) != 0) {
> -      printk("transmit failed %d\n", rc);
> +      printk("transmit failed %d\n", (int) rc);
>        goto duration;
>     }
>  
> @@ -1145,7 +1145,7 @@ struct tpm_chip* init_tpm_tis(unsigned long baseaddr, int localities, unsigned i
>        if(locality_enabled(tpm, i)) {
>  	 /* Map the page in now */
>  	 if((tpm->pages[i] = ioremap_nocache(addr, PAGE_SIZE)) == NULL) {
> -	    printk("Unable to map iomem page a address %p\n", addr);
> +	    printk("Unable to map iomem page a address %lx\n", addr);
>  	    goto abort_egress;
>  	 }
>  
> diff --git a/xenbus/xenbus.c b/xenbus/xenbus.c
> index 934f23b..4613ed6 100644
> --- a/xenbus/xenbus.c
> +++ b/xenbus/xenbus.c
> @@ -337,8 +337,8 @@ void init_xenbus(void)
>  		      xenbus_evtchn_handler,
>                NULL);
>      unmask_evtchn(start_info.store_evtchn);
> -    printk("xenbus initialised on irq %d mfn %#lx\n",
> -	   err, start_info.store_mfn);
> +    printk("xenbus initialised on irq %d mfn %#llx\n",
> +	   err, (unsigned long long) start_info.store_mfn);
>  }
>  
>  void fini_xenbus(void)



_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

From minios-devel-bounces@lists.xenproject.org Wed Jun 17 13:16:57 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 17 Jun 2015 13:16:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z5DD6-0007zf-EJ; Wed, 17 Jun 2015 13:16:56 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <talex5@gmail.com>) id 1Z5DD5-0007zP-NX
	for Minios-devel@lists.xenproject.org; Wed, 17 Jun 2015 13:16:55 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	78/C0-02952-74371855; Wed, 17 Jun 2015 13:16:55 +0000
X-Env-Sender: talex5@gmail.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1434547011!17144162!1
X-Originating-IP: [209.85.160.181]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7823 invoked from network); 17 Jun 2015 13:16:52 -0000
Received: from mail-yk0-f181.google.com (HELO mail-yk0-f181.google.com)
	(209.85.160.181)
	by server-7.tower-31.messagelabs.com with RC4-SHA encrypted SMTP;
	17 Jun 2015 13:16:52 -0000
Received: by ykdr198 with SMTP id r198so39449972ykd.3
	for <Minios-devel@lists.xenproject.org>;
	Wed, 17 Jun 2015 06:16:51 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=nrzPFtyLX8dPv7+4LQLKPpOZc+SRkRfknHgxJpLq0BU=;
	b=l30psY+9s69YDexjyaKfdMZ/mVxXRGbi8SBnaYtkg9c6lqvCIfccKIS0iNp17oZ0qo
	VhUcHekNXJu4sKL0CbE+yw99k0szr+iIF3nMMk3lTZx2EaMjdGBjtPbY1pP+Zw9D96K0
	S2hCbgmek8tN6acQxFdZD+GscATo6DiiyRialIrD8qOQFZLuJ/HXgCg8OEz89pJwlVUm
	xhC4GMoZ0OnH/MBMPO4Vl8EcOXQ47aORXFQ9IC2VKAYx2YUy1187meHtas7jC36qXJ4c
	pdExgSPLKBqmYy3upGbxWbhjKxVrN1Fce1s5MdumoBiuc2Up0aEQf1mL4qmBW8hhtmM2
	QoKg==
MIME-Version: 1.0
X-Received: by 10.52.35.107 with SMTP id g11mr4696358vdj.37.1434547011227;
	Wed, 17 Jun 2015 06:16:51 -0700 (PDT)
Received: by 10.31.95.6 with HTTP; Wed, 17 Jun 2015 06:16:51 -0700 (PDT)
In-Reply-To: <1434545240.13744.361.camel@citrix.com>
References: <1434535700-26779-1-git-send-email-talex5@gmail.com>
	<1434545240.13744.361.camel@citrix.com>
Date: Wed, 17 Jun 2015 14:16:51 +0100
Message-ID: <CAG4opy8ZZ5b1ZNp=8TKKkyHNMfWErvGg+Wyr9ech7w8wrczbRA@mail.gmail.com>
From: Thomas Leonard <talex5@gmail.com>
To: Ian Campbell <ian.campbell@citrix.com>
Cc: Minios-devel@lists.xenproject.org,
	Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Minios-devel] [PATCH v2] mini-os: enable compiler check for
	printk format types
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org

On 17 June 2015 at 13:47, Ian Campbell <ian.campbell@citrix.com> wrote:
> On Wed, 2015-06-17 at 11:08 +0100, Thomas Leonard wrote:
>> Signed-off-by: Thomas Leonard <talex5@gmail.com>
>> ---
>> Note: This patch might flag up warnings in downstream projects that use
>> incorrect format codes. In particular, it doesn't include the patch to
>> Xen's vtpm_load_disk, since that's now in a separate repository. See:
>>
>> http://lists.xenproject.org/archives/html/xen-devel/2014-10/msg00899.html
>
> Does such a fixup patch exist somewhere or are you intending to supply
> one?

The original patch [1] was supposed to fix it, but there was some
issue compiling on 32-bit which I can't reproduce. Do you have e.g. a
docker image with your test environment I could use? Otherwise, I
expect the solution will be obvious if you can see the errors.

[1] Attached to
http://lists.xenproject.org/archives/html/xen-devel/2014-08/msg00998.html


-- 
Dr Thomas Leonard        http://roscidus.com/blog/
GPG: DA98 25AE CAD0 8975 7CDA  BD8E 0713 3F96 CA74 D8BA

_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

From minios-devel-bounces@lists.xenproject.org Wed Jun 17 13:16:57 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 17 Jun 2015 13:16:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z5DD6-0007zf-EJ; Wed, 17 Jun 2015 13:16:56 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <talex5@gmail.com>) id 1Z5DD5-0007zP-NX
	for Minios-devel@lists.xenproject.org; Wed, 17 Jun 2015 13:16:55 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	78/C0-02952-74371855; Wed, 17 Jun 2015 13:16:55 +0000
X-Env-Sender: talex5@gmail.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1434547011!17144162!1
X-Originating-IP: [209.85.160.181]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7823 invoked from network); 17 Jun 2015 13:16:52 -0000
Received: from mail-yk0-f181.google.com (HELO mail-yk0-f181.google.com)
	(209.85.160.181)
	by server-7.tower-31.messagelabs.com with RC4-SHA encrypted SMTP;
	17 Jun 2015 13:16:52 -0000
Received: by ykdr198 with SMTP id r198so39449972ykd.3
	for <Minios-devel@lists.xenproject.org>;
	Wed, 17 Jun 2015 06:16:51 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=nrzPFtyLX8dPv7+4LQLKPpOZc+SRkRfknHgxJpLq0BU=;
	b=l30psY+9s69YDexjyaKfdMZ/mVxXRGbi8SBnaYtkg9c6lqvCIfccKIS0iNp17oZ0qo
	VhUcHekNXJu4sKL0CbE+yw99k0szr+iIF3nMMk3lTZx2EaMjdGBjtPbY1pP+Zw9D96K0
	S2hCbgmek8tN6acQxFdZD+GscATo6DiiyRialIrD8qOQFZLuJ/HXgCg8OEz89pJwlVUm
	xhC4GMoZ0OnH/MBMPO4Vl8EcOXQ47aORXFQ9IC2VKAYx2YUy1187meHtas7jC36qXJ4c
	pdExgSPLKBqmYy3upGbxWbhjKxVrN1Fce1s5MdumoBiuc2Up0aEQf1mL4qmBW8hhtmM2
	QoKg==
MIME-Version: 1.0
X-Received: by 10.52.35.107 with SMTP id g11mr4696358vdj.37.1434547011227;
	Wed, 17 Jun 2015 06:16:51 -0700 (PDT)
Received: by 10.31.95.6 with HTTP; Wed, 17 Jun 2015 06:16:51 -0700 (PDT)
In-Reply-To: <1434545240.13744.361.camel@citrix.com>
References: <1434535700-26779-1-git-send-email-talex5@gmail.com>
	<1434545240.13744.361.camel@citrix.com>
Date: Wed, 17 Jun 2015 14:16:51 +0100
Message-ID: <CAG4opy8ZZ5b1ZNp=8TKKkyHNMfWErvGg+Wyr9ech7w8wrczbRA@mail.gmail.com>
From: Thomas Leonard <talex5@gmail.com>
To: Ian Campbell <ian.campbell@citrix.com>
Cc: Minios-devel@lists.xenproject.org,
	Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Minios-devel] [PATCH v2] mini-os: enable compiler check for
	printk format types
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org

On 17 June 2015 at 13:47, Ian Campbell <ian.campbell@citrix.com> wrote:
> On Wed, 2015-06-17 at 11:08 +0100, Thomas Leonard wrote:
>> Signed-off-by: Thomas Leonard <talex5@gmail.com>
>> ---
>> Note: This patch might flag up warnings in downstream projects that use
>> incorrect format codes. In particular, it doesn't include the patch to
>> Xen's vtpm_load_disk, since that's now in a separate repository. See:
>>
>> http://lists.xenproject.org/archives/html/xen-devel/2014-10/msg00899.html
>
> Does such a fixup patch exist somewhere or are you intending to supply
> one?

The original patch [1] was supposed to fix it, but there was some
issue compiling on 32-bit which I can't reproduce. Do you have e.g. a
docker image with your test environment I could use? Otherwise, I
expect the solution will be obvious if you can see the errors.

[1] Attached to
http://lists.xenproject.org/archives/html/xen-devel/2014-08/msg00998.html


-- 
Dr Thomas Leonard        http://roscidus.com/blog/
GPG: DA98 25AE CAD0 8975 7CDA  BD8E 0713 3F96 CA74 D8BA

_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

From minios-devel-bounces@lists.xenproject.org Wed Jun 17 13:33:27 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 17 Jun 2015 13:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z5DT5-0001Ry-9m; Wed, 17 Jun 2015 13:33:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <prvs=6035412ff=Ian.Campbell@citrix.com>)
	id 1Z5DT4-0001Rl-Mv
	for Minios-devel@lists.xenproject.org; Wed, 17 Jun 2015 13:33:26 +0000
Received: from [85.158.137.68] by server-15.bemta-3.messagelabs.com id
	9A/8B-28408-52771855; Wed, 17 Jun 2015 13:33:25 +0000
X-Env-Sender: prvs=6035412ff=Ian.Campbell@citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1434548002!14717270!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n,
	received_headers: No Received headers
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2259 invoked from network); 17 Jun 2015 13:33:24 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-14.tower-31.messagelabs.com with RC4-SHA encrypted SMTP;
	17 Jun 2015 13:33:24 -0000
X-IronPort-AV: E=Sophos;i="5.13,632,1427760000"; d="scan'208";a="272860086"
Message-ID: <1434547999.13744.386.camel@citrix.com>
From: Ian Campbell <ian.campbell@citrix.com>
To: Thomas Leonard <talex5@gmail.com>
Date: Wed, 17 Jun 2015 14:33:19 +0100
In-Reply-To: <CAG4opy8ZZ5b1ZNp=8TKKkyHNMfWErvGg+Wyr9ech7w8wrczbRA@mail.gmail.com>
References: <1434535700-26779-1-git-send-email-talex5@gmail.com>
	<1434545240.13744.361.camel@citrix.com>
	<CAG4opy8ZZ5b1ZNp=8TKKkyHNMfWErvGg+Wyr9ech7w8wrczbRA@mail.gmail.com>
X-Mailer: Evolution 3.12.9-1+b1 
MIME-Version: 1.0
X-DLP: MIA2
Cc: Minios-devel@lists.xenproject.org,
	Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Minios-devel] [PATCH v2] mini-os: enable compiler check for
 printk format types
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org

On Wed, 2015-06-17 at 14:16 +0100, Thomas Leonard wrote:
> On 17 June 2015 at 13:47, Ian Campbell <ian.campbell@citrix.com> wrote:
> > On Wed, 2015-06-17 at 11:08 +0100, Thomas Leonard wrote:
> >> Signed-off-by: Thomas Leonard <talex5@gmail.com>
> >> ---
> >> Note: This patch might flag up warnings in downstream projects that use
> >> incorrect format codes. In particular, it doesn't include the patch to
> >> Xen's vtpm_load_disk, since that's now in a separate repository. See:
> >>
> >> http://lists.xenproject.org/archives/html/xen-devel/2014-10/msg00899.html
> >
> > Does such a fixup patch exist somewhere or are you intending to supply
> > one?
> 
> The original patch [1] was supposed to fix it, but there was some
> issue compiling on 32-bit which I can't reproduce. Do you have e.g. a
> docker image with your test environment I could use?

I'm afraid not, but my environment is just a plain old Debian Wheezy, so
one ought to be easy to find I expect. I do 32-bit builds in a 32-bit
chroot, FWIW.

>  Otherwise, I
> expect the solution will be obvious if you can see the errors.
> 
> [1] Attached to
> http://lists.xenproject.org/archives/html/xen-devel/2014-08/msg00998.html
> 
> 



_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

From minios-devel-bounces@lists.xenproject.org Wed Jun 17 13:33:27 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 17 Jun 2015 13:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z5DT5-0001Ry-9m; Wed, 17 Jun 2015 13:33:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <prvs=6035412ff=Ian.Campbell@citrix.com>)
	id 1Z5DT4-0001Rl-Mv
	for Minios-devel@lists.xenproject.org; Wed, 17 Jun 2015 13:33:26 +0000
Received: from [85.158.137.68] by server-15.bemta-3.messagelabs.com id
	9A/8B-28408-52771855; Wed, 17 Jun 2015 13:33:25 +0000
X-Env-Sender: prvs=6035412ff=Ian.Campbell@citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1434548002!14717270!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n,
	received_headers: No Received headers
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2259 invoked from network); 17 Jun 2015 13:33:24 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-14.tower-31.messagelabs.com with RC4-SHA encrypted SMTP;
	17 Jun 2015 13:33:24 -0000
X-IronPort-AV: E=Sophos;i="5.13,632,1427760000"; d="scan'208";a="272860086"
Message-ID: <1434547999.13744.386.camel@citrix.com>
From: Ian Campbell <ian.campbell@citrix.com>
To: Thomas Leonard <talex5@gmail.com>
Date: Wed, 17 Jun 2015 14:33:19 +0100
In-Reply-To: <CAG4opy8ZZ5b1ZNp=8TKKkyHNMfWErvGg+Wyr9ech7w8wrczbRA@mail.gmail.com>
References: <1434535700-26779-1-git-send-email-talex5@gmail.com>
	<1434545240.13744.361.camel@citrix.com>
	<CAG4opy8ZZ5b1ZNp=8TKKkyHNMfWErvGg+Wyr9ech7w8wrczbRA@mail.gmail.com>
X-Mailer: Evolution 3.12.9-1+b1 
MIME-Version: 1.0
X-DLP: MIA2
Cc: Minios-devel@lists.xenproject.org,
	Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Minios-devel] [PATCH v2] mini-os: enable compiler check for
 printk format types
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org

On Wed, 2015-06-17 at 14:16 +0100, Thomas Leonard wrote:
> On 17 June 2015 at 13:47, Ian Campbell <ian.campbell@citrix.com> wrote:
> > On Wed, 2015-06-17 at 11:08 +0100, Thomas Leonard wrote:
> >> Signed-off-by: Thomas Leonard <talex5@gmail.com>
> >> ---
> >> Note: This patch might flag up warnings in downstream projects that use
> >> incorrect format codes. In particular, it doesn't include the patch to
> >> Xen's vtpm_load_disk, since that's now in a separate repository. See:
> >>
> >> http://lists.xenproject.org/archives/html/xen-devel/2014-10/msg00899.html
> >
> > Does such a fixup patch exist somewhere or are you intending to supply
> > one?
> 
> The original patch [1] was supposed to fix it, but there was some
> issue compiling on 32-bit which I can't reproduce. Do you have e.g. a
> docker image with your test environment I could use?

I'm afraid not, but my environment is just a plain old Debian Wheezy, so
one ought to be easy to find I expect. I do 32-bit builds in a 32-bit
chroot, FWIW.

>  Otherwise, I
> expect the solution will be obvious if you can see the errors.
> 
> [1] Attached to
> http://lists.xenproject.org/archives/html/xen-devel/2014-08/msg00998.html
> 
> 



_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

From minios-devel-bounces@lists.xenproject.org Wed Jun 24 09:43:30 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 24 Jun 2015 09:43:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z7hDN-0007VO-9O; Wed, 24 Jun 2015 09:43:29 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <talex5@gmail.com>) id 1Z7hDL-0007VJ-9n
	for Minios-devel@lists.xenproject.org; Wed, 24 Jun 2015 09:43:27 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	E5/B0-13517-EBB7A855; Wed, 24 Jun 2015 09:43:26 +0000
X-Env-Sender: talex5@gmail.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1435139005!14836980!1
X-Originating-IP: [209.85.216.51]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4248 invoked from network); 24 Jun 2015 09:43:25 -0000
Received: from mail-vn0-f51.google.com (HELO mail-vn0-f51.google.com)
	(209.85.216.51)
	by server-6.tower-31.messagelabs.com with RC4-SHA encrypted SMTP;
	24 Jun 2015 09:43:25 -0000
Received: by vnav203 with SMTP id v203so5477660vna.8
	for <Minios-devel@lists.xenproject.org>;
	Wed, 24 Jun 2015 02:43:25 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=yORw7pHjCCIHAh0NcL1MKyYfoZhmeuQqB7mgdlhJ+OA=;
	b=KRh+BpKCuFWY9do1quuzxZb8lXS3YuHbG5sFHhSl5yTOVNS2jmqwzWqkcUIYJaPuGD
	TsS7P1RlJT97FXfx4CzSdyo1oV2IViDeXIVAqG+HrHYocVjZpOdTJXL3dfc4PF/+YbEW
	Sz7/VN/UpltImygK58SOtJxrmp9FO5DnUN5BSErr1sI7XcF350rregrI8/oeq6dodArP
	bbI1JkRrCe1R27AQJNo/4Qlyo8YoWnWAdWecrNBjCHCanpbavNQhCaynfUDdnvPpusex
	4DpmgLMm9ATcNnh8MWeFps9dnYNjOe9mp/qY0FfgrF0aICvK9fzaZ/aZrHFDTtKHgNnw
	xi0g==
MIME-Version: 1.0
X-Received: by 10.52.52.114 with SMTP id s18mr37646393vdo.9.1435139004893;
	Wed, 24 Jun 2015 02:43:24 -0700 (PDT)
Received: by 10.31.65.132 with HTTP; Wed, 24 Jun 2015 02:43:24 -0700 (PDT)
In-Reply-To: <1434547999.13744.386.camel@citrix.com>
References: <1434535700-26779-1-git-send-email-talex5@gmail.com>
	<1434545240.13744.361.camel@citrix.com>
	<CAG4opy8ZZ5b1ZNp=8TKKkyHNMfWErvGg+Wyr9ech7w8wrczbRA@mail.gmail.com>
	<1434547999.13744.386.camel@citrix.com>
Date: Wed, 24 Jun 2015 10:43:24 +0100
Message-ID: <CAG4opy_+J5qDR7rTTZnq=hLqknTXwKNbq4MAroA3NweU3KNi5Q@mail.gmail.com>
From: Thomas Leonard <talex5@gmail.com>
To: Ian Campbell <ian.campbell@citrix.com>
Cc: Minios-devel@lists.xenproject.org,
	Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Minios-devel] [PATCH v2] mini-os: enable compiler check for
 printk format types
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org

On 17 June 2015 at 14:33, Ian Campbell <ian.campbell@citrix.com> wrote:
> On Wed, 2015-06-17 at 14:16 +0100, Thomas Leonard wrote:
>> On 17 June 2015 at 13:47, Ian Campbell <ian.campbell@citrix.com> wrote:
>> > On Wed, 2015-06-17 at 11:08 +0100, Thomas Leonard wrote:
>> >> Signed-off-by: Thomas Leonard <talex5@gmail.com>
>> >> ---
>> >> Note: This patch might flag up warnings in downstream projects that use
>> >> incorrect format codes. In particular, it doesn't include the patch to
>> >> Xen's vtpm_load_disk, since that's now in a separate repository. See:
>> >>
>> >> http://lists.xenproject.org/archives/html/xen-devel/2014-10/msg00899.html
>> >
>> > Does such a fixup patch exist somewhere or are you intending to supply
>> > one?
>>
>> The original patch [1] was supposed to fix it, but there was some
>> issue compiling on 32-bit which I can't reproduce. Do you have e.g. a
>> docker image with your test environment I could use?
>
> I'm afraid not, but my environment is just a plain old Debian Wheezy, so
> one ought to be easy to find I expect. I do 32-bit builds in a 32-bit
> chroot, FWIW.

Is patching Xen still a requirement in order to contribute to Mini-OS?
I was hoping that having it in its own repository and with its own
mailing list would remove this requirement. i.e. if an improvement to
Mini-OS exposes a bug in Xen, then some Xen developer should fix it
when they update to the new version, rather than blocking the original
patch.

>>  Otherwise, I
>> expect the solution will be obvious if you can see the errors.
>>
>> [1] Attached to
>> http://lists.xenproject.org/archives/html/xen-devel/2014-08/msg00998.html




-- 
Dr Thomas Leonard        http://roscidus.com/blog/
GPG: DA98 25AE CAD0 8975 7CDA  BD8E 0713 3F96 CA74 D8BA

_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

From minios-devel-bounces@lists.xenproject.org Wed Jun 24 09:43:30 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 24 Jun 2015 09:43:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z7hDN-0007VO-9O; Wed, 24 Jun 2015 09:43:29 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <talex5@gmail.com>) id 1Z7hDL-0007VJ-9n
	for Minios-devel@lists.xenproject.org; Wed, 24 Jun 2015 09:43:27 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	E5/B0-13517-EBB7A855; Wed, 24 Jun 2015 09:43:26 +0000
X-Env-Sender: talex5@gmail.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1435139005!14836980!1
X-Originating-IP: [209.85.216.51]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4248 invoked from network); 24 Jun 2015 09:43:25 -0000
Received: from mail-vn0-f51.google.com (HELO mail-vn0-f51.google.com)
	(209.85.216.51)
	by server-6.tower-31.messagelabs.com with RC4-SHA encrypted SMTP;
	24 Jun 2015 09:43:25 -0000
Received: by vnav203 with SMTP id v203so5477660vna.8
	for <Minios-devel@lists.xenproject.org>;
	Wed, 24 Jun 2015 02:43:25 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=yORw7pHjCCIHAh0NcL1MKyYfoZhmeuQqB7mgdlhJ+OA=;
	b=KRh+BpKCuFWY9do1quuzxZb8lXS3YuHbG5sFHhSl5yTOVNS2jmqwzWqkcUIYJaPuGD
	TsS7P1RlJT97FXfx4CzSdyo1oV2IViDeXIVAqG+HrHYocVjZpOdTJXL3dfc4PF/+YbEW
	Sz7/VN/UpltImygK58SOtJxrmp9FO5DnUN5BSErr1sI7XcF350rregrI8/oeq6dodArP
	bbI1JkRrCe1R27AQJNo/4Qlyo8YoWnWAdWecrNBjCHCanpbavNQhCaynfUDdnvPpusex
	4DpmgLMm9ATcNnh8MWeFps9dnYNjOe9mp/qY0FfgrF0aICvK9fzaZ/aZrHFDTtKHgNnw
	xi0g==
MIME-Version: 1.0
X-Received: by 10.52.52.114 with SMTP id s18mr37646393vdo.9.1435139004893;
	Wed, 24 Jun 2015 02:43:24 -0700 (PDT)
Received: by 10.31.65.132 with HTTP; Wed, 24 Jun 2015 02:43:24 -0700 (PDT)
In-Reply-To: <1434547999.13744.386.camel@citrix.com>
References: <1434535700-26779-1-git-send-email-talex5@gmail.com>
	<1434545240.13744.361.camel@citrix.com>
	<CAG4opy8ZZ5b1ZNp=8TKKkyHNMfWErvGg+Wyr9ech7w8wrczbRA@mail.gmail.com>
	<1434547999.13744.386.camel@citrix.com>
Date: Wed, 24 Jun 2015 10:43:24 +0100
Message-ID: <CAG4opy_+J5qDR7rTTZnq=hLqknTXwKNbq4MAroA3NweU3KNi5Q@mail.gmail.com>
From: Thomas Leonard <talex5@gmail.com>
To: Ian Campbell <ian.campbell@citrix.com>
Cc: Minios-devel@lists.xenproject.org,
	Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Minios-devel] [PATCH v2] mini-os: enable compiler check for
 printk format types
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org

On 17 June 2015 at 14:33, Ian Campbell <ian.campbell@citrix.com> wrote:
> On Wed, 2015-06-17 at 14:16 +0100, Thomas Leonard wrote:
>> On 17 June 2015 at 13:47, Ian Campbell <ian.campbell@citrix.com> wrote:
>> > On Wed, 2015-06-17 at 11:08 +0100, Thomas Leonard wrote:
>> >> Signed-off-by: Thomas Leonard <talex5@gmail.com>
>> >> ---
>> >> Note: This patch might flag up warnings in downstream projects that use
>> >> incorrect format codes. In particular, it doesn't include the patch to
>> >> Xen's vtpm_load_disk, since that's now in a separate repository. See:
>> >>
>> >> http://lists.xenproject.org/archives/html/xen-devel/2014-10/msg00899.html
>> >
>> > Does such a fixup patch exist somewhere or are you intending to supply
>> > one?
>>
>> The original patch [1] was supposed to fix it, but there was some
>> issue compiling on 32-bit which I can't reproduce. Do you have e.g. a
>> docker image with your test environment I could use?
>
> I'm afraid not, but my environment is just a plain old Debian Wheezy, so
> one ought to be easy to find I expect. I do 32-bit builds in a 32-bit
> chroot, FWIW.

Is patching Xen still a requirement in order to contribute to Mini-OS?
I was hoping that having it in its own repository and with its own
mailing list would remove this requirement. i.e. if an improvement to
Mini-OS exposes a bug in Xen, then some Xen developer should fix it
when they update to the new version, rather than blocking the original
patch.

>>  Otherwise, I
>> expect the solution will be obvious if you can see the errors.
>>
>> [1] Attached to
>> http://lists.xenproject.org/archives/html/xen-devel/2014-08/msg00998.html




-- 
Dr Thomas Leonard        http://roscidus.com/blog/
GPG: DA98 25AE CAD0 8975 7CDA  BD8E 0713 3F96 CA74 D8BA

_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

From minios-devel-bounces@lists.xenproject.org Wed Jun 24 09:50:39 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 24 Jun 2015 09:50:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z7hKI-0000X3-SL; Wed, 24 Jun 2015 09:50:38 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <prvs=6101d5925=Ian.Campbell@citrix.com>)
	id 1Z7hKB-0000WT-CE
	for Minios-devel@lists.xenproject.org; Wed, 24 Jun 2015 09:50:37 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	B5/E6-21325-66D7A855; Wed, 24 Jun 2015 09:50:30 +0000
X-Env-Sender: prvs=6101d5925=Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1435139428!16473601!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n,
	received_headers: No Received headers
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6687 invoked from network); 24 Jun 2015 09:50:30 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-12.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	24 Jun 2015 09:50:30 -0000
X-IronPort-AV: E=Sophos;i="5.13,671,1427760000"; d="scan'208";a="275072776"
Message-ID: <1435139426.28264.283.camel@citrix.com>
From: Ian Campbell <ian.campbell@citrix.com>
To: Thomas Leonard <talex5@gmail.com>
Date: Wed, 24 Jun 2015 10:50:26 +0100
In-Reply-To: <CAG4opy_+J5qDR7rTTZnq=hLqknTXwKNbq4MAroA3NweU3KNi5Q@mail.gmail.com>
References: <1434535700-26779-1-git-send-email-talex5@gmail.com>
	<1434545240.13744.361.camel@citrix.com>
	<CAG4opy8ZZ5b1ZNp=8TKKkyHNMfWErvGg+Wyr9ech7w8wrczbRA@mail.gmail.com>
	<1434547999.13744.386.camel@citrix.com>
	<CAG4opy_+J5qDR7rTTZnq=hLqknTXwKNbq4MAroA3NweU3KNi5Q@mail.gmail.com>
X-Mailer: Evolution 3.12.9-1+b1 
MIME-Version: 1.0
X-DLP: MIA2
Cc: Minios-devel@lists.xenproject.org,
	Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Minios-devel] [PATCH v2] mini-os: enable compiler check for
 printk format types
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org

On Wed, 2015-06-24 at 10:43 +0100, Thomas Leonard wrote:
> On 17 June 2015 at 14:33, Ian Campbell <ian.campbell@citrix.com> wrote:
> > On Wed, 2015-06-17 at 14:16 +0100, Thomas Leonard wrote:
> >> On 17 June 2015 at 13:47, Ian Campbell <ian.campbell@citrix.com> wrote:
> >> > On Wed, 2015-06-17 at 11:08 +0100, Thomas Leonard wrote:
> >> >> Signed-off-by: Thomas Leonard <talex5@gmail.com>
> >> >> ---
> >> >> Note: This patch might flag up warnings in downstream projects that use
> >> >> incorrect format codes. In particular, it doesn't include the patch to
> >> >> Xen's vtpm_load_disk, since that's now in a separate repository. See:
> >> >>
> >> >> http://lists.xenproject.org/archives/html/xen-devel/2014-10/msg00899.html
> >> >
> >> > Does such a fixup patch exist somewhere or are you intending to supply
> >> > one?
> >>
> >> The original patch [1] was supposed to fix it, but there was some
> >> issue compiling on 32-bit which I can't reproduce. Do you have e.g. a
> >> docker image with your test environment I could use?
> >
> > I'm afraid not, but my environment is just a plain old Debian Wheezy, so
> > one ought to be easy to find I expect. I do 32-bit builds in a 32-bit
> > chroot, FWIW.
> 
> Is patching Xen still a requirement in order to contribute to Mini-OS?
> I was hoping that having it in its own repository and with its own
> mailing list would remove this requirement. i.e. if an improvement to
> Mini-OS exposes a bug in Xen, then some Xen developer should fix it
> when they update to the new version, rather than blocking the original
> patch.

Right, I'm not blocking on this I just haven't done a commit pass (to
either xen.git or mini-os.git) for a little while, sorry.

The only issue is that it is a little harder for me to compile test
mini-os changes before pushing them without updating xen.git (mainly due
to my own ignorance than any fundamental issue I'm sure).

Ian.


_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

From minios-devel-bounces@lists.xenproject.org Wed Jun 24 09:50:39 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 24 Jun 2015 09:50:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z7hKI-0000X3-SL; Wed, 24 Jun 2015 09:50:38 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <prvs=6101d5925=Ian.Campbell@citrix.com>)
	id 1Z7hKB-0000WT-CE
	for Minios-devel@lists.xenproject.org; Wed, 24 Jun 2015 09:50:37 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	B5/E6-21325-66D7A855; Wed, 24 Jun 2015 09:50:30 +0000
X-Env-Sender: prvs=6101d5925=Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1435139428!16473601!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n,
	received_headers: No Received headers
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6687 invoked from network); 24 Jun 2015 09:50:30 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-12.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	24 Jun 2015 09:50:30 -0000
X-IronPort-AV: E=Sophos;i="5.13,671,1427760000"; d="scan'208";a="275072776"
Message-ID: <1435139426.28264.283.camel@citrix.com>
From: Ian Campbell <ian.campbell@citrix.com>
To: Thomas Leonard <talex5@gmail.com>
Date: Wed, 24 Jun 2015 10:50:26 +0100
In-Reply-To: <CAG4opy_+J5qDR7rTTZnq=hLqknTXwKNbq4MAroA3NweU3KNi5Q@mail.gmail.com>
References: <1434535700-26779-1-git-send-email-talex5@gmail.com>
	<1434545240.13744.361.camel@citrix.com>
	<CAG4opy8ZZ5b1ZNp=8TKKkyHNMfWErvGg+Wyr9ech7w8wrczbRA@mail.gmail.com>
	<1434547999.13744.386.camel@citrix.com>
	<CAG4opy_+J5qDR7rTTZnq=hLqknTXwKNbq4MAroA3NweU3KNi5Q@mail.gmail.com>
X-Mailer: Evolution 3.12.9-1+b1 
MIME-Version: 1.0
X-DLP: MIA2
Cc: Minios-devel@lists.xenproject.org,
	Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Minios-devel] [PATCH v2] mini-os: enable compiler check for
 printk format types
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org

On Wed, 2015-06-24 at 10:43 +0100, Thomas Leonard wrote:
> On 17 June 2015 at 14:33, Ian Campbell <ian.campbell@citrix.com> wrote:
> > On Wed, 2015-06-17 at 14:16 +0100, Thomas Leonard wrote:
> >> On 17 June 2015 at 13:47, Ian Campbell <ian.campbell@citrix.com> wrote:
> >> > On Wed, 2015-06-17 at 11:08 +0100, Thomas Leonard wrote:
> >> >> Signed-off-by: Thomas Leonard <talex5@gmail.com>
> >> >> ---
> >> >> Note: This patch might flag up warnings in downstream projects that use
> >> >> incorrect format codes. In particular, it doesn't include the patch to
> >> >> Xen's vtpm_load_disk, since that's now in a separate repository. See:
> >> >>
> >> >> http://lists.xenproject.org/archives/html/xen-devel/2014-10/msg00899.html
> >> >
> >> > Does such a fixup patch exist somewhere or are you intending to supply
> >> > one?
> >>
> >> The original patch [1] was supposed to fix it, but there was some
> >> issue compiling on 32-bit which I can't reproduce. Do you have e.g. a
> >> docker image with your test environment I could use?
> >
> > I'm afraid not, but my environment is just a plain old Debian Wheezy, so
> > one ought to be easy to find I expect. I do 32-bit builds in a 32-bit
> > chroot, FWIW.
> 
> Is patching Xen still a requirement in order to contribute to Mini-OS?
> I was hoping that having it in its own repository and with its own
> mailing list would remove this requirement. i.e. if an improvement to
> Mini-OS exposes a bug in Xen, then some Xen developer should fix it
> when they update to the new version, rather than blocking the original
> patch.

Right, I'm not blocking on this I just haven't done a commit pass (to
either xen.git or mini-os.git) for a little while, sorry.

The only issue is that it is a little harder for me to compile test
mini-os changes before pushing them without updating xen.git (mainly due
to my own ignorance than any fundamental issue I'm sure).

Ian.


_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

From minios-devel-bounces@lists.xenproject.org Thu Jun 25 11:08:41 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 25 Jun 2015 11:08:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z851M-0008B2-Mn; Thu, 25 Jun 2015 11:08:40 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <prvs=611ba0aa7=Ian.Campbell@citrix.com>)
	id 1Z851L-0008AN-Qd
	for Minios-devel@lists.xenproject.org; Thu, 25 Jun 2015 11:08:39 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	71/6B-13517-731EB855; Thu, 25 Jun 2015 11:08:39 +0000
X-Env-Sender: prvs=611ba0aa7=Ian.Campbell@citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1435230517!17265097!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n,
	received_headers: No Received headers
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12928 invoked from network); 25 Jun 2015 11:08:38 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-14.tower-31.messagelabs.com with RC4-SHA encrypted SMTP;
	25 Jun 2015 11:08:38 -0000
X-IronPort-AV: E=Sophos;i="5.13,675,1427760000"; d="scan'208";a="275496715"
Message-ID: <1435230513.32500.36.camel@citrix.com>
From: Ian Campbell <ian.campbell@citrix.com>
To: Thomas Leonard <talex5@gmail.com>
Date: Thu, 25 Jun 2015 12:08:33 +0100
In-Reply-To: <1434535700-26779-1-git-send-email-talex5@gmail.com>
References: <1434535700-26779-1-git-send-email-talex5@gmail.com>
X-Mailer: Evolution 3.12.9-1+b1 
MIME-Version: 1.0
X-DLP: MIA1
Cc: Minios-devel@lists.xenproject.org, samuel.thibault@ens-lyon.org,
	stefano.stabellini@eu.citrix.com
Subject: Re: [Minios-devel] [PATCH v2] mini-os: enable compiler check for
 printk format types
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org

On Wed, 2015-06-17 at 11:08 +0100, Thomas Leonard wrote:
> Signed-off-by: Thomas Leonard <talex5@gmail.com>

Acked + applied, sorry for the delay.

My just-written pre-push test script is below. I've tried to enable
everything to get best coverage, if you have other tips please let me
know.

I don't think arm is currently expected to build and arm64 doesn't yet
exist, is that right?

Ian.


#!/bin/bash
# amd64 (cosworth minios.git):
#   ~/committer-minios.sh
# i386 (cosworth minios.git):
#   schroot -- ~/committer-minios.sh
# arm32 (TBD TBD):
#   TBD
# arm64 (TBD TBD):
#   TBD

export PATH=/usr/lib/ccache:/usr/local/bin:/usr/bin:/bin # $PATH

case $(hostname) in
    zakaz)
	J_FLAG=-j3
	;;
    *)
	J_FLAG=-j12
	;;
esac

ARCH=$(uname -m)

(
    set -ex
    git clean -q -f -dx
    
    cat >Config.committer <<EOF
#!/bin/bash
CONFIG_START_NETWORK ?= y
CONFIG_SPARSE_BSS ?= y
CONFIG_QEMU_XS_ARGS ?= y
CONFIG_TEST ?= y
CONFIG_PCIFRONT ?= y
CONFIG_BLKFRONT ?= y
CONFIG_TPMFRONT ?= y
CONFIG_TPM_TIS ?= y
CONFIG_TPMBACK ?= y
CONFIG_NETFRONT ?= y
CONFIG_FBFRONT ?= y
CONFIG_KBDFRONT ?= y
CONFIG_CONSFRONT ?= y
CONFIG_XENBUS ?= y
CONFIG_XC ?=y
#CONFIG_LWIP ?= \$(lwip)
include Config.mk
EOF

    make $J_FLAG MINIOS_CONFIG=Config.committer

) 2>&1 | tee ../MINIOS.${ARCH}.LOG



_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

From minios-devel-bounces@lists.xenproject.org Thu Jun 25 11:08:41 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 25 Jun 2015 11:08:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z851M-0008B2-Mn; Thu, 25 Jun 2015 11:08:40 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <prvs=611ba0aa7=Ian.Campbell@citrix.com>)
	id 1Z851L-0008AN-Qd
	for Minios-devel@lists.xenproject.org; Thu, 25 Jun 2015 11:08:39 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	71/6B-13517-731EB855; Thu, 25 Jun 2015 11:08:39 +0000
X-Env-Sender: prvs=611ba0aa7=Ian.Campbell@citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1435230517!17265097!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n,
	received_headers: No Received headers
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12928 invoked from network); 25 Jun 2015 11:08:38 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-14.tower-31.messagelabs.com with RC4-SHA encrypted SMTP;
	25 Jun 2015 11:08:38 -0000
X-IronPort-AV: E=Sophos;i="5.13,675,1427760000"; d="scan'208";a="275496715"
Message-ID: <1435230513.32500.36.camel@citrix.com>
From: Ian Campbell <ian.campbell@citrix.com>
To: Thomas Leonard <talex5@gmail.com>
Date: Thu, 25 Jun 2015 12:08:33 +0100
In-Reply-To: <1434535700-26779-1-git-send-email-talex5@gmail.com>
References: <1434535700-26779-1-git-send-email-talex5@gmail.com>
X-Mailer: Evolution 3.12.9-1+b1 
MIME-Version: 1.0
X-DLP: MIA1
Cc: Minios-devel@lists.xenproject.org, samuel.thibault@ens-lyon.org,
	stefano.stabellini@eu.citrix.com
Subject: Re: [Minios-devel] [PATCH v2] mini-os: enable compiler check for
 printk format types
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org

On Wed, 2015-06-17 at 11:08 +0100, Thomas Leonard wrote:
> Signed-off-by: Thomas Leonard <talex5@gmail.com>

Acked + applied, sorry for the delay.

My just-written pre-push test script is below. I've tried to enable
everything to get best coverage, if you have other tips please let me
know.

I don't think arm is currently expected to build and arm64 doesn't yet
exist, is that right?

Ian.


#!/bin/bash
# amd64 (cosworth minios.git):
#   ~/committer-minios.sh
# i386 (cosworth minios.git):
#   schroot -- ~/committer-minios.sh
# arm32 (TBD TBD):
#   TBD
# arm64 (TBD TBD):
#   TBD

export PATH=/usr/lib/ccache:/usr/local/bin:/usr/bin:/bin # $PATH

case $(hostname) in
    zakaz)
	J_FLAG=-j3
	;;
    *)
	J_FLAG=-j12
	;;
esac

ARCH=$(uname -m)

(
    set -ex
    git clean -q -f -dx
    
    cat >Config.committer <<EOF
#!/bin/bash
CONFIG_START_NETWORK ?= y
CONFIG_SPARSE_BSS ?= y
CONFIG_QEMU_XS_ARGS ?= y
CONFIG_TEST ?= y
CONFIG_PCIFRONT ?= y
CONFIG_BLKFRONT ?= y
CONFIG_TPMFRONT ?= y
CONFIG_TPM_TIS ?= y
CONFIG_TPMBACK ?= y
CONFIG_NETFRONT ?= y
CONFIG_FBFRONT ?= y
CONFIG_KBDFRONT ?= y
CONFIG_CONSFRONT ?= y
CONFIG_XENBUS ?= y
CONFIG_XC ?=y
#CONFIG_LWIP ?= \$(lwip)
include Config.mk
EOF

    make $J_FLAG MINIOS_CONFIG=Config.committer

) 2>&1 | tee ../MINIOS.${ARCH}.LOG



_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

From minios-devel-bounces@lists.xenproject.org Thu Jun 25 12:36:26 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 25 Jun 2015 12:36:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z86OH-0004Hx-GX; Thu, 25 Jun 2015 12:36:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <talex5@gmail.com>) id 1Z86OG-0004Hm-W2
	for Minios-devel@lists.xenproject.org; Thu, 25 Jun 2015 12:36:25 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	A5/9F-31880-8C5FB855; Thu, 25 Jun 2015 12:36:24 +0000
X-Env-Sender: talex5@gmail.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1435235781!16865604!1
X-Originating-IP: [209.85.216.44]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4279 invoked from network); 25 Jun 2015 12:36:23 -0000
Received: from mail-vn0-f44.google.com (HELO mail-vn0-f44.google.com)
	(209.85.216.44)
	by server-4.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	25 Jun 2015 12:36:23 -0000
Received: by vnbf7 with SMTP id f7so10766841vnb.7
	for <Minios-devel@lists.xenproject.org>;
	Thu, 25 Jun 2015 05:36:21 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=C6RqmKTeBq2q3jbOjCU86hyOaajh8jFp/IavvS5ZaO4=;
	b=DcF4loaX2ZrJIeg72Y3tAvndG20x2fYYmQf5uiBkY1cG/eSuuxmSUKRXcex3BjX3V3
	Y5qOQuXkP9om5WGIHENbFZLxC3yp3EhewcYD7s3WrXbIhu/evT/ml0gLoF8zcs0mx2Rn
	5radDR1iCcbhB1DTZsoO8qnYjYfHWNGzCPyHLQQNZBQhe4x/u5YKR7KzfDMBLBrhdcf9
	qOBiHIsAf1LITcULQfiwTz0WZbF3ulVS3uWLCTiwTVOvJ9lzK26eIUb4zWU/oUKvhACY
	6BUDQJfHNvhnDOqVhUpIyJQfjp4xfBRaZjnG6I3rE4Xqbi/ypbqo6F2lKkQPl0op6NBp
	spNA==
MIME-Version: 1.0
X-Received: by 10.52.52.114 with SMTP id s18mr43063560vdo.9.1435235781622;
	Thu, 25 Jun 2015 05:36:21 -0700 (PDT)
Received: by 10.31.65.132 with HTTP; Thu, 25 Jun 2015 05:36:21 -0700 (PDT)
In-Reply-To: <1435230513.32500.36.camel@citrix.com>
References: <1434535700-26779-1-git-send-email-talex5@gmail.com>
	<1435230513.32500.36.camel@citrix.com>
Date: Thu, 25 Jun 2015 13:36:21 +0100
Message-ID: <CAG4opy_aP-imBQahvxc+DB9b0hbnyacqgi0E_S_uMLefZdrRwA@mail.gmail.com>
From: Thomas Leonard <talex5@gmail.com>
To: Ian Campbell <ian.campbell@citrix.com>
Cc: Minios-devel@lists.xenproject.org,
	Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Minios-devel] [PATCH v2] mini-os: enable compiler check for
	printk format types
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org

On 25 June 2015 at 12:08, Ian Campbell <ian.campbell@citrix.com> wrote:
> On Wed, 2015-06-17 at 11:08 +0100, Thomas Leonard wrote:
>> Signed-off-by: Thomas Leonard <talex5@gmail.com>
>
> Acked + applied, sorry for the delay.

Thanks!

> My just-written pre-push test script is below. I've tried to enable
> everything to get best coverage, if you have other tips please let me
> know.

Would you accept a patch adding Travis tests? On my master branch, I
use this config to test every commit pushed to GitHub automatically:

  https://github.com/talex5/mini-os/blob/master/.travis.yml

Currently, it tests a minimal configuration that is useful for Mirage,
but of course any number of combinations could be added. I see I've
also added a test for cross-compiling to arm32, but it's commented out
(I forget why; probably Travis hadn't whitelisted the cross-compiler
package at the time).

> I don't think arm is currently expected to build and arm64 doesn't yet
> exist, is that right?

Correct. I'll send the arm32 patches next.

> Ian.
>
>
> #!/bin/bash
> # amd64 (cosworth minios.git):
> #   ~/committer-minios.sh
> # i386 (cosworth minios.git):
> #   schroot -- ~/committer-minios.sh
> # arm32 (TBD TBD):
> #   TBD
> # arm64 (TBD TBD):
> #   TBD
>
> export PATH=/usr/lib/ccache:/usr/local/bin:/usr/bin:/bin # $PATH
>
> case $(hostname) in
>     zakaz)
>         J_FLAG=-j3
>         ;;
>     *)
>         J_FLAG=-j12
>         ;;
> esac
>
> ARCH=$(uname -m)
>
> (
>     set -ex
>     git clean -q -f -dx
>
>     cat >Config.committer <<EOF
> #!/bin/bash
> CONFIG_START_NETWORK ?= y
> CONFIG_SPARSE_BSS ?= y
> CONFIG_QEMU_XS_ARGS ?= y
> CONFIG_TEST ?= y
> CONFIG_PCIFRONT ?= y
> CONFIG_BLKFRONT ?= y
> CONFIG_TPMFRONT ?= y
> CONFIG_TPM_TIS ?= y
> CONFIG_TPMBACK ?= y
> CONFIG_NETFRONT ?= y
> CONFIG_FBFRONT ?= y
> CONFIG_KBDFRONT ?= y
> CONFIG_CONSFRONT ?= y
> CONFIG_XENBUS ?= y
> CONFIG_XC ?=y
> #CONFIG_LWIP ?= \$(lwip)
> include Config.mk
> EOF
>
>     make $J_FLAG MINIOS_CONFIG=Config.committer
>
> ) 2>&1 | tee ../MINIOS.${ARCH}.LOG
>
>



-- 
Dr Thomas Leonard        http://roscidus.com/blog/
GPG: DA98 25AE CAD0 8975 7CDA  BD8E 0713 3F96 CA74 D8BA

_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

From minios-devel-bounces@lists.xenproject.org Thu Jun 25 12:36:26 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 25 Jun 2015 12:36:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z86OH-0004Hx-GX; Thu, 25 Jun 2015 12:36:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <talex5@gmail.com>) id 1Z86OG-0004Hm-W2
	for Minios-devel@lists.xenproject.org; Thu, 25 Jun 2015 12:36:25 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	A5/9F-31880-8C5FB855; Thu, 25 Jun 2015 12:36:24 +0000
X-Env-Sender: talex5@gmail.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1435235781!16865604!1
X-Originating-IP: [209.85.216.44]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4279 invoked from network); 25 Jun 2015 12:36:23 -0000
Received: from mail-vn0-f44.google.com (HELO mail-vn0-f44.google.com)
	(209.85.216.44)
	by server-4.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	25 Jun 2015 12:36:23 -0000
Received: by vnbf7 with SMTP id f7so10766841vnb.7
	for <Minios-devel@lists.xenproject.org>;
	Thu, 25 Jun 2015 05:36:21 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=C6RqmKTeBq2q3jbOjCU86hyOaajh8jFp/IavvS5ZaO4=;
	b=DcF4loaX2ZrJIeg72Y3tAvndG20x2fYYmQf5uiBkY1cG/eSuuxmSUKRXcex3BjX3V3
	Y5qOQuXkP9om5WGIHENbFZLxC3yp3EhewcYD7s3WrXbIhu/evT/ml0gLoF8zcs0mx2Rn
	5radDR1iCcbhB1DTZsoO8qnYjYfHWNGzCPyHLQQNZBQhe4x/u5YKR7KzfDMBLBrhdcf9
	qOBiHIsAf1LITcULQfiwTz0WZbF3ulVS3uWLCTiwTVOvJ9lzK26eIUb4zWU/oUKvhACY
	6BUDQJfHNvhnDOqVhUpIyJQfjp4xfBRaZjnG6I3rE4Xqbi/ypbqo6F2lKkQPl0op6NBp
	spNA==
MIME-Version: 1.0
X-Received: by 10.52.52.114 with SMTP id s18mr43063560vdo.9.1435235781622;
	Thu, 25 Jun 2015 05:36:21 -0700 (PDT)
Received: by 10.31.65.132 with HTTP; Thu, 25 Jun 2015 05:36:21 -0700 (PDT)
In-Reply-To: <1435230513.32500.36.camel@citrix.com>
References: <1434535700-26779-1-git-send-email-talex5@gmail.com>
	<1435230513.32500.36.camel@citrix.com>
Date: Thu, 25 Jun 2015 13:36:21 +0100
Message-ID: <CAG4opy_aP-imBQahvxc+DB9b0hbnyacqgi0E_S_uMLefZdrRwA@mail.gmail.com>
From: Thomas Leonard <talex5@gmail.com>
To: Ian Campbell <ian.campbell@citrix.com>
Cc: Minios-devel@lists.xenproject.org,
	Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Minios-devel] [PATCH v2] mini-os: enable compiler check for
	printk format types
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org

On 25 June 2015 at 12:08, Ian Campbell <ian.campbell@citrix.com> wrote:
> On Wed, 2015-06-17 at 11:08 +0100, Thomas Leonard wrote:
>> Signed-off-by: Thomas Leonard <talex5@gmail.com>
>
> Acked + applied, sorry for the delay.

Thanks!

> My just-written pre-push test script is below. I've tried to enable
> everything to get best coverage, if you have other tips please let me
> know.

Would you accept a patch adding Travis tests? On my master branch, I
use this config to test every commit pushed to GitHub automatically:

  https://github.com/talex5/mini-os/blob/master/.travis.yml

Currently, it tests a minimal configuration that is useful for Mirage,
but of course any number of combinations could be added. I see I've
also added a test for cross-compiling to arm32, but it's commented out
(I forget why; probably Travis hadn't whitelisted the cross-compiler
package at the time).

> I don't think arm is currently expected to build and arm64 doesn't yet
> exist, is that right?

Correct. I'll send the arm32 patches next.

> Ian.
>
>
> #!/bin/bash
> # amd64 (cosworth minios.git):
> #   ~/committer-minios.sh
> # i386 (cosworth minios.git):
> #   schroot -- ~/committer-minios.sh
> # arm32 (TBD TBD):
> #   TBD
> # arm64 (TBD TBD):
> #   TBD
>
> export PATH=/usr/lib/ccache:/usr/local/bin:/usr/bin:/bin # $PATH
>
> case $(hostname) in
>     zakaz)
>         J_FLAG=-j3
>         ;;
>     *)
>         J_FLAG=-j12
>         ;;
> esac
>
> ARCH=$(uname -m)
>
> (
>     set -ex
>     git clean -q -f -dx
>
>     cat >Config.committer <<EOF
> #!/bin/bash
> CONFIG_START_NETWORK ?= y
> CONFIG_SPARSE_BSS ?= y
> CONFIG_QEMU_XS_ARGS ?= y
> CONFIG_TEST ?= y
> CONFIG_PCIFRONT ?= y
> CONFIG_BLKFRONT ?= y
> CONFIG_TPMFRONT ?= y
> CONFIG_TPM_TIS ?= y
> CONFIG_TPMBACK ?= y
> CONFIG_NETFRONT ?= y
> CONFIG_FBFRONT ?= y
> CONFIG_KBDFRONT ?= y
> CONFIG_CONSFRONT ?= y
> CONFIG_XENBUS ?= y
> CONFIG_XC ?=y
> #CONFIG_LWIP ?= \$(lwip)
> include Config.mk
> EOF
>
>     make $J_FLAG MINIOS_CONFIG=Config.committer
>
> ) 2>&1 | tee ../MINIOS.${ARCH}.LOG
>
>



-- 
Dr Thomas Leonard        http://roscidus.com/blog/
GPG: DA98 25AE CAD0 8975 7CDA  BD8E 0713 3F96 CA74 D8BA

_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

From minios-devel-bounces@lists.xenproject.org Thu Jun 25 13:48:23 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 25 Jun 2015 13:48:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z87Vv-0004Xj-1B; Thu, 25 Jun 2015 13:48:23 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <talex5@gmail.com>) id 1Z87Vt-0004XJ-VQ
	for Minios-devel@lists.xenproject.org; Thu, 25 Jun 2015 13:48:22 +0000
Received: from [85.158.139.211] by server-10.bemta-5.messagelabs.com id
	F7/82-11201-5A60C855; Thu, 25 Jun 2015 13:48:21 +0000
X-Env-Sender: talex5@gmail.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1435240100!13517136!1
X-Originating-IP: [209.85.212.177]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21376 invoked from network); 25 Jun 2015 13:48:20 -0000
Received: from mail-wi0-f177.google.com (HELO mail-wi0-f177.google.com)
	(209.85.212.177)
	by server-15.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	25 Jun 2015 13:48:20 -0000
Received: by wicgi11 with SMTP id gi11so76474921wic.0
	for <Minios-devel@lists.xenproject.org>;
	Thu, 25 Jun 2015 06:48:20 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id:in-reply-to:references;
	bh=lBhFGT+vrk4dm2YH7+mzSXooaS69a7bJJ2/9n6U43jI=;
	b=Ur6aqXSoyKFGq5arPgBUCWP3Wsi0rsZhBKmyhwHZZhllmXiMWLXZI7IYK8wEZyth8W
	S2L6hxAtLG5SpIFlfWOIwLMJEG+L4gqFPDnVw6SbBaxfbf2czYGI3/mmuWjnEjtC9mrL
	Sx5oYYs8Rfj4M+us2HjCy1sltqc+8JcNuhkUnFDcvJv4ur8Z87SeXyPnDAiA5s9Ayjgb
	MDJ3WPPkxlJPEXWoAasH3Vh/bto+uQNbd+tMJntqOYyGLjwKrHj+495bUP943nKjkoav
	1rfCHdMj9vJTzAK8dFccf5BM2CDb1qB6vmNB6LDSa3wJlzv1T6J04QT+YyqKwiCtmza3
	hZrw==
X-Received: by 10.194.82.38 with SMTP id f6mr65305758wjy.16.1435240100546;
	Thu, 25 Jun 2015 06:48:20 -0700 (PDT)
Received: from cam.localdomain (82-69-101-169.dsl.in-addr.zen.co.uk.
	[82.69.101.169])
	by mx.google.com with ESMTPSA id v4sm7723372wiy.5.2015.06.25.06.48.19
	(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
	Thu, 25 Jun 2015 06:48:19 -0700 (PDT)
From: Thomas Leonard <talex5@gmail.com>
To: Minios-devel@lists.xenproject.org
Date: Thu, 25 Jun 2015 14:48:07 +0100
Message-Id: <1435240089-23413-2-git-send-email-talex5@gmail.com>
X-Mailer: git-send-email 2.4.2
In-Reply-To: <1435240089-23413-1-git-send-email-talex5@gmail.com>
References: <1435240089-23413-1-git-send-email-talex5@gmail.com>
Cc: Thomas Leonard <talex5@gmail.com>, Ian.Campbell@citrix.com, anil@recoil.org,
	karim.allah.ahmed@gmail.com, stefano.stabellini@eu.citrix.com,
	samuel.thibault@ens-lyon.org, Dave.Scott@eu.citrix.com
Subject: [Minios-devel] [PATCH ARM v9 1/3] mini-os: fix compiling with
	debug=n
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org

Without -fno-tree-loop-distribute-patterns, gcc -O3 recognises that our
"memset" is doing a memset operation and tries to make it call the
standard "memset", creating a loop.

Signed-off-by: Thomas Leonard <talex5@gmail.com>
---
 minios.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/minios.mk b/minios.mk
index e042027..41023e9 100644
--- a/minios.mk
+++ b/minios.mk
@@ -23,7 +23,7 @@ DEF_CFLAGS += -g
 #DEF_CFLAGS += -DGNT_DEBUG
 #DEF_CFLAGS += -DGNTMAP_DEBUG
 else
-DEF_CFLAGS += -O3
+DEF_CFLAGS += -O3 $(call cc-option,$(CC),-fno-tree-loop-distribute-patterns,)
 endif
 
 # Make the headers define our internal stuff
-- 
2.4.2


_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

From minios-devel-bounces@lists.xenproject.org Thu Jun 25 13:48:23 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 25 Jun 2015 13:48:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z87Vv-0004Xj-1B; Thu, 25 Jun 2015 13:48:23 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <talex5@gmail.com>) id 1Z87Vt-0004XJ-VQ
	for Minios-devel@lists.xenproject.org; Thu, 25 Jun 2015 13:48:22 +0000
Received: from [85.158.139.211] by server-10.bemta-5.messagelabs.com id
	F7/82-11201-5A60C855; Thu, 25 Jun 2015 13:48:21 +0000
X-Env-Sender: talex5@gmail.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1435240100!13517136!1
X-Originating-IP: [209.85.212.177]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21376 invoked from network); 25 Jun 2015 13:48:20 -0000
Received: from mail-wi0-f177.google.com (HELO mail-wi0-f177.google.com)
	(209.85.212.177)
	by server-15.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	25 Jun 2015 13:48:20 -0000
Received: by wicgi11 with SMTP id gi11so76474921wic.0
	for <Minios-devel@lists.xenproject.org>;
	Thu, 25 Jun 2015 06:48:20 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id:in-reply-to:references;
	bh=lBhFGT+vrk4dm2YH7+mzSXooaS69a7bJJ2/9n6U43jI=;
	b=Ur6aqXSoyKFGq5arPgBUCWP3Wsi0rsZhBKmyhwHZZhllmXiMWLXZI7IYK8wEZyth8W
	S2L6hxAtLG5SpIFlfWOIwLMJEG+L4gqFPDnVw6SbBaxfbf2czYGI3/mmuWjnEjtC9mrL
	Sx5oYYs8Rfj4M+us2HjCy1sltqc+8JcNuhkUnFDcvJv4ur8Z87SeXyPnDAiA5s9Ayjgb
	MDJ3WPPkxlJPEXWoAasH3Vh/bto+uQNbd+tMJntqOYyGLjwKrHj+495bUP943nKjkoav
	1rfCHdMj9vJTzAK8dFccf5BM2CDb1qB6vmNB6LDSa3wJlzv1T6J04QT+YyqKwiCtmza3
	hZrw==
X-Received: by 10.194.82.38 with SMTP id f6mr65305758wjy.16.1435240100546;
	Thu, 25 Jun 2015 06:48:20 -0700 (PDT)
Received: from cam.localdomain (82-69-101-169.dsl.in-addr.zen.co.uk.
	[82.69.101.169])
	by mx.google.com with ESMTPSA id v4sm7723372wiy.5.2015.06.25.06.48.19
	(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
	Thu, 25 Jun 2015 06:48:19 -0700 (PDT)
From: Thomas Leonard <talex5@gmail.com>
To: Minios-devel@lists.xenproject.org
Date: Thu, 25 Jun 2015 14:48:07 +0100
Message-Id: <1435240089-23413-2-git-send-email-talex5@gmail.com>
X-Mailer: git-send-email 2.4.2
In-Reply-To: <1435240089-23413-1-git-send-email-talex5@gmail.com>
References: <1435240089-23413-1-git-send-email-talex5@gmail.com>
Cc: Thomas Leonard <talex5@gmail.com>, Ian.Campbell@citrix.com, anil@recoil.org,
	karim.allah.ahmed@gmail.com, stefano.stabellini@eu.citrix.com,
	samuel.thibault@ens-lyon.org, Dave.Scott@eu.citrix.com
Subject: [Minios-devel] [PATCH ARM v9 1/3] mini-os: fix compiling with
	debug=n
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org

Without -fno-tree-loop-distribute-patterns, gcc -O3 recognises that our
"memset" is doing a memset operation and tries to make it call the
standard "memset", creating a loop.

Signed-off-by: Thomas Leonard <talex5@gmail.com>
---
 minios.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/minios.mk b/minios.mk
index e042027..41023e9 100644
--- a/minios.mk
+++ b/minios.mk
@@ -23,7 +23,7 @@ DEF_CFLAGS += -g
 #DEF_CFLAGS += -DGNT_DEBUG
 #DEF_CFLAGS += -DGNTMAP_DEBUG
 else
-DEF_CFLAGS += -O3
+DEF_CFLAGS += -O3 $(call cc-option,$(CC),-fno-tree-loop-distribute-patterns,)
 endif
 
 # Make the headers define our internal stuff
-- 
2.4.2


_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

From minios-devel-bounces@lists.xenproject.org Thu Jun 25 13:48:25 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 25 Jun 2015 13:48:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z87Vx-0004ZX-FA; Thu, 25 Jun 2015 13:48:25 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <talex5@gmail.com>) id 1Z87Vv-0004X2-PF
	for Minios-devel@lists.xenproject.org; Thu, 25 Jun 2015 13:48:23 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	3F/F8-23832-4A60C855; Thu, 25 Jun 2015 13:48:20 +0000
X-Env-Sender: talex5@gmail.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1435240099!19824993!1
X-Originating-IP: [74.125.82.48]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29769 invoked from network); 25 Jun 2015 13:48:19 -0000
Received: from mail-wg0-f48.google.com (HELO mail-wg0-f48.google.com)
	(74.125.82.48)
	by server-3.tower-31.messagelabs.com with RC4-SHA encrypted SMTP;
	25 Jun 2015 13:48:19 -0000
Received: by wgqq4 with SMTP id q4so63206037wgq.1
	for <Minios-devel@lists.xenproject.org>;
	Thu, 25 Jun 2015 06:48:19 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=+Ey7WKqalSMwD8/CdF6F/ndhOryHGSn2ZoGS+NxjkSc=;
	b=zBpeNTwpriTD/R76a7PbBp4bBRN52I5BRJkThooIzGglmpi1e5NwcSzF+Ud7pwvlsq
	ZGHtXwv7HfgVII74Cx9ao2HxnqslAbLlQikk9CnFK7bBIvzWa/f8kXU1q2TcjWJ2UGaj
	uJGfpbDDcK/Mik8ZQDVjLYwhUIunsQ5d0EWhgn8F0MlQLaQ4RkK2zpuGRqw53PN4MBtw
	h5My3HucMWrenZvBj/Lz9OPG2qBvoWJ+2663TRGbOmrGpBxJNByeDtPYJNbpsL4n7S9+
	EvLP0Kg9STG7g9O2EH5cV/pCXwdgs4/1UZj3srPP3y/puXpeWrBxMPrbYne9bLUn9mGL
	AeWw==
X-Received: by 10.180.188.48 with SMTP id fx16mr5908990wic.35.1435240099391;
	Thu, 25 Jun 2015 06:48:19 -0700 (PDT)
Received: from cam.localdomain (82-69-101-169.dsl.in-addr.zen.co.uk.
	[82.69.101.169])
	by mx.google.com with ESMTPSA id v4sm7723372wiy.5.2015.06.25.06.48.17
	(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
	Thu, 25 Jun 2015 06:48:18 -0700 (PDT)
From: Thomas Leonard <talex5@gmail.com>
To: Minios-devel@lists.xenproject.org
Date: Thu, 25 Jun 2015 14:48:06 +0100
Message-Id: <1435240089-23413-1-git-send-email-talex5@gmail.com>
X-Mailer: git-send-email 2.4.2
Cc: Thomas Leonard <talex5@gmail.com>, Ian.Campbell@citrix.com, anil@recoil.org,
	karim.allah.ahmed@gmail.com, stefano.stabellini@eu.citrix.com,
	samuel.thibault@ens-lyon.org, Dave.Scott@eu.citrix.com
Subject: [Minios-devel] [PATCH ARM v9 0/3] mini-os: initial ARM support
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org

This series is based on Karim's ARM support commits, further broken up into
smaller patches.

Changes since v8:

- Updated for standalone Mini-OS repository (fetch libfdt using git submodule)
- Added fix for compiling with debug=n

Addressed comments from Ian Campbell and Julien Grall:
- Drop obsolete interrupt configuration
- Write directly to GICD_ISENABLER (no need to read the old value first)
- Don't log spurious interrupts as unhandled even if debug logging is enabled

Thomas Leonard (3):
  mini-os: fix compiling with debug=n
  mini-os: arm: interrupt controller
  mini-os: arm: build system

 .gitmodules          |   3 +
 COPYING              |  27 ++++++
 Config.mk            |   2 +
 Makefile             |  27 +++++-
 arch/arm/Makefile    |  35 ++++++++
 arch/arm/arch.mk     |   6 ++
 arch/arm/gic.c       | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
 dtc                  |   1 +
 include/lib.h        |   4 +-
 include/libfdt_env.h |  33 +++++++
 lib/memmove.c        |  45 ++++++++++
 lib/string.c         |  12 +++
 minios.mk            |   2 +-
 13 files changed, 432 insertions(+), 3 deletions(-)
 create mode 100644 .gitmodules
 create mode 100755 arch/arm/Makefile
 create mode 100644 arch/arm/arch.mk
 create mode 100644 arch/arm/gic.c
 create mode 160000 dtc
 create mode 100644 include/libfdt_env.h
 create mode 100644 lib/memmove.c

-- 
2.4.2


_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

From minios-devel-bounces@lists.xenproject.org Thu Jun 25 13:48:25 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 25 Jun 2015 13:48:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z87Vx-0004ZX-FA; Thu, 25 Jun 2015 13:48:25 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <talex5@gmail.com>) id 1Z87Vv-0004X2-PF
	for Minios-devel@lists.xenproject.org; Thu, 25 Jun 2015 13:48:23 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	3F/F8-23832-4A60C855; Thu, 25 Jun 2015 13:48:20 +0000
X-Env-Sender: talex5@gmail.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1435240099!19824993!1
X-Originating-IP: [74.125.82.48]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29769 invoked from network); 25 Jun 2015 13:48:19 -0000
Received: from mail-wg0-f48.google.com (HELO mail-wg0-f48.google.com)
	(74.125.82.48)
	by server-3.tower-31.messagelabs.com with RC4-SHA encrypted SMTP;
	25 Jun 2015 13:48:19 -0000
Received: by wgqq4 with SMTP id q4so63206037wgq.1
	for <Minios-devel@lists.xenproject.org>;
	Thu, 25 Jun 2015 06:48:19 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=+Ey7WKqalSMwD8/CdF6F/ndhOryHGSn2ZoGS+NxjkSc=;
	b=zBpeNTwpriTD/R76a7PbBp4bBRN52I5BRJkThooIzGglmpi1e5NwcSzF+Ud7pwvlsq
	ZGHtXwv7HfgVII74Cx9ao2HxnqslAbLlQikk9CnFK7bBIvzWa/f8kXU1q2TcjWJ2UGaj
	uJGfpbDDcK/Mik8ZQDVjLYwhUIunsQ5d0EWhgn8F0MlQLaQ4RkK2zpuGRqw53PN4MBtw
	h5My3HucMWrenZvBj/Lz9OPG2qBvoWJ+2663TRGbOmrGpBxJNByeDtPYJNbpsL4n7S9+
	EvLP0Kg9STG7g9O2EH5cV/pCXwdgs4/1UZj3srPP3y/puXpeWrBxMPrbYne9bLUn9mGL
	AeWw==
X-Received: by 10.180.188.48 with SMTP id fx16mr5908990wic.35.1435240099391;
	Thu, 25 Jun 2015 06:48:19 -0700 (PDT)
Received: from cam.localdomain (82-69-101-169.dsl.in-addr.zen.co.uk.
	[82.69.101.169])
	by mx.google.com with ESMTPSA id v4sm7723372wiy.5.2015.06.25.06.48.17
	(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
	Thu, 25 Jun 2015 06:48:18 -0700 (PDT)
From: Thomas Leonard <talex5@gmail.com>
To: Minios-devel@lists.xenproject.org
Date: Thu, 25 Jun 2015 14:48:06 +0100
Message-Id: <1435240089-23413-1-git-send-email-talex5@gmail.com>
X-Mailer: git-send-email 2.4.2
Cc: Thomas Leonard <talex5@gmail.com>, Ian.Campbell@citrix.com, anil@recoil.org,
	karim.allah.ahmed@gmail.com, stefano.stabellini@eu.citrix.com,
	samuel.thibault@ens-lyon.org, Dave.Scott@eu.citrix.com
Subject: [Minios-devel] [PATCH ARM v9 0/3] mini-os: initial ARM support
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org

This series is based on Karim's ARM support commits, further broken up into
smaller patches.

Changes since v8:

- Updated for standalone Mini-OS repository (fetch libfdt using git submodule)
- Added fix for compiling with debug=n

Addressed comments from Ian Campbell and Julien Grall:
- Drop obsolete interrupt configuration
- Write directly to GICD_ISENABLER (no need to read the old value first)
- Don't log spurious interrupts as unhandled even if debug logging is enabled

Thomas Leonard (3):
  mini-os: fix compiling with debug=n
  mini-os: arm: interrupt controller
  mini-os: arm: build system

 .gitmodules          |   3 +
 COPYING              |  27 ++++++
 Config.mk            |   2 +
 Makefile             |  27 +++++-
 arch/arm/Makefile    |  35 ++++++++
 arch/arm/arch.mk     |   6 ++
 arch/arm/gic.c       | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
 dtc                  |   1 +
 include/lib.h        |   4 +-
 include/libfdt_env.h |  33 +++++++
 lib/memmove.c        |  45 ++++++++++
 lib/string.c         |  12 +++
 minios.mk            |   2 +-
 13 files changed, 432 insertions(+), 3 deletions(-)
 create mode 100644 .gitmodules
 create mode 100755 arch/arm/Makefile
 create mode 100644 arch/arm/arch.mk
 create mode 100644 arch/arm/gic.c
 create mode 160000 dtc
 create mode 100644 include/libfdt_env.h
 create mode 100644 lib/memmove.c

-- 
2.4.2


_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

From minios-devel-bounces@lists.xenproject.org Thu Jun 25 13:48:25 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 25 Jun 2015 13:48:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z87Vx-0004Zf-HD; Thu, 25 Jun 2015 13:48:25 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <talex5@gmail.com>) id 1Z87Vw-0004YG-AM
	for Minios-devel@lists.xenproject.org; Thu, 25 Jun 2015 13:48:24 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	4F/36-13517-7A60C855; Thu, 25 Jun 2015 13:48:23 +0000
X-Env-Sender: talex5@gmail.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1435240102!19773348!1
X-Originating-IP: [209.85.212.171]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15861 invoked from network); 25 Jun 2015 13:48:22 -0000
Received: from mail-wi0-f171.google.com (HELO mail-wi0-f171.google.com)
	(209.85.212.171)
	by server-7.tower-31.messagelabs.com with RC4-SHA encrypted SMTP;
	25 Jun 2015 13:48:22 -0000
Received: by wicnd19 with SMTP id nd19so18558259wic.1
	for <Minios-devel@lists.xenproject.org>;
	Thu, 25 Jun 2015 06:48:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id:in-reply-to:references;
	bh=s+Ju03Ln/dw0ibvnyaPfBpyNsmM5rGHQnYDAYgwm4Z4=;
	b=uGPdJirjM4iP9/pRyT+AtYsbnb2qgGrBxaISgKE/AutSay2eO55/9Bv1ihs27/lmfc
	iykSu+gTxrDYmlIXBFrsRY0lXHUrNlTXdRVC/oGz1X3UQP/5i61SwrKh0phXi3ZfdVKO
	9zmLlaA+9+hg3a9nuzItXsxX7R9z9zZ+UymV+EcE6Q1pO+gFySZtbST+m49erWUSq6VS
	mB3xGKFWIoLGrjZwyr1f3aDevtRyT6tl7tp+ZZCE2ToyAUAu4aJ2aN3asa5DLeSsF3BR
	q3OcbCkgY/BRX2DL6VIxebZkhBA4h//0W3uKtspsE23qpodwuZ2FW25mnoFxH4ntiVxY
	2BbQ==
X-Received: by 10.194.118.167 with SMTP id kn7mr10791623wjb.83.1435240102240; 
	Thu, 25 Jun 2015 06:48:22 -0700 (PDT)
Received: from cam.localdomain (82-69-101-169.dsl.in-addr.zen.co.uk.
	[82.69.101.169])
	by mx.google.com with ESMTPSA id v4sm7723372wiy.5.2015.06.25.06.48.20
	(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
	Thu, 25 Jun 2015 06:48:21 -0700 (PDT)
From: Thomas Leonard <talex5@gmail.com>
To: Minios-devel@lists.xenproject.org
Date: Thu, 25 Jun 2015 14:48:08 +0100
Message-Id: <1435240089-23413-3-git-send-email-talex5@gmail.com>
X-Mailer: git-send-email 2.4.2
In-Reply-To: <1435240089-23413-1-git-send-email-talex5@gmail.com>
References: <1435240089-23413-1-git-send-email-talex5@gmail.com>
Cc: Thomas Leonard <talex5@gmail.com>, Ian.Campbell@citrix.com, anil@recoil.org,
	karim.allah.ahmed@gmail.com, stefano.stabellini@eu.citrix.com,
	samuel.thibault@ens-lyon.org, Dave.Scott@eu.citrix.com
Subject: [Minios-devel] [PATCH ARM v9 2/3] mini-os: arm: interrupt controller
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org

Based on an initial patch by Karim Raslan.

Signed-off-by: Karim Allah Ahmed <karim.allah.ahmed@gmail.com>
Signed-off-by: Thomas Leonard <talex5@gmail.com>

---

Changes since v8

Addressed comments from Ian Campbell and Julien Grall:
- Drop obsolete interrupt configuration
- Write directly to GICD_ISENABLER (no need to read the old value first)
- Don't log spurious interrupts as unhandled even if debug logging is enabled
---
 arch/arm/gic.c | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 238 insertions(+)
 create mode 100644 arch/arm/gic.c

diff --git a/arch/arm/gic.c b/arch/arm/gic.c
new file mode 100644
index 0000000..1855293
--- /dev/null
+++ b/arch/arm/gic.c
@@ -0,0 +1,238 @@
+// ARM GIC implementation
+
+#include <mini-os/os.h>
+#include <mini-os/hypervisor.h>
+#include <mini-os/console.h>
+#include <libfdt.h>
+
+//#define VGIC_DEBUG
+#ifdef VGIC_DEBUG
+#define DEBUG(_f, _a...) \
+    printk("MINI_OS(file=vgic.c, line=%d) " _f , __LINE__, ## _a)
+#else
+#define DEBUG(_f, _a...)    ((void)0)
+#endif
+
+extern void (*IRQ_handler)(void);
+
+struct gic {
+    volatile char *gicd_base;
+    volatile char *gicc_base;
+};
+
+static struct gic gic;
+
+// Distributor Interface
+#define GICD_CTLR        0x0
+#define GICD_ISENABLER    0x100
+#define GICD_IPRIORITYR   0x400
+#define GICD_ITARGETSR    0x800
+#define GICD_ICFGR        0xC00
+
+// CPU Interface
+#define GICC_CTLR    0x0
+#define GICC_PMR    0x4
+#define GICC_IAR    0xc
+#define GICC_EOIR    0x10
+#define GICC_HPPIR    0x18
+
+#define gicd(gic, offset) ((gic)->gicd_base + (offset))
+#define gicc(gic, offset) ((gic)->gicc_base + (offset))
+
+#define REG(addr) ((uint32_t *)(addr))
+
+static inline uint32_t REG_READ32(volatile uint32_t *addr)
+{
+    uint32_t value;
+    __asm__ __volatile__("ldr %0, [%1]":"=&r"(value):"r"(addr));
+    rmb();
+    return value;
+}
+
+static inline void REG_WRITE32(volatile uint32_t *addr, unsigned int value)
+{
+    __asm__ __volatile__("str %0, [%1]"::"r"(value), "r"(addr));
+    wmb();
+}
+
+static void gic_set_priority(struct gic *gic, int irq_number, unsigned char priority)
+{
+    uint32_t value;
+    uint32_t *addr = REG(gicd(gic, GICD_IPRIORITYR)) + (irq_number >> 2);
+    value = REG_READ32(addr);
+    value &= ~(0xff << (8 * (irq_number & 0x3))); // clear old priority
+    value |= priority << (8 * (irq_number & 0x3)); // set new priority
+    REG_WRITE32(addr, value);
+}
+
+static void gic_route_interrupt(struct gic *gic, int irq_number, unsigned char cpu_set)
+{
+    uint32_t value;
+    uint32_t *addr = REG(gicd(gic, GICD_ITARGETSR)) + (irq_number >> 2);
+    value = REG_READ32(addr);
+    value &= ~(0xff << (8 * (irq_number & 0x3))); // clear old target
+    value |= cpu_set << (8 * (irq_number & 0x3)); // set new target
+    REG_WRITE32(addr, value);
+}
+
+/* When accessing the GIC registers, we can't use LDREX/STREX because it's not regular memory. */
+static __inline__ void clear_bit_non_atomic(int nr, volatile void *base)
+{
+    volatile uint32_t *tmp = base;
+    tmp[nr >> 5] &= (unsigned long)~(1 << (nr & 0x1f));
+}
+
+static __inline__ void set_bit_non_atomic(int nr, volatile void *base)
+{
+    volatile uint32_t *tmp = base;
+    tmp[nr >> 5] |= (1 << (nr & 0x1f));
+}
+
+/* Note: not thread safe (but we only support one CPU for now anyway) */
+static void gic_enable_interrupt(struct gic *gic, int irq_number,
+        unsigned char cpu_set, unsigned char level_sensitive)
+{
+    int *set_enable_reg;
+    void *cfg_reg;
+
+    // set priority
+    gic_set_priority(gic, irq_number, 0x0);
+
+    // set target cpus for this interrupt
+    gic_route_interrupt(gic, irq_number, cpu_set);
+
+    // set level/edge triggered
+    cfg_reg = (void *)gicd(gic, GICD_ICFGR);
+    if (level_sensitive) {
+        clear_bit_non_atomic((irq_number * 2) + 1, cfg_reg);
+    } else {
+        set_bit_non_atomic((irq_number * 2) + 1, cfg_reg);
+    }
+
+    wmb();
+
+    // enable forwarding interrupt from distributor to cpu interface
+    set_enable_reg = (int *)gicd(gic, GICD_ISENABLER);
+    set_enable_reg[irq_number >> 5] = 1 << (irq_number & 0x1f);
+    wmb();
+}
+
+static void gic_enable_interrupts(struct gic *gic)
+{
+    // Global enable forwarding interrupts from distributor to cpu interface
+    REG_WRITE32(REG(gicd(gic, GICD_CTLR)), 0x00000001);
+
+    // Global enable signalling of interrupt from the cpu interface
+    REG_WRITE32(REG(gicc(gic, GICC_CTLR)), 0x00000001);
+}
+
+static void gic_disable_interrupts(struct gic *gic)
+{
+    // Global disable signalling of interrupt from the cpu interface
+    REG_WRITE32(REG(gicc(gic, GICC_CTLR)), 0x00000000);
+
+    // Global disable forwarding interrupts from distributor to cpu interface
+    REG_WRITE32(REG(gicd(gic, GICD_CTLR)), 0x00000000);
+}
+
+static void gic_cpu_set_priority(struct gic *gic, char priority)
+{
+    REG_WRITE32(REG(gicc(gic, GICC_PMR)), priority & 0x000000FF);
+}
+
+static unsigned long gic_readiar(struct gic *gic) {
+    return REG_READ32(REG(gicc(gic, GICC_IAR))) & 0x000003FF; // Interrupt ID
+}
+
+static void gic_eoir(struct gic *gic, uint32_t irq) {
+    REG_WRITE32(REG(gicc(gic, GICC_EOIR)), irq & 0x000003FF);
+}
+
+//FIXME Get event_irq from dt
+#define EVENTS_IRQ 31
+#define VIRTUALTIMER_IRQ 27
+
+static void gic_handler(void) {
+    unsigned int irq = gic_readiar(&gic);
+
+    DEBUG("IRQ received : %i\n", irq);
+    switch(irq) {
+    case EVENTS_IRQ:
+        do_hypervisor_callback(NULL);
+        break;
+    case VIRTUALTIMER_IRQ:
+        /* We need to get this event to wake us up from block_domain,
+         * but we don't need to do anything special with it. */
+        break;
+    case 1022:
+    case 1023:
+        return;  /* Spurious interrupt */
+    default:
+        DEBUG("Unhandled irq\n");
+        break;
+    }
+
+    DEBUG("EIRQ\n");
+
+    gic_eoir(&gic, irq);
+}
+
+void gic_init(void) {
+    gic.gicd_base = NULL;
+    int node = 0;
+    int depth = 0;
+    for (;;)
+    {
+        node = fdt_next_node(device_tree, node, &depth);
+        if (node <= 0 || depth < 0)
+            break;
+
+        if (fdt_getprop(device_tree, node, "interrupt-controller", NULL)) {
+            int len = 0;
+
+            if (fdt_node_check_compatible(device_tree, node, "arm,cortex-a15-gic") &&
+                fdt_node_check_compatible(device_tree, node, "arm,cortex-a7-gic")) {
+                printk("Skipping incompatible interrupt-controller node\n");
+                continue;
+            }
+
+            const uint64_t *reg = fdt_getprop(device_tree, node, "reg", &len);
+
+            /* We have two registers (GICC and GICD), each of which contains
+             * two parts (an address and a size), each of which is a 64-bit
+             * value (8 bytes), so we expect a length of 2 * 2 * 8 = 32.
+             * If any extra values are passed in future, we ignore them. */
+            if (reg == NULL || len < 32) {
+                printk("Bad 'reg' property: %p %d\n", reg, len);
+                continue;
+            }
+
+            gic.gicd_base = to_virt((long) fdt64_to_cpu(reg[0]));
+            gic.gicc_base = to_virt((long) fdt64_to_cpu(reg[2]));
+            printk("Found GIC: gicd_base = %p, gicc_base = %p\n", gic.gicd_base, gic.gicc_base);
+            break;
+        }
+    }
+    if (!gic.gicd_base) {
+        printk("GIC not found!\n");
+        BUG();
+    }
+    wmb();
+
+    /* Note: we could mark this as "device" memory here, but Xen will have already
+     * set it that way in the second stage translation table, so it's not necessary.
+     * See "Overlaying the memory type attribute" in the Architecture Reference Manual.
+     */
+
+    IRQ_handler = gic_handler;
+
+    gic_disable_interrupts(&gic);
+    gic_cpu_set_priority(&gic, 0xff);
+
+    /* Must call gic_enable_interrupts before enabling individual interrupts, otherwise our IRQ handler
+     * gets called endlessly with spurious interrupts. */
+    gic_enable_interrupts(&gic);
+
+    gic_enable_interrupt(&gic, EVENTS_IRQ /* interrupt number */, 0x1 /*cpu_set*/, 1 /*level_sensitive*/);
+    gic_enable_interrupt(&gic, VIRTUALTIMER_IRQ /* interrupt number */, 0x1 /*cpu_set*/, 1 /*level_sensitive*/);
+}
-- 
2.4.2


_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

From minios-devel-bounces@lists.xenproject.org Thu Jun 25 13:48:25 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 25 Jun 2015 13:48:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z87Vx-0004Zf-HD; Thu, 25 Jun 2015 13:48:25 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <talex5@gmail.com>) id 1Z87Vw-0004YG-AM
	for Minios-devel@lists.xenproject.org; Thu, 25 Jun 2015 13:48:24 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	4F/36-13517-7A60C855; Thu, 25 Jun 2015 13:48:23 +0000
X-Env-Sender: talex5@gmail.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1435240102!19773348!1
X-Originating-IP: [209.85.212.171]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15861 invoked from network); 25 Jun 2015 13:48:22 -0000
Received: from mail-wi0-f171.google.com (HELO mail-wi0-f171.google.com)
	(209.85.212.171)
	by server-7.tower-31.messagelabs.com with RC4-SHA encrypted SMTP;
	25 Jun 2015 13:48:22 -0000
Received: by wicnd19 with SMTP id nd19so18558259wic.1
	for <Minios-devel@lists.xenproject.org>;
	Thu, 25 Jun 2015 06:48:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id:in-reply-to:references;
	bh=s+Ju03Ln/dw0ibvnyaPfBpyNsmM5rGHQnYDAYgwm4Z4=;
	b=uGPdJirjM4iP9/pRyT+AtYsbnb2qgGrBxaISgKE/AutSay2eO55/9Bv1ihs27/lmfc
	iykSu+gTxrDYmlIXBFrsRY0lXHUrNlTXdRVC/oGz1X3UQP/5i61SwrKh0phXi3ZfdVKO
	9zmLlaA+9+hg3a9nuzItXsxX7R9z9zZ+UymV+EcE6Q1pO+gFySZtbST+m49erWUSq6VS
	mB3xGKFWIoLGrjZwyr1f3aDevtRyT6tl7tp+ZZCE2ToyAUAu4aJ2aN3asa5DLeSsF3BR
	q3OcbCkgY/BRX2DL6VIxebZkhBA4h//0W3uKtspsE23qpodwuZ2FW25mnoFxH4ntiVxY
	2BbQ==
X-Received: by 10.194.118.167 with SMTP id kn7mr10791623wjb.83.1435240102240; 
	Thu, 25 Jun 2015 06:48:22 -0700 (PDT)
Received: from cam.localdomain (82-69-101-169.dsl.in-addr.zen.co.uk.
	[82.69.101.169])
	by mx.google.com with ESMTPSA id v4sm7723372wiy.5.2015.06.25.06.48.20
	(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
	Thu, 25 Jun 2015 06:48:21 -0700 (PDT)
From: Thomas Leonard <talex5@gmail.com>
To: Minios-devel@lists.xenproject.org
Date: Thu, 25 Jun 2015 14:48:08 +0100
Message-Id: <1435240089-23413-3-git-send-email-talex5@gmail.com>
X-Mailer: git-send-email 2.4.2
In-Reply-To: <1435240089-23413-1-git-send-email-talex5@gmail.com>
References: <1435240089-23413-1-git-send-email-talex5@gmail.com>
Cc: Thomas Leonard <talex5@gmail.com>, Ian.Campbell@citrix.com, anil@recoil.org,
	karim.allah.ahmed@gmail.com, stefano.stabellini@eu.citrix.com,
	samuel.thibault@ens-lyon.org, Dave.Scott@eu.citrix.com
Subject: [Minios-devel] [PATCH ARM v9 2/3] mini-os: arm: interrupt controller
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org

Based on an initial patch by Karim Raslan.

Signed-off-by: Karim Allah Ahmed <karim.allah.ahmed@gmail.com>
Signed-off-by: Thomas Leonard <talex5@gmail.com>

---

Changes since v8

Addressed comments from Ian Campbell and Julien Grall:
- Drop obsolete interrupt configuration
- Write directly to GICD_ISENABLER (no need to read the old value first)
- Don't log spurious interrupts as unhandled even if debug logging is enabled
---
 arch/arm/gic.c | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 238 insertions(+)
 create mode 100644 arch/arm/gic.c

diff --git a/arch/arm/gic.c b/arch/arm/gic.c
new file mode 100644
index 0000000..1855293
--- /dev/null
+++ b/arch/arm/gic.c
@@ -0,0 +1,238 @@
+// ARM GIC implementation
+
+#include <mini-os/os.h>
+#include <mini-os/hypervisor.h>
+#include <mini-os/console.h>
+#include <libfdt.h>
+
+//#define VGIC_DEBUG
+#ifdef VGIC_DEBUG
+#define DEBUG(_f, _a...) \
+    printk("MINI_OS(file=vgic.c, line=%d) " _f , __LINE__, ## _a)
+#else
+#define DEBUG(_f, _a...)    ((void)0)
+#endif
+
+extern void (*IRQ_handler)(void);
+
+struct gic {
+    volatile char *gicd_base;
+    volatile char *gicc_base;
+};
+
+static struct gic gic;
+
+// Distributor Interface
+#define GICD_CTLR        0x0
+#define GICD_ISENABLER    0x100
+#define GICD_IPRIORITYR   0x400
+#define GICD_ITARGETSR    0x800
+#define GICD_ICFGR        0xC00
+
+// CPU Interface
+#define GICC_CTLR    0x0
+#define GICC_PMR    0x4
+#define GICC_IAR    0xc
+#define GICC_EOIR    0x10
+#define GICC_HPPIR    0x18
+
+#define gicd(gic, offset) ((gic)->gicd_base + (offset))
+#define gicc(gic, offset) ((gic)->gicc_base + (offset))
+
+#define REG(addr) ((uint32_t *)(addr))
+
+static inline uint32_t REG_READ32(volatile uint32_t *addr)
+{
+    uint32_t value;
+    __asm__ __volatile__("ldr %0, [%1]":"=&r"(value):"r"(addr));
+    rmb();
+    return value;
+}
+
+static inline void REG_WRITE32(volatile uint32_t *addr, unsigned int value)
+{
+    __asm__ __volatile__("str %0, [%1]"::"r"(value), "r"(addr));
+    wmb();
+}
+
+static void gic_set_priority(struct gic *gic, int irq_number, unsigned char priority)
+{
+    uint32_t value;
+    uint32_t *addr = REG(gicd(gic, GICD_IPRIORITYR)) + (irq_number >> 2);
+    value = REG_READ32(addr);
+    value &= ~(0xff << (8 * (irq_number & 0x3))); // clear old priority
+    value |= priority << (8 * (irq_number & 0x3)); // set new priority
+    REG_WRITE32(addr, value);
+}
+
+static void gic_route_interrupt(struct gic *gic, int irq_number, unsigned char cpu_set)
+{
+    uint32_t value;
+    uint32_t *addr = REG(gicd(gic, GICD_ITARGETSR)) + (irq_number >> 2);
+    value = REG_READ32(addr);
+    value &= ~(0xff << (8 * (irq_number & 0x3))); // clear old target
+    value |= cpu_set << (8 * (irq_number & 0x3)); // set new target
+    REG_WRITE32(addr, value);
+}
+
+/* When accessing the GIC registers, we can't use LDREX/STREX because it's not regular memory. */
+static __inline__ void clear_bit_non_atomic(int nr, volatile void *base)
+{
+    volatile uint32_t *tmp = base;
+    tmp[nr >> 5] &= (unsigned long)~(1 << (nr & 0x1f));
+}
+
+static __inline__ void set_bit_non_atomic(int nr, volatile void *base)
+{
+    volatile uint32_t *tmp = base;
+    tmp[nr >> 5] |= (1 << (nr & 0x1f));
+}
+
+/* Note: not thread safe (but we only support one CPU for now anyway) */
+static void gic_enable_interrupt(struct gic *gic, int irq_number,
+        unsigned char cpu_set, unsigned char level_sensitive)
+{
+    int *set_enable_reg;
+    void *cfg_reg;
+
+    // set priority
+    gic_set_priority(gic, irq_number, 0x0);
+
+    // set target cpus for this interrupt
+    gic_route_interrupt(gic, irq_number, cpu_set);
+
+    // set level/edge triggered
+    cfg_reg = (void *)gicd(gic, GICD_ICFGR);
+    if (level_sensitive) {
+        clear_bit_non_atomic((irq_number * 2) + 1, cfg_reg);
+    } else {
+        set_bit_non_atomic((irq_number * 2) + 1, cfg_reg);
+    }
+
+    wmb();
+
+    // enable forwarding interrupt from distributor to cpu interface
+    set_enable_reg = (int *)gicd(gic, GICD_ISENABLER);
+    set_enable_reg[irq_number >> 5] = 1 << (irq_number & 0x1f);
+    wmb();
+}
+
+static void gic_enable_interrupts(struct gic *gic)
+{
+    // Global enable forwarding interrupts from distributor to cpu interface
+    REG_WRITE32(REG(gicd(gic, GICD_CTLR)), 0x00000001);
+
+    // Global enable signalling of interrupt from the cpu interface
+    REG_WRITE32(REG(gicc(gic, GICC_CTLR)), 0x00000001);
+}
+
+static void gic_disable_interrupts(struct gic *gic)
+{
+    // Global disable signalling of interrupt from the cpu interface
+    REG_WRITE32(REG(gicc(gic, GICC_CTLR)), 0x00000000);
+
+    // Global disable forwarding interrupts from distributor to cpu interface
+    REG_WRITE32(REG(gicd(gic, GICD_CTLR)), 0x00000000);
+}
+
+static void gic_cpu_set_priority(struct gic *gic, char priority)
+{
+    REG_WRITE32(REG(gicc(gic, GICC_PMR)), priority & 0x000000FF);
+}
+
+static unsigned long gic_readiar(struct gic *gic) {
+    return REG_READ32(REG(gicc(gic, GICC_IAR))) & 0x000003FF; // Interrupt ID
+}
+
+static void gic_eoir(struct gic *gic, uint32_t irq) {
+    REG_WRITE32(REG(gicc(gic, GICC_EOIR)), irq & 0x000003FF);
+}
+
+//FIXME Get event_irq from dt
+#define EVENTS_IRQ 31
+#define VIRTUALTIMER_IRQ 27
+
+static void gic_handler(void) {
+    unsigned int irq = gic_readiar(&gic);
+
+    DEBUG("IRQ received : %i\n", irq);
+    switch(irq) {
+    case EVENTS_IRQ:
+        do_hypervisor_callback(NULL);
+        break;
+    case VIRTUALTIMER_IRQ:
+        /* We need to get this event to wake us up from block_domain,
+         * but we don't need to do anything special with it. */
+        break;
+    case 1022:
+    case 1023:
+        return;  /* Spurious interrupt */
+    default:
+        DEBUG("Unhandled irq\n");
+        break;
+    }
+
+    DEBUG("EIRQ\n");
+
+    gic_eoir(&gic, irq);
+}
+
+void gic_init(void) {
+    gic.gicd_base = NULL;
+    int node = 0;
+    int depth = 0;
+    for (;;)
+    {
+        node = fdt_next_node(device_tree, node, &depth);
+        if (node <= 0 || depth < 0)
+            break;
+
+        if (fdt_getprop(device_tree, node, "interrupt-controller", NULL)) {
+            int len = 0;
+
+            if (fdt_node_check_compatible(device_tree, node, "arm,cortex-a15-gic") &&
+                fdt_node_check_compatible(device_tree, node, "arm,cortex-a7-gic")) {
+                printk("Skipping incompatible interrupt-controller node\n");
+                continue;
+            }
+
+            const uint64_t *reg = fdt_getprop(device_tree, node, "reg", &len);
+
+            /* We have two registers (GICC and GICD), each of which contains
+             * two parts (an address and a size), each of which is a 64-bit
+             * value (8 bytes), so we expect a length of 2 * 2 * 8 = 32.
+             * If any extra values are passed in future, we ignore them. */
+            if (reg == NULL || len < 32) {
+                printk("Bad 'reg' property: %p %d\n", reg, len);
+                continue;
+            }
+
+            gic.gicd_base = to_virt((long) fdt64_to_cpu(reg[0]));
+            gic.gicc_base = to_virt((long) fdt64_to_cpu(reg[2]));
+            printk("Found GIC: gicd_base = %p, gicc_base = %p\n", gic.gicd_base, gic.gicc_base);
+            break;
+        }
+    }
+    if (!gic.gicd_base) {
+        printk("GIC not found!\n");
+        BUG();
+    }
+    wmb();
+
+    /* Note: we could mark this as "device" memory here, but Xen will have already
+     * set it that way in the second stage translation table, so it's not necessary.
+     * See "Overlaying the memory type attribute" in the Architecture Reference Manual.
+     */
+
+    IRQ_handler = gic_handler;
+
+    gic_disable_interrupts(&gic);
+    gic_cpu_set_priority(&gic, 0xff);
+
+    /* Must call gic_enable_interrupts before enabling individual interrupts, otherwise our IRQ handler
+     * gets called endlessly with spurious interrupts. */
+    gic_enable_interrupts(&gic);
+
+    gic_enable_interrupt(&gic, EVENTS_IRQ /* interrupt number */, 0x1 /*cpu_set*/, 1 /*level_sensitive*/);
+    gic_enable_interrupt(&gic, VIRTUALTIMER_IRQ /* interrupt number */, 0x1 /*cpu_set*/, 1 /*level_sensitive*/);
+}
-- 
2.4.2


_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

From minios-devel-bounces@lists.xenproject.org Thu Jun 25 13:48:27 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 25 Jun 2015 13:48:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z87Vz-0004bZ-Ir; Thu, 25 Jun 2015 13:48:27 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <talex5@gmail.com>) id 1Z87Vx-0004Yn-BI
	for Minios-devel@lists.xenproject.org; Thu, 25 Jun 2015 13:48:25 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	A0/95-12923-8A60C855; Thu, 25 Jun 2015 13:48:24 +0000
X-Env-Sender: talex5@gmail.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1435240103!16860441!1
X-Originating-IP: [209.85.212.180]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG, UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27519 invoked from network); 25 Jun 2015 13:48:23 -0000
Received: from mail-wi0-f180.google.com (HELO mail-wi0-f180.google.com)
	(209.85.212.180)
	by server-2.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	25 Jun 2015 13:48:23 -0000
Received: by wiga1 with SMTP id a1so165059163wig.0
	for <Minios-devel@lists.xenproject.org>;
	Thu, 25 Jun 2015 06:48:23 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id:in-reply-to:references;
	bh=qmExttdyLy8v83bWVN/SEikTHXBXrXvaZXBtZzNcxS4=;
	b=B0poJSK2I0hP0mMlP6KWL4U+t0mCnFtcyIz+7n7pnH8SnRLfyEurqVRZhJxgXK/Moe
	w6g/Ra7diK3Fb7HRmxu9BhY/4IqNkIJZouFcO/eAMugVPZECAjt9d0waEd9sckXxNiE9
	LbDJl83jBU9nemM8Hh5UVPtuFwb5dCpHGzHXGndOdaUoKVmNoqLy3uqzior2dO+h77Q1
	WeZFokzyEvrm7RLuCjFPH9RrHtc9Y7tHwQqnraoPiLC9wAlEj8lC4Rcv5ovejixoKn1m
	VmsfbDeCxTSCHVZmDTdbeUyxe/WqZLrEh6jZnyoiLmXUYGyxTf+qw7+iEB5zczscd3gD
	PIQg==
X-Received: by 10.180.88.201 with SMTP id bi9mr6003970wib.58.1435240103582;
	Thu, 25 Jun 2015 06:48:23 -0700 (PDT)
Received: from cam.localdomain (82-69-101-169.dsl.in-addr.zen.co.uk.
	[82.69.101.169])
	by mx.google.com with ESMTPSA id v4sm7723372wiy.5.2015.06.25.06.48.22
	(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
	Thu, 25 Jun 2015 06:48:22 -0700 (PDT)
From: Thomas Leonard <talex5@gmail.com>
To: Minios-devel@lists.xenproject.org
Date: Thu, 25 Jun 2015 14:48:09 +0100
Message-Id: <1435240089-23413-4-git-send-email-talex5@gmail.com>
X-Mailer: git-send-email 2.4.2
In-Reply-To: <1435240089-23413-1-git-send-email-talex5@gmail.com>
References: <1435240089-23413-1-git-send-email-talex5@gmail.com>
Cc: Thomas Leonard <talex5@gmail.com>, Ian.Campbell@citrix.com, anil@recoil.org,
	karim.allah.ahmed@gmail.com, stefano.stabellini@eu.citrix.com,
	samuel.thibault@ens-lyon.org, Dave.Scott@eu.citrix.com
Subject: [Minios-devel] [PATCH ARM v9 3/3] mini-os: arm: build system
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org

Based on an initial patch by Karim Raslan.

This activates the ARM code added in the previous patches. On ARM,
Mini-OS will boot and display some output on the console. Tested with:

make XEN_TARGET_ARCH=arm32 CROSS_COMPILE=arm-linux-gnueabihf- \
	CONFIG_TEST=y CONFIG_START_NETWORK=n CONFIG_BLKFRONT=n \
	CONFIG_NETFRONT=n CONFIG_FBFRONT=n CONFIG_KBDFRONT=n \
	CONFIG_CONSFRONT=n CONFIG_XC=n -j4

The memmove implementation is from FreeBSD's
contrib/ldns/compat/memmove.c (r246827).

Signed-off-by: Karim Allah Ahmed <karim.allah.ahmed@gmail.com>
Signed-off-by: Thomas Leonard <talex5@gmail.com>

---

Changes since v8:

- updated for standalone Mini-OS repository
---
 .gitmodules          |  3 +++
 COPYING              | 27 +++++++++++++++++++++++++++
 Config.mk            |  2 ++
 Makefile             | 27 ++++++++++++++++++++++++++-
 arch/arm/Makefile    | 35 +++++++++++++++++++++++++++++++++++
 arch/arm/arch.mk     |  6 ++++++
 dtc                  |  1 +
 include/lib.h        |  4 +++-
 include/libfdt_env.h | 33 +++++++++++++++++++++++++++++++++
 lib/memmove.c        | 45 +++++++++++++++++++++++++++++++++++++++++++++
 lib/string.c         | 12 ++++++++++++
 11 files changed, 193 insertions(+), 2 deletions(-)
 create mode 100644 .gitmodules
 create mode 100755 arch/arm/Makefile
 create mode 100644 arch/arm/arch.mk
 create mode 160000 dtc
 create mode 100644 include/libfdt_env.h
 create mode 100644 lib/memmove.c

diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..221102d
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "dtc"]
+	path = dtc
+	url = git://git.kernel.org/pub/scm/utils/dtc/dtc.git
diff --git a/COPYING b/COPYING
index 1d9df6c..b676bb6 100644
--- a/COPYING
+++ b/COPYING
@@ -34,3 +34,30 @@ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 SUCH DAMAGE.
 
+
+Copyright (c) 2005,2006, NLnetLabs
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice,
+      this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+    * Neither the name of NLnetLabs nor the names of its
+      contributors may be used to endorse or promote products derived from this
+      software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
diff --git a/Config.mk b/Config.mk
index e5d8ade..eb53f2d 100644
--- a/Config.mk
+++ b/Config.mk
@@ -54,6 +54,8 @@ export XEN_INTERFACE_VERSION
 # If not x86 then use $(MINIOS_TARGET_ARCH)
 ifeq ($(findstring x86_,$(MINIOS_TARGET_ARCH)),x86_)
 TARGET_ARCH_FAM = x86
+else ifeq ($(findstring arm,$(MINIOS_TARGET_ARCH)),arm)
+TARGET_ARCH_FAM = arm
 else
 TARGET_ARCH_FAM = $(MINIOS_TARGET_ARCH)
 endif
diff --git a/Makefile b/Makefile
index 2cb5e51..d06fc3b 100644
--- a/Makefile
+++ b/Makefile
@@ -54,8 +54,15 @@ DEF_CFLAGS += $(flags-y)
 # Symlinks and headers that must be created before building the C files
 GENERATED_HEADERS := include/list.h $(ARCH_LINKS) include/mini-os include/$(TARGET_ARCH_FAM)/mini-os
 
+ifeq ($(MINIOS_TARGET_ARCH),arm32)
+GENERATED_HEADERS += include/fdt.h include/libfdt.h
+endif
+
 EXTRA_DEPS += $(GENERATED_HEADERS)
 
+include/%.h: dtc/libfdt/%.h
+	ln -s ../$^ $@
+
 # Include common mini-os makerules.
 include minios.mk
 
@@ -76,7 +83,18 @@ EXTRA_OBJS =
 TARGET := mini-os
 
 # Subdirectories common to mini-os
-SUBDIRS := lib xenbus console
+SUBDIRS := lib xenbus console dtc/libfdt
+
+FDT_SRC :=
+ifeq ($(MINIOS_TARGET_ARCH),arm32)
+# Need libgcc.a for division helpers
+LDLIBS += `$(CC) -print-libgcc-file-name`
+
+# Device tree support
+FDT_SRC := dtc/libfdt/fdt.c dtc/libfdt/fdt_ro.c dtc/libfdt/fdt_strerror.c
+
+src-y += ${FDT_SRC}
+endif
 
 src-$(CONFIG_BLKFRONT) += blkfront.c
 src-$(CONFIG_TPMFRONT) += tpmfront.c
@@ -98,10 +116,13 @@ src-y += sched.c
 src-$(CONFIG_TEST) += test.c
 
 src-y += lib/ctype.c
+ifneq ($(MINIOS_TARGET_ARCH),arm32)
 src-y += lib/math.c
+endif
 src-y += lib/printf.c
 src-y += lib/stack_chk_fail.c
 src-y += lib/string.c
+src-y += lib/memmove.c
 src-y += lib/sys.c
 src-y += lib/xmalloc.c
 src-$(CONFIG_XENBUS) += lib/xs.c
@@ -188,7 +209,11 @@ $(OBJ_DIR)/$(TARGET): $(OBJS) $(APP_O) arch_lib
 	$(LD) -r $(LDFLAGS) $(HEAD_OBJ) $(APP_O) $(OBJS) $(LDARCHLIB) $(LDLIBS) -o $@.o
 	$(OBJCOPY) -w -G $(GLOBAL_PREFIX)* -G _start $@.o $@.o
 	$(LD) $(LDFLAGS) $(LDFLAGS_FINAL) $@.o $(EXTRA_OBJS) -o $@
+ifeq ($(MINIOS_TARGET_ARCH),arm32)
+	$(OBJCOPY) -O binary $@ $@.img
+else
 	gzip -f -9 -c $@ >$@.gz
+endif
 
 .PHONY: clean arch_clean
 
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
new file mode 100755
index 0000000..e018dad
--- /dev/null
+++ b/arch/arm/Makefile
@@ -0,0 +1,35 @@
+#
+# ARM architecture specific makefiles.
+#
+
+TOPLEVEL_DIR = $(CURDIR)/../..
+OBJ_DIR=$(CURDIR)
+include ../../Config.mk
+
+# include arch.mk has to be before minios.mk!
+
+include arch.mk
+include ../../minios.mk
+
+include $(MINI-OS_ROOT)/config/MiniOS.mk
+
+
+# Sources here are all *.c (without $(MINIOS_TARGET_ARCH).S)
+# This is handled in $(HEAD_ARCH_OBJ)
+ARCH_SRCS := $(wildcard *.c)
+
+# The objects built from the sources.
+ARCH_OBJS := $(patsubst %.c,$(OBJ_DIR)/%.o,$(ARCH_SRCS))
+
+ARCH_OBJS += $(OBJ_DIR)/hypercalls32.o
+
+all: $(OBJ_DIR)/$(ARCH_LIB)
+
+# $(HEAD_ARCH_OBJ) is only built here, needed on linking
+# in ../../Makefile.
+$(OBJ_DIR)/$(ARCH_LIB): $(ARCH_OBJS) $(OBJ_DIR)/$(HEAD_ARCH_OBJ)
+	$(AR) rv $(OBJ_DIR)/$(ARCH_LIB) $(ARCH_OBJS)
+
+clean:
+	rm -f $(OBJ_DIR)/$(ARCH_LIB) $(ARCH_OBJS) $(OBJ_DIR)/$(HEAD_ARCH_OBJ)
+
diff --git a/arch/arm/arch.mk b/arch/arm/arch.mk
new file mode 100644
index 0000000..b4cb65b
--- /dev/null
+++ b/arch/arm/arch.mk
@@ -0,0 +1,6 @@
+ifeq ($(MINIOS_TARGET_ARCH),arm32)
+DEF_ASFLAGS += -march=armv7-a -mfpu=vfpv3
+ARCH_CFLAGS  := -march=armv7-a -marm -fms-extensions -D__arm__ -DXEN_HAVE_PV_GUEST_ENTRY #-DCPU_EXCLUSIVE_LDST
+EXTRA_INC += $(TARGET_ARCH_FAM)/$(MINIOS_TARGET_ARCH)
+EXTRA_SRC += arch/$(EXTRA_INC)
+endif
diff --git a/dtc b/dtc
new file mode 160000
index 0000000..64c46b0
--- /dev/null
+++ b/dtc
@@ -0,0 +1 @@
+Subproject commit 64c46b098b969502a74c8b0fd97e6f5e4aa07e21
diff --git a/include/lib.h b/include/lib.h
index 62836c7..326e39f 100644
--- a/include/lib.h
+++ b/include/lib.h
@@ -95,6 +95,7 @@ char	*strncpy(char * __restrict, const char * __restrict, size_t);
 
 char	*strstr(const char *, const char *);
 
+void *memmove(void *, const void *, size_t);
 void *memset(void *, int, size_t);
 
 char *strchr(const char *p, int ch);
@@ -104,7 +105,8 @@ char *strrchr(const char *p, int ch);
  *	@(#)systm.h	8.7 (Berkeley) 3/29/95
  * $FreeBSD$
  */
-void	*memcpy(void *to, const void *from, size_t len);
+void *memcpy(void *to, const void *from, size_t len);
+void *memchr(const void *s, int c, size_t n);
 
 size_t strnlen(const char *, size_t);
 #endif
diff --git a/include/libfdt_env.h b/include/libfdt_env.h
new file mode 100644
index 0000000..722fac6
--- /dev/null
+++ b/include/libfdt_env.h
@@ -0,0 +1,33 @@
+#ifndef _LIBFDT_ENV_H
+#define _LIBFDT_ENV_H
+
+#include <stddef.h>
+#include <stdint.h>
+#include <lib.h>
+
+typedef uint16_t fdt16_t;
+typedef uint32_t fdt32_t;
+typedef uint64_t fdt64_t;
+
+#define EXTRACT_BYTE(n) ((unsigned long long)((uint8_t *)&x)[n])
+static inline uint16_t fdt16_to_cpu(uint16_t x)
+{
+    return (EXTRACT_BYTE(0) << 8) | EXTRACT_BYTE(1);
+}
+#define cpu_to_fdt16(x) fdt16_to_cpu(x)
+
+static inline uint32_t fdt32_to_cpu(uint32_t x)
+{
+    return (EXTRACT_BYTE(0) << 24) | (EXTRACT_BYTE(1) << 16) | (EXTRACT_BYTE(2) << 8) | EXTRACT_BYTE(3);
+}
+#define cpu_to_fdt32(x) fdt32_to_cpu(x)
+
+static inline uint64_t fdt64_to_cpu(uint64_t x)
+{
+    return (EXTRACT_BYTE(0) << 56) | (EXTRACT_BYTE(1) << 48) | (EXTRACT_BYTE(2) << 40) | (EXTRACT_BYTE(3) << 32)
+            | (EXTRACT_BYTE(4) << 24) | (EXTRACT_BYTE(5) << 16) | (EXTRACT_BYTE(6) << 8) | EXTRACT_BYTE(7);
+}
+#define cpu_to_fdt64(x) fdt64_to_cpu(x)
+#undef EXTRACT_BYTE
+
+#endif /* _LIBFDT_ENV_H */
diff --git a/lib/memmove.c b/lib/memmove.c
new file mode 100644
index 0000000..0298b7c
--- /dev/null
+++ b/lib/memmove.c
@@ -0,0 +1,45 @@
+/*
+ *	memmove.c: memmove compat implementation.
+ *
+ *	Copyright (c) 2001-2008, NLnet Labs. All rights reserved.
+ *
+ * See COPYING for the license.
+*/
+
+#include <os.h>
+#include <mini-os/lib.h>
+
+#ifndef HAVE_LIBC
+
+void *memmove(void *dest, const void *src, size_t n)
+{
+	uint8_t* from = (uint8_t*) src;
+	uint8_t* to = (uint8_t*) dest;
+
+	if (from == to || n == 0)
+		return dest;
+	if (to > from && to-from < (int)n) {
+		/* to overlaps with from */
+		/*  <from......>         */
+		/*         <to........>  */
+		/* copy in reverse, to avoid overwriting from */
+		int i;
+		for(i=n-1; i>=0; i--)
+			to[i] = from[i];
+		return dest;
+	}
+	if (from > to  && from-to < (int)n) {
+		/* to overlaps with from */
+		/*        <from......>   */
+		/*  <to........>         */
+		/* copy forwards, to avoid overwriting from */
+		size_t i;
+		for(i=0; i<n; i++)
+			to[i] = from[i];
+		return dest;
+	}
+	memcpy(dest, src, n);
+	return dest;
+}
+
+#endif
diff --git a/lib/string.c b/lib/string.c
index 8b24146..c96ca41 100644
--- a/lib/string.c
+++ b/lib/string.c
@@ -225,4 +225,16 @@ int ffs(int i)
    return 0;
 }
 
+void *memchr(const void *s, int c, size_t n)
+{
+    if (n != 0) {
+        const unsigned char *p = s;
+
+        do {
+            if (*p++ == (unsigned char)c)
+                return ((void *)(uintptr_t)(p - 1));
+        } while (--n != 0);
+    }
+    return (NULL);
+}
 #endif
-- 
2.4.2


_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

From minios-devel-bounces@lists.xenproject.org Thu Jun 25 13:48:27 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 25 Jun 2015 13:48:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z87Vz-0004bZ-Ir; Thu, 25 Jun 2015 13:48:27 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <talex5@gmail.com>) id 1Z87Vx-0004Yn-BI
	for Minios-devel@lists.xenproject.org; Thu, 25 Jun 2015 13:48:25 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	A0/95-12923-8A60C855; Thu, 25 Jun 2015 13:48:24 +0000
X-Env-Sender: talex5@gmail.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1435240103!16860441!1
X-Originating-IP: [209.85.212.180]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG, UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27519 invoked from network); 25 Jun 2015 13:48:23 -0000
Received: from mail-wi0-f180.google.com (HELO mail-wi0-f180.google.com)
	(209.85.212.180)
	by server-2.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	25 Jun 2015 13:48:23 -0000
Received: by wiga1 with SMTP id a1so165059163wig.0
	for <Minios-devel@lists.xenproject.org>;
	Thu, 25 Jun 2015 06:48:23 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id:in-reply-to:references;
	bh=qmExttdyLy8v83bWVN/SEikTHXBXrXvaZXBtZzNcxS4=;
	b=B0poJSK2I0hP0mMlP6KWL4U+t0mCnFtcyIz+7n7pnH8SnRLfyEurqVRZhJxgXK/Moe
	w6g/Ra7diK3Fb7HRmxu9BhY/4IqNkIJZouFcO/eAMugVPZECAjt9d0waEd9sckXxNiE9
	LbDJl83jBU9nemM8Hh5UVPtuFwb5dCpHGzHXGndOdaUoKVmNoqLy3uqzior2dO+h77Q1
	WeZFokzyEvrm7RLuCjFPH9RrHtc9Y7tHwQqnraoPiLC9wAlEj8lC4Rcv5ovejixoKn1m
	VmsfbDeCxTSCHVZmDTdbeUyxe/WqZLrEh6jZnyoiLmXUYGyxTf+qw7+iEB5zczscd3gD
	PIQg==
X-Received: by 10.180.88.201 with SMTP id bi9mr6003970wib.58.1435240103582;
	Thu, 25 Jun 2015 06:48:23 -0700 (PDT)
Received: from cam.localdomain (82-69-101-169.dsl.in-addr.zen.co.uk.
	[82.69.101.169])
	by mx.google.com with ESMTPSA id v4sm7723372wiy.5.2015.06.25.06.48.22
	(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
	Thu, 25 Jun 2015 06:48:22 -0700 (PDT)
From: Thomas Leonard <talex5@gmail.com>
To: Minios-devel@lists.xenproject.org
Date: Thu, 25 Jun 2015 14:48:09 +0100
Message-Id: <1435240089-23413-4-git-send-email-talex5@gmail.com>
X-Mailer: git-send-email 2.4.2
In-Reply-To: <1435240089-23413-1-git-send-email-talex5@gmail.com>
References: <1435240089-23413-1-git-send-email-talex5@gmail.com>
Cc: Thomas Leonard <talex5@gmail.com>, Ian.Campbell@citrix.com, anil@recoil.org,
	karim.allah.ahmed@gmail.com, stefano.stabellini@eu.citrix.com,
	samuel.thibault@ens-lyon.org, Dave.Scott@eu.citrix.com
Subject: [Minios-devel] [PATCH ARM v9 3/3] mini-os: arm: build system
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org

Based on an initial patch by Karim Raslan.

This activates the ARM code added in the previous patches. On ARM,
Mini-OS will boot and display some output on the console. Tested with:

make XEN_TARGET_ARCH=arm32 CROSS_COMPILE=arm-linux-gnueabihf- \
	CONFIG_TEST=y CONFIG_START_NETWORK=n CONFIG_BLKFRONT=n \
	CONFIG_NETFRONT=n CONFIG_FBFRONT=n CONFIG_KBDFRONT=n \
	CONFIG_CONSFRONT=n CONFIG_XC=n -j4

The memmove implementation is from FreeBSD's
contrib/ldns/compat/memmove.c (r246827).

Signed-off-by: Karim Allah Ahmed <karim.allah.ahmed@gmail.com>
Signed-off-by: Thomas Leonard <talex5@gmail.com>

---

Changes since v8:

- updated for standalone Mini-OS repository
---
 .gitmodules          |  3 +++
 COPYING              | 27 +++++++++++++++++++++++++++
 Config.mk            |  2 ++
 Makefile             | 27 ++++++++++++++++++++++++++-
 arch/arm/Makefile    | 35 +++++++++++++++++++++++++++++++++++
 arch/arm/arch.mk     |  6 ++++++
 dtc                  |  1 +
 include/lib.h        |  4 +++-
 include/libfdt_env.h | 33 +++++++++++++++++++++++++++++++++
 lib/memmove.c        | 45 +++++++++++++++++++++++++++++++++++++++++++++
 lib/string.c         | 12 ++++++++++++
 11 files changed, 193 insertions(+), 2 deletions(-)
 create mode 100644 .gitmodules
 create mode 100755 arch/arm/Makefile
 create mode 100644 arch/arm/arch.mk
 create mode 160000 dtc
 create mode 100644 include/libfdt_env.h
 create mode 100644 lib/memmove.c

diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..221102d
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "dtc"]
+	path = dtc
+	url = git://git.kernel.org/pub/scm/utils/dtc/dtc.git
diff --git a/COPYING b/COPYING
index 1d9df6c..b676bb6 100644
--- a/COPYING
+++ b/COPYING
@@ -34,3 +34,30 @@ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 SUCH DAMAGE.
 
+
+Copyright (c) 2005,2006, NLnetLabs
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice,
+      this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+    * Neither the name of NLnetLabs nor the names of its
+      contributors may be used to endorse or promote products derived from this
+      software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
diff --git a/Config.mk b/Config.mk
index e5d8ade..eb53f2d 100644
--- a/Config.mk
+++ b/Config.mk
@@ -54,6 +54,8 @@ export XEN_INTERFACE_VERSION
 # If not x86 then use $(MINIOS_TARGET_ARCH)
 ifeq ($(findstring x86_,$(MINIOS_TARGET_ARCH)),x86_)
 TARGET_ARCH_FAM = x86
+else ifeq ($(findstring arm,$(MINIOS_TARGET_ARCH)),arm)
+TARGET_ARCH_FAM = arm
 else
 TARGET_ARCH_FAM = $(MINIOS_TARGET_ARCH)
 endif
diff --git a/Makefile b/Makefile
index 2cb5e51..d06fc3b 100644
--- a/Makefile
+++ b/Makefile
@@ -54,8 +54,15 @@ DEF_CFLAGS += $(flags-y)
 # Symlinks and headers that must be created before building the C files
 GENERATED_HEADERS := include/list.h $(ARCH_LINKS) include/mini-os include/$(TARGET_ARCH_FAM)/mini-os
 
+ifeq ($(MINIOS_TARGET_ARCH),arm32)
+GENERATED_HEADERS += include/fdt.h include/libfdt.h
+endif
+
 EXTRA_DEPS += $(GENERATED_HEADERS)
 
+include/%.h: dtc/libfdt/%.h
+	ln -s ../$^ $@
+
 # Include common mini-os makerules.
 include minios.mk
 
@@ -76,7 +83,18 @@ EXTRA_OBJS =
 TARGET := mini-os
 
 # Subdirectories common to mini-os
-SUBDIRS := lib xenbus console
+SUBDIRS := lib xenbus console dtc/libfdt
+
+FDT_SRC :=
+ifeq ($(MINIOS_TARGET_ARCH),arm32)
+# Need libgcc.a for division helpers
+LDLIBS += `$(CC) -print-libgcc-file-name`
+
+# Device tree support
+FDT_SRC := dtc/libfdt/fdt.c dtc/libfdt/fdt_ro.c dtc/libfdt/fdt_strerror.c
+
+src-y += ${FDT_SRC}
+endif
 
 src-$(CONFIG_BLKFRONT) += blkfront.c
 src-$(CONFIG_TPMFRONT) += tpmfront.c
@@ -98,10 +116,13 @@ src-y += sched.c
 src-$(CONFIG_TEST) += test.c
 
 src-y += lib/ctype.c
+ifneq ($(MINIOS_TARGET_ARCH),arm32)
 src-y += lib/math.c
+endif
 src-y += lib/printf.c
 src-y += lib/stack_chk_fail.c
 src-y += lib/string.c
+src-y += lib/memmove.c
 src-y += lib/sys.c
 src-y += lib/xmalloc.c
 src-$(CONFIG_XENBUS) += lib/xs.c
@@ -188,7 +209,11 @@ $(OBJ_DIR)/$(TARGET): $(OBJS) $(APP_O) arch_lib
 	$(LD) -r $(LDFLAGS) $(HEAD_OBJ) $(APP_O) $(OBJS) $(LDARCHLIB) $(LDLIBS) -o $@.o
 	$(OBJCOPY) -w -G $(GLOBAL_PREFIX)* -G _start $@.o $@.o
 	$(LD) $(LDFLAGS) $(LDFLAGS_FINAL) $@.o $(EXTRA_OBJS) -o $@
+ifeq ($(MINIOS_TARGET_ARCH),arm32)
+	$(OBJCOPY) -O binary $@ $@.img
+else
 	gzip -f -9 -c $@ >$@.gz
+endif
 
 .PHONY: clean arch_clean
 
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
new file mode 100755
index 0000000..e018dad
--- /dev/null
+++ b/arch/arm/Makefile
@@ -0,0 +1,35 @@
+#
+# ARM architecture specific makefiles.
+#
+
+TOPLEVEL_DIR = $(CURDIR)/../..
+OBJ_DIR=$(CURDIR)
+include ../../Config.mk
+
+# include arch.mk has to be before minios.mk!
+
+include arch.mk
+include ../../minios.mk
+
+include $(MINI-OS_ROOT)/config/MiniOS.mk
+
+
+# Sources here are all *.c (without $(MINIOS_TARGET_ARCH).S)
+# This is handled in $(HEAD_ARCH_OBJ)
+ARCH_SRCS := $(wildcard *.c)
+
+# The objects built from the sources.
+ARCH_OBJS := $(patsubst %.c,$(OBJ_DIR)/%.o,$(ARCH_SRCS))
+
+ARCH_OBJS += $(OBJ_DIR)/hypercalls32.o
+
+all: $(OBJ_DIR)/$(ARCH_LIB)
+
+# $(HEAD_ARCH_OBJ) is only built here, needed on linking
+# in ../../Makefile.
+$(OBJ_DIR)/$(ARCH_LIB): $(ARCH_OBJS) $(OBJ_DIR)/$(HEAD_ARCH_OBJ)
+	$(AR) rv $(OBJ_DIR)/$(ARCH_LIB) $(ARCH_OBJS)
+
+clean:
+	rm -f $(OBJ_DIR)/$(ARCH_LIB) $(ARCH_OBJS) $(OBJ_DIR)/$(HEAD_ARCH_OBJ)
+
diff --git a/arch/arm/arch.mk b/arch/arm/arch.mk
new file mode 100644
index 0000000..b4cb65b
--- /dev/null
+++ b/arch/arm/arch.mk
@@ -0,0 +1,6 @@
+ifeq ($(MINIOS_TARGET_ARCH),arm32)
+DEF_ASFLAGS += -march=armv7-a -mfpu=vfpv3
+ARCH_CFLAGS  := -march=armv7-a -marm -fms-extensions -D__arm__ -DXEN_HAVE_PV_GUEST_ENTRY #-DCPU_EXCLUSIVE_LDST
+EXTRA_INC += $(TARGET_ARCH_FAM)/$(MINIOS_TARGET_ARCH)
+EXTRA_SRC += arch/$(EXTRA_INC)
+endif
diff --git a/dtc b/dtc
new file mode 160000
index 0000000..64c46b0
--- /dev/null
+++ b/dtc
@@ -0,0 +1 @@
+Subproject commit 64c46b098b969502a74c8b0fd97e6f5e4aa07e21
diff --git a/include/lib.h b/include/lib.h
index 62836c7..326e39f 100644
--- a/include/lib.h
+++ b/include/lib.h
@@ -95,6 +95,7 @@ char	*strncpy(char * __restrict, const char * __restrict, size_t);
 
 char	*strstr(const char *, const char *);
 
+void *memmove(void *, const void *, size_t);
 void *memset(void *, int, size_t);
 
 char *strchr(const char *p, int ch);
@@ -104,7 +105,8 @@ char *strrchr(const char *p, int ch);
  *	@(#)systm.h	8.7 (Berkeley) 3/29/95
  * $FreeBSD$
  */
-void	*memcpy(void *to, const void *from, size_t len);
+void *memcpy(void *to, const void *from, size_t len);
+void *memchr(const void *s, int c, size_t n);
 
 size_t strnlen(const char *, size_t);
 #endif
diff --git a/include/libfdt_env.h b/include/libfdt_env.h
new file mode 100644
index 0000000..722fac6
--- /dev/null
+++ b/include/libfdt_env.h
@@ -0,0 +1,33 @@
+#ifndef _LIBFDT_ENV_H
+#define _LIBFDT_ENV_H
+
+#include <stddef.h>
+#include <stdint.h>
+#include <lib.h>
+
+typedef uint16_t fdt16_t;
+typedef uint32_t fdt32_t;
+typedef uint64_t fdt64_t;
+
+#define EXTRACT_BYTE(n) ((unsigned long long)((uint8_t *)&x)[n])
+static inline uint16_t fdt16_to_cpu(uint16_t x)
+{
+    return (EXTRACT_BYTE(0) << 8) | EXTRACT_BYTE(1);
+}
+#define cpu_to_fdt16(x) fdt16_to_cpu(x)
+
+static inline uint32_t fdt32_to_cpu(uint32_t x)
+{
+    return (EXTRACT_BYTE(0) << 24) | (EXTRACT_BYTE(1) << 16) | (EXTRACT_BYTE(2) << 8) | EXTRACT_BYTE(3);
+}
+#define cpu_to_fdt32(x) fdt32_to_cpu(x)
+
+static inline uint64_t fdt64_to_cpu(uint64_t x)
+{
+    return (EXTRACT_BYTE(0) << 56) | (EXTRACT_BYTE(1) << 48) | (EXTRACT_BYTE(2) << 40) | (EXTRACT_BYTE(3) << 32)
+            | (EXTRACT_BYTE(4) << 24) | (EXTRACT_BYTE(5) << 16) | (EXTRACT_BYTE(6) << 8) | EXTRACT_BYTE(7);
+}
+#define cpu_to_fdt64(x) fdt64_to_cpu(x)
+#undef EXTRACT_BYTE
+
+#endif /* _LIBFDT_ENV_H */
diff --git a/lib/memmove.c b/lib/memmove.c
new file mode 100644
index 0000000..0298b7c
--- /dev/null
+++ b/lib/memmove.c
@@ -0,0 +1,45 @@
+/*
+ *	memmove.c: memmove compat implementation.
+ *
+ *	Copyright (c) 2001-2008, NLnet Labs. All rights reserved.
+ *
+ * See COPYING for the license.
+*/
+
+#include <os.h>
+#include <mini-os/lib.h>
+
+#ifndef HAVE_LIBC
+
+void *memmove(void *dest, const void *src, size_t n)
+{
+	uint8_t* from = (uint8_t*) src;
+	uint8_t* to = (uint8_t*) dest;
+
+	if (from == to || n == 0)
+		return dest;
+	if (to > from && to-from < (int)n) {
+		/* to overlaps with from */
+		/*  <from......>         */
+		/*         <to........>  */
+		/* copy in reverse, to avoid overwriting from */
+		int i;
+		for(i=n-1; i>=0; i--)
+			to[i] = from[i];
+		return dest;
+	}
+	if (from > to  && from-to < (int)n) {
+		/* to overlaps with from */
+		/*        <from......>   */
+		/*  <to........>         */
+		/* copy forwards, to avoid overwriting from */
+		size_t i;
+		for(i=0; i<n; i++)
+			to[i] = from[i];
+		return dest;
+	}
+	memcpy(dest, src, n);
+	return dest;
+}
+
+#endif
diff --git a/lib/string.c b/lib/string.c
index 8b24146..c96ca41 100644
--- a/lib/string.c
+++ b/lib/string.c
@@ -225,4 +225,16 @@ int ffs(int i)
    return 0;
 }
 
+void *memchr(const void *s, int c, size_t n)
+{
+    if (n != 0) {
+        const unsigned char *p = s;
+
+        do {
+            if (*p++ == (unsigned char)c)
+                return ((void *)(uintptr_t)(p - 1));
+        } while (--n != 0);
+    }
+    return (NULL);
+}
 #endif
-- 
2.4.2


_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

From minios-devel-bounces@lists.xenproject.org Thu Jun 25 15:49:32 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 25 Jun 2015 15:49:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z89P8-0007YA-Rq; Thu, 25 Jun 2015 15:49:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <prvs=611ba0aa7=Ian.Campbell@citrix.com>)
	id 1Z89P7-0007Y1-H6
	for Minios-devel@lists.xenproject.org; Thu, 25 Jun 2015 15:49:29 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	41/52-02952-8032C855; Thu, 25 Jun 2015 15:49:28 +0000
X-Env-Sender: prvs=611ba0aa7=Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1435247366!19764262!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n,
	received_headers: No Received headers
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31264 invoked from network); 25 Jun 2015 15:49:28 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-12.tower-31.messagelabs.com with RC4-SHA encrypted SMTP;
	25 Jun 2015 15:49:28 -0000
X-IronPort-AV: E=Sophos;i="5.13,677,1427760000"; d="scan'208";a="275610246"
Message-ID: <1435247348.32500.98.camel@citrix.com>
From: Ian Campbell <ian.campbell@citrix.com>
To: Thomas Leonard <talex5@gmail.com>
Date: Thu, 25 Jun 2015 16:49:08 +0100
In-Reply-To: <1435240089-23413-2-git-send-email-talex5@gmail.com>
References: <1435240089-23413-1-git-send-email-talex5@gmail.com>
	<1435240089-23413-2-git-send-email-talex5@gmail.com>
X-Mailer: Evolution 3.12.9-1+b1 
MIME-Version: 1.0
X-DLP: MIA1
Cc: Dave.Scott@eu.citrix.com, anil@recoil.org, karim.allah.ahmed@gmail.com,
	stefano.stabellini@eu.citrix.com,
	Minios-devel@lists.xenproject.org, samuel.thibault@ens-lyon.org
Subject: Re: [Minios-devel] [PATCH ARM v9 1/3] mini-os: fix compiling with
	debug=n
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org

On Thu, 2015-06-25 at 14:48 +0100, Thomas Leonard wrote:
> Without -fno-tree-loop-distribute-patterns, gcc -O3 recognises that our
> "memset" is doing a memset operation and tries to make it call the
> standard "memset", creating a loop.

Isn't this what -nostdlib and such like are for?

In any case if we are to go down this route I think we'd be better off
applying it only to lib/string.c or even better just to the memset
function, if there is a way to do that.

> 
> Signed-off-by: Thomas Leonard <talex5@gmail.com>
> ---
>  minios.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/minios.mk b/minios.mk
> index e042027..41023e9 100644
> --- a/minios.mk
> +++ b/minios.mk
> @@ -23,7 +23,7 @@ DEF_CFLAGS += -g
>  #DEF_CFLAGS += -DGNT_DEBUG
>  #DEF_CFLAGS += -DGNTMAP_DEBUG
>  else
> -DEF_CFLAGS += -O3
> +DEF_CFLAGS += -O3 $(call cc-option,$(CC),-fno-tree-loop-distribute-patterns,)
>  endif
>  
>  # Make the headers define our internal stuff



_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

From minios-devel-bounces@lists.xenproject.org Thu Jun 25 15:49:32 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 25 Jun 2015 15:49:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z89P8-0007YA-Rq; Thu, 25 Jun 2015 15:49:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <prvs=611ba0aa7=Ian.Campbell@citrix.com>)
	id 1Z89P7-0007Y1-H6
	for Minios-devel@lists.xenproject.org; Thu, 25 Jun 2015 15:49:29 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	41/52-02952-8032C855; Thu, 25 Jun 2015 15:49:28 +0000
X-Env-Sender: prvs=611ba0aa7=Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1435247366!19764262!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n,
	received_headers: No Received headers
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31264 invoked from network); 25 Jun 2015 15:49:28 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-12.tower-31.messagelabs.com with RC4-SHA encrypted SMTP;
	25 Jun 2015 15:49:28 -0000
X-IronPort-AV: E=Sophos;i="5.13,677,1427760000"; d="scan'208";a="275610246"
Message-ID: <1435247348.32500.98.camel@citrix.com>
From: Ian Campbell <ian.campbell@citrix.com>
To: Thomas Leonard <talex5@gmail.com>
Date: Thu, 25 Jun 2015 16:49:08 +0100
In-Reply-To: <1435240089-23413-2-git-send-email-talex5@gmail.com>
References: <1435240089-23413-1-git-send-email-talex5@gmail.com>
	<1435240089-23413-2-git-send-email-talex5@gmail.com>
X-Mailer: Evolution 3.12.9-1+b1 
MIME-Version: 1.0
X-DLP: MIA1
Cc: Dave.Scott@eu.citrix.com, anil@recoil.org, karim.allah.ahmed@gmail.com,
	stefano.stabellini@eu.citrix.com,
	Minios-devel@lists.xenproject.org, samuel.thibault@ens-lyon.org
Subject: Re: [Minios-devel] [PATCH ARM v9 1/3] mini-os: fix compiling with
	debug=n
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org

On Thu, 2015-06-25 at 14:48 +0100, Thomas Leonard wrote:
> Without -fno-tree-loop-distribute-patterns, gcc -O3 recognises that our
> "memset" is doing a memset operation and tries to make it call the
> standard "memset", creating a loop.

Isn't this what -nostdlib and such like are for?

In any case if we are to go down this route I think we'd be better off
applying it only to lib/string.c or even better just to the memset
function, if there is a way to do that.

> 
> Signed-off-by: Thomas Leonard <talex5@gmail.com>
> ---
>  minios.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/minios.mk b/minios.mk
> index e042027..41023e9 100644
> --- a/minios.mk
> +++ b/minios.mk
> @@ -23,7 +23,7 @@ DEF_CFLAGS += -g
>  #DEF_CFLAGS += -DGNT_DEBUG
>  #DEF_CFLAGS += -DGNTMAP_DEBUG
>  else
> -DEF_CFLAGS += -O3
> +DEF_CFLAGS += -O3 $(call cc-option,$(CC),-fno-tree-loop-distribute-patterns,)
>  endif
>  
>  # Make the headers define our internal stuff



_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

From minios-devel-bounces@lists.xenproject.org Thu Jun 25 17:03:24 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 25 Jun 2015 17:03:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z8AYd-0007PP-4u; Thu, 25 Jun 2015 17:03:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <anil@recoil.org>) id 1Z8AYc-0007PG-EQ
	for Minios-devel@lists.xenproject.org; Thu, 25 Jun 2015 17:03:22 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	5E/A4-06457-9543C855; Thu, 25 Jun 2015 17:03:21 +0000
X-Env-Sender: anil@recoil.org
X-Msg-Ref: server-6.tower-31.messagelabs.com!1435251800!15418581!1
X-Originating-IP: [5.153.225.51]
X-SpamReason: No, hits=0.2 required=7.0 tests=RCVD_ILLEGAL_IP
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28787 invoked from network); 25 Jun 2015 17:03:20 -0000
Received: from bark.recoil.org (HELO bark.recoil.org) (5.153.225.51)
	by server-6.tower-31.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 25 Jun 2015 17:03:20 -0000
Received: from flick.office (volstagg-0.srg.cl.cam.ac.uk [128.232.32.232]);
	by bark.recoil.org (OpenSMTPD) with ESMTPSA id 9451944f;
	TLS version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO; 
	Thu, 25 Jun 2015 18:03:19 +0100 (BST)
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\))
From: Anil Madhavapeddy <anil@recoil.org>
In-Reply-To: <1435247348.32500.98.camel@citrix.com>
Date: Thu, 25 Jun 2015 18:03:19 +0100
Message-Id: <C9ECA08C-4E3C-4B9D-9F88-E1386E40FF20@recoil.org>
References: <1435240089-23413-1-git-send-email-talex5@gmail.com>
	<1435240089-23413-2-git-send-email-talex5@gmail.com>
	<1435247348.32500.98.camel@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
X-Mailer: Apple Mail (2.2098)
Cc: Thomas Leonard <talex5@gmail.com>, Dave.Scott@eu.citrix.com,
	stefano.stabellini@eu.citrix.com, karim.allah.ahmed@gmail.com,
	Minios-devel@lists.xenproject.org, samuel.thibault@ens-lyon.org
Subject: Re: [Minios-devel] [PATCH ARM v9 1/3] mini-os: fix compiling with
	debug=n
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org

On 25 Jun 2015, at 16:49, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> 
> On Thu, 2015-06-25 at 14:48 +0100, Thomas Leonard wrote:
>> Without -fno-tree-loop-distribute-patterns, gcc -O3 recognises that our
>> "memset" is doing a memset operation and tries to make it call the
>> standard "memset", creating a loop.
> 
> Isn't this what -nostdlib and such like are for?
> 
> In any case if we are to go down this route I think we'd be better off
> applying it only to lib/string.c or even better just to the memset
> function, if there is a way to do that.

I think -nostdlib is distinct from -fno-builtins.  If the issue is
convincing GCC to not replace the memset with a builtin one, would
-fno-builtin-memset be more appropriate here?

-anil


_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

From minios-devel-bounces@lists.xenproject.org Thu Jun 25 17:03:24 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 25 Jun 2015 17:03:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z8AYd-0007PP-4u; Thu, 25 Jun 2015 17:03:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <anil@recoil.org>) id 1Z8AYc-0007PG-EQ
	for Minios-devel@lists.xenproject.org; Thu, 25 Jun 2015 17:03:22 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	5E/A4-06457-9543C855; Thu, 25 Jun 2015 17:03:21 +0000
X-Env-Sender: anil@recoil.org
X-Msg-Ref: server-6.tower-31.messagelabs.com!1435251800!15418581!1
X-Originating-IP: [5.153.225.51]
X-SpamReason: No, hits=0.2 required=7.0 tests=RCVD_ILLEGAL_IP
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28787 invoked from network); 25 Jun 2015 17:03:20 -0000
Received: from bark.recoil.org (HELO bark.recoil.org) (5.153.225.51)
	by server-6.tower-31.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 25 Jun 2015 17:03:20 -0000
Received: from flick.office (volstagg-0.srg.cl.cam.ac.uk [128.232.32.232]);
	by bark.recoil.org (OpenSMTPD) with ESMTPSA id 9451944f;
	TLS version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO; 
	Thu, 25 Jun 2015 18:03:19 +0100 (BST)
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\))
From: Anil Madhavapeddy <anil@recoil.org>
In-Reply-To: <1435247348.32500.98.camel@citrix.com>
Date: Thu, 25 Jun 2015 18:03:19 +0100
Message-Id: <C9ECA08C-4E3C-4B9D-9F88-E1386E40FF20@recoil.org>
References: <1435240089-23413-1-git-send-email-talex5@gmail.com>
	<1435240089-23413-2-git-send-email-talex5@gmail.com>
	<1435247348.32500.98.camel@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
X-Mailer: Apple Mail (2.2098)
Cc: Thomas Leonard <talex5@gmail.com>, Dave.Scott@eu.citrix.com,
	stefano.stabellini@eu.citrix.com, karim.allah.ahmed@gmail.com,
	Minios-devel@lists.xenproject.org, samuel.thibault@ens-lyon.org
Subject: Re: [Minios-devel] [PATCH ARM v9 1/3] mini-os: fix compiling with
	debug=n
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org

On 25 Jun 2015, at 16:49, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> 
> On Thu, 2015-06-25 at 14:48 +0100, Thomas Leonard wrote:
>> Without -fno-tree-loop-distribute-patterns, gcc -O3 recognises that our
>> "memset" is doing a memset operation and tries to make it call the
>> standard "memset", creating a loop.
> 
> Isn't this what -nostdlib and such like are for?
> 
> In any case if we are to go down this route I think we'd be better off
> applying it only to lib/string.c or even better just to the memset
> function, if there is a way to do that.

I think -nostdlib is distinct from -fno-builtins.  If the issue is
convincing GCC to not replace the memset with a builtin one, would
-fno-builtin-memset be more appropriate here?

-anil


_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

From minios-devel-bounces@lists.xenproject.org Fri Jun 26 07:23:01 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 26 Jun 2015 07:23:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z8NyW-000174-Ty; Fri, 26 Jun 2015 07:23:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <prvs=612dc5eed=Ian.Campbell@citrix.com>)
	id 1Z8NyV-00016z-HO
	for Minios-devel@lists.xenproject.org; Fri, 26 Jun 2015 07:22:59 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	61/C0-23096-2DDFC855; Fri, 26 Jun 2015 07:22:58 +0000
X-Env-Sender: prvs=612dc5eed=Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1435303376!17021098!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n,
	received_headers: No Received headers
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12023 invoked from network); 26 Jun 2015 07:22:58 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-6.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Jun 2015 07:22:58 -0000
X-IronPort-AV: E=Sophos;i="5.13,683,1427760000"; d="scan'208";a="275840393"
Message-ID: <1435303373.17598.33.camel@citrix.com>
From: Ian Campbell <ian.campbell@citrix.com>
To: Anil Madhavapeddy <anil@recoil.org>
Date: Fri, 26 Jun 2015 08:22:53 +0100
In-Reply-To: <C9ECA08C-4E3C-4B9D-9F88-E1386E40FF20@recoil.org>
References: <1435240089-23413-1-git-send-email-talex5@gmail.com>
	<1435240089-23413-2-git-send-email-talex5@gmail.com>
	<1435247348.32500.98.camel@citrix.com>
	<C9ECA08C-4E3C-4B9D-9F88-E1386E40FF20@recoil.org>
Organization: Citrix
X-Mailer: Evolution 3.12.9-1+b1 
MIME-Version: 1.0
X-DLP: MIA2
Cc: Thomas Leonard <talex5@gmail.com>, Dave.Scott@eu.citrix.com,
	stefano.stabellini@eu.citrix.com, karim.allah.ahmed@gmail.com,
	Minios-devel@lists.xenproject.org, samuel.thibault@ens-lyon.org
Subject: Re: [Minios-devel] [PATCH ARM v9 1/3] mini-os: fix compiling with
 debug=n
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org

On Thu, 2015-06-25 at 18:03 +0100, Anil Madhavapeddy wrote:
> On 25 Jun 2015, at 16:49, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > 
> > On Thu, 2015-06-25 at 14:48 +0100, Thomas Leonard wrote:
> >> Without -fno-tree-loop-distribute-patterns, gcc -O3 recognises that our
> >> "memset" is doing a memset operation and tries to make it call the
> >> standard "memset", creating a loop.
> > 
> > Isn't this what -nostdlib and such like are for?
> > 
> > In any case if we are to go down this route I think we'd be better off
> > applying it only to lib/string.c or even better just to the memset
> > function, if there is a way to do that.
> 
> I think -nostdlib is distinct from -fno-builtins.  If the issue is
> convincing GCC to not replace the memset with a builtin one, would
> -fno-builtin-memset be more appropriate here?

Assuming that's a thing then yes, a bunch of
-fno-builtin-<specific-thing-we-provide> would be better than
-fno-builtins would be better than -nostdlib would be better than a
bunch of -fno-foo-optimisation to stop gcc generating builtin calls.

I'd assume that memset is just the first thing we've found and that
there might be other cases, e.g. memcpy which just aren't seeing yet, in
which case we might need a broad set of -fno-builtin-foo

Ideally the tweak would be applied with the smallest possible scope,
such that when compiling application code gcc can spot memset
opportunities and call the "builtin" which is actually the one provided
by mini-os. If it's more complicated than
__attribute__((no-builtin-memset)) on the function then it's probably
not worth losing too much sleep over though.

Ian.


_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

From minios-devel-bounces@lists.xenproject.org Fri Jun 26 07:23:01 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 26 Jun 2015 07:23:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z8NyW-000174-Ty; Fri, 26 Jun 2015 07:23:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <prvs=612dc5eed=Ian.Campbell@citrix.com>)
	id 1Z8NyV-00016z-HO
	for Minios-devel@lists.xenproject.org; Fri, 26 Jun 2015 07:22:59 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	61/C0-23096-2DDFC855; Fri, 26 Jun 2015 07:22:58 +0000
X-Env-Sender: prvs=612dc5eed=Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1435303376!17021098!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n,
	received_headers: No Received headers
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12023 invoked from network); 26 Jun 2015 07:22:58 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-6.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Jun 2015 07:22:58 -0000
X-IronPort-AV: E=Sophos;i="5.13,683,1427760000"; d="scan'208";a="275840393"
Message-ID: <1435303373.17598.33.camel@citrix.com>
From: Ian Campbell <ian.campbell@citrix.com>
To: Anil Madhavapeddy <anil@recoil.org>
Date: Fri, 26 Jun 2015 08:22:53 +0100
In-Reply-To: <C9ECA08C-4E3C-4B9D-9F88-E1386E40FF20@recoil.org>
References: <1435240089-23413-1-git-send-email-talex5@gmail.com>
	<1435240089-23413-2-git-send-email-talex5@gmail.com>
	<1435247348.32500.98.camel@citrix.com>
	<C9ECA08C-4E3C-4B9D-9F88-E1386E40FF20@recoil.org>
Organization: Citrix
X-Mailer: Evolution 3.12.9-1+b1 
MIME-Version: 1.0
X-DLP: MIA2
Cc: Thomas Leonard <talex5@gmail.com>, Dave.Scott@eu.citrix.com,
	stefano.stabellini@eu.citrix.com, karim.allah.ahmed@gmail.com,
	Minios-devel@lists.xenproject.org, samuel.thibault@ens-lyon.org
Subject: Re: [Minios-devel] [PATCH ARM v9 1/3] mini-os: fix compiling with
 debug=n
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org

On Thu, 2015-06-25 at 18:03 +0100, Anil Madhavapeddy wrote:
> On 25 Jun 2015, at 16:49, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > 
> > On Thu, 2015-06-25 at 14:48 +0100, Thomas Leonard wrote:
> >> Without -fno-tree-loop-distribute-patterns, gcc -O3 recognises that our
> >> "memset" is doing a memset operation and tries to make it call the
> >> standard "memset", creating a loop.
> > 
> > Isn't this what -nostdlib and such like are for?
> > 
> > In any case if we are to go down this route I think we'd be better off
> > applying it only to lib/string.c or even better just to the memset
> > function, if there is a way to do that.
> 
> I think -nostdlib is distinct from -fno-builtins.  If the issue is
> convincing GCC to not replace the memset with a builtin one, would
> -fno-builtin-memset be more appropriate here?

Assuming that's a thing then yes, a bunch of
-fno-builtin-<specific-thing-we-provide> would be better than
-fno-builtins would be better than -nostdlib would be better than a
bunch of -fno-foo-optimisation to stop gcc generating builtin calls.

I'd assume that memset is just the first thing we've found and that
there might be other cases, e.g. memcpy which just aren't seeing yet, in
which case we might need a broad set of -fno-builtin-foo

Ideally the tweak would be applied with the smallest possible scope,
such that when compiling application code gcc can spot memset
opportunities and call the "builtin" which is actually the one provided
by mini-os. If it's more complicated than
__attribute__((no-builtin-memset)) on the function then it's probably
not worth losing too much sleep over though.

Ian.


_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

From minios-devel-bounces@lists.xenproject.org Fri Jun 26 08:34:34 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 26 Jun 2015 08:34:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z8P5l-0005xC-Hg; Fri, 26 Jun 2015 08:34:33 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <prvs=612dc5eed=Ian.Campbell@citrix.com>)
	id 1Z8P5k-0005x6-Gq
	for Minios-devel@lists.xenproject.org; Fri, 26 Jun 2015 08:34:32 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	01/B8-29123-79E0D855; Fri, 26 Jun 2015 08:34:31 +0000
X-Env-Sender: prvs=612dc5eed=Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1435307669!19281939!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n,
	received_headers: No Received headers
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21796 invoked from network); 26 Jun 2015 08:34:31 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-16.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Jun 2015 08:34:31 -0000
X-IronPort-AV: E=Sophos;i="5.13,683,1427760000"; d="scan'208";a="275853076"
Message-ID: <1435307647.32500.133.camel@citrix.com>
From: Ian Campbell <ian.campbell@citrix.com>
To: <Minios-devel@lists.xenproject.org>
Date: Fri, 26 Jun 2015 09:34:07 +0100
X-Mailer: Evolution 3.12.9-1+b1 
MIME-Version: 1.0
X-DLP: MIA1
Subject: [Minios-devel] mini-os README
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org

The README file in mini-os.git is still written as if mini-os lived in
xen.git/extras/mini-os e.g. it has references to tools/fs-back (which
isn't even a thing in xen.git anymore!) and the stubdom/ directory.

Does someone who knows a bit more about how things stand today fancy
updating it a bit?

Ian.


_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

From minios-devel-bounces@lists.xenproject.org Fri Jun 26 08:34:34 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 26 Jun 2015 08:34:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z8P5l-0005xC-Hg; Fri, 26 Jun 2015 08:34:33 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <prvs=612dc5eed=Ian.Campbell@citrix.com>)
	id 1Z8P5k-0005x6-Gq
	for Minios-devel@lists.xenproject.org; Fri, 26 Jun 2015 08:34:32 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	01/B8-29123-79E0D855; Fri, 26 Jun 2015 08:34:31 +0000
X-Env-Sender: prvs=612dc5eed=Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1435307669!19281939!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n,
	received_headers: No Received headers
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21796 invoked from network); 26 Jun 2015 08:34:31 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-16.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Jun 2015 08:34:31 -0000
X-IronPort-AV: E=Sophos;i="5.13,683,1427760000"; d="scan'208";a="275853076"
Message-ID: <1435307647.32500.133.camel@citrix.com>
From: Ian Campbell <ian.campbell@citrix.com>
To: <Minios-devel@lists.xenproject.org>
Date: Fri, 26 Jun 2015 09:34:07 +0100
X-Mailer: Evolution 3.12.9-1+b1 
MIME-Version: 1.0
X-DLP: MIA1
Subject: [Minios-devel] mini-os README
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org

The README file in mini-os.git is still written as if mini-os lived in
xen.git/extras/mini-os e.g. it has references to tools/fs-back (which
isn't even a thing in xen.git anymore!) and the stubdom/ directory.

Does someone who knows a bit more about how things stand today fancy
updating it a bit?

Ian.


_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

From minios-devel-bounces@lists.xenproject.org Fri Jun 26 10:58:49 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 26 Jun 2015 10:58:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z8RLM-0007sU-Ql; Fri, 26 Jun 2015 10:58:48 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <prvs=612dc5eed=Ian.Campbell@citrix.com>)
	id 1Z8RLL-0007sB-01
	for minios-devel@lists.xenproject.org; Fri, 26 Jun 2015 10:58:47 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	41/D1-32406-6603D855; Fri, 26 Jun 2015 10:58:46 +0000
X-Env-Sender: prvs=612dc5eed=Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1435316324!20056996!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n,
	received_headers: No Received headers
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3112 invoked from network); 26 Jun 2015 10:58:45 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-8.tower-31.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Jun 2015 10:58:45 -0000
X-IronPort-AV: E=Sophos;i="5.13,684,1427760000"; d="scan'208";a="278848967"
From: Ian Campbell <ian.campbell@citrix.com>
To: <minios-devel@lists.xenproject.org>
Date: Fri, 26 Jun 2015 11:58:40 +0100
Message-ID: <1435316320-1811-1-git-send-email-ian.campbell@citrix.com>
X-Mailer: git-send-email 1.7.10.4
MIME-Version: 1.0
X-DLP: MIA2
Cc: samuel.thibault@ens-lyon.org, Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	Thomas Leonard <talex5@gmail.com>,
	Ian Campbell <ian.campbell@citrix.com>, xen-devel@lists.xen.org
Subject: [Minios-devel] [PATCH mini-os] Correct printf formatting for
	tpm_tis message.
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org

This is under #ifdef HAVE_LIBC so went unnoticed before.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 tpm_tis.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tpm_tis.c b/tpm_tis.c
index 98fe837..475ac5d 100644
--- a/tpm_tis.c
+++ b/tpm_tis.c
@@ -1429,7 +1429,7 @@ struct tpm_chip* init_tpm2_tis(unsigned long baseaddr, int localities, unsigned
 
             /* Map the page in now */
             if ((tpm->pages[i] = ioremap_nocache(addr, PAGE_SIZE)) == NULL) {
-                printk("Unable to map iomem page a address %p\n", addr);
+                printk("Unable to map iomem page a address %lx\n", addr);
                 goto abort_egress;
             }
 
-- 
1.7.10.4


_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

From minios-devel-bounces@lists.xenproject.org Fri Jun 26 10:58:49 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 26 Jun 2015 10:58:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z8RLM-0007sU-Ql; Fri, 26 Jun 2015 10:58:48 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <prvs=612dc5eed=Ian.Campbell@citrix.com>)
	id 1Z8RLL-0007sB-01
	for minios-devel@lists.xenproject.org; Fri, 26 Jun 2015 10:58:47 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	41/D1-32406-6603D855; Fri, 26 Jun 2015 10:58:46 +0000
X-Env-Sender: prvs=612dc5eed=Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1435316324!20056996!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n,
	received_headers: No Received headers
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3112 invoked from network); 26 Jun 2015 10:58:45 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-8.tower-31.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Jun 2015 10:58:45 -0000
X-IronPort-AV: E=Sophos;i="5.13,684,1427760000"; d="scan'208";a="278848967"
From: Ian Campbell <ian.campbell@citrix.com>
To: <minios-devel@lists.xenproject.org>
Date: Fri, 26 Jun 2015 11:58:40 +0100
Message-ID: <1435316320-1811-1-git-send-email-ian.campbell@citrix.com>
X-Mailer: git-send-email 1.7.10.4
MIME-Version: 1.0
X-DLP: MIA2
Cc: samuel.thibault@ens-lyon.org, Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	Thomas Leonard <talex5@gmail.com>,
	Ian Campbell <ian.campbell@citrix.com>, xen-devel@lists.xen.org
Subject: [Minios-devel] [PATCH mini-os] Correct printf formatting for
	tpm_tis message.
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org

This is under #ifdef HAVE_LIBC so went unnoticed before.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 tpm_tis.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tpm_tis.c b/tpm_tis.c
index 98fe837..475ac5d 100644
--- a/tpm_tis.c
+++ b/tpm_tis.c
@@ -1429,7 +1429,7 @@ struct tpm_chip* init_tpm2_tis(unsigned long baseaddr, int localities, unsigned
 
             /* Map the page in now */
             if ((tpm->pages[i] = ioremap_nocache(addr, PAGE_SIZE)) == NULL) {
-                printk("Unable to map iomem page a address %p\n", addr);
+                printk("Unable to map iomem page a address %lx\n", addr);
                 goto abort_egress;
             }
 
-- 
1.7.10.4


_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

From minios-devel-bounces@lists.xenproject.org Fri Jun 26 11:06:19 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 26 Jun 2015 11:06:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z8RSc-0000ih-Ua; Fri, 26 Jun 2015 11:06:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <prvs=612dc5eed=Ian.Campbell@citrix.com>)
	id 1Z8RSc-0000iE-0y
	for minios-devel@lists.xenproject.org; Fri, 26 Jun 2015 11:06:18 +0000
Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id
	F1/14-17050-9223D855; Fri, 26 Jun 2015 11:06:17 +0000
X-Env-Sender: prvs=612dc5eed=Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1435316774!15666101!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n,
	received_headers: No Received headers
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20864 invoked from network); 26 Jun 2015 11:06:16 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-31.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Jun 2015 11:06:16 -0000
X-IronPort-AV: E=Sophos;i="5.13,684,1427760000"; d="scan'208";a="278851171"
From: Ian Campbell <ian.campbell@citrix.com>
To: <xen-devel@lists.xen.org>
Date: Fri, 26 Jun 2015 12:06:09 +0100
Message-ID: <1435316769-5784-1-git-send-email-ian.campbell@citrix.com>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1435316320-1811-1-git-send-email-ian.campbell@citrix.com>
References: <1435316320-1811-1-git-send-email-ian.campbell@citrix.com>
MIME-Version: 1.0
X-DLP: MIA1
Cc: Thomas Leonard <talex5@gmail.com>, Ian Campbell <ian.campbell@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	minios-devel@lists.xenproject.org, samuel.thibault@ens-lyon.org,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>
Subject: [Minios-devel] [PATCH xen] stubdom: vtpmmgr: Correctly format
	size_t with %z when printing.
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org

Also contains a fix from Thomas Leonard (to use %u for "4 + 32", not
%lu) previously posted as part of "mini-os: enable compiler check for
printk format types" but with mini-os now having been split a separate
repo most of that change has been applied there.

This fixes the 32-bit build with updated mini-os which includes format
string checking.

Signed-off-by: Thomas Leonard <talex5@gmail.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
I intend to fold in an update to MINIOS_UPSTREAM_REVISION upon commit
to pull in the updated mini-os plus the "Correct printf formatting for
tpm_tis message." patch I've just posted.
---
 stubdom/vtpmmgr/disk_read.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/stubdom/vtpmmgr/disk_read.c b/stubdom/vtpmmgr/disk_read.c
index e9dc20f..944d3ff 100644
--- a/stubdom/vtpmmgr/disk_read.c
+++ b/stubdom/vtpmmgr/disk_read.c
@@ -548,18 +548,18 @@ int vtpm_load_disk(void)
 	TPM_read_pcrs();
 
 	printk("TPM Manager - disk format %d\n", TPM_MGR_VERSION);
-	printk(" root seal: %lu; sector of %d: %lu\n",
+	printk(" root seal: %zu; sector of %d: %zu\n",
 		sizeof(struct disk_root_sealed_data), SEALS_PER_ROOT_SEAL_LIST, sizeof(struct disk_seal_list));
-	printk(" root: %lu v=%lu\n", sizeof(root1), sizeof(root1.v));
-	printk(" itree: %lu; sector of %d: %lu\n",
+	printk(" root: %zu v=%zu\n", sizeof(root1), sizeof(root1.v));
+	printk(" itree: %u; sector of %d: %zu\n",
 		4 + 32, NR_ENTRIES_PER_ITREE, sizeof(struct disk_itree_sector));
-	printk(" group: %lu v=%lu id=%lu md=%lu\n",
+	printk(" group: %zu v=%zu id=%zu md=%zu\n",
 		sizeof(struct disk_group_sector), sizeof(struct disk_group_sector_mac3_area),
 		sizeof(struct group_id_data), sizeof(struct group_details));
-	printk(" group seal: %lu; %d in parent: %lu; sector of %d: %lu\n",
+	printk(" group seal: %zu; %d in parent: %zu; sector of %d: %zu\n",
 		sizeof(struct disk_group_sealed_data), NR_SEALS_PER_GROUP, sizeof(struct disk_group_boot_config_list),
 		SEALS_PER_GROUP_SEAL_LIST, sizeof(struct disk_group_seal_list));
-	printk(" vtpm: %lu+%lu; sector of %d: %lu\n",
+	printk(" vtpm: %zu+%zu; sector of %d: %zu\n",
 		sizeof(struct disk_vtpm_plain), sizeof(struct disk_vtpm_secret),
 		VTPMS_PER_SECTOR, sizeof(struct disk_vtpm_sector));
 
-- 
1.7.10.4


_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

From minios-devel-bounces@lists.xenproject.org Fri Jun 26 11:06:19 2015
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 26 Jun 2015 11:06:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1Z8RSc-0000ih-Ua; Fri, 26 Jun 2015 11:06:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <prvs=612dc5eed=Ian.Campbell@citrix.com>)
	id 1Z8RSc-0000iE-0y
	for minios-devel@lists.xenproject.org; Fri, 26 Jun 2015 11:06:18 +0000
Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id
	F1/14-17050-9223D855; Fri, 26 Jun 2015 11:06:17 +0000
X-Env-Sender: prvs=612dc5eed=Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1435316774!15666101!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n,
	received_headers: No Received headers
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20864 invoked from network); 26 Jun 2015 11:06:16 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-31.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Jun 2015 11:06:16 -0000
X-IronPort-AV: E=Sophos;i="5.13,684,1427760000"; d="scan'208";a="278851171"
From: Ian Campbell <ian.campbell@citrix.com>
To: <xen-devel@lists.xen.org>
Date: Fri, 26 Jun 2015 12:06:09 +0100
Message-ID: <1435316769-5784-1-git-send-email-ian.campbell@citrix.com>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1435316320-1811-1-git-send-email-ian.campbell@citrix.com>
References: <1435316320-1811-1-git-send-email-ian.campbell@citrix.com>
MIME-Version: 1.0
X-DLP: MIA1
Cc: Thomas Leonard <talex5@gmail.com>, Ian Campbell <ian.campbell@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	minios-devel@lists.xenproject.org, samuel.thibault@ens-lyon.org,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>
Subject: [Minios-devel] [PATCH xen] stubdom: vtpmmgr: Correctly format
	size_t with %z when printing.
X-BeenThere: minios-devel@lists.xenproject.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <http://lists.xenproject.org/cgi-bin/mailman/options/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel>,
	<mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: minios-devel-bounces@lists.xenproject.org
Errors-To: minios-devel-bounces@lists.xenproject.org

Also contains a fix from Thomas Leonard (to use %u for "4 + 32", not
%lu) previously posted as part of "mini-os: enable compiler check for
printk format types" but with mini-os now having been split a separate
repo most of that change has been applied there.

This fixes the 32-bit build with updated mini-os which includes format
string checking.

Signed-off-by: Thomas Leonard <talex5@gmail.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
I intend to fold in an update to MINIOS_UPSTREAM_REVISION upon commit
to pull in the updated mini-os plus the "Correct printf formatting for
tpm_tis message." patch I've just posted.
---
 stubdom/vtpmmgr/disk_read.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/stubdom/vtpmmgr/disk_read.c b/stubdom/vtpmmgr/disk_read.c
index e9dc20f..944d3ff 100644
--- a/stubdom/vtpmmgr/disk_read.c
+++ b/stubdom/vtpmmgr/disk_read.c
@@ -548,18 +548,18 @@ int vtpm_load_disk(void)
 	TPM_read_pcrs();
 
 	printk("TPM Manager - disk format %d\n", TPM_MGR_VERSION);
-	printk(" root seal: %lu; sector of %d: %lu\n",
+	printk(" root seal: %zu; sector of %d: %zu\n",
 		sizeof(struct disk_root_sealed_data), SEALS_PER_ROOT_SEAL_LIST, sizeof(struct disk_seal_list));
-	printk(" root: %lu v=%lu\n", sizeof(root1), sizeof(root1.v));
-	printk(" itree: %lu; sector of %d: %lu\n",
+	printk(" root: %zu v=%zu\n", sizeof(root1), sizeof(root1.v));
+	printk(" itree: %u; sector of %d: %zu\n",
 		4 + 32, NR_ENTRIES_PER_ITREE, sizeof(struct disk_itree_sector));
-	printk(" group: %lu v=%lu id=%lu md=%lu\n",
+	printk(" group: %zu v=%zu id=%zu md=%zu\n",
 		sizeof(struct disk_group_sector), sizeof(struct disk_group_sector_mac3_area),
 		sizeof(struct group_id_data), sizeof(struct group_details));
-	printk(" group seal: %lu; %d in parent: %lu; sector of %d: %lu\n",
+	printk(" group seal: %zu; %d in parent: %zu; sector of %d: %zu\n",
 		sizeof(struct disk_group_sealed_data), NR_SEALS_PER_GROUP, sizeof(struct disk_group_boot_config_list),
 		SEALS_PER_GROUP_SEAL_LIST, sizeof(struct disk_group_seal_list));
-	printk(" vtpm: %lu+%lu; sector of %d: %lu\n",
+	printk(" vtpm: %zu+%zu; sector of %d: %zu\n",
 		sizeof(struct disk_vtpm_plain), sizeof(struct disk_vtpm_secret),
 		VTPMS_PER_SECTOR, sizeof(struct disk_vtpm_sector));
 
-- 
1.7.10.4


_______________________________________________
Minios-devel mailing list
Minios-devel@lists.xenproject.org
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

