Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp631020pxb; Tue, 2 Feb 2021 13:46:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJyKF2vcYR1kNA+BlmaRF2/qm+V4bmHyP/2AQJofJi+X8JabH7y2NK5xN1SWkULLq5u7xQRx X-Received: by 2002:a05:6402:2547:: with SMTP id l7mr96732edb.157.1612302379058; Tue, 02 Feb 2021 13:46:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612302379; cv=none; d=google.com; s=arc-20160816; b=s1fGtK2mlFcO/xNcvV23wlLKLj2ZMhsJMHZJZnVkV8E0EcQw6al7MaW/+BHJfb9145 A0A2/2Yk9x7Q7gaDzW5hD87BW0I3VAzaeN1idwNDbW98AJgDy1akCsLTm/6MRU5IucF4 PP4u+wbgwbYiIWcpq8FFhJHqy8d/pCLLOqg50eKQ6tBnqR027t/lILtusMGI3Pei6bAp i9LZHF5sh79FtDSzgP5kYv67ZQ8x9o4AH1JeJM2HN6XhkYT8W8Kv3ghaolS5LRJ320c/ 5ct45DWIeeiioGTNVW2kSUDB9uuwRg/T6/8FnliP5G48z8Sp48QN2ViKqgB7sNO2yicX flMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gfFeCoBYnmpKeEsPpGMmj+lY445D2TcmNveSR3BVjOI=; b=szPCqSXCCNE38r7A9ZeIesebadIaBCiISPjC3KhndLf3onjB428N2ZTODE6yBKh086 09o9ikrJ9DYwx7yZHUIHJnij3iytQjJPjnq3Ycn3kz622TrVw/GtI6YpDqPvx1ToflWb 87k2DZL4sOD5c6ECY/bkYaA8lgX/Yl7kbqfdT6CNtxxGaquMaNUqnM9DVLDdaq2TnC15 /R55Z+MnOTKuagdU9v7l3LzyCTRjlII+mkZ88WGZvKExQzqYbZU4LstAEwVQo2wqVJI2 Ud8AFCZ2NLzT3UvTXjrfVu3Dy4uSNcJVjy1gKCwWL4HBYyPWz1+wwbOGMSpMQmVXldOm w3Jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1zWjGdxX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d24si7302edt.102.2021.02.02.13.45.53; Tue, 02 Feb 2021 13:46:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1zWjGdxX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232893AbhBBNvU (ORCPT + 99 others); Tue, 2 Feb 2021 08:51:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:37906 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232895AbhBBNpP (ORCPT ); Tue, 2 Feb 2021 08:45:15 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id A6AAF64F75; Tue, 2 Feb 2021 13:40:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612273232; bh=ixEoOD4jkCzseN3kj0WMPriJN4qWxoxRMhcouJBB820=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1zWjGdxXjkSE1vSZfylERNvW6L89eUFXS68bHBrDd9jXF6rlnhephIfH1sLEBhqlu 16kFhHzXXxMVK/oBlYGj8jse14WEjCJASewY0mvOeYehIyVuVPtIEa1GfUPrUsh6aq vDymjUOrYvmMEWtTOqHYcDYNllhMN2XMZZaZLc20= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Janosch Frank , Claudio Imbrenda , Cornelia Huck , Vasily Gorbik Subject: [PATCH 5.10 029/142] s390: uv: Fix sysfs max number of VCPUs reporting Date: Tue, 2 Feb 2021 14:36:32 +0100 Message-Id: <20210202132958.914356931@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210202132957.692094111@linuxfoundation.org> References: <20210202132957.692094111@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Janosch Frank commit e82080e1f456467cc185fe65ee69fe9f9bd0b576 upstream. The number reported by the query is N-1 and I think people reading the sysfs file would expect N instead. For users creating VMs there's no actual difference because KVM's limit is currently below the UV's limit. Signed-off-by: Janosch Frank Fixes: a0f60f8431999 ("s390/protvirt: Add sysfs firmware interface for Ultravisor information") Cc: stable@vger.kernel.org Reviewed-by: Claudio Imbrenda Acked-by: Cornelia Huck Signed-off-by: Vasily Gorbik Signed-off-by: Greg Kroah-Hartman diff --git a/arch/s390/boot/uv.c b/arch/s390/boot/uv.c index a15c033f53ca..87641dd65ccf 100644 --- a/arch/s390/boot/uv.c +++ b/arch/s390/boot/uv.c @@ -35,7 +35,7 @@ void uv_query_info(void) uv_info.guest_cpu_stor_len = uvcb.cpu_stor_len; uv_info.max_sec_stor_addr = ALIGN(uvcb.max_guest_stor_addr, PAGE_SIZE); uv_info.max_num_sec_conf = uvcb.max_num_sec_conf; - uv_info.max_guest_cpus = uvcb.max_guest_cpus; + uv_info.max_guest_cpu_id = uvcb.max_guest_cpu_id; } #ifdef CONFIG_PROTECTED_VIRTUALIZATION_GUEST diff --git a/arch/s390/include/asm/uv.h b/arch/s390/include/asm/uv.h index 0325fc0469b7..7b98d4caee77 100644 --- a/arch/s390/include/asm/uv.h +++ b/arch/s390/include/asm/uv.h @@ -96,7 +96,7 @@ struct uv_cb_qui { u32 max_num_sec_conf; u64 max_guest_stor_addr; u8 reserved88[158 - 136]; - u16 max_guest_cpus; + u16 max_guest_cpu_id; u8 reserveda0[200 - 160]; } __packed __aligned(8); @@ -273,7 +273,7 @@ struct uv_info { unsigned long guest_cpu_stor_len; unsigned long max_sec_stor_addr; unsigned int max_num_sec_conf; - unsigned short max_guest_cpus; + unsigned short max_guest_cpu_id; }; extern struct uv_info uv_info; diff --git a/arch/s390/kernel/uv.c b/arch/s390/kernel/uv.c index 883bfed9f5c2..b2d2ad153067 100644 --- a/arch/s390/kernel/uv.c +++ b/arch/s390/kernel/uv.c @@ -368,7 +368,7 @@ static ssize_t uv_query_max_guest_cpus(struct kobject *kobj, struct kobj_attribute *attr, char *page) { return scnprintf(page, PAGE_SIZE, "%d\n", - uv_info.max_guest_cpus); + uv_info.max_guest_cpu_id + 1); } static struct kobj_attribute uv_query_max_guest_cpus_attr =