From nobody Thu May 2 09:56:50 2024 Delivered-To: importer@patchew.org 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; 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1563443732; cv=none; d=zoho.com; s=zohoarc; b=Svo9CBF9ncyHq70z9DA2k6wUGhf+LZSD2vl6VBdVQ6JUj0eLJgOEprPzrHHVaI5nrXovb7kDsQvj6wvwrHryy2gCpjT+mir6TEdFuriB9trqhuqZ2mQDLli2ay28FJeFkQ8lPlzUrl6tmOxCg2o/s2WWcqKVOOVGS/WgUgIlWr0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563443732; 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:ARC-Authentication-Results; bh=/VO5gkNm1qH5bP8GvnjS1aShPkuHxjzs6DYsfHqqKhc=; b=V0/pN9FAepqyP45MXoOJhQHlepSavpWio3J0rBucXVvJl5vX5EizgNFPrQTzSh3ZpdVI54i2ksm8nGObGIrt5k42k0rVrKxKVb/UCEBaIkuVFqed55EyUPCxWUdWs8BR2W2ySpqUSatPOPhTafB9BTIf7ccugxvRXm6VxvCUZ5c= 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 1563443732042773.7393045562897; Thu, 18 Jul 2019 02:55:32 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ho37G-0000Hx-SX; Thu, 18 Jul 2019 09:54:22 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ho37F-0000Hs-6I for xen-devel@lists.xenproject.org; Thu, 18 Jul 2019 09:54:21 +0000 Received: from mail-lj1-x244.google.com (unknown [2a00:1450:4864:20::244]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 026d5d3b-a942-11e9-8980-bc764e045a96; Thu, 18 Jul 2019 09:54:19 +0000 (UTC) Received: by mail-lj1-x244.google.com with SMTP id v24so26715223ljg.13 for ; Thu, 18 Jul 2019 02:54:19 -0700 (PDT) Received: from aanisov-work.kyiv.epam.com (ll-22.209.223.85.sovam.net.ua. [85.223.209.22]) by smtp.gmail.com with ESMTPSA id k27sm4308280lfm.90.2019.07.18.02.54.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 18 Jul 2019 02:54:16 -0700 (PDT) X-Inumbo-ID: 026d5d3b-a942-11e9-8980-bc764e045a96 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=+4o2+eFFhgbwp5ihS5Vdct+p+xXhdL8cUpHmebzUVZM=; b=RNWemrYyp5z18795E7UqFT9QFpmXZ3dSimkb2NXCCROjl36Px8IxBhiojjezGFmtIr C5eL8am7S3AwdvQGPql9tmIj7AEC3BQ9CiLzh8m4Yapd6Xl9/2E6+Ou+HZKEAyj7if4n 0BuOBKY2o7xL9yM/zVkEtXQH55K9jD9sWSbWN3XJXmU1mLQnuWHaCQOcOiXFrm2uQs6k E2EnurKacuFDQgTa79+utnX3Y3OYBTMN4lCojWlApN9+uKecwaJMPFfDvKBYNssBY7/a L+U+pYKP2m+FAVXWdkR44IjPe9EQcDcXDNV0ch5AQDG3nNE/3RqCiMjT2/VnpnE01JJO ULEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=+4o2+eFFhgbwp5ihS5Vdct+p+xXhdL8cUpHmebzUVZM=; b=GzI/vEnXBqFyt1yCMOLdqE77aC4VKQgFtADsXSVUeKrPGHRLaDI7Y/k/r2MSkNsgaA RTHU+aO+8nPlf6Gfusyz8vYnF4mjJyFHweR4u43W0Joz3QZ/ZZmGJTj5SgQ8tEh+LMxg DzdazzuyekyqlO7P3AX6ZibgpJ9/mKykEEEG1QEIh7W1scEYYZcSdIVe58Ud6wg1gAPY CgER3iwdZFDAtdHdw3M8XfRmqBNU1mWj8af6Aq8anNadc4PlUuVfGCqxVC3VnApwehNz q9GYViEuMU6jiZHPGV7iLXBiMpZBxusYY7jhXEIjSKjY+AN6sbIbFMA5AKEB2pwcgjiy s33A== X-Gm-Message-State: APjAAAXyCFk/0KstIwLVyir6oiRHwd1Tmlqk/gffj77/5b+lG6NwuNV1 ItEe+34tblxdMGkDDE0StG3M5BGd X-Google-Smtp-Source: APXvYqxB/18ntNyzFl74fAFKNmX1OUXuOPHJbNcPN/3bmh44Oci2zQIavzoBqZ8B8bkRd4K344l5Ug== X-Received: by 2002:a2e:9685:: with SMTP id q5mr9960252lji.227.1563443657504; Thu, 18 Jul 2019 02:54:17 -0700 (PDT) From: Andrii Anisov To: xen-devel@lists.xenproject.org Date: Thu, 18 Jul 2019 12:54:15 +0300 Message-Id: <1563443655-15802-1-git-send-email-andrii.anisov@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [Xen-devel] [PATCH] schedule: mask out XEN_RUNSTATE_UPDATE from state entry time 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: George Dunlap , Andrii Anisov , Dario Faggioli MIME-Version: 1.0 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) From: Andrii Anisov Using XEN_RUNSTATE_UPDATE mask during the process of copying runstate values to guest causes runstate entry time to be eventually considered negative on a calculation of the time delta. So the XEN_RUNSTATE_UPDATE should be masked out during the calculation of the time spent in the particular runstate. Signed-off-by: Andrii Anisov --- xen/common/schedule.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xen/common/schedule.c b/xen/common/schedule.c index 25f6ab3..f4f1a81 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -182,7 +182,9 @@ static inline void vcpu_runstate_change( =20 trace_runstate_change(v, new_state); =20 - delta =3D new_entry_time - v->runstate.state_entry_time; + delta =3D new_entry_time - + (v->runstate.state_entry_time & ~XEN_RUNSTATE_UPDATE); + if ( delta > 0 ) { v->runstate.time[v->runstate.state] +=3D delta; --=20 2.7.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel