From nobody Fri Sep 20 23:50:07 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=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1722007917; cv=none; d=zohomail.com; s=zohoarc; b=i6umi1rH6QwgNM7w1gAB43vJsTRSC1rIm1onvRL6mUk7auextEa7fuV2Lid5CkRA9Be1Pa+hQUgFuG8MtyeoyTbsqpvP7rVhi6xvUDJZwc9JIabmMK9g3NeWMsvhR36uUst8Szf3xWx6wG2s+4+8ntIq498wq5wunzk+w3XL3Hw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722007917; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0xB8CrUuvcSfc2nlcH8MxzDzMULu8CCxjZFQajnmXd4=; b=drepbLc6pCapj913KNqOaywB89EXuEKQCFvZPFPd2JLGYIK4ZYHg8hOenH1h8DIImuwCJskX2dXn1UsF06ZYND5Ds0sj0JGwmtVln6fud4cBjdaQmq5iFeLMxTUuzTHFvZp/wlpsr+yofm6XF2s1Yk1J3hRsBnGWZGYLEN2YrFc= 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=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1722007917968927.5019166940629; Fri, 26 Jul 2024 08:31:57 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.765514.1176167 (Exim 4.92) (envelope-from ) id 1sXMv1-0001Fj-LP; Fri, 26 Jul 2024 15:31:43 +0000 Received: by outflank-mailman (output) from mailman id 765514.1176167; Fri, 26 Jul 2024 15:31:43 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sXMv1-0001Ef-Hv; Fri, 26 Jul 2024 15:31:43 +0000 Received: by outflank-mailman (input) for mailman id 765514; Fri, 26 Jul 2024 15:31:43 +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 1sXMv1-00084T-1n for xen-devel@lists.xenproject.org; Fri, 26 Jul 2024 15:31:43 +0000 Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [2607:f8b0:4864:20::736]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 27d047fb-4b64-11ef-8776-851b0ebba9a2; Fri, 26 Jul 2024 17:31:41 +0200 (CEST) Received: by mail-qk1-x736.google.com with SMTP id af79cd13be357-7a1d42da3baso57124785a.1 for ; Fri, 26 Jul 2024 08:31:41 -0700 (PDT) Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-44fe820158esm14064471cf.73.2024.07.26.08.31.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jul 2024 08:31:39 -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: 27d047fb-4b64-11ef-8776-851b0ebba9a2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1722007900; x=1722612700; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0xB8CrUuvcSfc2nlcH8MxzDzMULu8CCxjZFQajnmXd4=; b=rAG0gPfdWsyWmy1P9g3gvzV5bNgiGgG98k5YOBlVlCfxdLKMKGkm3+cMRO3YkcURst mi5ztb0CV9VtSY4meOYnYLls0nxS40q0iENp4IHp26J5vqBEBQFVW6T7uAV8OM0eEjIP 29Mp2g+pauVBnbFwsz9Am4Ri2qTNWdE1rJVbY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722007900; x=1722612700; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0xB8CrUuvcSfc2nlcH8MxzDzMULu8CCxjZFQajnmXd4=; b=Bm/8QvXjX8DZZQNWBvqqvHaK2lGvbOZJ08LiuyrV9U29jnsrDFtf5UGTuLLIRAx6vL wHOcVV32b4wBo0GEv2XQy2A6OoWTF3sTpI0PQYBS5gjSnMh7lnYqqv7XPSMMdlrMWyYU 5NYwoo134A9lHKJzK1KK2t4Z5U+ouPihQgN6ZM9f0MyM8frh/TAN7aw+5TfckGvVPTYM gaRst43bB8WdeqwFAqqo3blk+b7cEXXjs7iEQNhSizatEK+OAw0sj9EZcCKUwj4NcBLN 2HJKTLuwoWwujlrerNdfWFsrcCkI1uLguSPQAouxKWYF4QaSVlaPg9nIv/LIH/7Xiko9 MOBA== X-Gm-Message-State: AOJu0YwHBrJPcQbqY4o0+6adH15gbooEzE8DiGNrzzeSqKSuIl8MW1gR 9zBHZNrYlYscTfCPabXWK2807d6bHbY4q+0jS30AHTZYjiDhKto0RPGWlNqk8MxOGCjpPP0jsJB / X-Google-Smtp-Source: AGHT+IG5blLKfHhCf2QVQb7PvatlQw/jrtr6nl9TiOaAlzbLO5OiY1VzEjatQoI/IW6I/wUCr86o/w== X-Received: by 2002:a05:620a:17a4:b0:79f:62a:808 with SMTP id af79cd13be357-7a1e52fbc86mr6582685a.61.1722007899832; Fri, 26 Jul 2024 08:31:39 -0700 (PDT) From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: alejandro.vallejo@cloud.com, Roger Pau Monne , Jan Beulich , Andrew Cooper Subject: [PATCH 06/22] x86/mm: introduce a local domain variable to write_ptbase() Date: Fri, 26 Jul 2024 17:21:50 +0200 Message-ID: <20240726152206.28411-7-roger.pau@citrix.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240726152206.28411-1-roger.pau@citrix.com> References: <20240726152206.28411-1-roger.pau@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1722007919572116600 This reduces the repeated accessing of v->domain. No functional change intended. Signed-off-by: Roger Pau Monn=C3=A9 Acked-by: Andrew Cooper --- xen/arch/x86/mm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index ca3d116b0e05..a792a300a866 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -517,13 +517,14 @@ void make_cr3(struct vcpu *v, mfn_t mfn) =20 void write_ptbase(struct vcpu *v) { + const struct domain *d =3D v->domain; struct cpu_info *cpu_info =3D get_cpu_info(); unsigned long new_cr4; =20 - new_cr4 =3D (is_pv_vcpu(v) && !is_idle_vcpu(v)) + new_cr4 =3D (is_pv_domain(d) && !is_idle_domain(d)) ? pv_make_cr4(v) : mmu_cr4_features; =20 - if ( is_pv_vcpu(v) && v->domain->arch.pv.xpti ) + if ( is_pv_domain(d) && d->arch.pv.xpti ) { cpu_info->root_pgt_changed =3D true; cpu_info->pv_cr3 =3D __pa(this_cpu(root_pgt)); --=20 2.45.2