Skip to contentSkip to conversation

x86: Skip check apic_id_limit for Xen

PATCH In review Lan Tianyu 4 participants 9 messages Aug 16, 2017 – Oct 27, 2017

lore
Share & tools
lore

Lan Tianyu

author
#0 lore raw

PATCH 1/1 x86: Skip check apic_id_limit for Xen

Xen vIOMMU device model will be in Xen hypervisor. Skip vIOMMU check for Xen here when vcpu number is more than 255.

---
 hw/i386/pc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/i386/pc.c +1 -1
index 5943539..fc17885 100644
@@ -1260,7 +1260,7 @@ void pc_machine_done(Notifier *notifier, void *data)
         fw_cfg_modify_i16(pcms->fw_cfg, FW_CFG_NB_CPUS, pcms->boot_cpus);
     }
 
-    if (pcms->apic_id_limit > 255) {
+    if (pcms->apic_id_limit > 255 && !xen_enabled()) {
         IntelIOMMUState *iommu = INTEL_IOMMU_DEVICE(x86_iommu_get_default());
 
         if (!iommu || !iommu->x86_iommu.intr_supported ||
Signature · 7 lines
1.8.3.1


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#1 lore raw
Quoted 2 lines · Lan Tianyu

Xen vIOMMU device model will be in Xen hypervisor. Skip vIOMMU check for Xen here when vcpu number is more than 255.

I think you still need to do a check for vIOMMU being enabled.

Paolo

Quoted 11 lines
---
 hw/i386/pc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/i386/pc.c +0 -0
index 5943539..fc17885 100644

hw/i386/pc.c void pc_machine_done(Notifier *notifier, void *data) · line 1266

Quoted 8 lines
hw/i386/pc.c +1 -1
@@ -1260,7 +1260,7 @@ void pc_machine_done(Notifier *notifier, void *data)
         fw_cfg_modify_i16(pcms->fw_cfg, FW_CFG_NB_CPUS, pcms->boot_cpus);
     }
 
-    if (pcms->apic_id_limit > 255) {
+    if (pcms->apic_id_limit > 255 && !xen_enabled()) {
         IntelIOMMUState *iommu = INTEL_IOMMU_DEVICE(x86_iommu_get_default());
 
         if (!iommu || !iommu->x86_iommu.intr_supported ||

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

author
#2 lore raw
Quoted 5 lines · Paolo Bonzini
Quoted 2 lines · Lan Tianyu

Xen vIOMMU device model will be in Xen hypervisor. Skip vIOMMU check for Xen here when vcpu number is more than 255.

I think you still need to do a check for vIOMMU being enabled.

Yes, this will be done in the Xen tool stack and Qemu doesn't have such knowledge. Operations of create, destroy Xen vIOMMU will be done in the Xen tool stack.

Quoted 16 lines

Paolo

Quoted 13 lines
---
 hw/i386/pc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/i386/pc.c +0 -0
index 5943539..fc17885 100644
@@ -1260,7 +1260,7 @@ void pc_machine_done(Notifier *notifier, void *data)
         fw_cfg_modify_i16(pcms->fw_cfg, FW_CFG_NB_CPUS, pcms->boot_cpus);
     }
 
Quoted 7 lines

hw/i386/pc.c void pc_machine_done(Notifier *notifier, void *data) · line 1266

Quoted 6 lines
hw/i386/pc.c +1 -1
-    if (pcms->apic_id_limit > 255) {
+    if (pcms->apic_id_limit > 255 && !xen_enabled()) {
         IntelIOMMUState *iommu = INTEL_IOMMU_DEVICE(x86_iommu_get_default());
 
         if (!iommu || !iommu->x86_iommu.intr_supported ||

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#3 lore raw
Quoted 10 lines · Lan Tianyu
Quoted 5 lines · Paolo Bonzini
Quoted 2 lines · Lan Tianyu

Xen vIOMMU device model will be in Xen hypervisor. Skip vIOMMU check for Xen here when vcpu number is more than 255.

I think you still need to do a check for vIOMMU being enabled.

Yes, this will be done in the Xen tool stack and Qemu doesn't have such knowledge. Operations of create, destroy Xen vIOMMU will be done in the Xen tool stack.

Shouldn't we make QEMU have knowledge of the vIOMMU device, then? Won't QEMU need to know about it eventually?

Signature · 6 lines
Eduardo

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#4 lore raw
Quoted 8 lines · Eduardo Habkost
Quoted 5 lines
Quoted 1 line

I think you still need to do a check for vIOMMU being enabled.

Yes, this will be done in the Xen tool stack and Qemu doesn't have such knowledge. Operations of create, destroy Xen vIOMMU will be done in the Xen tool stack.

Shouldn't we make QEMU have knowledge of the vIOMMU device, then? Won't QEMU need to know about it eventually?

No, it actually makes sense since Xen hosts all system-wide interrupt sources outside QEMU, unlike KVM which only hosts the (per-CPU) local APIC.

Paolo

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

author
#5 lore raw
In reply to Eduardo Habkost
Quoted 6 lines · Eduardo Habkost
Quoted 5 lines · Lan Tianyu
Quoted 4 lines · Paolo Bonzini
Quoted 2 lines · Lan Tianyu

Xen vIOMMU device model will be in Xen hypervisor. Skip vIOMMU check for Xen here when vcpu number is more than 255.

Quoted 9 lines
Quoted 5 lines
Quoted 1 line

I think you still need to do a check for vIOMMU being enabled.

Yes, this will be done in the Xen tool stack and Qemu doesn't have such knowledge. Operations of create, destroy Xen vIOMMU will be done in the Xen tool stack.

Shouldn't we make QEMU have knowledge of the vIOMMU device, then? Won't QEMU need to know about it eventually?

Hi Eduardo:
Thanks for your review.
Xen has some guest modes which doesn't use Qemu and we tried to
make Xen vIOMMU framework compatible with all guest modes. So far, we are adding interrupt remapping function for Xen vIOMMU and find qemu doesn't need to know Xen vIOMMU. The check of vcpu number > 255 here will be done in Xen side and so skip the check in Qemu to avoid blocking Xen creating >255 vcpus.
We may make Qemu have knowledge of the vIOMMU device if it's
necessary when adding new function.

Signature · 7 lines
Best regards
Tianyu Lan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#6 lore raw
Quoted 17 lines · Lan Tianyu
Quoted 6 lines · Eduardo Habkost
Quoted 5 lines · Lan Tianyu
Quoted 4 lines · Paolo Bonzini
Quoted 2 lines · Lan Tianyu

Xen vIOMMU device model will be in Xen hypervisor. Skip vIOMMU check for Xen here when vcpu number is more than 255.

Quoted 9 lines
Quoted 5 lines
Quoted 1 line

I think you still need to do a check for vIOMMU being enabled.

Yes, this will be done in the Xen tool stack and Qemu doesn't have such knowledge. Operations of create, destroy Xen vIOMMU will be done in the Xen tool stack.

Shouldn't we make QEMU have knowledge of the vIOMMU device, then? Won't QEMU need to know about it eventually?

Quoted 10 lines

Hi Eduardo:
Thanks for your review.
Xen has some guest modes which doesn't use Qemu and we tried to
make Xen vIOMMU framework compatible with all guest modes. So far, we are adding interrupt remapping function for Xen vIOMMU and find qemu doesn't need to know Xen vIOMMU. The check of vcpu number > 255 here will be done in Xen side and so skip the check in Qemu to avoid blocking Xen creating >255 vcpus.
We may make Qemu have knowledge of the vIOMMU device if it's
necessary when adding new function.

I was expecting it to go through the PC tree, but I will queue it on x86-next instead.

Signature · 6 lines
Eduardo

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#7 lore raw
Quoted 29 lines · Eduardo Habkost
Quoted 17 lines · Lan Tianyu
Quoted 6 lines · Eduardo Habkost
Quoted 5 lines · Lan Tianyu
Quoted 4 lines · Paolo Bonzini
Quoted 2 lines · Lan Tianyu

Xen vIOMMU device model will be in Xen hypervisor. Skip vIOMMU check for Xen here when vcpu number is more than 255.

Quoted 9 lines
Quoted 5 lines
Quoted 1 line

I think you still need to do a check for vIOMMU being enabled.

Yes, this will be done in the Xen tool stack and Qemu doesn't have such knowledge. Operations of create, destroy Xen vIOMMU will be done in the Xen tool stack.

Shouldn't we make QEMU have knowledge of the vIOMMU device, then? Won't QEMU need to know about it eventually?

Quoted 10 lines

Hi Eduardo:
Thanks for your review.
Xen has some guest modes which doesn't use Qemu and we tried to
make Xen vIOMMU framework compatible with all guest modes. So far, we are adding interrupt remapping function for Xen vIOMMU and find qemu doesn't need to know Xen vIOMMU. The check of vcpu number > 255 here will be done in Xen side and so skip the check in Qemu to avoid blocking Xen creating >255 vcpus.
We may make Qemu have knowledge of the vIOMMU device if it's
necessary when adding new function.

Quoted 2 lines

I was expecting it to go through the PC tree, but I will queue it on x86-next instead.

I was waiting for an ack from you or Paolo as you participated in the discussion. But sure, go ahead

Quoted 2 lines
Signature · 1 line
Eduardo

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

author
#8 lore raw
Quoted 30 lines · Michael S. Tsirkin
Quoted 29 lines · Eduardo Habkost
Quoted 27 lines · Lan Tianyu
Quoted 6 lines · Eduardo Habkost
Quoted 5 lines · Lan Tianyu
Quoted 4 lines · Paolo Bonzini
Quoted 2 lines · Lan Tianyu

Xen vIOMMU device model will be in Xen hypervisor. Skip vIOMMU check for Xen here when vcpu number is more than 255.

Quoted 9 lines
Quoted 5 lines
Quoted 1 line

I think you still need to do a check for vIOMMU being enabled.

Yes, this will be done in the Xen tool stack and Qemu doesn't have such knowledge. Operations of create, destroy Xen vIOMMU will be done in the Xen tool stack.

Shouldn't we make QEMU have knowledge of the vIOMMU device, then? Won't QEMU need to know about it eventually?

Hi Eduardo:
Thanks for your review.
Xen has some guest modes which doesn't use Qemu and we tried to
make Xen vIOMMU framework compatible with all guest modes. So far, we are adding interrupt remapping function for Xen vIOMMU and find qemu doesn't need to know Xen vIOMMU. The check of vcpu number > 255 here will be done in Xen side and so skip the check in Qemu to avoid blocking Xen creating >255 vcpus.
We may make Qemu have knowledge of the vIOMMU device if it's
necessary when adding new function.

Quoted 8 lines
Quoted 2 lines

I was expecting it to go through the PC tree, but I will queue it on x86-next instead.

I was waiting for an ack from you or Paolo as you participated in the discussion. But sure, go ahead

Great. Thanks.

Signature · 7 lines
Best regards
Tianyu Lan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel