From nobody Wed Nov 12 07:09:45 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1568648272; cv=none; d=zoho.com; s=zohoarc; b=NzVAZjclbwFQwgKvV1UTB66cLjDmYnRc7hMjXGu8ibeAXkM0y54IlCYcyGAFSmrLtSRNmu43uDQKgdB7YPY3oWFjUqW1OQ7Pyk5wdWEIy1Okh+NQ+mKZVRSb96BLNfUJooZHmu0Z1eaJqNq2Tifmas8hSczuYebu2yFSfDnEY2w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568648272; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=YKW2Y+e7G2qkXzUR5XTC1dqXN0+JuqZwNXAZTTRmCi4=; b=Dlj2ETv5fHAvjjmyF8Za+3C2rpH3S6poRg272v+e66By09feBlqqe/JNfTnTetxFvbjrXIP2vqR4U9yHng1HFnycRT0MGoTAucsjVZ9yGAat9tz1OQ+o8ASWEsWOyz9kYDTzLDMJuE4iDwv4HCJq6WO0AcelUimb8jVEfMRnqlw= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1568648272182245.64559906076113; Mon, 16 Sep 2019 08:37:52 -0700 (PDT) Received: from localhost ([::1]:36000 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i9t4T-0002iG-EJ for importer@patchew.org; Mon, 16 Sep 2019 11:37:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53543) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i9sCl-0006FP-4T for qemu-devel@nongnu.org; Mon, 16 Sep 2019 10:42:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i9sCj-0007Ov-Lb for qemu-devel@nongnu.org; Mon, 16 Sep 2019 10:42:14 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:33082) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i9sCj-0007OY-Bi for qemu-devel@nongnu.org; Mon, 16 Sep 2019 10:42:13 -0400 Received: by mail-wr1-x431.google.com with SMTP id b9so5595624wrs.0 for ; Mon, 16 Sep 2019 07:42:13 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id i14sm17024298wra.78.2019.09.16.07.42.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Sep 2019 07:42:11 -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 :mime-version:content-transfer-encoding; bh=YKW2Y+e7G2qkXzUR5XTC1dqXN0+JuqZwNXAZTTRmCi4=; b=IvaP5gIBmrC/4DUFcqOpdwesGChREks7RykTzhC9l+jNXTo4CmivPXNAR+UfQDGEx0 QCAF7TAUaThkU/UFYsvCOJy7tmYJVxcb57iKFHiPeeupuXXRlauRS0g31LtqchHtCr5n znLuCZavB6zMklIe3ZCyFruG5MNTk4awBdF/KdIHssuwW42pA8tqMA1JtpZkx6uhdq9I ncKm5hiZ/5etsySPigPNxpBtPpdF17CZfIVycCKAkOMIQGekTHXTdIWDFVIzFG9mKTfd +PjApwLG/gmhzz3mtqrJZwWu0oudh7Z8cDP/cueONnWpEEy5Sq8bEEUJGJ7GYcXY3nDN NZVA== 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:mime-version:content-transfer-encoding; bh=YKW2Y+e7G2qkXzUR5XTC1dqXN0+JuqZwNXAZTTRmCi4=; b=GDa11oNTooSQQqTh5+nNvlcraWzhLhwoT1tXHh5RyYKuEQfrnfLZDdUoTWS0GIDZuG sjIjW+Tk6VQyQW2nDurg87cPWQOtxstUbjYwv/+Ll8pfsvVaV4eVaW1XgVaZiivaa4Pq a3jakFuC76YMzuyCA664hP6c14SpYtbdPJU1ro66xz4i17PvE2RIfki2NRfE1keOSMco YNm7ISyHfTgCFEZwMAvWeTpvVuIRL7HCU3HRzcepMwL3/ER2VBtft+ik/PqugkCAmCJg c6//q58KaQ19qcMAFTA82pxiqvhIkaoafZpZfJVK1z2ISQaJVlLVj8b/qpoiD80gt6zN E8zA== X-Gm-Message-State: APjAAAVPRgrMsm6TKMAmxNUtiMW5f5UAjqS3BEM3Gn687F10T2PnJWZn VMi4G9O3dAOh2gi0cPwQo8KZeb/P X-Google-Smtp-Source: APXvYqxLViKlkJ/7umDpDDZxbvo9fHqk33ZdOSOfARXpU4JgZaygykS70v50qIbZbrp30ogf+dkZyQ== X-Received: by 2002:a5d:694e:: with SMTP id r14mr152206wrw.34.1568644931756; Mon, 16 Sep 2019 07:42:11 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 16 Sep 2019 16:41:41 +0200 Message-Id: <1568644929-9124-2-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1568644929-9124-1-git-send-email-pbonzini@redhat.com> References: <1568644929-9124-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::431 Subject: [Qemu-devel] [PULL 01/29] i386/kvm: support guest access CORE cstate X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Wanpeng Li , Eduardo Habkost , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Wanpeng Li Allow guest reads CORE cstate when exposing host CPU power management capab= ilities to the guest. PKG cstate is restricted to avoid a guest to get the whole pa= ckage information in multi-tenant scenario. Cc: Eduardo Habkost Cc: Paolo Bonzini Cc: Radim Kr=C4=8Dm=C3=A1=C5=99 Signed-off-by: Wanpeng Li Message-Id: <1563154124-18579-1-git-send-email-wanpengli@tencent.com> Signed-off-by: Paolo Bonzini --- linux-headers/linux/kvm.h | 4 +++- target/i386/kvm.c | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h index c8423e7..18892d6 100644 --- a/linux-headers/linux/kvm.h +++ b/linux-headers/linux/kvm.h @@ -696,9 +696,11 @@ struct kvm_ioeventfd { #define KVM_X86_DISABLE_EXITS_MWAIT (1 << 0) #define KVM_X86_DISABLE_EXITS_HLT (1 << 1) #define KVM_X86_DISABLE_EXITS_PAUSE (1 << 2) +#define KVM_X86_DISABLE_EXITS_CSTATE (1 << 3) #define KVM_X86_DISABLE_VALID_EXITS (KVM_X86_DISABLE_EXITS_MWAIT = | \ KVM_X86_DISABLE_EXITS_HLT | \ - KVM_X86_DISABLE_EXITS_PAUSE) + KVM_X86_DISABLE_EXITS_PAUSE = | \ + KVM_X86_DISABLE_EXITS_CSTATE) =20 /* for KVM_ENABLE_CAP */ struct kvm_enable_cap { diff --git a/target/i386/kvm.c b/target/i386/kvm.c index 8023c67..3435fc4 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -2076,7 +2076,8 @@ int kvm_arch_init(MachineState *ms, KVMState *s) if (disable_exits) { disable_exits &=3D (KVM_X86_DISABLE_EXITS_MWAIT | KVM_X86_DISABLE_EXITS_HLT | - KVM_X86_DISABLE_EXITS_PAUSE); + KVM_X86_DISABLE_EXITS_PAUSE | + KVM_X86_DISABLE_EXITS_CSTATE); } =20 ret =3D kvm_vm_enable_cap(s, KVM_CAP_X86_DISABLE_EXITS, 0, --=20 1.8.3.1