From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH] Setup vcpu add/remove infrastructure, including madt bios_info and dsdt. Date: Fri, 22 Jan 2010 07:45:50 +0200 Message-ID: <20100122054549.GA2076@redhat.com> References: <20100121124426.GT5238@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "kvm@vger.kernel.org" , Avi Kivity To: "Liu, Jinsong" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:21767 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751206Ab0AVFpw (ORCPT ); Fri, 22 Jan 2010 00:45:52 -0500 Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Jan 22, 2010 at 10:15:44AM +0800, Liu, Jinsong wrote: > Gleb Natapov wrote: > > On Thu, Jan 21, 2010 at 07:48:23PM +0800, Liu, Jinsong wrote: > >>> From cb997030cba02e7e74a29b3d942aeba9808ed293 Mon Sep 17 00:00:00 > >>> 2001 > >> From: Liu, Jinsong > >> Date: Fri, 22 Jan 2010 03:18:46 +0800 > >> Subject: [PATCH] Setup vcpu add/remove infrastructure, > >> including madt bios_info and dsdt. > >> > >> 1. setup madt bios_info structure, so that static dsdt get > >> run-time madt info like checksum address, lapic address, > >> max cpu numbers, with least hardcode magic number > >> (realmode address of bios_info). > >> 2. setup vcpu add/remove dsdt infrastructure, including > >> processor related acpi objects and control methods. vcpu > >> add/remove will trigger SCI and then control method _L02. > >> By matching madt, vcpu number and add/remove action were > >> found, then by notify control method, it will notify OS > >> acpi driver. > >> > >> Signed-off-by: Liu, Jinsong > > It looks like AML code is a port of what we had in BOCHS bios with > > minor changes. Can you detail what is changed and why for easy review > > please? And this still doesn't work with Windows I assume. > > > > Yes, my work is based on BOCHS infrastructure, thanks BOCHS :) > I just change some minor points: > 1. explicitly define returen value of '_MAT' as 'buffer', otherwise some linux acpi driver (i.e. linux 2.6.30) would parse error which will handle it as 'integer' not 'buffer'; > 2. keep correct 'checksum' of madt when vcpu add/remove, otherwise it will report 'checksum error' when using acpi tools to get madt info if we add/remove vcpu; > 3. add '_EJ0' so that linux has acpi obj under /sys/devices/LNXSYSTM:00, which is need for vcpu remove; > 4. on Method(PRSC, 0), just scan 'xxx' vcpus that qemu get from cmdline para 'maxcpus=xxx', not all 256 vcpus, otherwise under some dsdt processor define, it will result error; What kind of errors? Qemu should never set bit over maxcpus in PRS. > 5. use 1 hardcode address bios_info structure to replace '0x514', so that it can transfer more madt info to dsdt; > > Thanks, > Jinsong -- Gleb.