From nobody Thu May 2 17:01:05 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1574165429; cv=none; d=zoho.com; s=zohoarc; b=PQTaDAHC8ZHAhTynM737J/WVsgDMPAF6miD4OW0FS2ztDEujefgayiSMqgPZPpwsfd2r2Ty1o7e4xEVXs1GNWO97ULyNBhZUWt4w6C2Gw6/+S3qIXlwObcrsYbbxPHs7okNlEnAeKxT2OVb+5ujafH468CFXi7083BWJdW2gR/k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1574165429; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=2AC0LJhvT2Ev+tu3BmJ0QWqlTLCTyKpjF3DHw2/NNvU=; b=YLsTB/Eyzd1ODhuLEcJIBLavd5qe1JeslwtGPC7/qcpBaKaThtAE2Oaj1WlFF3gqrRIbNPmw149QEfBqgYouWwP5f837rYpXgt/DsopQ9YEW0GkiaGKAPX/bjA/v6a9IrDWmxJgY7w12HIawYRylQ9boRZgSRXC0x2K63HJv1LE= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1574165429406729.1793228835096; Tue, 19 Nov 2019 04:10:29 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iX2Je-0003jj-7m; Tue, 19 Nov 2019 12:09:06 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iX2Jc-0003je-V8 for xen-devel@lists.xenproject.org; Tue, 19 Nov 2019 12:09:05 +0000 Received: from esa4.hc3370-68.iphmx.com (unknown [216.71.155.144]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 599a33cc-0ac5-11ea-a2f9-12813bfff9fa; Tue, 19 Nov 2019 12:08:52 +0000 (UTC) X-Inumbo-ID: 599a33cc-0ac5-11ea-a2f9-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1574165331; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=0ZmOn2G3sznXMWFupB29G58F8HtaQfg2sCdZtBYjYas=; b=hvAGNjDuVlrjgW5fEDIqzKLo5rBycO7wEJtsNmcBAm79u/9lV62Q1Q/l sfzbOdboi0Z8NTfLjAjsA6xnoWU2cHwHt+MbKKzYla1bwhNoSaH4Bo2Vj Zy9F0hM8tfrPwy90X8w7oD6qIw+UVkEXlUbdyGKLnylakwpNs+Qqa6dLm w=; Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa4.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa4.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa4.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa4.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa4.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa4.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: cY9jv+g8HvDunovBhPKwoWBykgDSkAtmLwdqBXyidts/YxK92TM9GKgXhk9XC0Qv5iR5aSpEtJ 0r+8NwqV79teo8UmUBLq4GdrP7N+ltLJt1zS/yRe9BVf4ioyfgnPHANJ07ElkyMTdbCS4AP895 AKw/KPaXwQKtXJjMTnSUu54TTgkTmoYwgH+CvLUsZFN/4+q1MDpNg+Uges5TN98PGXCMokqYXz dmHsUYttWkW2NbF9Y39Ip+T0OhEekybltKCPxMyde3OnyuYOdan+opBDuITffqoZJrvmJlF99j A5c= X-SBRS: 2.7 X-MesageID: 9056611 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.68,322,1569297600"; d="scan'208";a="9056611" From: Anthony PERARD To: Date: Tue, 19 Nov 2019 12:08:49 +0000 Message-ID: <20191119120849.1547072-1-anthony.perard@citrix.com> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Subject: [Xen-devel] [XEN PATCH] x86/domctl: Have XEN_DOMCTL_getpageframeinfo3 preemptible X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Andrew Cooper , Jan Beulich , Wei Liu , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) This hypercall can take a long time to finish because it attempts to grab the `hostp2m' lock up to 1024 times. The accumulated wait for the lock can take several seconds. This can easily happen with a guest with 32 vcpus and plenty of RAM, during localhost migration. Signed-off-by: Anthony PERARD --- Notes: I don't know if it's a correct way to make the hypercall preemptible, the patch kind of modify the response, but libxc doesn't seems to care. =20 Is it fine to modify the domctl_t that the domain (dom0) provides? If not, where could we store the progress made? xen/arch/x86/domctl.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c index 43e368d63bb9..5c0a7462e63b 100644 --- a/xen/arch/x86/domctl.c +++ b/xen/arch/x86/domctl.c @@ -425,6 +425,18 @@ long arch_do_domctl( ret =3D -EFAULT; break; } + + if ( hypercall_preempt_check() ) { + domctl->u.getpageframeinfo3.num =3D num - i - 1; + domctl->u.getpageframeinfo3.array.p =3D + guest_handle + ((i + 1) * width); + if ( __copy_to_guest(u_domctl, domctl, 1) ) { + ret =3D -EFAULT; + break; + } + return hypercall_create_continuation(__HYPERVISOR_domctl, + "h", u_domctl); + } } =20 break; --=20 Anthony PERARD _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel