Re: [kvm-devel] [1-5/17] Patch 1-10 of kvm/ia64 V2

From: Akio Takebe <takebe_akio_at_jp.fujitsu.com>
Date: 2007-12-21 18:07:06
Hi, Xiantao

I got reading kvm-ia64 started. :)
Which member is p2m table?

> [2/17] Add kvm-ia64.c to support kvm module on Itanium processors.
Some trivial comments.

+int kvm_arch_init(void *opaque)
+{
+	int r;
+	struct kvm_vmm_info *vmm_info = (struct kvm_vmm_info *)opaque;
+
+	if (kvm_vmm_info) {
+		printk(KERN_ERR "kvm: already loaded the other module!\n");
+		r = -EEXIST;
+		goto out;
+	}
+
+	r =  -ENOMEM;
extra white space.

+	kvm_vmm_info = kzalloc(sizeof(struct kvm_vmm_info), GFP_KERNEL);
+	if (!kvm_vmm_info)
+		goto out;
+
Can we get the message of shortage of memory by qemu?

+	if (!vti_cpu_has_kvm_support()) {
+		printk(KERN_ERR "kvm: no hardware support\n");
+		r = -EOPNOTSUPP;
+		goto out_free0;
+	}
+
We had better check vti support at the first.

+	kvm_hack_insert_tr();
+
+	if (kvm_alloc_vmm_area())
+		goto out_free0;
+
r = kvm_alloc_vmm_area() is better.

+	r = kvm_relocate_vmm(vmm_info, vmm_info->module);
+	if (r)
+		goto out_free1;
+
+	return 0;
+
+out_free1:
+	kvm_free_vmm_area();
+out_free0:
+	kfree(kvm_vmm_info);
+out:
+	return r;
+}
+
+void kvm_arch_exit(void)
+{
+	kvm_free_vmm_area();
+	kfree(kvm_vmm_info);
+	kvm_vmm_info = 0;
+}
kvm_vmm_info = (void *)0?

Best Regards,

Akio Takebe

-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Fri Dec 21 18:10:55 2007

This archive was generated by hypermail 2.1.8 : 2007-12-21 18:11:11 EST