Received: by 10.213.65.68 with SMTP id h4csp2132733imn; Sun, 8 Apr 2018 20:32:08 -0700 (PDT) X-Google-Smtp-Source: AIpwx48NFgwsnTKjlCprGRW+uX0GDiceOZyKf0hd0OSu37/nR57JoXMZ4fHh14lillPvAoCdkEJ1 X-Received: by 2002:a17:902:9892:: with SMTP id s18-v6mr20721810plp.95.1523244728332; Sun, 08 Apr 2018 20:32:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523244728; cv=none; d=google.com; s=arc-20160816; b=zQ9D2JvlzwHLdPt+Tq+O8OolvpAYHBjo7FAwVg9DbTNAA0r0F/jx6TuHp3nwgoBn5n 6OOMibFFPfTk0BW9K343EgG7WQblQOUfQMFyKjkqOrAxv+wpcZGCITAu7QHsHDyECjBJ k3XVv/pflbNgLQLN3O4eqomi5vxW1+RGCKfH/HQ6tjr2vZuSKOub0ySPMnf01YG2samO VfMaTdjTJti2x8rbuaQiW0HYtBKTjy8ZxHcMueiLJtdOxVA1Q++cHIjebnjrmEogsufd dDSLV9BnJd3owo+MCfj7rA/oFOW989qnlvEjOx5ySq90/J9puSpYa4VKb4syh3Q4MOFS 5DoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=QKwj0HdMUCxI9Z91+FW66d6gkScJAZ6i+lAqFAcXo6k=; b=JovkdG4SnjtS4iwG++j/zn7tRaThJS3AUiWs3KSKMZLH0koH5XqpjQGcaImOAhypXQ RZG5w8asejOPsLwsLwNmrVRKo4zxjmGFchdBCQSWBy0CbhIEw/dt0NhCGqcg3mT1WeA4 +ss5yeX8m57wU30A25P2NAVaVLujqBn+gO9nCmCU/84Su5B//KwTvetByvkl6gO3bugU 0tAp2tH2ERNsvCKaAyImEewxiyJH9bG9mBwG8y04Xvtt6Qyz/BosK78wLR9AaZv48WEt SHGUDwDlfa8fx6lPjym1yfnRaJ+tooHU+ii9szovkWYLBWoSQutT1xa5/xvu0eLhT51h OLDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=JSDrO54E; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f9-v6si4276425pli.50.2018.04.08.20.31.31; Sun, 08 Apr 2018 20:32:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=JSDrO54E; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753918AbeDID1C (ORCPT + 99 others); Sun, 8 Apr 2018 23:27:02 -0400 Received: from mail-bl2nam02on0137.outbound.protection.outlook.com ([104.47.38.137]:3548 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754574AbeDIAWI (ORCPT ); Sun, 8 Apr 2018 20:22:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=QKwj0HdMUCxI9Z91+FW66d6gkScJAZ6i+lAqFAcXo6k=; b=JSDrO54Ea6j22/vEcisDG1o8j87aO3vF0R1xrbihwlgHpGIFQeypgoP1LRmTeOuyk1e756i26V3nIv2ytOR1aUXV6L6dpvwd/Kjc+ZHu0sTM5yuAmrEqSdMQeleIrEFG+NvEPj2ZthAWE5CoJDdcL+XkjZAE3Hh1kkoZ3+aTsEE= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0936.namprd21.prod.outlook.com (52.132.131.166) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.3; Mon, 9 Apr 2018 00:22:00 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:22:00 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Christian Borntraeger , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 012/161] KVM: s390: use created_vcpus in more places Thread-Topic: [PATCH AUTOSEL for 4.14 012/161] KVM: s390: use created_vcpus in more places Thread-Index: AQHTz5h5A8EBYN+Knk6NO2r3BIXzYg== Date: Mon, 9 Apr 2018 00:19:50 +0000 Message-ID: <20180409001936.162706-12-alexander.levin@microsoft.com> References: <20180409001936.162706-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001936.162706-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0936;7:xMdw8HtKx9Jf2LSFeRXhx6JvOaQA5qxjUjlmYwp20lL1UsrqUlPNEvycseeEu0XFQykwJcDkjNvXqUSXikWUqSDUeNb8ck+oarCGXNzSu8UkyoW/4CJEPdHTS3A0GPC3h6HrGBNiwXC6RuqZUiOR67zWBacqQvsSYPjIkgSAKs82TU/C5TcmptKuLnf4JZ+HTcevoMPlOhLv6rrQfU2itaqvfwEbu1WxmRrd+HiMT3TT+tJeSpu6fui9hGW56Ido;20:asPhdTxbISIvaic9j6muvhcWfTwVQQTmZfJuIhkCELKTskUaU3YnUIlNcdL1oNZhg2m4ZZcEBzjieksyE04XdWpjXydvSzHGQv3yOV2U+GSkTch6B94vYRwRE9JEJUU0CTbZz32BCne9SXycTAQ07PRzBj2Du2xnNazmAwjJrLA= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 7dbe638f-fbec-4d68-accd-08d59dafe9a9 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0936; x-ms-traffictypediagnostic: DM5PR2101MB0936: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(209352067349851)(190383065149520)(104084551191319); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB0936;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0936; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(39380400002)(39860400002)(396003)(376002)(366004)(199004)(189003)(3660700001)(36756003)(2501003)(76176011)(10290500003)(2616005)(5250100002)(3280700002)(478600001)(1076002)(72206003)(6436002)(53936002)(486006)(476003)(4326008)(6486002)(107886003)(5660300001)(54906003)(110136005)(102836004)(2906002)(6116002)(575784001)(3846002)(86612001)(81156014)(81166006)(6666003)(8936002)(305945005)(8676002)(2900100001)(6506007)(68736007)(14454004)(106356001)(105586002)(25786009)(6512007)(86362001)(99286004)(446003)(59450400001)(10090500001)(11346002)(316002)(26005)(7736002)(66066001)(186003)(22452003)(97736004)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0936;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: jamrqTpgFOr9BM4ytfKvCA0cS6PoIB+OhUXVDR5PHi7T1absrNtv7iW44KP6ca0kaV1EB3Hzv/BlSWdX6p/ueJeaPYhumbsUesf3sVzcD/iETiggXsXiNZZ05iPwNLRIDfVHFXVZ+mbN/2r0j2Zu9bC2MV0duxAnDPSAuASjaI4DDNvtf/2VkdocN2djt2zEyhNScbR0HNn9XfEo4QEn3vknf3i8aTVpbqKKan4K9FE0rJ3+Pw3Mdpauvg6d1IExxDJTOsELutNGvBza+y9ZQ4RBAs9okycyKruGSRUy1ESZkv2QvQ/pzBQJX7hYPWFFqCcbU6hNn0LtWMfqPWMvMzB4ka6BV6cC8EpyNrGbXZhqUGJPXPRkIaa1YzQpI7HnvVsnxkHIcj4ZLewwgMV7CFl/TFDoKEaru+NmyeURczU= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7dbe638f-fbec-4d68-accd-08d59dafe9a9 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:19:50.6295 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0936 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christian Borntraeger [ Upstream commit 241e3ec0faf5ab1a0d9b1f6c43eefa919fb9c112 ] commit a03825bbd0c3 ("KVM: s390: use kvm->created_vcpus") introduced kvm->created_vcpus to avoid races with the existing kvm->online_vcpus scheme. One place was "forgotten" and one new place was "added". Let's fix those. Reported-by: Halil Pasic Signed-off-by: Christian Borntraeger Reviewed-by: Halil Pasic Reviewed-by: Cornelia Huck Reviewed-by: David Hildenbrand Fixes: 4e0b1ab72b8a ("KVM: s390: gs support for kvm guests") Fixes: a03825bbd0c3 ("KVM: s390: use kvm->created_vcpus") Signed-off-by: Sasha Levin --- arch/s390/kvm/kvm-s390.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index 0fa3a788dd20..0bce918db11a 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -601,7 +601,7 @@ static int kvm_vm_ioctl_enable_cap(struct kvm *kvm, str= uct kvm_enable_cap *cap) case KVM_CAP_S390_GS: r =3D -EINVAL; mutex_lock(&kvm->lock); - if (atomic_read(&kvm->online_vcpus)) { + if (kvm->created_vcpus) { r =3D -EBUSY; } else if (test_facility(133)) { set_kvm_facility(kvm->arch.model.fac_mask, 133); @@ -1121,7 +1121,7 @@ static int kvm_s390_set_processor_feat(struct kvm *kv= m, return -EINVAL; =20 mutex_lock(&kvm->lock); - if (!atomic_read(&kvm->online_vcpus)) { + if (!kvm->created_vcpus) { bitmap_copy(kvm->arch.cpu_feat, (unsigned long *) data.feat, KVM_S390_VM_CPU_FEAT_NR_BITS); ret =3D 0; --=20 2.15.1