Received: by 10.213.65.68 with SMTP id h4csp2160348imn; Sun, 8 Apr 2018 21:17:05 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/pXZgjOyMpUWP1COp+irihg8kK/u3HwJoNHPbkVAWk2EeZ5BHMUMZNVVn7lbXtJMJdVc6g X-Received: by 2002:a17:902:7517:: with SMTP id i23-v6mr6304687pll.398.1523247425053; Sun, 08 Apr 2018 21:17:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523247424; cv=none; d=google.com; s=arc-20160816; b=M07efb2z3aoVEq4EanvcQYRtEStuml+XNCjtEGoc3Bo6lsz5ZxSyLB0CeRE2QkviOs iny+0SVw94BoIhJxBW+pNVYF7+0nnWpbg0b0r/9kfBLEp1u9Ql5L5MF2czOMcqTiTcrQ a7fe1+pvO8inhz0314rjjTHEVcryZRXUEBZT3+uUGM7HAKpnvx3LQmXuU52k4x5kfixK YyKVKq1OsPtTdkMVwh3uMgu86YNspkeAmGQeUJltDV01E6bTyhJBvAZRpoKQ4/JKMBqZ 2fLd1XQdVh3d2hPUCccH5A/qmCSJo8GHDMYxmdog0CLPPLiMJ5M4SMTPTCiWdyrE20U9 ISAw== 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=zaf5eosrKnXvXKNojDwByaOUcwR1xjxHT1ZjcSR9PlE=; b=FHncoYrXnoA5RnUoGK/YP1gfcZhR0/bC0cLi9GiD60G9s26Z31QXSg/0FRC8sJevoG LOwD+sQW0fbfWVQRDj0Cu0KzBYICDdMkoqdpnWKBnqit5HTYtkXk9LGeTADIwfZka4Vp zIhBz8Fo1XlwPW0gtnt9e5pUBVW9eSo0nMf+w/X10L3yW3xGcdQXJdQ+Xh+a8yHNkRCk eIYi7s3PezeHbWFdc4vGsyzWWhiCRfpVgtTzlrkg5Z4TzSs1RdQnoWoGKrCtJBN8yGgV LkMu3PX0DVaIybA0yPgglU37NYcjucx6owY6vVcPtUYnB/gdFVFdeqeRT4msmrdGzYlP faUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=hK1O2I66; 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 h10si10567547pgs.538.2018.04.08.21.16.27; Sun, 08 Apr 2018 21:17:04 -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=hK1O2I66; 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 S1754443AbeDIEK5 (ORCPT + 99 others); Mon, 9 Apr 2018 00:10:57 -0400 Received: from mail-co1nam03on0128.outbound.protection.outlook.com ([104.47.40.128]:49080 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752992AbeDIARB (ORCPT ); Sun, 8 Apr 2018 20:17:01 -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=zaf5eosrKnXvXKNojDwByaOUcwR1xjxHT1ZjcSR9PlE=; b=hK1O2I66IZ+6Lm8LiXVHqa3OgHYXwV3ddDFek4b8ckrmkCrkDHc3HrI52xX9lWSajW9Ih7bckh05AbmNvuQ4WJVOwpfmV4bRP8jBSNTmS5u5yH526iM53xUSdeb0zFsTyEQ28K/984Arh8ijZhEqwU/i5wmglQvYHQ7D2QB0464= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1127.namprd21.prod.outlook.com (52.132.132.167) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:16:56 +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:16:56 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Christian Borntraeger , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 015/189] KVM: s390: use created_vcpus in more places Thread-Topic: [PATCH AUTOSEL for 4.15 015/189] KVM: s390: use created_vcpus in more places Thread-Index: AQHTz5gRBEGpHD7TMEKQwteh0chGjQ== Date: Mon, 9 Apr 2018 00:16:56 +0000 Message-ID: <20180409001637.162453-15-alexander.levin@microsoft.com> References: <20180409001637.162453-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001637.162453-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;DM5PR2101MB1127;7:DSBhYlHMp3eUrVmPiBQFVjix8piM/eGzWXx79kNGQ1gEDs/VXKeXk6+IcnsPe2d4nAf8x38ybwwZy6NAF+iqIyvRjPfU/pZX/IUpAPDnFRh8KpcT7cNk8xaFvHww7eWKKyHDgtxVSFYJFdA2r1qgE2gYwPL4x/HN00dY+8igaZ0J3Ne4oAzuc2zDxB5Sme/UfYrX09OJRJ0DZA6YGWHFmu45Ou9oyt7hOWa0eraY4PPwMsMSdK28dIFwIMbdtTQ3;20:zCscY/8v6ppqmyYelmVhr5PYqecSW1AxI2WCaxhxK8a6aIPHAHlThGSV2Pczc+i1WPhjIklTsH5H07RK+9/9w2m8VBKpjBb305RgqcAeCuqdguSNQx1Hz1GCLiyKPZe47uWu95TTxKHh7gyJb/ojG3B1l4M6zccvnEl0OfM4Ous= x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: bef04675-0d32-4da8-f914-08d59daf3424 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1127; x-ms-traffictypediagnostic: DM5PR2101MB1127: 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)(8121501046)(5005006)(3231221)(944501327)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB1127;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1127; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(396003)(39380400002)(39860400002)(376002)(346002)(366004)(189003)(199004)(105586002)(186003)(66066001)(6486002)(54906003)(7736002)(26005)(575784001)(86362001)(316002)(305945005)(110136005)(478600001)(3280700002)(86612001)(10290500003)(25786009)(5250100002)(2616005)(99286004)(22452003)(5660300001)(3660700001)(2900100001)(81166006)(3846002)(2906002)(106356001)(6506007)(59450400001)(107886003)(486006)(8676002)(81156014)(14454004)(10090500001)(68736007)(4326008)(6116002)(1076002)(72206003)(102836004)(97736004)(11346002)(8936002)(476003)(2501003)(6436002)(6512007)(446003)(76176011)(36756003)(53936002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1127;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: Tb19vznTUbp9DpeKne0WktkVyiQMm+9I07o7uc+Kf030CbShitdOaXYKTgPnE3Mu7kjhi8CIYsFNKHT9o2hxLalARRHkYPkBEAkla/gfCwFfXn89CR6avFl6KpKvP33LErgzjpQtU1w9dZV319CRuJGtKX+v9MkK19wMlJ9fwQr7HsqmHxbx3SBaoN3onq2gOC5gjFSkeDtqgbN78hF+o66IiHYTsDp3TSnJF/mKVDI9B2ArWDf7XBFMcUHRgMVJGlq9bBL7nZqxVGC9D+S1ltHpZezcSA+/FqGhu48mHvOvOb9Yrrx8QX6cnXLN+LEig1hM/9+euiLwWjqmy8FyLMmvlWfUiza1bP34X+FFulQJ9tPXjiwBgvrpBia1IcaxvsxeAy2CokILR98gL/jg89AW4p6KAz2UvcMgtjaqGYs= 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: bef04675-0d32-4da8-f914-08d59daf3424 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:16:56.0594 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1127 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 004684eaa827..50193cbc819a 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -602,7 +602,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); @@ -1122,7 +1122,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