[PATCH] kvm: build: Make make sync get correct header files with latest Linux source
From: Xiantao Zhang [EMAIL PROTECTED] In latest linux repo, ia64, s390 and other archs moved header files from include/asm-$(ARCH)/ to arch/$(ARCH)/include/asm/, so this patch adds the compatibility for new source structure. Signed-off-by: Xiantao Zhang [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] diff --git a/kernel/Makefile b/kernel/Makefile index e5f43a2..6f8cc9d 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -36,7 +36,7 @@ hack-files = $(hack-files-$(ARCH_DIR)) all:: header-link prerequisite # include header priority 1) $LINUX 2) $KERNELDIR 3) include-compat $(MAKE) -C $(KERNELDIR) M=`pwd` \ - LINUXINCLUDE=-I`pwd`/include -Iinclude -I`pwd`/include-compat \ + LINUXINCLUDE=-I`pwd`/include -Iinclude -Iarch/${ARCH_DIR}/include -I`pwd`/include-compat \ -include include/linux/autoconf.h \ -include `pwd`/$(ARCH_DIR)/external-module-compat.h $$@ @@ -56,6 +56,9 @@ header-sync: $(LINUX)/./include/linux/kvm*.h \ $(LINUX)/./include/asm-*/kvm*.h \ $T/ + -rsync -R \ +$(LINUX)/arch/$(ARCH_DIR)/include/asm/./kvm*.h \ + $T/include/asm-$(ARCH_DIR)/ set -e for i in $(find $T -name '*.h'); do \ $(call unifdef,$$i); done diff --git a/kernel/ia64/Makefile.pre b/kernel/ia64/Makefile.pre index 033bdee..c55ea0f 100644 --- a/kernel/ia64/Makefile.pre +++ b/kernel/ia64/Makefile.pre @@ -20,4 +20,4 @@ asm-offsets.h: asm-offsets.s echo #endif) $ $@ asm-offsets.s: ia64/asm-offsets.c - gcc -S -D__KERNEL__ -I$(KERNELDIR)/include -I./include ia64/asm-offsets.c + gcc -S -D__KERNEL__ -I$(KERNELDIR)/include -I$(KERNELDIR)/arch/ia64/include -I./include ia64/asm-offsets.c -- To unsubscribe from this list: send the line unsubscribe kvm-commits in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] kvm: qemu: Handle tap fds with IFF_VNET_HDR
From: Mark McLoughlin [EMAIL PROTECTED] Allow users to pass an IFF_VNET_HDR tap fd via -net tap,fd=X by querying the fd with the recently added TUNGETIFF ioctl() to see if IFF_VNET_HDR has been enabled. Note: users wishing to pass an IFF_VNET_HDR tap fd to qemu should check both that a) this version of qemu can handle such an fd and b) that the TUNGETIFF ioctl() is available in the running kernel. Signed-off-by: Mark McLoughlin [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] diff --git a/qemu/vl.c b/qemu/vl.c index fc25739..24d54a0 100644 --- a/qemu/vl.c +++ b/qemu/vl.c @@ -4570,6 +4570,22 @@ void tap_using_vnet_hdr(void *opaque, int using_vnet_hdr) s-using_vnet_hdr = using_vnet_hdr != 0; } +static int tap_probe_vnet_hdr(int fd) +{ +#if defined(TUNGETIFF) defined(IFF_VNET_HDR) +struct ifreq ifr; + +if (ioctl(fd, TUNGETIFF, ifr) != 0) { + fprintf(stderr, TUNGETIFF ioctl() failed: %s\n, strerror(errno)); + return 0; +} + +return ifr.ifr_flags IFF_VNET_HDR; +#else +return 0; +#endif +} + #ifdef TUNSETOFFLOAD static void tap_set_offload(VLANClientState *vc, int csum, int tso4, int tso6, int ecn) @@ -5535,7 +5551,7 @@ int net_client_init(const char *device, const char *p) fd = strtol(buf, NULL, 0); fcntl(fd, F_SETFL, O_NONBLOCK); ret = -1; -if (net_tap_fd_init(vlan, fd, 0)) +if (net_tap_fd_init(vlan, fd, tap_probe_vnet_hdr(fd))) ret = 0; } else { if (get_param_value(ifname, sizeof(ifname), ifname, p) = 0) { -- To unsubscribe from this list: send the line unsubscribe kvm-commits in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] KVM: x86 emulator: remove bad ByteOp specifier from NEG descriptor
From: Avi Kivity [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c index 5d6c144..ae30435 100644 --- a/arch/x86/kvm/x86_emulate.c +++ b/arch/x86/kvm/x86_emulate.c @@ -270,7 +270,7 @@ static u16 group_table[] = { 0, 0, 0, 0, [Group3*8] = DstMem | SrcImm | ModRM, 0, - DstMem | SrcNone | ModRM, ByteOp | DstMem | SrcNone | ModRM, + DstMem | SrcNone | ModRM, DstMem | SrcNone | ModRM, 0, 0, 0, 0, [Group4*8] = ByteOp | DstMem | SrcNone | ModRM, ByteOp | DstMem | SrcNone | ModRM, -- To unsubscribe from this list: send the line unsubscribe kvm-commits in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] KVM: x86 emulator: remove duplicate SrcImm
From: roel kluin [EMAIL PROTECTED] Signed-off-by: Roel Kluin [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c index d5da7f1..5d6c144 100644 --- a/arch/x86/kvm/x86_emulate.c +++ b/arch/x86/kvm/x86_emulate.c @@ -269,7 +269,7 @@ static u16 group_table[] = { ByteOp | DstMem | SrcNone | ModRM, ByteOp | DstMem | SrcNone | ModRM, 0, 0, 0, 0, [Group3*8] = - DstMem | SrcImm | ModRM | SrcImm, 0, + DstMem | SrcImm | ModRM, 0, DstMem | SrcNone | ModRM, ByteOp | DstMem | SrcNone | ModRM, 0, 0, 0, 0, [Group4*8] = -- To unsubscribe from this list: send the line unsubscribe kvm-commits in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] KVM: Use .fixup instead of .text.fixup on __kvm_handle_fault_on_reboot
From: Eduardo Habkost [EMAIL PROTECTED] vmlinux.lds expects the fixup code to be on a section named .fixup. The .text.fixup section is not mentioned on vmlinux.lds, and is included on the resulting vmlinux (just after .text) only because of ld heuristics on placing orphan sections. However, placing .text.fixup outside .text breaks the definition of _etext, making it exclude the .text.fixup contents. That makes .text.fixup be ignored by the kernel initialization code that needs to know about section locations, such as the code setting page protection bits. Signed-off-by: Eduardo Habkost [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] diff --git a/include/asm-x86/kvm_host.h b/include/asm-x86/kvm_host.h index 1e28880..982b6b2 100644 --- a/include/asm-x86/kvm_host.h +++ b/include/asm-x86/kvm_host.h @@ -743,7 +743,7 @@ asmlinkage void kvm_handle_fault_on_reboot(void); #define __kvm_handle_fault_on_reboot(insn) \ 666: insn \n\t \ - .pushsection .text.fixup, \ax\ \n \ + .pushsection .fixup, \ax\ \n \ 667: \n\t \ __ASM_SIZE(push) $666b \n\t\ jmp kvm_handle_fault_on_reboot \n\t \ -- To unsubscribe from this list: send the line unsubscribe kvm-commits in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] KVM: MMU: Unify direct map 4K and large page paths
From: Avi Kivity [EMAIL PROTECTED] The two paths are equivalent except for one argument, which is already available. Merge the two codepaths. Signed-off-by: Avi Kivity [EMAIL PROTECTED] diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index be26b43..9b79c05 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -1237,15 +1237,10 @@ static int __direct_map(struct kvm_vcpu *vcpu, gpa_t v, int write, ASSERT(VALID_PAGE(table_addr)); table = __va(table_addr); - if (level == 1) { + if (level == 1 || (largepage level == 2)) { mmu_set_spte(vcpu, table[index], ACC_ALL, ACC_ALL, -0, write, 1, pt_write, 0, gfn, pfn, false); - return pt_write; - } - - if (largepage level == 2) { - mmu_set_spte(vcpu, table[index], ACC_ALL, ACC_ALL, -0, write, 1, pt_write, 1, gfn, pfn, false); +0, write, 1, pt_write, largepage, +gfn, pfn, false); return pt_write; } -- To unsubscribe from this list: send the line unsubscribe kvm-commits in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] KVM: MMU: Move SHADOW_PT_INDEX to mmu.c
From: Avi Kivity [EMAIL PROTECTED] It is not specific to the paging mode, so can be made global (and reusable). Signed-off-by: Avi Kivity [EMAIL PROTECTED] diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 3008279..be26b43 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -135,6 +135,8 @@ module_param(dbg, bool, 0644); #define ACC_USER_MASKPT_USER_MASK #define ACC_ALL (ACC_EXEC_MASK | ACC_WRITE_MASK | ACC_USER_MASK) +#define SHADOW_PT_INDEX(addr, level) PT64_INDEX(addr, level) + struct kvm_rmap_desc { u64 *shadow_ptes[RMAP_EXT]; struct kvm_rmap_desc *more; diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h index f72ac1f..e0d3103 100644 --- a/arch/x86/kvm/paging_tmpl.h +++ b/arch/x86/kvm/paging_tmpl.h @@ -29,7 +29,6 @@ #define PT_BASE_ADDR_MASK PT64_BASE_ADDR_MASK #define PT_DIR_BASE_ADDR_MASK PT64_DIR_BASE_ADDR_MASK #define PT_INDEX(addr, level) PT64_INDEX(addr, level) - #define SHADOW_PT_INDEX(addr, level) PT64_INDEX(addr, level) #define PT_LEVEL_MASK(level) PT64_LEVEL_MASK(level) #define PT_LEVEL_BITS PT64_LEVEL_BITS #ifdef CONFIG_X86_64 @@ -46,7 +45,6 @@ #define PT_BASE_ADDR_MASK PT32_BASE_ADDR_MASK #define PT_DIR_BASE_ADDR_MASK PT32_DIR_BASE_ADDR_MASK #define PT_INDEX(addr, level) PT32_INDEX(addr, level) - #define SHADOW_PT_INDEX(addr, level) PT64_INDEX(addr, level) #define PT_LEVEL_MASK(level) PT32_LEVEL_MASK(level) #define PT_LEVEL_BITS PT32_LEVEL_BITS #define PT_MAX_FULL_LEVELS 2 @@ -504,7 +502,6 @@ static void FNAME(prefetch_page)(struct kvm_vcpu *vcpu, #undef FNAME #undef PT_BASE_ADDR_MASK #undef PT_INDEX -#undef SHADOW_PT_INDEX #undef PT_LEVEL_MASK #undef PT_DIR_BASE_ADDR_MASK #undef PT_LEVEL_BITS -- To unsubscribe from this list: send the line unsubscribe kvm-commits in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
From: Avi Kivity [EMAIL PROTECTED] -- To unsubscribe from this list: send the line unsubscribe kvm-commits in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] KVM: MMU: Fix torn shadow pte
From: Avi Kivity [EMAIL PROTECTED] The shadow code assigns a pte directly in one place, which is nonatomic on i386 can can cause random memory references. Fix by using an atomic setter. Signed-off-by: Avi Kivity [EMAIL PROTECTED] diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h index e0d3103..ebb26a0 100644 --- a/arch/x86/kvm/paging_tmpl.h +++ b/arch/x86/kvm/paging_tmpl.h @@ -343,7 +343,7 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr, shadow_addr = __pa(shadow_page-spt); shadow_pte = shadow_addr | PT_PRESENT_MASK | PT_ACCESSED_MASK | PT_WRITABLE_MASK | PT_USER_MASK; - *shadow_ent = shadow_pte; + set_shadow_pte(shadow_ent, shadow_pte); } mmu_set_spte(vcpu, shadow_ent, access, walker-pte_access access, -- To unsubscribe from this list: send the line unsubscribe kvm-commits in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] Merge branch 'qemu-cvs'
From: Avi Kivity [EMAIL PROTECTED] Conflicts: qemu/console.h qemu/hw/pc.c qemu/hw/usb-uhci.c qemu/monitor.c qemu/vl.c Signed-off-by: Avi Kivity [EMAIL PROTECTED] -- To unsubscribe from this list: send the line unsubscribe kvm-commits in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] Revert generic-ipi: fix stack and rcu interaction bug in smp_call_function_mask(), fix
From: Avi Kivity [EMAIL PROTECTED] This reverts commit c2fc11985db304572322f1dcdcb0f71337315006. diff --git a/kernel/smp.c b/kernel/smp.c index 782e2b9..e6084f6 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -135,8 +135,7 @@ void generic_smp_call_function_interrupt(void) */ smp_wmb(); data-csd.flags = ~CSD_FLAG_WAIT; - } - if (data-csd.flags CSD_FLAG_ALLOC) + } else call_rcu(data-rcu_head, rcu_free_call_data); } rcu_read_unlock(); @@ -290,11 +289,10 @@ static void smp_call_function_mask_quiesce_stack(cpumask_t mask) data.func = quiesce_dummy; data.info = NULL; + data.flags = CSD_FLAG_WAIT; - for_each_cpu_mask(cpu, mask) { - data.flags = CSD_FLAG_WAIT; + for_each_cpu_mask(cpu, mask) generic_exec_single(cpu, data); - } } /** @@ -373,7 +371,7 @@ int smp_call_function_mask(cpumask_t mask, void (*func)(void *), void *info, if (wait) { csd_flag_wait(data-csd); if (unlikely(slowpath)) - smp_call_function_mask_quiesce_stack(mask); + smp_call_function_mask_quiesce_stack(allbutself); } return 0; -- To unsubscribe from this list: send the line unsubscribe kvm-commits in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] Revert generic-ipi: fix stack and rcu interaction bug in smp_call_function_mask()
From: Avi Kivity [EMAIL PROTECTED] This reverts commit cc7a486cac78f6fc1a24e8cd63036bae8d2ab431. diff --git a/kernel/smp.c b/kernel/smp.c index e6084f6..96fc7c0 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -260,41 +260,6 @@ void __smp_call_function_single(int cpu, struct call_single_data *data) generic_exec_single(cpu, data); } -/* Dummy function */ -static void quiesce_dummy(void *unused) -{ -} - -/* - * Ensure stack based data used in call function mask is safe to free. - * - * This is needed by smp_call_function_mask when using on-stack data, because - * a single call function queue is shared by all CPUs, and any CPU may pick up - * the data item on the queue at any time before it is deleted. So we need to - * ensure that all CPUs have transitioned through a quiescent state after - * this call. - * - * This is a very slow function, implemented by sending synchronous IPIs to - * all possible CPUs. For this reason, we have to alloc data rather than use - * stack based data even in the case of synchronous calls. The stack based - * data is then just used for deadlock/oom fallback which will be very rare. - * - * If a faster scheme can be made, we could go back to preferring stack based - * data -- the data allocation/free is non-zero cost. - */ -static void smp_call_function_mask_quiesce_stack(cpumask_t mask) -{ - struct call_single_data data; - int cpu; - - data.func = quiesce_dummy; - data.info = NULL; - data.flags = CSD_FLAG_WAIT; - - for_each_cpu_mask(cpu, mask) - generic_exec_single(cpu, data); -} - /** * smp_call_function_mask(): Run a function on a set of other CPUs. * @mask: The set of cpus to run on. @@ -320,7 +285,6 @@ int smp_call_function_mask(cpumask_t mask, void (*func)(void *), void *info, cpumask_t allbutself; unsigned long flags; int cpu, num_cpus; - int slowpath = 0; /* Can deadlock when called with interrupts disabled */ WARN_ON(irqs_disabled()); @@ -342,16 +306,15 @@ int smp_call_function_mask(cpumask_t mask, void (*func)(void *), void *info, return smp_call_function_single(cpu, func, info, wait); } - data = kmalloc(sizeof(*data), GFP_ATOMIC); - if (data) { - data-csd.flags = CSD_FLAG_ALLOC; - if (wait) - data-csd.flags |= CSD_FLAG_WAIT; - } else { + if (!wait) { + data = kmalloc(sizeof(*data), GFP_ATOMIC); + if (data) + data-csd.flags = CSD_FLAG_ALLOC; + } + if (!data) { data = d; data-csd.flags = CSD_FLAG_WAIT; wait = 1; - slowpath = 1; } spin_lock_init(data-lock); @@ -368,11 +331,8 @@ int smp_call_function_mask(cpumask_t mask, void (*func)(void *), void *info, arch_send_call_function_ipi(mask); /* optionally wait for the CPUs to complete */ - if (wait) { + if (wait) csd_flag_wait(data-csd); - if (unlikely(slowpath)) - smp_call_function_mask_quiesce_stack(allbutself); - } return 0; } -- To unsubscribe from this list: send the line unsubscribe kvm-commits in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] Work around dhclient brokenness
On Fri, Aug 15, 2008 at 02:47:12PM -0500, Anthony Liguori wrote: +static void work_around_broken_dhclient(struct virtio_net_hdr *hdr, +const uint8_t *buf, size_t size) +{ +if ((hdr-flags VIRTIO_NET_HDR_F_NEEDS_CSUM) /* missing csum */ +(size 18 size 1500) /* normal sized MTU */ +(buf[12] == 0x08 buf[13] == 0x00) /* ethertype == IPv4 */ +(buf[23] == 17)) { /* ip.protocol == UDP */ +/* FIXME this cast is evil */ +net_checksum_calculate((uint8_t *)buf, size); If we're going to do this, how about just setting the checksum to zero? Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmVHI~} [EMAIL PROTECTED] Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] KVM: Qemu: Enable kvm/ia64's network.
Zhang, Xiantao wrote: Hi, Avi Please help to apply this patch. It will fix kvm/ia64's networking issue. Thanks Xiantao From fe6e28ce9295acba107438979fe6ead0d24f7e20 Mon Sep 17 00:00:00 2001 From: Xiantao Zhang [EMAIL PROTECTED] Date: Fri, 22 Aug 2008 17:14:15 +0800 Subject: [PATCH] KVM: Qemu: Enable kvm/ia64's network. kvm/ia64's IRQ may 16, but current Qemu can't support it. Here we implment a IRQ map function to solve this issue to enable its networking. Signed-off-by: Anthony Xu [EMAIL PROTECTED] Signed-off-by: Xiantao Zhang [EMAIL PROTECTED] --- qemu/hw/ipf.c | 24 qemu/hw/pci.c |9 + 2 files changed, 33 insertions(+), 0 deletions(-) diff --git a/qemu/hw/ipf.c b/qemu/hw/ipf.c index b11e328..ffa7843 100644 --- a/qemu/hw/ipf.c +++ b/qemu/hw/ipf.c @@ -672,3 +672,27 @@ QEMUMachine ipf_machine = { ipf_init_pci, VGA_RAM_SIZE + VGA_RAM_SIZE, }; + +#define IOAPIC_NUM_PINS 48 + +static int ioapic_irq_count[IOAPIC_NUM_PINS]; + +int ioapic_map_irq(int devfn, int irq_num) +{ +int irq, dev; +dev = devfn 3; +irq = dev 2) + (dev 3) + irq_num) 31) + 16); +return irq; +} + +void ioapic_set_irq(void *opaque, int vector, int level) +{ +if( level ) if (level) +ioapic_irq_count[vector] += 1; +else +ioapic_irq_count[vector] -= 1; + +if (kvm_enabled()) + if (kvm_set_irq(vector, ioapic_irq_count[vector] == 0)) + return; +} Please move this to pci.c. This can be made to work for x86 too. diff --git a/qemu/hw/pci.c b/qemu/hw/pci.c index 92683d1..fac58c5 100644 --- a/qemu/hw/pci.c +++ b/qemu/hw/pci.c @@ -544,6 +544,15 @@ static void pci_set_irq(void *opaque, int irq_num, int level) return; pci_dev-irq_state[irq_num] = level; +#if defined(TARGET_IA64) +{ int irq; +extern int ioapic_map_irq(int devfn, int irq_num); +extern void ioapic_set_irq(void *opaque, int vector, int level); Use headers instead (or move the functions here). + +irq = ioapic_map_irq(pci_dev-devfn, irq_num); +ioapic_set_irq(NULL, irq, level); +} +#endif for (;;) { bus = pci_dev-bus; irq_num = bus-map_irq(pci_dev, irq_num); -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH] KVM: Qemu: Enable kvm/ia64's network.
Avi Kivity wrote: Zhang, Xiantao wrote: Hi, Avi Please help to apply this patch. It will fix kvm/ia64's networking issue. Thanks Xiantao From fe6e28ce9295acba107438979fe6ead0d24f7e20 Mon Sep 17 00:00:00 2001 From: Xiantao Zhang [EMAIL PROTECTED] Date: Fri, 22 Aug 2008 17:14:15 +0800 Subject: [PATCH] KVM: Qemu: Enable kvm/ia64's network. kvm/ia64's IRQ may 16, but current Qemu can't support it. Here we implment a IRQ map function to solve this issue to enable its networking. Signed-off-by: Anthony Xu [EMAIL PROTECTED] Signed-off-by: Xiantao Zhang [EMAIL PROTECTED] --- qemu/hw/ipf.c | 24 qemu/hw/pci.c |9 + 2 files changed, 33 insertions(+), 0 deletions(-) diff --git a/qemu/hw/ipf.c b/qemu/hw/ipf.c index b11e328..ffa7843 100644 --- a/qemu/hw/ipf.c +++ b/qemu/hw/ipf.c @@ -672,3 +672,27 @@ QEMUMachine ipf_machine = { ipf_init_pci, VGA_RAM_SIZE + VGA_RAM_SIZE, }; + +#define IOAPIC_NUM_PINS 48 + +static int ioapic_irq_count[IOAPIC_NUM_PINS]; + +int ioapic_map_irq(int devfn, int irq_num) +{ +int irq, dev; +dev = devfn 3; +irq = dev 2) + (dev 3) + irq_num) 31) + 16); + return irq; +} + +void ioapic_set_irq(void *opaque, int vector, int level) +{ +if( level ) if (level) +ioapic_irq_count[vector] += 1; +else +ioapic_irq_count[vector] -= 1; + +if (kvm_enabled()) +if (kvm_set_irq(vector, ioapic_irq_count[vector] == 0)) + return; +} Please move this to pci.c. This can be made to work for x86 too. So, we should change X86 bios's dsdt also ? Thanks Xiantao -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] KVM: Qemu: Enable kvm/ia64's network.
Zhang, Xiantao wrote: Please move this to pci.c. This can be made to work for x86 too. So, we should change X86 bios's dsdt also ? If you like. But I would also accept a patch that makes it conditional on ia64. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/2] KVM: Device assignemnt with VT-d
Amit Shah wrote: That only detects if the headers have the flag, not if the kernel actually supports it (and whether there is an iommu in the host). We need run-time detection. Which means we expose KVM_CAP_IOMMU only if one was detected? Yes. How to do this correctly? I don't know. Can't the VT-d api tell you if an iommu exists? -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: VT-d support for device assignment
Amit Shah wrote: So long as there is no potential for performance or security impact, having pvdma turned on automatically is better. We could still have dma=noparavirt to disable it. So we fail the hypercalls once the guest tries to contact us? Yes. Also don't expose the feature bit to the guest. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: VT-d support for device assignment
Muli Ben-Yehuda wrote: On Sat, Aug 23, 2008 at 12:33:46PM +0300, Avi Kivity wrote: So long as there is no potential for performance or security impact, having pvdma turned on automatically is better. We could still have dma=noparavirt to disable it. pvdma has advantages and disadvantages. It has a significant performance impact (compared to direct map) That needs to be fixed. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Booting ESXi from within KVM
Ian Kirk wrote: Having given up getting normal ESX booting from within KVM, I thought i'd give ESXi a go. PXE booting the hypervisor image outside of KVM I have working fine. When trying within KVM i had a few issues: The 'vmport' breaks ESXi, so for now I commented out vmport_init(); Then it complains about the CPU model_id, so I copy pasted it from my host. Now it gives an error that I don't quite understand: No pages allocated to Node 0 -- big mismatch between BIOS and SRAT memory maps, or MTRR error, or user removed all memory from a Node. Try checking memory or upgrading BIOS. Older kvm versions did not support mtrr properly. what kvm are you running? -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Booting ESXi from within KVM
Avi Kivity wrote: No pages allocated to Node 0 -- big mismatch between BIOS and SRAT memory maps, or MTRR error, or user removed all memory from a Node. Try checking memory or upgrading BIOS. Older kvm versions did not support mtrr properly. what kvm are you running? Pretty much the latest git version for testing purposes. I just re-tried with vanilla kvm-73, and after disabling vmport_init() and hardcoding the CPU model_id I get the same error/problem. Ian. -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH] KVM: Qemu: Enable kvm/ia64's network.
Hi, Avi Since x86 and IA-64's ioapic don't have same number of PINs. They have to use different map functions. Besides, we also need to modify x86's dsdt to meet the map, so in this patch, I just changed it for ia64 side, and didn't touch x86. Maybe x86 needs another patch. Please help to apply. Thanks Xiantao From d2bc9284cb659d120beb7dd224567f7a859d80ce Mon Sep 17 00:00:00 2001 From: Xiantao Zhang [EMAIL PROTECTED] Date: Mon, 25 Aug 2008 09:28:29 +0800 Subject: [PATCH] KVM: Qemu: Enable kvm/ia64's network. kvm/ia64's IRQ may 16, but current Qemu can't support it. Here we implment a IRQ map function to solve this issue to enable its networking. Signed-off-by: Anthony Xu [EMAIL PROTECTED] Signed-off-by: Xiantao Zhang [EMAIL PROTECTED] --- qemu/hw/ipf.c | 29 + qemu/hw/pci.c |5 + 2 files changed, 34 insertions(+), 0 deletions(-) diff --git a/qemu/hw/ipf.c b/qemu/hw/ipf.c index b11e328..134076a 100644 --- a/qemu/hw/ipf.c +++ b/qemu/hw/ipf.c @@ -672,3 +672,32 @@ QEMUMachine ipf_machine = { ipf_init_pci, VGA_RAM_SIZE + VGA_RAM_SIZE, }; + +#define IOAPIC_NUM_PINS 48 + +static int ioapic_irq_count[IOAPIC_NUM_PINS]; + +static int ioapic_map_irq(int devfn, int irq_num) +{ +int irq, dev; +dev = devfn 3; +irq = dev 2) + (dev 3) + irq_num) 31) + 16); +return irq; +} + +void ioapic_set_irq(void *opaque, int irq_num, int level) +{ +int vector; + +PCIDevice *pci_dev = (PCIDevice *)opaque; +vector = ioapic_map_irq(pci_dev-devfn, irq_num); + +if (level) +ioapic_irq_count[vector] += 1; +else +ioapic_irq_count[vector] -= 1; + +if (kvm_enabled()) + if (kvm_set_irq(vector, ioapic_irq_count[vector] == 0)) + return; +} diff --git a/qemu/hw/pci.c b/qemu/hw/pci.c index 92683d1..07d37a8 100644 --- a/qemu/hw/pci.c +++ b/qemu/hw/pci.c @@ -544,6 +544,11 @@ static void pci_set_irq(void *opaque, int irq_num, int level) return; pci_dev-irq_state[irq_num] = level; + +#if defined(TARGET_IA64) +ioapic_set_irq(pci_dev, irq_num, level); +#endif + for (;;) { bus = pci_dev-bus; irq_num = bus-map_irq(pci_dev, irq_num); -- 1.5.1 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Avi Kivity Sent: Sunday, August 24, 2008 5:51 PM To: Zhang, Xiantao Cc: [EMAIL PROTECTED]; kvm@vger.kernel.org Subject: Re: [PATCH] KVM: Qemu: Enable kvm/ia64's network. Zhang, Xiantao wrote: Please move this to pci.c. This can be made to work for x86 too. So, we should change X86 bios's dsdt also ? If you like. But I would also accept a patch that makes it conditional on ia64. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html 0001-KVM-Qemu-Enable-kvm-ia64-s-network.patch Description: 0001-KVM-Qemu-Enable-kvm-ia64-s-network.patch
Re: [PATCH] Work around dhclient brokenness
On Wednesday 20 August 2008 01:05:55 Chris Wedgwood wrote: On Tue, Aug 19, 2008 at 07:10:44PM +1000, Rusty Russell wrote: We need both. CSUM2 is the new virtio-level feature. Perhaps that's what I'm misisng. How is this different to CSUM? Because current guests which say they can handle CSUM can't *really* handle it. That's the entire point. We need a new one, so that existing guests don't ack it (because they don't understand it), and new guests can ack it later. Hope that clarifies, Rusty. -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 2/2] KVM: Device assignemnt with VT-d
Avi Kivity wrote: Amit Shah wrote: That only detects if the headers have the flag, not if the kernel actually supports it (and whether there is an iommu in the host). We need run-time detection. Which means we expose KVM_CAP_IOMMU only if one was detected? Yes. How to do this correctly? I don't know. Can't the VT-d api tell you if an iommu exists? I think KVM_CAP_IOMMU is good. At the same time, there is only one iommu at most, and userspace doesn't care about the iommu model. It's easy to know whether an iommu exists. There is a VT-d api (intel_iommu_found()) to know if VT-d exists. Other iommu implementation can easily have this api too. Randy (Weidong) -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html