WARNING - OLD ARCHIVES

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

xen-ia64-devel

[Xen-ia64-devel] [PATCH] fix sal emulation.

To: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx, Yutaka Ezaki <yutaka.ezaki@xxxxxxxxxxxxxx>, Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>, Kazuhiro Suzuki <kaz@xxxxxxxxxxxxxx>
Subject: [Xen-ia64-devel] [PATCH] fix sal emulation.
From: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Date: Tue, 13 May 2008 17:49:55 +0900
Delivery-date: Tue, 13 May 2008 01:50:12 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.6i
[IA64] fix sal emulation.

fix sal emulation, SAL_SET_VECTORS, SAL_MC_SET_PARAMS.
It allowed any domains to change system wide state. But only
dom0 is able to change it.

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

diff -r dfe378c657e0 xen/arch/ia64/xen/fw_emul.c
--- a/xen/arch/ia64/xen/fw_emul.c       Fri May 09 17:50:37 2008 +0900
+++ b/xen/arch/ia64/xen/fw_emul.c       Tue May 13 17:30:18 2008 +0900
@@ -200,10 +200,15 @@
                                d->arch.sal_data->boot_rdv_r1 = in3;
                        }
                }
-               else
-               {
-                       if (in1 > sizeof(sal_vectors)/sizeof(sal_vectors[0])-1)
-                               BUG();
+               else if (current->domain == dom0){
+                       if (in1 >
+                           sizeof(sal_vectors)/sizeof(sal_vectors[0])-1) {
+                               gdprintk(XENLOG_DEBUG,
+                                        "SAL_SET_VECTORS invalid in1 %ld\n",
+                                        in1);
+                               status = -2;
+                               break;
+                       }
                        sal_vectors[in1].vector_type    = in1;
                        sal_vectors[in1].handler_addr1  = in2;
                        sal_vectors[in1].gp1            = in3;
@@ -211,6 +216,10 @@
                        sal_vectors[in1].handler_addr2  = in5;
                        sal_vectors[in1].gp2            = in6;
                        sal_vectors[in1].handler_len2   = in7;
+               } else {
+                       gdprintk(XENLOG_DEBUG, "NON-PRIV DOMAIN CALLED "
+                                "SAL_SET_VECTORS %ld\n", in1);
+                       status = -2;
                }
                break;
            case SAL_GET_STATE_INFO:
@@ -352,13 +361,25 @@
                printk("*** CALLED SAL_MC_RENDEZ.  IGNORED...\n");
                break;
            case SAL_MC_SET_PARAMS:
-               if (in1 > sizeof(sal_mc_params)/sizeof(sal_mc_params[0]))
-                       BUG();
-               sal_mc_params[in1].param_type   = in1;
-               sal_mc_params[in1].i_or_m       = in2;
-               sal_mc_params[in1].i_or_m_val   = in3;
-               sal_mc_params[in1].timeout      = in4;
-               sal_mc_params[in1].rz_always    = in5;
+               if (current->domain == dom0) {
+                       if (in1 > 
+                           sizeof(sal_mc_params) / sizeof(sal_mc_params[0])) {
+                               gdprintk(XENLOG_DEBUG,
+                                        "SAL_MC_SET_PARAMS invalid in1 %ld\n",
+                                        in1);
+                               status = -2;
+                               break;
+                       }
+                       sal_mc_params[in1].param_type   = in1;
+                       sal_mc_params[in1].i_or_m       = in2;
+                       sal_mc_params[in1].i_or_m_val   = in3;
+                       sal_mc_params[in1].timeout      = in4;
+                       sal_mc_params[in1].rz_always    = in5;
+               } else {
+                       gdprintk(XENLOG_DEBUG,
+                                "*** CALLED SAL_MC_SET_PARAMS. IGNORED...\n");
+                       status = -1; /* not implemented */
+               }
                break;
            case SAL_CACHE_FLUSH:
                if (1) {





-- 
yamahata

Attachment: fix-sal-emul.patch
Description: Text Data

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