From nobody Fri Nov 29 03:45:21 2024 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1650988192; cv=none; d=zohomail.com; s=zohoarc; b=Pw71C2cJHk1z69JoD8KguZ5MJ3WE2jtyNU30vscsKc5KOp505nBpD02vOyQVoS9E/McJ7zExZ6nq1pdB+8L4y725aEVG8F4SMB7+yHH6i0zjmjjoOWvA3ZvskXXAXcAtXZ5aMwYn20K/d5SOr5pdHvTHf+muxGGLywJ/REAx0OY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650988192; h=Content-Type:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=tPv0CVXqU70KWoKIiR1mvzTdX3vbXAGSStsF5ep6zGY=; b=KJsBMc/mUeMjvgmvyHwTPXgfe4g/YaAl1iAgsDlExDDcyDOtpPj+TsE18ey0AOabiUntg7XR9e8IGXQ596EBFE0JM/QP3rjphD/spbeeljQp2uQGtMNYuvvNo4/c9oRhCuxOA8kYRphpbm+n19104EjlV7La6fEcNrS/IbYbHwQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1650988192428324.8064433659731; Tue, 26 Apr 2022 08:49:52 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.314033.531900 (Exim 4.92) (envelope-from ) id 1njNR9-0004fo-R1; Tue, 26 Apr 2022 15:49:11 +0000 Received: by outflank-mailman (output) from mailman id 314033.531900; Tue, 26 Apr 2022 15:49:11 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1njNR9-0004fh-Mt; Tue, 26 Apr 2022 15:49:11 +0000 Received: by outflank-mailman (input) for mailman id 314033; Tue, 26 Apr 2022 15:49:10 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1njNR8-0004fb-If for xen-devel@lists.xenproject.org; Tue, 26 Apr 2022 15:49:10 +0000 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [2607:f8b0:4864:20::1030]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 68b76703-c578-11ec-8fc2-03012f2f19d4; Tue, 26 Apr 2022 17:49:09 +0200 (CEST) Received: by mail-pj1-x1030.google.com with SMTP id iq10so5402519pjb.0 for ; Tue, 26 Apr 2022 08:49:09 -0700 (PDT) Received: from localhost ([118.33.58.98]) by smtp.gmail.com with ESMTPSA id p1-20020a056a000a0100b0050ac9c31b7esm17145655pfh.180.2022.04.26.08.49.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Apr 2022 08:49:07 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 68b76703-c578-11ec-8fc2-03012f2f19d4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=tPv0CVXqU70KWoKIiR1mvzTdX3vbXAGSStsF5ep6zGY=; b=aB1kcoPYNJrsemdnI8inT9YidIrM/5nIdL44JDIQccNsFCbrNEWYaIyRrG5mSJhnN9 m4mXbD5Zzqw8LeGt1WPhu5c5VFHR2Xkpgq2QABh5onREUcNyHmz8g463XzQty8vqnQiw xSCyxM9dzK+Cc0LjuThOinbSXcCneNFxccq4DbmGxm23yNoKpr4npFgBAEPPA/qXL9vB CoOi7CNa5q+8+RLdY9Epv8h48IcR+0FNoFbz4OryDAQlEQcPfgxq8D7ivwZ/aJ455iWY Glfr03/HhRVzJxeFs6cUQQS8RUU3EnsUrMYdHqotqXqHUIbAH9BRQ4Cq2RcPEU0/AGcH t/Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=tPv0CVXqU70KWoKIiR1mvzTdX3vbXAGSStsF5ep6zGY=; b=egZ6qOknP4/mzcksaaBVQAJm0PGeVprjifgleEVz3LqA4aP/TpuWPG2Q5uo9SzlHgb SzeoAS10qDX3LqHsBLnFGj28jm3zjjr+IjxPs8sR6+hszFZZ0h8l+AgVOjTeW3xUi6JK zWVtdcnjOpwC+hd+LjY4n2H1sjZjBpsM3aXMl6b26GgD5eCx6AqqU19B8QGIypBamexG p6gdWL7Hdarq1qJyaxCDqbEeeLR8+kgm7Lk41wX6teddGRQUxxHZAEWMPzQ99P8C1Dfw qEvzHfqTy8uMC0yq2YBD/neSX/o/qJAUOUKmnsyTOAPDOayTA844kXvszDmQh6a8NKfN pkBQ== X-Gm-Message-State: AOAM530jHdLUPtR0trusiunGQfyJVP8PrDgTtzTxNvSMpRYNS8eNf1+1 E8FbAUct1/YMurG9+6K2p24= X-Google-Smtp-Source: ABdhPJzJxmrVBJ8YNTOD/sZSY5ZT08VM8ql6hEsaUNdgvvYURMQnFOU3ghmv7F3FPWzOlLJpzlff5w== X-Received: by 2002:a17:902:da85:b0:15d:3a9a:aad1 with SMTP id j5-20020a170902da8500b0015d3a9aaad1mr2928463plx.113.1650988147963; Tue, 26 Apr 2022 08:49:07 -0700 (PDT) Date: Wed, 27 Apr 2022 00:49:04 +0900 From: Paran Lee To: Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk Cc: austindh.kim@gmail.com, xen-devel@lists.xenproject.org Subject: [PATCH v2] xen/arm: p2m_set_entry reuse mask variables Message-ID: <20220426154904.GA11482@DESKTOP-NK4TH6S.localdomain> MIME-Version: 1.0 Content-Disposition: inline X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1650988194620100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Reuse mask variables on order shift duplicated calculation. Signed-off-by: Paran Lee --- xen/arch/arm/p2m.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index 1d1059f7d2..cdb3b56aa1 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -1118,11 +1118,12 @@ int p2m_set_entry(struct p2m_domain *p2m, if ( rc ) break; =20 - sgfn =3D gfn_add(sgfn, (1 << order)); + mask =3D 1UL << order; + sgfn =3D gfn_add(sgfn, mask); if ( !mfn_eq(smfn, INVALID_MFN) ) - smfn =3D mfn_add(smfn, (1 << order)); + smfn =3D mfn_add(smfn, mask); =20 - nr -=3D (1 << order); + nr -=3D mask; } =20 return rc; --=20 2.25.1