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 time services of EFI emulation

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [IA64] Fix time services of EFI emulation
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 15 Nov 2006 00:40:33 +0000
Delivery-date: Tue, 14 Nov 2006 16:41:58 -0800
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 awilliam@xxxxxxxxxxx
# Node ID e28beea6d2284f9123a3f54c7ca901bc01d90dd4
# Parent  3ac52066af814d8f2dee0c0467d641891753c96e
[IA64] Fix time services of EFI emulation

This patch serializes the execution of following efi.runtimes.
  - GetTime
  - SetTime
  - GetWakeTime
  - SetWakeTime

Linux/ia64 uses similar spinlocks in the EFI RTC driver.

Signed-off-by: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
---
 xen/arch/ia64/xen/fw_emul.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff -r 3ac52066af81 -r e28beea6d228 xen/arch/ia64/xen/fw_emul.c
--- a/xen/arch/ia64/xen/fw_emul.c       Fri Nov 10 11:44:38 2006 -0700
+++ b/xen/arch/ia64/xen/fw_emul.c       Fri Nov 10 12:03:19 2006 -0700
@@ -31,6 +31,8 @@
 #include <asm/uaccess.h>
 #include <xen/console.h>
 #include <xen/hypercall.h>
+
+static DEFINE_SPINLOCK(efi_time_services_lock);
 
 extern unsigned long running_on_sim;
 
@@ -445,7 +447,6 @@ efi_emulate_get_time(
        struct page_info *tc_page = NULL;
        efi_status_t status = 0;
 
-       //printk("efi_get_time(%016lx,%016lx) called\n", tv_addr, tc_addr);
        tv = efi_translate_domain_addr(tv_addr, fault, &tv_page);
        if (*fault != IA64_NO_FAULT)
                goto errout;
@@ -455,9 +456,9 @@ efi_emulate_get_time(
                        goto errout;
        }
 
-       //printk("efi_get_time(%016lx,%016lx) translated to xen virtual 
address\n", tv, tc);
+       spin_lock(&efi_time_services_lock);
        status = (*efi.get_time)((efi_time_t *) tv, (efi_time_cap_t *) tc);
-       //printk("efi_get_time returns %lx\n", status);
+       spin_unlock(&efi_time_services_lock);
 
 errout:
        if (tc_page != NULL)
@@ -483,7 +484,9 @@ efi_emulate_set_time(
        if (*fault != IA64_NO_FAULT)
                goto errout;
 
+       spin_lock(&efi_time_services_lock);
        status = (*efi.set_time)((efi_time_t *)tv);
+       spin_unlock(&efi_time_services_lock);
 
 errout:
        if (tv_page != NULL)
@@ -518,9 +521,11 @@ efi_emulate_get_wakeup_time(
        if (*fault != IA64_NO_FAULT)
                goto errout;
 
+       spin_lock(&efi_time_services_lock);
        status = (*efi.get_wakeup_time)((efi_bool_t *)enabled,
                                        (efi_bool_t *)pending,
                                        (efi_time_t *)tv);
+       spin_unlock(&efi_time_services_lock);
 
 errout:
        if (e_page != NULL)
@@ -551,8 +556,10 @@ efi_emulate_set_wakeup_time(
                        goto errout;
        }
 
+       spin_lock(&efi_time_services_lock);
        status = (*efi.set_wakeup_time)((efi_bool_t)enabled,
                                        (efi_time_t *)tv);
+       spin_unlock(&efi_time_services_lock);
 
 errout:
        if (tv_page != NULL)

_______________________________________________
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 time services of EFI emulation, Xen patchbot-unstable <=