From patchwork Thu Mar 3 16:48:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 8494001 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 671A9C0553 for ; Thu, 3 Mar 2016 16:51:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8DC4720374 for ; Thu, 3 Mar 2016 16:51:34 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id 3D7F220382 for ; Thu, 3 Mar 2016 16:51:32 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1abWR4-0005NW-1u; Thu, 03 Mar 2016 16:49:10 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1abWR2-0005LG-3k for xen-devel@lists.xen.org; Thu, 03 Mar 2016 16:49:08 +0000 Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id DF/A2-30817-30B68D65; Thu, 03 Mar 2016 16:49:07 +0000 X-Env-Sender: jgross@suse.com X-Msg-Ref: server-13.tower-206.messagelabs.com!1457023746!26397618!1 X-Originating-IP: [195.135.220.15] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.11; banners=-,-,- X-VirusChecked: Checked Received: (qmail 25584 invoked from network); 3 Mar 2016 16:49:06 -0000 Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by server-13.tower-206.messagelabs.com with DHE-RSA-CAMELLIA256-SHA encrypted SMTP; 3 Mar 2016 16:49:06 -0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 9BC46ADD4; Thu, 3 Mar 2016 16:49:05 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xen.org Date: Thu, 3 Mar 2016 17:48:47 +0100 Message-Id: <1457023730-10997-4-git-send-email-jgross@suse.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1457023730-10997-1-git-send-email-jgross@suse.com> References: <1457023730-10997-1-git-send-email-jgross@suse.com> Cc: Juergen Gross , Wei Liu , Stefano Stabellini , Andrew Cooper , Ian Jackson , David Vrabel , Jan Beulich Subject: [Xen-devel] [PATCH v3 3/6] xen: add force flag to xen_domctl_vcpuaffinity for undoing pin override 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: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a XEN_VCPUAFFINITY_FORCE flag to xen_domctl_vcpuaffinity structure which will allow to undo a SCHEDOP_pin_override in case of a driver error of the hardware domain which didn't do the expected SCHEDOP_pin_override with cpu < 0 which would have done the undo operation. Cc: Jan Beulich Cc: Andrew Cooper Cc: Ian Jackson Cc: David Vrabel Cc: Stefano Stabellini Cc: Wei Liu Signed-off-by: Juergen Gross Acked-by: Jan Beulich --- xen/common/domctl.c | 6 ++++++ xen/include/public/domctl.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/xen/common/domctl.c b/xen/common/domctl.c index b34c0a1..e43904e 100644 --- a/xen/common/domctl.c +++ b/xen/common/domctl.c @@ -782,6 +782,12 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl) break; } + /* Undo a stuck SCHED_pin_override? */ + if ( vcpuaff->flags & XEN_VCPUAFFINITY_FORCE ) + vcpu_pin_override(v, -1); + + ret = 0; + /* * We both set a new affinity and report back to the caller what * the scheduler will be effectively using. diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h index a934318..076b1ae 100644 --- a/xen/include/public/domctl.h +++ b/xen/include/public/domctl.h @@ -307,6 +307,9 @@ struct xen_domctl_vcpuaffinity { /* Set/get the soft affinity for vcpu */ #define _XEN_VCPUAFFINITY_SOFT 1 #define XEN_VCPUAFFINITY_SOFT (1U<<_XEN_VCPUAFFINITY_SOFT) + /* Undo SCHEDOP_pin_override */ +#define _XEN_VCPUAFFINITY_FORCE 2 +#define XEN_VCPUAFFINITY_FORCE (1U<<_XEN_VCPUAFFINITY_FORCE) uint32_t flags; /* * IN/OUT variables.