[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XEN][PATCH 2/3] x86/hvm: vmx: account for SHADOW_PAGING when use hvm_shadow_handle_cd()


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
  • Date: Thu, 30 Oct 2025 14:07:04 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=c4ZKgOXvu5t1egfSJku8xBaz7rejEbIdq0JMJZuYgT8=; b=fk2Bo7IBuGH8119Xvgt/s2mgz+GeMFFsEJhx2P+wZ0aAjaYiJyfrwKvUIP4ES5tfO5qisRS3U0ID7R9bJSD7QW7LytJMV8nRCEGbDGGpBGt3SFblsCPH+oCUgKOlzfslq02f8MScK6mThL0m15DeisTA90d09OO0z3XrAGaXqOhH/XlN3nLXSxYLwW/ALMxyGXFrCt7SZLAOqha5mBK6s0btlYqGsiYpxkodmqKZ9O6RUhVspyVfav6hYLgll/J49hD/eJMI5gQM/5WbyM65Vg1BfsZng0jFMxKIqMd1FdAy3eSI0LRwQVVIulIh7hY9ZFd5RFE5hkcARyB4Clr7UA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MwuOBgCmrnrrtZRssw8xX5Yt9+R0OfUBxej7B5cr0Nrt9Ln9QQLET4XgN9G1ne4ELVLzTHH6KURAxGvI+XwhptTJ7JYCzUtSEr8JagRzRApVBOHzgBRgr/cPwc6yb7yLs8rVytq+1LDlsYy7v6eLxwvXxdiK6qrI753g1kO0kMpsxF+G6J1V4KAISZTI+7hT1JEgtVORjjw8MU0UUgs2bWxJYuI+KKMjh+AdQG8kudf2J2wcwJCKa1fNFBm9dqGC0fePVooVgNqHZZnLIPx5QK8FhlAXG1pzu4aiK+WlgSGL84z1ab2awF61yVf39w5VuSKdGEIK31eX8Ro4nuIFhg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Jason Andryuk <jason.andryuk@xxxxxxx>, Teddy Astie <teddy.astie@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 30 Oct 2025 12:07:21 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>



On 30.10.25 13:12, Jan Beulich wrote:
On 30.10.2025 00:54, Grygorii Strashko wrote:
From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>

The hvm_shadow_handle_cd() can be used only with SHADOW_PAGING=y,
so guard hvm_shadow_handle_cd() call with IS_ENABLED(CONFIG_SHADOW_PAGING).

bloat-o-meter
  add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-290 (-290)

Signed-off-by: Grygorii Strashko <grygorii_strashko@xxxxxxxx>

Requested-by: <me> (or some other of the available tags)?

Will do. or Suggested-by:?


--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1506,7 +1506,7 @@ static int cf_check vmx_get_guest_pat(struct vcpu *v, u64 
*gpat)
static void cf_check vmx_handle_cd(struct vcpu *v, unsigned long value)
  {
-    if ( !paging_mode_hap(v->domain) )
+    if ( IS_ENABLED(CONFIG_SHADOW_PAGING) && !paging_mode_hap(v->domain) )

I don't think there's a need for IS_ENABLED() here - you can simply switch to
using paging_mode_shadow(). That would be more correct anyway, for the abstract
case of there being a 3rd paging mode.

Will do. I've seen it, but was not sure :(

With the adjustment:
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>


--
Best regards,
-grygorii




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.