From nobody Sat Feb 7 06:55:28 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505826905612773.4924963494418; Tue, 19 Sep 2017 06:15:05 -0700 (PDT) Received: from localhost ([::1]:42783 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duIMi-0008Gp-II for importer@patchew.org; Tue, 19 Sep 2017 09:15:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60389) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duHfk-0004Yi-4B for qemu-devel@nongnu.org; Tue, 19 Sep 2017 08:30:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duHfd-0005hb-Rc for qemu-devel@nongnu.org; Tue, 19 Sep 2017 08:30:40 -0400 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]:35314) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1duHfd-0005gO-Kr for qemu-devel@nongnu.org; Tue, 19 Sep 2017 08:30:33 -0400 Received: by mail-wr0-x244.google.com with SMTP id n64so2147786wrb.2 for ; Tue, 19 Sep 2017 05:30:33 -0700 (PDT) Received: from 640k.lan (dynamic-adsl-78-12-246-117.clienti.tiscali.it. [78.12.246.117]) by smtp.gmail.com with ESMTPSA id k18sm1292878wmd.22.2017.09.19.05.30.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Sep 2017 05:30:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=CLTzrNxLT5YnrmEpoumhUtduGeJf6CIKe0iHcy/cHxE=; b=h4EeC97eMiRW9Un4SBDqxzpiYuOQ4ftELDbSPIN9HSY8SDcuKxt6lSJF0mBoNQM21Q 17gGI5EWvZ6KT7aqHBrfkLg1DlcOSKkYix4QiILwoc04Z+mRxnoJXW+OoZc3B5II/VvP JRrSsLwmHJ3kRwu6huNuRmlBKduqQSkRDHxynOeLzozYHanBt3wboAzc3Cc6r98a9dYA vfqdN1tm8E+GUN0cHVH9qczzT3/oWRNuI18jwNqgJAuch02lkEtPDXQVKgqY/LVxv22Q PQwq6V9IcM+Is83hic/7cTrl8rEpbF0jKcVtbwDya62RSY/YGhloQ/yWfyiyd45wN+BQ 1kSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=CLTzrNxLT5YnrmEpoumhUtduGeJf6CIKe0iHcy/cHxE=; b=I2cx4BdaHdGaPgxnImhiGQR8MK+JUXCxjpAz+26MI432uOSsKjYeNeUgHoovKKfgsn LElFxmPTkZ4sEYBvd5SJytP4MgvSM0SAiM3EhEmwml7u6XT+ybBjUKyWkSfaHkxKjmQZ 1fz8LKs7fY75xKNvMiwRXmH9R0pRFFsNOo9PxWLklQGPV8m2RcHU7VUReQE3G6RIUXY/ sc70FGyY4adRssFOUYusX3E1lJoInVsEpZVPNG0f4prplbVqrxh6XAM27fft0NDIGqQd SSLFcww7qUr51kc5B+9Meh+UoEuoqKod/hVOPylEQMmhAOloZCmkJ5FrdRmJ3cgZiqgY lLcw== X-Gm-Message-State: AHPjjUj+xuARJAlAa30qu9nNJ+tGlwkYFH4cWMstf6BB7ddKqhkLvRqG K1fBoJNaC7vaAVmG+V508yaFeqJd X-Google-Smtp-Source: AOwi7QCHJ3c+IpbLfHyOnYHHehxQhoChJx3S3f/nfJD/ejY4hsDwLplJnaKA0EgFGZ7cneCMymMKww== X-Received: by 10.223.174.214 with SMTP id y80mr1226526wrc.192.1505824232347; Tue, 19 Sep 2017 05:30:32 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 19 Sep 2017 14:29:32 +0200 Message-Id: <1505824179-21541-44-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1505824179-21541-1-git-send-email-pbonzini@redhat.com> References: <1505824179-21541-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::244 Subject: [Qemu-devel] [PULL 43/50] update-linux-headers: prepare for hyperv.h removal X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Roman Kagan Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Roman Kagan All definitions related to Hyper-V emulation are now taken from the QEMU own header, so the one imported from the kernel is no longer needed. Unfortunately it's included by kvm_para.h. So, until this is fixed in the kernel, teach the header harvesting script to substitute kernel's hyperv.h with a dummy. Signed-off-by: Roman Kagan Message-Id: <20170713201522.13765-3-rkagan@virtuozzo.com> Signed-off-by: Paolo Bonzini --- scripts/update-linux-headers.sh | 4 +++- target/i386/hyperv-proto.h | 3 +++ target/i386/kvm.c | 17 +++++------------ 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers= .sh index 2f906c4..ad80fe3 100755 --- a/scripts/update-linux-headers.sh +++ b/scripts/update-linux-headers.sh @@ -104,7 +104,9 @@ for arch in $ARCHLIST; do cp "$tmpdir/include/asm/unistd-common.h" "$output/linux-headers/as= m-arm/" fi if [ $arch =3D x86 ]; then - cp_portable "$tmpdir/include/asm/hyperv.h" "$output/include/standa= rd-headers/asm-x86/" + cat <<-EOF >"$output/include/standard-headers/asm-x86/hyperv.h" + /* this is a temporary placeholder until kvm_para.h stops includin= g it */ + EOF cp "$tmpdir/include/asm/unistd_32.h" "$output/linux-headers/asm-x8= 6/" cp "$tmpdir/include/asm/unistd_x32.h" "$output/linux-headers/asm-x= 86/" cp "$tmpdir/include/asm/unistd_64.h" "$output/linux-headers/asm-x8= 6/" diff --git a/target/i386/hyperv-proto.h b/target/i386/hyperv-proto.h index 1b3fa6e..cb4d7f2 100644 --- a/target/i386/hyperv-proto.h +++ b/target/i386/hyperv-proto.h @@ -34,6 +34,8 @@ #define HV_VP_INDEX_AVAILABLE (1u << 6) #define HV_RESET_AVAILABLE (1u << 7) #define HV_REFERENCE_TSC_AVAILABLE (1u << 9) +#define HV_ACCESS_FREQUENCY_MSRS (1u << 11) + =20 /* * HV_CPUID_FEATURES.EDX bits @@ -44,6 +46,7 @@ #define HV_CPU_DYNAMIC_PARTITIONING_AVAILABLE (1u << 3) #define HV_HYPERCALL_PARAMS_XMM_AVAILABLE (1u << 4) #define HV_GUEST_IDLE_STATE_AVAILABLE (1u << 5) +#define HV_FREQUENCY_MSRS_AVAILABLE (1u << 8) #define HV_GUEST_CRASH_MSR_AVAILABLE (1u << 10) =20 /* diff --git a/target/i386/kvm.c b/target/i386/kvm.c index 0498ab7..b1e32e9 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -639,21 +639,14 @@ static int hyperv_handle_properties(CPUState *cs) env->features[FEAT_HYPERV_EAX] |=3D HV_APIC_ACCESS_AVAILABLE; } if (cpu->hyperv_time) { -<<<<<<< HEAD - env->features[FEAT_HYPERV_EAX] |=3D HV_X64_MSR_HYPERCALL_AVAILABLE; - env->features[FEAT_HYPERV_EAX] |=3D HV_X64_MSR_TIME_REF_COUNT_AVAI= LABLE; - env->features[FEAT_HYPERV_EAX] |=3D HV_X64_MSR_REFERENCE_TSC_AVAIL= ABLE; - - if (has_msr_hv_frequencies && tsc_is_stable_and_known(env)) { - env->features[FEAT_HYPERV_EAX] |=3D HV_X64_ACCESS_FREQUENCY_MS= RS; - env->features[FEAT_HYPERV_EDX] |=3D - HV_FEATURE_FREQUENCY_MSRS_AVAILABLE; - } -=3D=3D=3D=3D=3D=3D=3D env->features[FEAT_HYPERV_EAX] |=3D HV_HYPERCALL_AVAILABLE; env->features[FEAT_HYPERV_EAX] |=3D HV_TIME_REF_COUNT_AVAILABLE; env->features[FEAT_HYPERV_EAX] |=3D HV_REFERENCE_TSC_AVAILABLE; ->>>>>>> hyperv: add header with protocol definitions + + if (has_msr_hv_frequencies && tsc_is_stable_and_known(env)) { + env->features[FEAT_HYPERV_EAX] |=3D HV_ACCESS_FREQUENCY_MSRS; + env->features[FEAT_HYPERV_EDX] |=3D HV_FREQUENCY_MSRS_AVAILABL= E; + } } if (cpu->hyperv_crash && has_msr_hv_crash) { env->features[FEAT_HYPERV_EDX] |=3D HV_GUEST_CRASH_MSR_AVAILABLE; --=20 1.8.3.1