From: Jan Kiszka <jan.kis...@siemens.com>

There might be systems without it, and then we should still be able to
start the hypervisor and cells that are fine without it as well - such
as Linux.

Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>
---
 hypervisor/arch/x86/vcpu.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/hypervisor/arch/x86/vcpu.c b/hypervisor/arch/x86/vcpu.c
index 246ef31b..21da0592 100644
--- a/hypervisor/arch/x86/vcpu.c
+++ b/hypervisor/arch/x86/vcpu.c
@@ -91,10 +91,6 @@ int vcpu_cell_init(struct cell *cell)
        int err;
        u8 *b;
 
-       /* PM timer has to be provided */
-       if (system_config->platform_info.x86.pm_timer_address == 0)
-               return trace_error(-EINVAL);
-
        err = vcpu_vendor_cell_init(cell);
        if (err)
                return err;
@@ -124,11 +120,13 @@ int vcpu_cell_init(struct cell *cell)
                        *b |= ~*pio_bitmap;
        }
 
-       /* permit access to the PM timer */
+       /* permit access to the PM timer if there is any */
        pm_timer_addr = system_config->platform_info.x86.pm_timer_address;
-       for (n = 0; n < 4; n++, pm_timer_addr++) {
-               b = cell_iobm.data;
-               b[pm_timer_addr / 8] &= ~(1 << (pm_timer_addr % 8));
+       if (pm_timer_addr) {
+               for (n = 0; n < 4; n++, pm_timer_addr++) {
+                       b = cell_iobm.data;
+                       b[pm_timer_addr / 8] &= ~(1 << (pm_timer_addr % 8));
+               }
        }
 
        return 0;

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jailhouse-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to