From nobody Thu Oct 30 23:04:48 2025 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 header.i=teddy.astie@vates.tech; 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=vates.tech ARC-Seal: i=1; a=rsa-sha256; t=1753261583; cv=none; d=zohomail.com; s=zohoarc; b=QUkIbAcg9/q7KZd/1mT6k3xzcE6e7lp4kGoJhQo0jNwxvMvr2yy6Wk0gidXZguHtPHdvKRqVgng9rXAYfLT1BVe9dLvpzL4CJs4EFURfH4wHbVO3pYqELu8u+2YbmegEUaqvP6cKh4pvZSbPxbit2cAnuLB4imTw8AVyQ4M9GpU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1753261583; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+gszZElYn+lb5gI2E7OsKENBYfCudiALczJKzBzKwao=; b=byIZtPy5yd2/3tXp+HptofLQfhuGQyXq8w2oh7XfzdRplrCfwC0lEHIn07vNnioqXAX4xU7GrQj5dbaEl2XOpdVb5qwqzLjQT5XGbvIfeeiEWw3AFjZC+w9fDK3VykIjacaykp5GK3MTnCyQC0qKHmudooTTCNjzYZoHF2X/8EI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=teddy.astie@vates.tech; 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 1753261583133622.3140219135659; Wed, 23 Jul 2025 02:06:23 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1053628.1422385 (Exim 4.92) (envelope-from ) id 1ueVQG-0007dz-SB; Wed, 23 Jul 2025 09:06:00 +0000 Received: by outflank-mailman (output) from mailman id 1053628.1422385; Wed, 23 Jul 2025 09:06: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 1ueVQG-0007ds-Og; Wed, 23 Jul 2025 09:06:00 +0000 Received: by outflank-mailman (input) for mailman id 1053628; Wed, 23 Jul 2025 09:05:59 +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 1ueVQF-0007Wy-PZ for xen-devel@lists.xenproject.org; Wed, 23 Jul 2025 09:05:59 +0000 Received: from mail132-21.atl131.mandrillapp.com (mail132-21.atl131.mandrillapp.com [198.2.132.21]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 3ec88e3e-67a4-11f0-b895-0df219b8e170; Wed, 23 Jul 2025 11:05:58 +0200 (CEST) Received: from pmta09.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1]) by mail132-21.atl131.mandrillapp.com (Mailchimp) with ESMTP id 4bn7XN72cNz1XLW09 for ; Wed, 23 Jul 2025 09:05:56 +0000 (GMT) Received: from [37.26.189.201] by mandrillapp.com id fb427a3363674315bd01b4d0db7342d7; Wed, 23 Jul 2025 09:05:56 +0000 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: 3ec88e3e-67a4-11f0-b895-0df219b8e170 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com; s=mte1; t=1753261557; x=1753531557; bh=+gszZElYn+lb5gI2E7OsKENBYfCudiALczJKzBzKwao=; h=From:Subject:To:Cc:Message-Id:Feedback-ID:Date:MIME-Version: Content-Type:Content-Transfer-Encoding:CC:Date:Subject:From; b=N0s7Y+EPjW/iVAGx+8pLw73vyjx9FytIfT6Jq0UIeclSyXorhQTULJbXFhujRbt8V 7EOFI+nN5aBoDSarECBH4U/uKrjpgm5kbM6EegXPK/IoLdUNlonImpyFKfnRggx3q/ XArQzKs1gkLgs0676c2Mgl2thd+BRCwnRiUk2a+s7/JkHCBRjYEKzQgFLizGpM0NfG JIKcDIY3BMFL1ij6Bvdfcg4/oZluHPzInhmXzJem/va9sQK34ApnpktBnI7hVXe3mX 1ro1Iu3dKeVIRiRNQQtWeeiKjhg6dYJsKQe9qs/nH+Q85gS7W1KnevvPskqBEowjfI 6TtasuIeGtwBQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1; t=1753261557; x=1753522057; i=teddy.astie@vates.tech; bh=+gszZElYn+lb5gI2E7OsKENBYfCudiALczJKzBzKwao=; h=From:Subject:To:Cc:Message-Id:Feedback-ID:Date:MIME-Version: Content-Type:Content-Transfer-Encoding:CC:Date:Subject:From; b=S6RdVNCf8QeeNQpMwU1syxjK7A+HcRgKbWvlP//ixtYDekq9pjGqlDZKO0ASjgrmn /kgR0IWvqVm/1nxlOg8kq/Ngn1jDx0RBmCVaRzXZrM6txF3vBxuV2GU7dD2anBwg0Q pM8G68sLojKcqu6xvZKYzLADlDF0yTRnuKg4cetUVQ1+TKDbrJh3DxBmvldOV5WLKX rOpSfJBlkqTu568tDrJLGpr4gpszxrokWxzLAR1ifOPraayBgLzYE4W/GhpL++oneS 8qPmJsRAEEuCV5A0HIy0s/rbNHJbNMp2DHvy/hdIt4XSkRSYL2IBasBCHv1ATlZQ9C wlJ5X5ME00OtQ== From: "Teddy Astie" Subject: =?utf-8?Q?[PATCH=20v2]=20x86/hvm:=20Replace=20do=5Fsched=5Fop=20calls=20with=20their=20underlying=20logic?= X-Mailer: git-send-email 2.50.1 X-Bm-Disclaimer: Yes X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2 X-Bm-Transport-Timestamp: 1753261555355 To: xen-devel@lists.xenproject.org Cc: "Teddy Astie" , "Jan Beulich" , "Andrew Cooper" , "=?utf-8?Q?Roger=20Pau=20Monn=C3=A9?=" , "Anthony PERARD" , "Michal Orzel" , "Julien Grall" , "Stefano Stabellini" , "Paul Durrant" , "Dario Faggioli" , "Juergen Gross" , "George Dunlap" Message-Id: <584b490f7f26a746fd2c74be977a4769f73880bb.1753261165.git.teddy.astie@vates.tech> X-Native-Encoded: 1 X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.fb427a3363674315bd01b4d0db7342d7?= X-Mandrill-User: md_30504962 Feedback-ID: 30504962:30504962.20250723:md Date: Wed, 23 Jul 2025 09:05:56 +0000 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @mandrillapp.com) (identity teddy.astie@vates.tech) X-ZM-MESSAGEID: 1753261584994116600 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Juergen Gross --- v2: - For SCHEDOP_block case: export and use vcpu_block_enable_events instead --- xen/arch/x86/hvm/hvm.c | 2 +- xen/arch/x86/hvm/svm/svm.c | 2 +- xen/arch/x86/hvm/viridian/viridian.c | 2 +- xen/arch/x86/hvm/vmx/vmx.c | 2 +- xen/common/sched/core.c | 2 +- xen/include/xen/sched.h | 1 + 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 4cb2e13046..e2720daf1e 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -1736,7 +1736,7 @@ void hvm_hlt(unsigned int eflags) if ( unlikely(!(eflags & X86_EFLAGS_IF)) ) return hvm_vcpu_down(curr); =20 - do_sched_op(SCHEDOP_block, guest_handle_from_ptr(NULL, void)); + vcpu_block_enable_events(); =20 TRACE(TRC_HVM_HLT, /* pending =3D */ vcpu_runnable(curr)); } diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c index e33a38c1e4..b0bcd4b1e7 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -2159,7 +2159,7 @@ static void svm_vmexit_do_pause(struct cpu_user_regs = *regs) * Do something useful, like reschedule the guest */ perfc_incr(pauseloop_exits); - do_sched_op(SCHEDOP_yield, guest_handle_from_ptr(NULL, void)); + vcpu_yield(); } =20 static void diff --git a/xen/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridi= an/viridian.c index 33d54e587e..7ea6c90168 100644 --- a/xen/arch/x86/hvm/viridian/viridian.c +++ b/xen/arch/x86/hvm/viridian/viridian.c @@ -959,7 +959,7 @@ int viridian_hypercall(struct cpu_user_regs *regs) /* * See section 14.5.1 of the specification. */ - do_sched_op(SCHEDOP_yield, guest_handle_from_ptr(NULL, void)); + vcpu_yield(); break; =20 case HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE: diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index d8879c304e..1b9fbc4f4e 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -4768,7 +4768,7 @@ void asmlinkage vmx_vmexit_handler(struct cpu_user_re= gs *regs) =20 case EXIT_REASON_PAUSE_INSTRUCTION: perfc_incr(pauseloop_exits); - do_sched_op(SCHEDOP_yield, guest_handle_from_ptr(NULL, void)); + vcpu_yield(); break; =20 case EXIT_REASON_XSETBV: diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c index 9043414290..b1e831df9d 100644 --- a/xen/common/sched/core.c +++ b/xen/common/sched/core.c @@ -1431,7 +1431,7 @@ void vcpu_block(void) } } =20 -static void vcpu_block_enable_events(void) +void vcpu_block_enable_events(void) { local_event_delivery_enable(); vcpu_block(); diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index fe53d4fab7..45bc40ed07 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -1030,6 +1030,7 @@ static inline bool vcpu_cpu_dirty(const struct vcpu *= v) } =20 void vcpu_block(void); +void vcpu_block_enable_events(void); void vcpu_unblock(struct vcpu *v); =20 void vcpu_pause(struct vcpu *v); --=20 2.50.1 Teddy Astie | Vates XCP-ng Developer XCP-ng & Xen Orchestra - Vates solutions web: https://vates.tech