From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lin Ming Subject: Re: [RFC PATCH] x86: Add a new physdev_op PHYSDEVOP_nr_irqs_gsi Date: Tue, 10 Apr 2012 23:50:08 +0800 Message-ID: <1334073008.9703.6.camel@hp6530s> References: <1334070786.5865.133.camel@hp6530s> <4F846EE3020000780007D0F7@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4F846EE3020000780007D0F7@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Konrad Rzeszutek Wilk , Xiantao Zhang , xen-devel List-Id: xen-devel@lists.xenproject.org On Tue, 2012-04-10 at 16:33 +0100, Jan Beulich wrote: > >>> On 10.04.12 at 17:13, Lin Ming wrote: > > This new physdev_op is added for Linux guest kernel to get the correct > > nr_irqs_gsi value. > > I'm not convinced this is really needed - the kernel can work out the > right number without any hypercall afaict. In Linux kernel: mp_register_ioapic(...): entries = io_apic_get_redir_entries(idx); gsi_cfg = mp_ioapic_gsi_routing(idx); gsi_cfg->gsi_base = gsi_base; gsi_cfg->gsi_end = gsi_base + entries - 1; /* * The number of IO-APIC IRQ registers (== #pins): */ ioapics[idx].nr_registers = entries; if (gsi_cfg->gsi_end >= gsi_top) gsi_top = gsi_cfg->gsi_end + 1; io_apic_get_redir_entries calls io_apic_read(), which returns wrong value(0xFFFFFFFF) on Xen Dom0 kernel. How can we get the correct gsi_top value, which is used to set nr_irqs_gsi, without hypercall? The problem here is we don't have a Xen version of io_apic_read in Linux kernel. Thanks, Lin Ming > > Jan