All of lore.kernel.org
 help / color / mirror / Atom feed
From: aq <aquynh@gmail.com>
To: Stefan Berger <stefanb@us.ibm.com>
Cc: xen-devel <xen-devel@lists.xensource.com>
Subject: Re: [PATCH] fix broken ACM
Date: Thu, 23 Jun 2005 16:56:52 +0900	[thread overview]
Message-ID: <9cde8bff0506230056a11146a@mail.gmail.com> (raw)
In-Reply-To: <OFE2D4E0BF.95BE8F69-ON85257029.0016AE2B-85257029.0017A596@us.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 5213 bytes --]

On 6/23/05, Stefan Berger <stefanb@us.ibm.com> wrote:
> aq <aquynh@gmail.com> wrote on 06/22/2005 11:56:07 PM:
> 
> > On 6/23/05, Stefan Berger <stefanb@us.ibm.com> wrote:
> > > xen-devel-bounces@lists.xensource.com wrote on 06/22/2005 01:40:16 PM:
> > >
> > > > The latest change to ACM makes it fail to compile. This patch fixes
> the
> > > problem.
> > > >
> > > > Signed-off-by: Nguyen Anh Quynh <aquynh@gmail.com>
> > > >
> > > > $ diffstat acm.patch
> > > >  acm/acm_core.c          |   61 ---------------------
> > > >  include/acm/acm_hooks.h |  135
> > > ++++++++++++++++++++++++++++++++++--------------
> > > >  2 files changed, 96 insertions(+), 100 deletions(-)
> > > > [attachment "acm.patch" deleted by Stefan Berger/Watson/IBM]
> > >
> > > This patch seems to work for gcc 4.0.0 (FC4), but the resulting source
> > > does not compile with gcc 3.4.3 (FC3). I will try to find a common
> > > solution. I think the problem is related to gcc 3.4.3 having a limit
> on
> > > inline functions.
> >
> > it builds fine for me on gcc 3.3.5
> >
> > $ gcc -v
> > Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.5/specs
> > Configured with: ../src/configure -v
> > --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang
> > --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
> > --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared
> > --with-system-zlib --enable-nls --without-included-gettext
> > --enable-__cxa_atexit --enable-clocale=gnu --enable-debug
> > --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc
> > i486-linux
> > Thread model: posix
> > gcc version 3.3.5 (Debian 1:3.3.5-8ubuntu2)
> 
> It seems to be missing a couple of prototypes.
> 
> In file included from dom0_ops.c:22:
> /xen/xeno-unstable.bk/xen/include/acm/acm_hooks.h: In function `acm_init':
> /xen/xeno-unstable.bk/xen/include/acm/acm_hooks.h:359: warning: implicit
> declaration of function `acm_set_endian'
> /xen/xeno-unstable.bk/xen/include/acm/acm_hooks.h:364: warning: implicit
> declaration of function `acm_init_chwall_policy'
> /xen/xeno-unstable.bk/xen/include/acm/acm_hooks.h:366: error:
> `acm_chinesewall_ops' undeclared (first use in this function)
> /xen/xeno-unstable.bk/xen/include/acm/acm_hooks.h:366: error: (Each
> undeclared identifier is reported only once
> /xen/xeno-unstable.bk/xen/include/acm/acm_hooks.h:366: error: for each
> function it appears in.)
> /xen/xeno-unstable.bk/xen/include/acm/acm_hooks.h:368: error:
> `acm_null_ops' undeclared (first use in this function)
> /xen/xeno-unstable.bk/xen/include/acm/acm_hooks.h:372: warning: implicit
> declaration of function `acm_init_ste_policy'
> /xen/xeno-unstable.bk/xen/include/acm/acm_hooks.h:374: error:
> `acm_simple_type_enforcement_ops' undeclared (first use in this function)
> make[2]: *** [dom0_ops.o] Error 1
> make[2]: Leaving directory `/xen/xeno-unstable.bk/xen/common'
> make[1]: *** [/xen/xeno-unstable.bk/xen/xen] Error 2
> make[1]: Leaving directory `/xen/xeno-unstable.bk/xen'
> make: *** [xen] Error 2
> 
> 
> Once those are fixed the following happens:
> 
> ld   -m elf_i386  -T x86_32/xen.lds -N \
>     boot/x86_32.o /xen/xeno-unstable.bk/xen/common/common.o
> /xen/xeno-unstable.bk/xen/drivers/char/driver.o
> /xen/xeno-unstable.bk/xen/drivers/acpi/driver.o
> /xen/xeno-unstable.bk/xen/arch/x86/arch.o -o
> /xen/xeno-unstable.bk/xen/xen-syms
> /xen/xeno-unstable.bk/xen/common/common.o(.text+0x121a): In function
> `do_dom0_op':
> : undefined reference to `acm_primary_ops'
> /xen/xeno-unstable.bk/xen/common/common.o(.text+0x1246): In function
> `do_dom0_op':
> : undefined reference to `acm_secondary_ops'
> /xen/xeno-unstable.bk/xen/common/common.o(.text+0x126b): In function
> `do_dom0_op':
> : undefined reference to `acm_primary_ops'
> /xen/xeno-unstable.bk/xen/common/common.o(.text+0x1288): In function
> `do_dom0_op':
> : undefined reference to `acm_secondary_ops'
> /xen/xeno-unstable.bk/xen/common/common.o(.text+0x12b0): In function
> `do_dom0_op':
> : undefined reference to `acm_primary_ops'
> /xen/xeno-unstable.bk/xen/common/common.o(.text+0x12c0): In function
> `do_dom0_op':
> : undefined reference to `acm_secondary_ops'
> /xen/xeno-unstable.bk/xen/common/common.o(.text+0x12d7): In function
> `do_dom0_op':
> : undefined reference to `acm_free_domain_ssid'
> /xen/xeno-unstable.bk/xen/common/common.o(.text+0x134e): In function
> `do_dom0_op':
> : undefined reference to `acm_primary_ops'
> /xen/xeno-unstable.bk/xen/common/common.o(.text+0x1376): In function
> `do_dom0_op':
> : undefined reference to `acm_init_domain_ssid'
> [...]
> 

ok, i see the point. the problem is because i moved some codes
(acm_init() and acm_init_binary_policy()) to acm_hooks.h. now it seems
better to move them back. but it is weird that i got no problem with
gcc 3.3.5

could you please try again with the new patch below? 


Signed-off-by: Nguyen Anh Quynh <aquynh@gmail.com>

# diffstat acm3.patch 
 acm/acm_core.c          |    3 +
 include/acm/acm_hooks.h |   76 ++++++++++++++++++++++++------------------------
 2 files changed, 41 insertions(+), 38 deletions(-)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: acm3.patch --]
[-- Type: text/x-patch; name="acm3.patch", Size: 4709 bytes --]

===== xen/acm/acm_core.c 1.1 vs edited =====
--- 1.1/xen/acm/acm_core.c	2005-06-21 07:28:06 +09:00
+++ edited/xen/acm/acm_core.c	2005-06-23 16:53:17 +09:00
@@ -79,6 +79,8 @@
 	acm_bin_pol.secondary_binary_policy = secondary;
 }
 
+#if (ACM_USE_SECURITY_POLICY != ACM_NULL_POLICY)
+
 int
 acm_init(void)
 {
@@ -129,6 +131,7 @@
 	return ACM_OK;
 }
 
+#endif
 
 int
 acm_init_domain_ssid(domid_t id, ssidref_t ssidref)
===== xen/include/acm/acm_hooks.h 1.2 vs edited =====
--- 1.2/xen/include/acm/acm_hooks.h	2005-06-22 23:18:11 +09:00
+++ edited/xen/include/acm/acm_hooks.h	2005-06-23 16:30:48 +09:00
@@ -30,6 +30,44 @@
 #include <public/event_channel.h>
 #include <asm/current.h>
 
+struct acm_operations {
+    /* policy management functions (must always be defined!) */
+    int  (*init_domain_ssid)           (void **ssid, ssidref_t ssidref);
+    void (*free_domain_ssid)           (void *ssid);
+    int  (*dump_binary_policy)         (u8 *buffer, u16 buf_size);
+    int  (*set_binary_policy)          (u8 *buffer, u16 buf_size);
+    int  (*dump_statistics)            (u8 *buffer, u16 buf_size);
+    /* domain management control hooks (can be NULL) */
+    int  (*pre_domain_create)          (void *subject_ssid, ssidref_t ssidref);
+    void (*post_domain_create)         (domid_t domid, ssidref_t ssidref);
+    void (*fail_domain_create)         (void *subject_ssid, ssidref_t ssidref);
+    void (*post_domain_destroy)        (void *object_ssid, domid_t id);
+    /* event channel control hooks  (can be NULL) */
+    int  (*pre_eventchannel_unbound)      (domid_t id);
+    void (*fail_eventchannel_unbound)     (domid_t id);
+    int  (*pre_eventchannel_interdomain)  (domid_t id1, domid_t id2);
+    int  (*fail_eventchannel_interdomain) (domid_t id1, domid_t id2);
+    /* grant table control hooks (can be NULL)  */
+    int  (*pre_grant_map_ref)          (domid_t id);
+    void (*fail_grant_map_ref)         (domid_t id);
+    int  (*pre_grant_setup)            (domid_t id);
+    void (*fail_grant_setup)           (domid_t id);
+};
+
+/* global variables */
+extern struct acm_operations *acm_primary_ops;
+extern struct acm_operations *acm_secondary_ops;
+
+/* if ACM_TRACE_MODE defined, all hooks should
+ * print a short trace message */
+/* #define ACM_TRACE_MODE */
+
+#ifdef ACM_TRACE_MODE
+# define traceprintk(fmt, args...) printk(fmt,## args)
+#else
+# define traceprintk(fmt, args...)
+#endif
+
 #if (ACM_USE_SECURITY_POLICY == ACM_NULL_POLICY)
 
 static inline int acm_pre_dom0_op(dom0_op_t *op, void **ssid) 
@@ -51,20 +89,6 @@
 
 #else
 
-/* if ACM_TRACE_MODE defined, all hooks should
- * print a short trace message */
-/* #define ACM_TRACE_MODE */
-
-#ifdef ACM_TRACE_MODE
-# define traceprintk(fmt, args...) printk(fmt,## args)
-#else
-# define traceprintk(fmt, args...)
-#endif
-
-/* global variables */
-extern struct acm_operations *acm_primary_ops;
-extern struct acm_operations *acm_secondary_ops;
-
 /*********************************************************************
  * HOOK structure and meaning (justifies a few words about our model):
  * 
@@ -123,30 +147,6 @@
  *                                            sys-ops error
  *
  ********************************************************************/
-
-struct acm_operations {
-    /* policy management functions (must always be defined!) */
-    int  (*init_domain_ssid)           (void **ssid, ssidref_t ssidref);
-    void (*free_domain_ssid)           (void *ssid);
-    int  (*dump_binary_policy)         (u8 *buffer, u16 buf_size);
-    int  (*set_binary_policy)          (u8 *buffer, u16 buf_size);
-    int  (*dump_statistics)            (u8 *buffer, u16 buf_size);
-    /* domain management control hooks (can be NULL) */
-    int  (*pre_domain_create)          (void *subject_ssid, ssidref_t ssidref);
-    void (*post_domain_create)         (domid_t domid, ssidref_t ssidref);
-    void (*fail_domain_create)         (void *subject_ssid, ssidref_t ssidref);
-    void (*post_domain_destroy)        (void *object_ssid, domid_t id);
-    /* event channel control hooks  (can be NULL) */
-    int  (*pre_eventchannel_unbound)      (domid_t id);
-    void (*fail_eventchannel_unbound)     (domid_t id);
-    int  (*pre_eventchannel_interdomain)  (domid_t id1, domid_t id2);
-    int  (*fail_eventchannel_interdomain) (domid_t id1, domid_t id2);
-    /* grant table control hooks (can be NULL)  */
-    int  (*pre_grant_map_ref)          (domid_t id);
-    void (*fail_grant_map_ref)         (domid_t id);
-    int  (*pre_grant_setup)            (domid_t id);
-    void (*fail_grant_setup)           (domid_t id);
-};
 
 static inline int acm_pre_domain_create(void *subject_ssid, ssidref_t ssidref)
 {

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

  reply	other threads:[~2005-06-23  7:56 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-22 17:40 [PATCH] fix broken ACM aq
2005-06-22 17:51 ` Keir Fraser
2005-06-22 17:52   ` aq
2005-06-23  7:48     ` Keir Fraser
2005-06-23  8:04       ` aq
2005-06-23  8:14         ` Keir Fraser
2005-06-23  8:19           ` aq
2005-06-22 18:22   ` aq
2005-06-23  3:42 ` Stefan Berger
2005-06-23  3:56   ` aq
2005-06-23  4:18     ` Stefan Berger
2005-06-23  7:56       ` aq [this message]
2005-06-23 14:57         ` Stefan Berger
2005-06-23 15:16           ` Keir Fraser
2005-06-23 15:22             ` aq
2005-06-23 15:52               ` Keir Fraser
2005-06-23 22:06                 ` aq
2005-06-23 15:56               ` Stefan Berger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9cde8bff0506230056a11146a@mail.gmail.com \
    --to=aquynh@gmail.com \
    --cc=stefanb@us.ibm.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.