From patchwork Thu Mar 20 10:34:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergiy Kibrik X-Patchwork-Id: 14023682 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C047FC36000 for ; Thu, 20 Mar 2025 10:34:47 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.921685.1325465 (Exim 4.92) (envelope-from ) id 1tvDEV-0002Nf-JU; Thu, 20 Mar 2025 10:34:39 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 921685.1325465; Thu, 20 Mar 2025 10:34:39 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tvDEV-0002NY-Fi; Thu, 20 Mar 2025 10:34:39 +0000 Received: by outflank-mailman (input) for mailman id 921685; Thu, 20 Mar 2025 10:34:38 +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 1tvDEU-00028p-8f for xen-devel@lists.xenproject.org; Thu, 20 Mar 2025 10:34:38 +0000 Received: from fforwardh-b4-smtp.messagingengine.com (fforwardh-b4-smtp.messagingengine.com [202.12.124.199]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id eae78487-0576-11f0-9ffa-bf95429c2676; Thu, 20 Mar 2025 11:34:36 +0100 (CET) Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfforwardh.stl.internal (Postfix) with ESMTP id 05A6A174026D; Thu, 20 Mar 2025 06:34:34 -0400 (EDT) Received: from phl-frontend-02 ([10.202.2.161]) by phl-compute-09.internal (MEProxy); Thu, 20 Mar 2025 06:34:35 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 20 Mar 2025 06:34:33 -0400 (EDT) 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: eae78487-0576-11f0-9ffa-bf95429c2676 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1742466874; x=1742553274; bh=Z vqoqk1j+rIu5ILPWCa0JGJxnaepdFoSJRqpq0naegA=; b=Gn2Eo1Tzdlh03yvJ/ SxWJkL1Oir9Q5RatAmHmOnlAAweksRBuHlzLaOXvzyluip72eP8T+jvxcvRVzDYY xThJRjGS47hrDS9xFYef7JQ9cTDEoBvjjcppDZiYZP/RLZVdOd44zQ1B43s0lFSB 2+NIbJ+qdq9IN0zmyo134o0WvilP804aljvUjNmNLkj24yrLDf0gkFvZqV/LWJok BWJrQTkEGk95+f9LGIgKkFIGHu0tpY2RbfdV3/A6QcMuDBlUhYN6Wti7d/nu77nA /BPQ/SwUXt1K+FNGOlzyxwQ4/NhjLkiS+sWH2z+Y+D9h4uGzxLi/owuy9KDfFQ+Z c//nQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddugeejleelucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredt tdenucfhrhhomhepufgvrhhgihihucfmihgsrhhikhcuoefuvghrghhihigpmfhisghrih hksegvphgrmhdrtghomheqnecuggftrfgrthhtvghrnheptdejgeegvdffkeekleefueev gfduheevkedvhfdvkeeludehleegheeivedugfejnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepshgrkhhisgesuggrrhhkshhtrghrrdhsihht vgdpnhgspghrtghpthhtohepiedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepgi gvnhdquggvvhgvlheslhhishhtshdrgigvnhhprhhojhgvtghtrdhorhhgpdhrtghpthht ohepshgvrhhgihihpghkihgsrhhikhesvghprghmrdgtohhmpdhrtghpthhtohepjhgsvg hulhhitghhsehsuhhsvgdrtghomhdprhgtphhtthhopegrnhgurhgvfidrtghoohhpvghr feestghithhrihigrdgtohhmpdhrtghpthhtoheprhhoghgvrhdrphgruhestghithhrih igrdgtohhmpdhrtghpthhtohepshhsthgrsggvlhhlihhniheskhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: idf2f5561:Fastmail From: Sergiy Kibrik To: xen-devel@lists.xenproject.org Cc: Sergiy Kibrik , Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini Subject: [XEN PATCH v1 1/4] x86:svm: use nsvm_efer_svm_enabled() to check guest's EFER.SVME Date: Thu, 20 Mar 2025 12:34:31 +0200 Message-Id: <67e52e38695be12aca828025077a378e92174952.1742465624.git.Sergiy_Kibrik@epam.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 There's a macro for this, might improve readability a bit & save a bit of space. Signed-off-by: Sergiy Kibrik Acked-by: Jan Beulich --- xen/arch/x86/hvm/svm/nestedsvm.c | 2 +- xen/arch/x86/hvm/svm/svm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c index 35a2cbfd7d..dc2b6a4253 100644 --- a/xen/arch/x86/hvm/svm/nestedsvm.c +++ b/xen/arch/x86/hvm/svm/nestedsvm.c @@ -1616,7 +1616,7 @@ void svm_nested_features_on_efer_update(struct vcpu *v) * Need state for transfering the nested gif status so only write on * the hvm_vcpu EFER.SVME changing. */ - if ( v->arch.hvm.guest_efer & EFER_SVME ) + if ( nsvm_efer_svm_enabled(v) ) { if ( !vmcb->virt_ext.fields.vloadsave_enable && paging_mode_hap(v->domain) && diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c index 4b24891096..e33a38c1e4 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -253,7 +253,7 @@ static void cf_check svm_update_guest_efer(struct vcpu *v) vmcb_set_efer(vmcb, guest_efer); ASSERT(nestedhvm_enabled(v->domain) || - !(v->arch.hvm.guest_efer & EFER_SVME)); + !nsvm_efer_svm_enabled(v)); if ( nestedhvm_enabled(v->domain) ) svm_nested_features_on_efer_update(v);