From patchwork Tue Sep 27 15:56:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 9352175 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 664D360757 for ; Tue, 27 Sep 2016 16:00:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 584C52925C for ; Tue, 27 Sep 2016 16:00:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4CDD32928A; Tue, 27 Sep 2016 16:00:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 236892925C for ; Tue, 27 Sep 2016 16:00:37 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1boulr-0007Vm-Jn; Tue, 27 Sep 2016 15:58:15 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1boulq-0007UN-Uw for xen-devel@lists.xenproject.org; Tue, 27 Sep 2016 15:58:15 +0000 Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id 57/6B-06971-5179AE75; Tue, 27 Sep 2016 15:58:13 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrBIsWRWlGSWpSXmKPExsXitHSDva7I9Ff hBmteqFt83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBlfXhoVrOWo2HL/C2sD43a2LkZODgkBf4nr N1azg9hsAjoSF+fuBIpzcIgIqEjc3mvQxcjFwSxwn1Hi8fGVYPXCArESN7sesoDYLAKqEk8XH AeL8wq4SNzetxRqpq7Ew3O/WUFsTgFXid62BUwgthBQzd2ZH1kh6gUlTs58AjaHWUBTonX7b3 YIW16ieetsZoh6RYn+eQ+gZnJL3D49lXkCI/8sJO2zkLTPQtK+gJF5FaNGcWpRWWqRrqGhXlJ RZnpGSW5iZo6uoYGpXm5qcXFiempOYlKxXnJ+7iZGYAgyAMEOxpXtzocYJTmYlER5NdpfhQvx JeWnVGYkFmfEF5XmpBYfYpTh4FCS4PWYCpQTLEpNT61Iy8wBRgNMWoKDR0mEl2caUJq3uCAxt zgzHSJ1ilFRSpy3AaRPACSRUZoH1waLwEuMslLCvIxAhwjxFKQW5WaWoMq/YhTnYFQS5lUAGc +TmVcCN/0V0GImoMVLT7wAWVySiJCSamBMq7jowTpb++zUxNyKa7nLzznJzPyka7ZWPjb211b jKVUModMDfiQtduQrN9GPTs4/nCqZafGKO0ngs8FrvmPu1+Z1BOqx/GA928LkvkF5z6PXyYdE bBdd+qCyRb1O6MeM8x9e7rrnvH9VQc+ia09yLEOCnkudb24UmXRJxGPlJtmABsO7z7OUWIozE g21mIuKEwGuFCjTuwIAAA== X-Env-Sender: prvs=071b8e69e=roger.pau@citrix.com X-Msg-Ref: server-5.tower-206.messagelabs.com!1474991886!60100383!2 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 16900 invoked from network); 27 Sep 2016 15:58:12 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-5.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 27 Sep 2016 15:58:12 -0000 X-IronPort-AV: E=Sophos;i="5.30,405,1470700800"; d="scan'208";a="389169468" From: Roger Pau Monne To: Date: Tue, 27 Sep 2016 17:56:59 +0200 Message-ID: <1474991845-27962-5-git-send-email-roger.pau@citrix.com> X-Mailer: git-send-email 2.7.4 (Apple Git-66) In-Reply-To: <1474991845-27962-1-git-send-email-roger.pau@citrix.com> References: <1474991845-27962-1-git-send-email-roger.pau@citrix.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: George Dunlap , Andrew Cooper , Jan Beulich , boris.ostrovsky@oracle.com, Roger Pau Monne Subject: [Xen-devel] [PATCH v2 04/30] xen/x86: allow calling {sh/hap}_set_allocation with the idle domain X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP ... and using the "preempted" parameter. The solution relies on just calling softirq_pending if the current domain is the idle domain. Signed-off-by: Roger Pau Monné Acked-by: George Dunlap --- Cc: George Dunlap Cc: Jan Beulich Cc: Andrew Cooper --- xen/arch/x86/mm/hap/hap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c index b6d2c61..2dc82f5 100644 --- a/xen/arch/x86/mm/hap/hap.c +++ b/xen/arch/x86/mm/hap/hap.c @@ -379,7 +379,9 @@ hap_set_allocation(struct domain *d, unsigned long pages, int *preempted) break; /* Check to see if we need to yield and try again */ - if ( preempted && hypercall_preempt_check() ) + if ( preempted && + (is_idle_vcpu(current) ? softirq_pending(smp_processor_id()) : + hypercall_preempt_check()) ) { *preempted = 1; return 0;