From nobody Fri Nov 29 03:51:05 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=1650554326; cv=none; d=zohomail.com; s=zohoarc; b=lipmMTkrHOl1Pm9tCQiSC6TbnnCq4Lh+RlMTojQ6foSzw0M4OSQyJMhj08D/jjb5doaO3CnO8FMSkLC0tCrlK+eQwnEeqagsfiTlrhjcqCgawrU94PibL1f/k/22R9w6YmTEZUDEwBU1OkzNFMhvb0VarIl9+JlJSGtmFeugzzI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650554326; h=Content-Type:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=HwkPi7EESKLMHvB+8DbibUoGGrCc2TxwDdNOywmo7kg=; b=cibeYEH9JK9EhP/oIZOipxPEhgF1jbKAp841Kl9Ixx33u1/dHohAmRky87FF78m+BkIVflgITIr3N5W1YdqaHv58jruORGLO+/TaE4ICgkDxVD3jcEa2qBFLvzYex5JLSGGHC4FP1SQZM8RFlPmAHS/7ACXA9uogZoFuhkg/GYs= 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 1650554326084619.4951881963011; Thu, 21 Apr 2022 08:18:46 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.310303.527063 (Exim 4.92) (envelope-from ) id 1nhYZE-0005dp-1W; Thu, 21 Apr 2022 15:18:00 +0000 Received: by outflank-mailman (output) from mailman id 310303.527063; Thu, 21 Apr 2022 15:18:00 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nhYZD-0005di-UA; Thu, 21 Apr 2022 15:17:59 +0000 Received: by outflank-mailman (input) for mailman id 310303; Thu, 21 Apr 2022 15:17:59 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nhYZD-0005dc-4h for xen-devel@lists.xenproject.org; Thu, 21 Apr 2022 15:17:59 +0000 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [2607:f8b0:4864:20::431]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 39469e3c-c186-11ec-a405-831a346695d4; Thu, 21 Apr 2022 17:17:58 +0200 (CEST) Received: by mail-pf1-x431.google.com with SMTP id l127so5298590pfl.6 for ; Thu, 21 Apr 2022 08:17:58 -0700 (PDT) Received: from localhost ([118.33.58.98]) by smtp.gmail.com with ESMTPSA id p4-20020a637404000000b00375948e63d6sm22914548pgc.91.2022.04.21.08.17.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 08:17:56 -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: 39469e3c-c186-11ec-a405-831a346695d4 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=HwkPi7EESKLMHvB+8DbibUoGGrCc2TxwDdNOywmo7kg=; b=hK4FvLb45aaO/zXcX3H8e0CpOAQEFa9TXmt9bhMJLAXLaCeN7+3hwazClNZxzxmJyb jS1kx7TGn0WAYKme1U/l9ZdibGl2D20g5XMU5aJsz0opMoZectMCnpwcDa5uZrRpRTBV Q46+dtrgsXwKbAunlvcDXq+4l+OTRn8bmUQ5p4p0EnswcZfzXtz0uiUHrRK8LkyYiJ9X f1TyYn4ojuLoEb+vw743s0ET6fopOzBodWVaNsTSrROhb1Yr+jGjHP3XERZNYj9jldBl hB8LWcwb3G9Q56GWseTY2JfLw5ENajJbYCs8E3GRwbb2Q9ZGXnzRxYeOk7jzMFX9pEir U9lA== 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=HwkPi7EESKLMHvB+8DbibUoGGrCc2TxwDdNOywmo7kg=; b=iVtEUNvlSS+PncIduoltsjbVZzi8CQpmnPU1k3Rey+QM5MihMTw5Uab+laQsK1d3ZQ JHP2ojgQ5ggzxV7t3t9Q8Z8ktD2S8rt7SRgo6dxVGZoUazC0D055QbZWsGCaIo52NfP+ REM8tsNpLfdM/d6fbLERXj18ADZtk2plO3okut55tFZNwMWUoks0TsqsMhSRGWIdsJt4 TsSZZGzPO8j5uFp0c97ho61KFciidp2aExp/ZKu7Zv3qCZLtrGwvWFF7cqhWYwVi0nXN eLJBSRZM78EFXlir31eE4uUhT/mFflEO/MpWclsfZVnmJsjBTfFvy3f9UWy942wbvHSo Q9KA== X-Gm-Message-State: AOAM530afZNU8/PdWaJqF1EWhgSTq4EOTkUbTjz+e1ty48oaZ3YXCAuC l2W0NBYjYi1BcXbqThEDwEk= X-Google-Smtp-Source: ABdhPJwsJBv7j6lm1zv+MhgWjiFUztQlpbffeBU4x6GSZ0YG80tXvyuhOJkOwl+F5dh+CIM9G3CG2A== X-Received: by 2002:a65:638d:0:b0:39d:74ad:ce0b with SMTP id h13-20020a65638d000000b0039d74adce0bmr24761836pgv.103.1650554276683; Thu, 21 Apr 2022 08:17:56 -0700 (PDT) Date: Fri, 22 Apr 2022 00:17:55 +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] xen/arm: p2m_set_entry duplicate calculation. Message-ID: <20220421151755.GA4718@DESKTOP-NK4TH6S.localdomain> MIME-Version: 1.0 Content-Disposition: inline X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1650554328505100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" It doesn't seem necessary to do that calculation of order shift again. Signed-off-by: Paran Lee Reviewed-by: Stefano Stabellini --- xen/arch/arm/p2m.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index 1d1059f7d2..533afc830a 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -1092,7 +1092,7 @@ int p2m_set_entry(struct p2m_domain *p2m, while ( nr ) { unsigned long mask; - unsigned long order; + unsigned long order, pages; =20 /* * Don't take into account the MFN when removing mapping (i.e @@ -1118,11 +1118,12 @@ int p2m_set_entry(struct p2m_domain *p2m, if ( rc ) break; =20 - sgfn =3D gfn_add(sgfn, (1 << order)); + pages =3D 1 << order; + sgfn =3D gfn_add(sgfn, pages); if ( !mfn_eq(smfn, INVALID_MFN) ) - smfn =3D mfn_add(smfn, (1 << order)); + smfn =3D mfn_add(smfn, pages); =20 - nr -=3D (1 << order); + nr -=3D pages; } =20 return rc; --=20 2.25.1