From patchwork Wed Jul 23 12:05:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 34153 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f198.google.com (mail-yk0-f198.google.com [209.85.160.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3F47F2061E for ; Wed, 23 Jul 2014 12:07:43 +0000 (UTC) Received: by mail-yk0-f198.google.com with SMTP id q200sf2456190ykb.9 for ; Wed, 23 Jul 2014 05:07:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=zwO3grzgO/YYWp1a74FcfNUYLug18W4ANQ5AsP3lmFk=; b=LYvzoDDGrKFigBmkmyqKRBXLHNNYcag/n7vU5PfBc9Q9ahaEPi+G6Pmr289LEI27g5 MpIE8T3JP9mcu2QQvR+cI17NMvoupiGzrLM1FPMwC6A+9Pm/qKaCaH5HVkb+HAyVxd8Q AXVnQSrlDyTbPdtrbSrul01P25lJiYCBzv5mzxEE5I54oxp7LXVtwfLc7ucqlX3pf0qi 9gGewtR9knp4If1MPjQsiHFihM1LtsJKjcHS9KyAx3yacFJ7CDbC8t2ijkWqmkZcrezv NyQ74lL+zA91MmDueaovShPJTymiektIu/8zTHD/Fhqo2Uc39W29yJ9nxQ8B8rjPG/sZ yZ1Q== X-Gm-Message-State: ALoCoQmQzhons0DdcwjeIppBsI/GBrln2t4WpeUrWDui6zfeFXn4vHmYJu4gL8EhEFP3eIB1pFDn X-Received: by 10.236.99.8 with SMTP id w8mr16730626yhf.31.1406117263045; Wed, 23 Jul 2014 05:07:43 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.88.199 with SMTP id t65ls296211qgd.93.gmail; Wed, 23 Jul 2014 05:07:42 -0700 (PDT) X-Received: by 10.52.26.173 with SMTP id m13mr980217vdg.69.1406117262874; Wed, 23 Jul 2014 05:07:42 -0700 (PDT) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id io2si1656418vcb.84.2014.07.23.05.07.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Jul 2014 05:07:42 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.169 as permitted sender) client-ip=209.85.220.169; Received: by mail-vc0-f169.google.com with SMTP id hu12so1946872vcb.0 for ; Wed, 23 Jul 2014 05:07:42 -0700 (PDT) X-Received: by 10.52.129.200 with SMTP id ny8mr1061576vdb.27.1406117262794; Wed, 23 Jul 2014 05:07:42 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp273350vcb; Wed, 23 Jul 2014 05:07:42 -0700 (PDT) X-Received: by 10.50.1.37 with SMTP id 5mr2733298igj.47.1406117262288; Wed, 23 Jul 2014 05:07:42 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id v20si5616166icb.23.2014.07.23.05.07.41 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 23 Jul 2014 05:07:42 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X9vJA-00054b-97; Wed, 23 Jul 2014 12:06:08 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X9vJ9-000547-Ap for xen-devel@lists.xenproject.org; Wed, 23 Jul 2014 12:06:07 +0000 Received: from [85.158.143.35:11123] by server-3.bemta-4.messagelabs.com id FF/20-06192-E25AFC35; Wed, 23 Jul 2014 12:06:06 +0000 X-Env-Sender: Stefano.Stabellini@citrix.com X-Msg-Ref: server-15.tower-21.messagelabs.com!1406117164!19585335!2 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 3787 invoked from network); 23 Jul 2014 12:06:05 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-15.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 23 Jul 2014 12:06:05 -0000 X-IronPort-AV: E=Sophos;i="5.01,717,1400025600"; d="scan'208";a="154882256" Received: from accessns.citrite.net (HELO FTLPEX01CL03.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 23 Jul 2014 12:06:04 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.80) with Microsoft SMTP Server id 14.3.181.6; Wed, 23 Jul 2014 08:06:03 -0400 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1X9vJ5-0002de-Cr; Wed, 23 Jul 2014 13:06:03 +0100 From: Stefano Stabellini To: Date: Wed, 23 Jul 2014 13:05:02 +0100 Message-ID: <1406117103-10584-1-git-send-email-stefano.stabellini@eu.citrix.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 X-DLP: MIA1 Cc: Ian.Campbell@citrix.com, anup.patel@linaro.org, stefano.stabellini@eu.citrix.com, george.dunlap@eu.citrix.com, julien.grall@linaro.org, JBeulich@suse.com, pranavkumar@linaro.org Subject: [Xen-devel] [PATCH 1/2] xen: export do_yield as vcpu_yield X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: stefano.stabellini@eu.citrix.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.169 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: Signed-off-by: Stefano Stabellini CC: george.dunlap@eu.citrix.com CC: JBeulich@suse.com --- xen/common/schedule.c | 10 +++++----- xen/include/xen/sched.h | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/xen/common/schedule.c b/xen/common/schedule.c index e9eb0bc..6631dc8 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -795,9 +795,8 @@ static long do_poll(struct sched_poll *sched_poll) } /* Voluntarily yield the processor for this allocation. */ -static long do_yield(void) +void vcpu_yield(struct vcpu *v) { - struct vcpu * v=current; spinlock_t *lock = vcpu_schedule_lock_irq(v); SCHED_OP(VCPU2OP(v), yield, v); @@ -805,7 +804,6 @@ static long do_yield(void) TRACE_2D(TRC_SCHED_YIELD, current->domain->domain_id, current->vcpu_id); raise_softirq(SCHEDULE_SOFTIRQ); - return 0; } static void domain_watchdog_timeout(void *data) @@ -888,7 +886,8 @@ long do_sched_op_compat(int cmd, unsigned long arg) { case SCHEDOP_yield: { - ret = do_yield(); + vcpu_yield(current); + ret = 0; break; } @@ -925,7 +924,8 @@ ret_t do_sched_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg) { case SCHEDOP_yield: { - ret = do_yield(); + vcpu_yield(current); + ret = 0; break; } diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index 2f876f5..b99a8d3 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -634,6 +634,7 @@ int sched_id(void); void sched_tick_suspend(void); void sched_tick_resume(void); void vcpu_wake(struct vcpu *v); +void vcpu_yield(struct vcpu *v); void vcpu_sleep_nosync(struct vcpu *v); void vcpu_sleep_sync(struct vcpu *v);