[IA64] fix vtlb flush
authorIsaku Yamahata <yamahata@valinux.co.jp>
Wed, 13 Aug 2008 04:18:06 +0000 (13:18 +0900)
committerIsaku Yamahata <yamahata@valinux.co.jp>
Wed, 13 Aug 2008 04:18:06 +0000 (13:18 +0900)
Live migration with uninitialized vcpu will crash xen by null pointer.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
xen/arch/ia64/xen/vhpt.c

index 6e89f0d44fc569cedd59ee026f018ac1a284914e..525b76fc37fa960027c2e61433f4bf79454cd21e 100644 (file)
@@ -526,6 +526,8 @@ void flush_tlb_for_log_dirty(struct domain *d)
        /* NB. There is no race because all vcpus are paused. */
        if (is_hvm_domain(d)) {
                for_each_vcpu (d, v) {
+                       if (!v->is_initialised)
+                               continue;
                        /* XXX: local_flush_tlb_all is called redundantly */
                        thash_purge_all(v);
                }
@@ -533,6 +535,8 @@ void flush_tlb_for_log_dirty(struct domain *d)
                                        NULL, 1, 1);
        } else if (HAS_PERVCPU_VHPT(d)) {
                for_each_vcpu (d, v) {
+                       if (!v->is_initialised)
+                               continue;
                        vcpu_purge_tr_entry(&PSCBX(v,dtlb));
                        vcpu_purge_tr_entry(&PSCBX(v,itlb));
                        vcpu_vhpt_flush(v);