From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [Qemu-devel] [PATCH 2/2] Expose tsc deadline timer cpuid to guest Date: Fri, 09 Mar 2012 19:56:23 +0100 Message-ID: <4F5A5257.9060008@siemens.com> References: <4F0482D6.8080705@web.de> <4F060961.9050002@web.de> <4F0A099C.5040805@web.de> <4F4BBAEC.2040603@siemens.com> <4F55E39F.6020608@siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: "qemu-devel@nongnu.org" , Marcelo Tosatti , Avi Kivity , kvm , Alexey Zaytsev To: "Liu, Jinsong" Return-path: Received: from david.siemens.de ([192.35.17.14]:21584 "EHLO david.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758700Ab2CIS4g (ORCPT ); Fri, 9 Mar 2012 13:56:36 -0500 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 2012-03-09 19:27, Liu, Jinsong wrote: > Jan Kiszka wrote: >> On 2012-03-06 08:49, Liu, Jinsong wrote: >>> Jan, >>> >>> Any comments? I feel some confused about your point 'disable cpuid >>> feature for older machine types by default': are you planning a >>> common approach for this common issue, or, you just ask me a >>> specific solution for the tsc deadline timer case? >> >> I think a generic solution for this can be as simple as passing a >> feature exclusion mask to cpu_init. You could simple append a string >> of "-feature1,-feature2" to the cpu model that is specified on >> creation. And that string could be defined in the compat machine >> descriptions. Does this make sense? >> > > Jan, to prevent misunderstanding, I elaborate my understanding of your points below (if any misunderstanding please point out to me): > ===================== > Your target is, to migrate from A(old qemu) to B(new qemu) by > 1. at A: qemu-version-A [-cpu whatever] // currently the default machine type is pc-A > 2. at B: qemu-version-B -machine pc-A [-cpu whatever] -feature1 -feature2 > > B run new qemu-version-B (w/ new features 'feature1' and 'feature2'), but when B runs w/ compat '-machine pc-A', vm should not see 'feature1' and 'feature2', so commandline append string to cpu model '-cpu whatever -feature1 -feature2' to hidden new feature1 and feature2 to vm, hence vm can see same cpuid features (at B) as those at A (which means, no feature1, no feature2) > ===================== > > If my understanding of your thoughts is right, I think currently qemu has satisfied your target, code refer to > pc_cpus_init(cpu_model) > ...... > cpu_init(cpu_model) > --> cpu_x86_register(*env, cpu_model) > --> cpu_x86_find_by_name(*def, cpu_model) // parse '+/- features', generate feature masks plus_features... > // and minus_features...(this is feature exclusion masks you want) > I think your point 'define in the compat machine description' is unnecessary. The user would have to specify the new feature as exclusions *manually* on the command line if -machine pc-A doesn't inject them *automatically*. So it is necessary to enhance qemu in this regard. Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53270) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S64zS-00059r-V7 for qemu-devel@nongnu.org; Fri, 09 Mar 2012 13:56:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S64zR-0006rH-6a for qemu-devel@nongnu.org; Fri, 09 Mar 2012 13:56:34 -0500 Received: from david.siemens.de ([192.35.17.14]:19027) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S64zQ-0006r1-SX for qemu-devel@nongnu.org; Fri, 09 Mar 2012 13:56:33 -0500 Message-ID: <4F5A5257.9060008@siemens.com> Date: Fri, 09 Mar 2012 19:56:23 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <4F0482D6.8080705@web.de> <4F060961.9050002@web.de> <4F0A099C.5040805@web.de> <4F4BBAEC.2040603@siemens.com> <4F55E39F.6020608@siemens.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/2] Expose tsc deadline timer cpuid to guest List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Liu, Jinsong" Cc: Alexey Zaytsev , Marcelo Tosatti , "qemu-devel@nongnu.org" , kvm , Avi Kivity On 2012-03-09 19:27, Liu, Jinsong wrote: > Jan Kiszka wrote: >> On 2012-03-06 08:49, Liu, Jinsong wrote: >>> Jan, >>> >>> Any comments? I feel some confused about your point 'disable cpuid >>> feature for older machine types by default': are you planning a >>> common approach for this common issue, or, you just ask me a >>> specific solution for the tsc deadline timer case? >> >> I think a generic solution for this can be as simple as passing a >> feature exclusion mask to cpu_init. You could simple append a string >> of "-feature1,-feature2" to the cpu model that is specified on >> creation. And that string could be defined in the compat machine >> descriptions. Does this make sense? >> > > Jan, to prevent misunderstanding, I elaborate my understanding of your points below (if any misunderstanding please point out to me): > ===================== > Your target is, to migrate from A(old qemu) to B(new qemu) by > 1. at A: qemu-version-A [-cpu whatever] // currently the default machine type is pc-A > 2. at B: qemu-version-B -machine pc-A [-cpu whatever] -feature1 -feature2 > > B run new qemu-version-B (w/ new features 'feature1' and 'feature2'), but when B runs w/ compat '-machine pc-A', vm should not see 'feature1' and 'feature2', so commandline append string to cpu model '-cpu whatever -feature1 -feature2' to hidden new feature1 and feature2 to vm, hence vm can see same cpuid features (at B) as those at A (which means, no feature1, no feature2) > ===================== > > If my understanding of your thoughts is right, I think currently qemu has satisfied your target, code refer to > pc_cpus_init(cpu_model) > ...... > cpu_init(cpu_model) > --> cpu_x86_register(*env, cpu_model) > --> cpu_x86_find_by_name(*def, cpu_model) // parse '+/- features', generate feature masks plus_features... > // and minus_features...(this is feature exclusion masks you want) > I think your point 'define in the compat machine description' is unnecessary. The user would have to specify the new feature as exclusions *manually* on the command line if -machine pc-A doesn't inject them *automatically*. So it is necessary to enhance qemu in this regard. Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux