Re: [PATCH v5 3/3] irqchip/loongson-eiointc: Add extioi virt extension support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 2024/8/11 上午4:46, Thomas Gleixner wrote:
On Mon, Aug 05 2024 at 15:35, Bibo Mao wrote:

Interrupts can be routed to maximal four virtual CPUs with one external
hardware interrupt. Add the extioi virt extension support so that
Interrupts can be routed to 256 vcpus on hypervisor mode.

interrupts .... 256 vCPUs in hypervisor mode.
will modify in next version.


  static int cpu_to_eio_node(int cpu)
  {
-	return cpu_logical_map(cpu) / CORES_PER_EIO_NODE;
+	int cores;
+
+	if (kvm_para_available() && kvm_para_has_feature(KVM_FEATURE_VIRT_EXTIOI))

Why isn't that kvm_para_available() check inside of
kvm_para_has_feature() instead of inflicting it on every usage site?
That's just error prone.
I had the same idea but not sure about it, it is to follow the implemantion of x86.

Yeap, it is better to put kvm_para_available() in function kvm_para_has_feature(), one api for caller is simple and enough.

Will do in next version.

+		cores = CORES_PER_VEIO_NODE;
+	else
+		cores = CORES_PER_EIO_NODE;
+	return cpu_logical_map(cpu) / cores;
  }

@@ -105,18 +144,24 @@ static int eiointc_set_irq_affinity(struct irq_data *d, const struct cpumask *af
@@ -140,17 +185,23 @@ static int eiointc_index(int node)
static int eiointc_router_init(unsigned int cpu)
  {
-	int i, bit;
-	uint32_t data;
-	uint32_t node = cpu_to_eio_node(cpu);
-	int index = eiointc_index(node);
+	uint32_t data, node;
+	int i, bit, cores, index;

Is it so hard to follow:

   https://www.kernel.org/doc/html/latest/process/maintainer-tip.html#variable-declarations

?
Sorry to have the same coding style issue for the second time. I am not familiar with it.

Will do in next version.

Regards
Bibo Mao

Thanks,

         tglx






[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux