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-changelog

[Xen-changelog] [xen-unstable] [IA64] fix sal emulation.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [IA64] fix sal emulation.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 20 May 2008 08:30:33 -0700
Delivery-date: Tue, 20 May 2008 08:31:42 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
# Date 1210828718 -32400
# Node ID b03e24f9c1d85e50fcd9cb07d8a517e7f6df2b9a
# Parent  f0737df2dee1150a19283fffb26c57e4b06f1874
[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>
---
 xen/arch/ia64/xen/fw_emul.c |   43 ++++++++++++++++++++++++++++++++-----------
 1 files changed, 32 insertions(+), 11 deletions(-)

diff -r f0737df2dee1 -r b03e24f9c1d8 xen/arch/ia64/xen/fw_emul.c
--- a/xen/arch/ia64/xen/fw_emul.c       Thu May 15 14:18:38 2008 +0900
+++ b/xen/arch/ia64/xen/fw_emul.c       Thu May 15 14:18:38 2008 +0900
@@ -200,10 +200,15 @@ sal_emulator (long index, unsigned long 
                                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_emulator (long index, unsigned long 
                        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 @@ sal_emulator (long index, unsigned long 
                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) {

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [IA64] fix sal emulation., Xen patchbot-unstable <=