From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46501) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJo3H-0004ey-JD for qemu-devel@nongnu.org; Fri, 06 Feb 2015 13:54:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YJo3G-0004a0-Jj for qemu-devel@nongnu.org; Fri, 06 Feb 2015 13:54:51 -0500 Received: from mail-qa0-x229.google.com ([2607:f8b0:400d:c00::229]:45226) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJo3G-0004Zr-FT for qemu-devel@nongnu.org; Fri, 06 Feb 2015 13:54:50 -0500 Received: by mail-qa0-f41.google.com with SMTP id bm13so12286489qab.0 for ; Fri, 06 Feb 2015 10:54:49 -0800 (PST) MIME-Version: 1.0 Date: Fri, 6 Feb 2015 10:54:49 -0800 Message-ID: From: Xin Tong Content-Type: text/plain; charset=UTF-8 Subject: [Qemu-devel] X86 cpuid reported feature List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU Developers I am wondering why QEMU requires host CPU to support a feature for a emulated CPU to support the same feature. say i want to support intel transactional memory. I put the CPUID_7_0_EBX_RTM flag in the haswell cpu feature list. However, why do i need to put the same flag into TCG_7_0_EBX_FEATURES in order to make sure its not filtered out. I do not think we need RTM on the host to support RTM on the guest. Thanks, Xin /* * Filters CPU feature words based on host availability of each feature. * * Returns: 0 if all flags are supported by the host, non-zero otherwise. */ static int x86_cpu_filter_features(X86CPU *cpu) { CPUX86State *env = &cpu->env; FeatureWord w; int rv = 0; for (w = 0; w < FEATURE_WORDS; w++) { uint32_t host_feat = x86_cpu_get_supported_feature_word(w, cpu->migratable); uint32_t requested_features = env->features[w]; env->features[w] &= host_feat; cpu->filtered_features[w] = requested_features & ~env->features[w]; if (cpu->filtered_features[w]) { if (cpu->check_cpuid || cpu->enforce_cpuid) { report_unavailable_features(w, cpu->filtered_features[w]); } rv = 1; } } return rv; }