From nobody Mon Apr 29 15:38:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) 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=1589192533; cv=none; d=zohomail.com; s=zohoarc; b=jeMvFzS+aZvJqtQ+0CeAlu0g4dveB2LPDaxi1l7UY6LYi3kiIeeSDDpL7x4JXTEsy5t7PUwkYt28mFQnOWPrXrWAmVNfPMJdQYoJkqB22NmWGNHHYF3pPrZWPOjCKaXbgKlF0L98NvO3VyxC9/Afnd0jJPJGX7MMweVCn6JZJMk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589192533; 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=g2zld2LujJUAUBSm0ebugxq/vRsF6l+xLAFkIUDCZT8=; b=PEUGfWnzr+61MuULqm/4f4h9xg0HDQVM2UF/fhiG7Dm5lTWsRx1Jhmck/PGheJenPnhxZEM79GrVp8To0cdKn9B+NjdqFiTE1Y8cTXOZKCG6tIRe6s85D6m61MrpJZtFrFRus6ZhVRBvT1vUypMRFkxPtaqHaMNs5cQVz8TpPk8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) 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 1589192533710402.7280171432625; Mon, 11 May 2020 03:22:13 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jY5ZM-0004Li-2Y; Mon, 11 May 2020 10:21:56 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jY5ZK-0004Ld-Kr for xen-devel@lists.xenproject.org; Mon, 11 May 2020 10:21:54 +0000 Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 3bae6d30-9371-11ea-b9cf-bc764e2007e4; Mon, 11 May 2020 10:21:53 +0000 (UTC) X-Inumbo-ID: 3bae6d30-9371-11ea-b9cf-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1589192514; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=c4qVm48SiE+9k82it/FvAxSBf0G4nzK3DjxTozoPa7Y=; b=ftww0LVqOinIxyw8+tPfkf8QpMg3X80ne0Z0SJ7ZQtqtjZy0lWV++5xw RUK+6WnNC0s2YC+9Q7DmL548+xoyapfOKwWZZJoc+gDWjANpnchOvEPV7 MyoScFKppun+NdaxXQCzYraI8WbMiCXckHCweWJG/JYgQSKsXp/8fWpSz 0=; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) 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 roger.pau@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa3.hc3370-68.iphmx.com: domain of roger.pau@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="roger.pau@citrix.com"; x-sender="roger.pau@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="roger.pau@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=roger.pau@citrix.com; spf=Pass smtp.mailfrom=roger.pau@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com; dmarc=pass (p=none dis=none) d=citrix.com IronPort-SDR: s3GUxM4AJt54wrwnnts09AYyXrm/w/IKEDf+Dtun/2y+h9eYhqDz29aWd1iyr1Tz55kF7xQoAR IJTZ/x81FD1aNKOxObvDlHutOQ+/QgJyTvlhrDdzRXO2mpkgDRt+6AOxRWOz+wen2Z/jq2ovWf mlSVTfCwyvjG6QmUTjpKrxZ8G36wU3p+UTQIe/zyVsBOjGkCz/Km2duT0Fc81us+p75qeTB/xx BpY0bcxzWHdDP12ks56kBufq4woQYwTtAWdBoANKAkNZRA44Wyy9gW+2fWkE+LBTy9GUTCEYfB YaQ= X-SBRS: 2.7 X-MesageID: 17192982 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.73,379,1583211600"; d="scan'208";a="17192982" From: Roger Pau Monne To: Subject: [PATCH] x86/mwait: remove unneeded local variables Date: Mon, 11 May 2020 12:21:28 +0200 Message-ID: <20200511102128.36840-1-roger.pau@citrix.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Andrew Cooper , Wei Liu , Jan Beulich , Roger Pau Monne Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Remove the eax and cstate local variables, the same can be directly fetched from acpi_processor_cx without any transformations. No functional change. Signed-off-by: Roger Pau Monn=C3=A9 Reviewed-by: Jan Beulich --- xen/arch/x86/cpu/mwait-idle.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c index bb017c488f..6d10ac32b8 100644 --- a/xen/arch/x86/cpu/mwait-idle.c +++ b/xen/arch/x86/cpu/mwait-idle.c @@ -721,7 +721,7 @@ static void mwait_idle(void) unsigned int cpu =3D smp_processor_id(); struct acpi_processor_power *power =3D processor_powers[cpu]; struct acpi_processor_cx *cx =3D NULL; - unsigned int eax, next_state, cstate; + unsigned int next_state; u64 before, after; u32 exp =3D 0, pred =3D 0, irq_traced[4] =3D { 0 }; =20 @@ -773,9 +773,6 @@ static void mwait_idle(void) if (cx->type >=3D 3 && errata_c6_eoi_workaround()) cx =3D power->safe_state; =20 - eax =3D cx->address; - cstate =3D ((eax >> MWAIT_SUBSTATE_SIZE) & MWAIT_CSTATE_MASK) + 1; - #if 0 /* XXX Can we/do we need to do something similar on Xen? */ /* * leave_mm() to avoid costly and often unnecessary wakeups @@ -785,7 +782,7 @@ static void mwait_idle(void) leave_mm(cpu); #endif =20 - if (!(lapic_timer_reliable_states & (1 << cstate))) + if (!(lapic_timer_reliable_states & (1 << cx->type))) lapic_timer_off(); =20 before =3D alternative_call(cpuidle_get_tick); @@ -794,7 +791,7 @@ static void mwait_idle(void) update_last_cx_stat(power, cx, before); =20 if (cpu_is_haltable(cpu)) - mwait_idle_with_hints(eax, MWAIT_ECX_INTERRUPT_BREAK); + mwait_idle_with_hints(cx->address, MWAIT_ECX_INTERRUPT_BREAK); =20 after =3D alternative_call(cpuidle_get_tick); =20 @@ -807,7 +804,7 @@ static void mwait_idle(void) update_idle_stats(power, cx, before, after); local_irq_enable(); =20 - if (!(lapic_timer_reliable_states & (1 << cstate))) + if (!(lapic_timer_reliable_states & (1 << cx->type))) lapic_timer_on(); =20 rcu_idle_exit(cpu); --=20 2.26.2