From nobody Tue May 7 08:37:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1582554206; cv=none; d=zohomail.com; s=zohoarc; b=Awvw1rlTWztaDQ/H+uVA/EjPll1JhjuKZ+J4MQnOYrRdeOgffwbD2AsSSLiRUfc5Hpt2SGwY9deUGMhzWgyslMaF0MzVVnXf+RqIgQaAFYpbh+DR8TJ/KozckT3RG+wT7P7bwfonIs3GECEQ/QRzVENGxD3x/c2MJTSAO+VKyy0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582554206; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=+gbq3icVTj2qsdBkAIl3SPwbs9JXcGAosnUk8KD1Z4c=; b=eD1+855Bw4sK5MyH746KrsF6DHgU0isox8zgIscqO/faXReDk0UtRYr4RqFZ9fbof+G3gtBn8Gj0rZZHzdYS0CWEfu0hn9RKDJmQ2ZjdlnMc62LTrpey2p7qVRg5gqCFujnaxUYFjASdQG+hKQsqenT6E1uiX5oOkop09j3DpYU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1582554206583524.3622460169003; Mon, 24 Feb 2020 06:23:26 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j6Ed7-0007sE-BR; Mon, 24 Feb 2020 14:22:41 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j6Ed6-0007s4-3t for xen-devel@lists.xenproject.org; Mon, 24 Feb 2020 14:22:40 +0000 Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 1a61e61c-5711-11ea-8fc3-bc764e2007e4; Mon, 24 Feb 2020 14:22:39 +0000 (UTC) X-Inumbo-ID: 1a61e61c-5711-11ea-8fc3-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1582554159; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=PrTcGZjCfX4mw5/DeW/ZK38uM4L2M6blEk4voumThUc=; b=FyaAc0fB6Ayp8ljz+WS8YHVDXnMQcyy8GQ6KDJ4VgpbQmNL1OnAQhnFd Nj9LZSbaCe85Mg6ftgJQ0nFoXtwpAxaGcVMNB177fkYfSDNVh8UJlKSEo 5RJGOAxhSGN2/wcW7NPyTXQIG/2Wd+bJE3pIZPNTj+ZUXGGVzLgpxHTna s=; Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa3.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: a7inpJKr3okox+CK/vGhP/BoIQpaYDdFYxsjcyWkzXgGJOn2r7+29PtoQr7ri4hWqiLSYjZr3K MUkNha03yyZVTuJJo+4v7hW9DWDT3KQwHNhYxgSWOpyFYOUthDFZkG4Q4aYYNcPBW6wUzWz5xL tT7855oz0oj81KWt12YJQXxHl1kJHzdLI26+nGWCcEgZGcuH8zl+pOE7ZikLEMn/oWR6/0plGB 9yO4v4mQDf/5NbR5V17BY7yRNQ3vkykQcgbT+R8jh1P2anufQ4gD/Yx72v+CJ4f9edAOx/rWIq HFY= X-SBRS: 2.7 X-MesageID: 12890964 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.70,480,1574139600"; d="scan'208";a="12890964" From: Andrew Cooper To: Xen-devel Date: Mon, 24 Feb 2020 14:22:31 +0000 Message-ID: <20200224142231.31097-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] x86/msr: Drop {pv,hvm}_max_vcpu_msrs objects X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Andrew Cooper , Wei Liu , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) It turns out that these are unused, and we dup a type-dependent block of zeros. Use xzalloc() instead. Read/write MSRs are typically 0 to being with, and non-zero defaults would need dealing with at suitable INIT/RESET points (e.g. arch_vcpu_regs_init). Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich Reviewed-by: Roger Pau Monn=C3=A9 --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 --- xen/arch/x86/msr.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/xen/arch/x86/msr.c b/xen/arch/x86/msr.c index dd26c87758..3ebf777c53 100644 --- a/xen/arch/x86/msr.c +++ b/xen/arch/x86/msr.c @@ -35,9 +35,6 @@ struct msr_policy __read_mostly raw_msr_policy, __read_mostly hvm_max_msr_policy, __read_mostly pv_max_msr_policy; =20 -struct vcpu_msrs __read_mostly hvm_max_vcpu_msrs, - __read_mostly pv_max_vcpu_msrs; - static void __init calculate_raw_policy(void) { /* 0x000000ce MSR_INTEL_PLATFORM_INFO */ @@ -103,10 +100,7 @@ int init_domain_msr_policy(struct domain *d) =20 int init_vcpu_msr_policy(struct vcpu *v) { - struct domain *d =3D v->domain; - struct vcpu_msrs *msrs =3D - xmemdup(is_pv_domain(d) ? &pv_max_vcpu_msrs - : &hvm_max_vcpu_msrs); + struct vcpu_msrs *msrs =3D xzalloc(*msrs); =20 if ( !msrs ) return -ENOMEM; --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel