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

Re: [PATCH] x86/hvm: Replace do_sched_op calls with their underlying logic


  • To: Teddy Astie <teddy.astie@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Tue, 22 Jul 2025 08:05:34 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vates.tech smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • 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=CCwhL43ttMXFmNeshai5CwY67mFOSGMquCfBdQ6uo2c=; b=ATbscpYZy4SvhgIYvZDAyfZxO39cnyGPXEe67vGjCTAPQoXWpM00gl9c9mboxO1JpE+atL4aKEoL5w3QSwRrWmXHip/k8Jk1BXOC0pz42y44yYXOyQ3t+wFLM3HwLgNANGfg172wpWGVvdAVjUrXd04649x/YNgWbFQqy9OhihFD5a6p+ewdGOD2kMAi4h8WHRyNEUQ5a1GmMvyz5XcaHj1NgcwMKlSCjZBs8SxMEL+OChQU9E/Aw/75dxGosk+Wba+6xgU+fxohPfqVbr0B2PZ2mD1VEoZlGL66YG5Zu63/HSrdOh3p4Oc1qpRNlNLSXfodrHfbYwNIEilOtNTPiw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=oyTzC1rrRVZC4hvY8TndTh1DsHQ3Fl6WZl88qyELSj0Xi82J20VmlIrsnKKmEfXLnZF8KXcpWnDsZcfOIJWyQVAyeF1iX3tbWQy56zF6w/NQuZ88ZCijwDor4ZxZ4Re3t/mCPNob9KqAoPg7qC3vxcwGsfd9YHmrA9EfbASw7aP0qD4tkepNcHT+01YLlkm4NYrJ5zu/XYWUdOmCKerAdswu2nCge19VaOIUvjQNOAp0S+feXZnZuGEICEqedesNg/hHjOjrfhZe/OemGnQPwvUBVEP9ZGE8loAwpIPx+M68MakkGRwMe/yFmEJaep5fCNxCYWSNnY90Uq+uH2PpqA==
  • Cc: Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>
  • Delivery-date: Wed, 23 Jul 2025 00:16:04 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2025-07-22 14:07, Teddy Astie wrote:
do_sched_op(SCHEDOP_yield) just calls vcpu_yield(). Remove the indirection
through the hypercall handler and use the function directly.

Perform the same for SCHEDOP_block.

Not a functional change.

Signed-off-by: Teddy Astie <teddy.astie@xxxxxxxxxx>
---
  xen/arch/x86/hvm/hvm.c               | 3 ++-
  xen/arch/x86/hvm/svm/svm.c           | 2 +-
  xen/arch/x86/hvm/viridian/viridian.c | 2 +-
  xen/arch/x86/hvm/vmx/vmx.c           | 2 +-
  4 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 4cb2e13046..5c3e9ad72e 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1736,7 +1736,8 @@ void hvm_hlt(unsigned int eflags)
      if ( unlikely(!(eflags & X86_EFLAGS_IF)) )
          return hvm_vcpu_down(curr);
- do_sched_op(SCHEDOP_block, guest_handle_from_ptr(NULL, void));
+    local_event_delivery_enable();
+    vcpu_block();

I think it would be better to export and call vcpu_block_enable_events(). This ensures they stay in-sync.

The vcpu_vield() conversion looks good to me.

Regards,
Jason

TRACE(TRC_HVM_HLT, /* pending = */ vcpu_runnable(curr));
  }



 


Rackspace

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