Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp178685imd; Wed, 31 Oct 2018 16:54:38 -0700 (PDT) X-Google-Smtp-Source: AJdET5dC3KsvhkdKL1Rbfvrw021GhxnPHZfizuvchvnfIVULwAt4DY8BdVM5QykV7thjS4e7jpKC X-Received: by 2002:a63:c447:: with SMTP id m7mr2622702pgg.27.1541030078805; Wed, 31 Oct 2018 16:54:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541030078; cv=none; d=google.com; s=arc-20160816; b=cO9JkE06jDPlTxjQoJ3BAvFZBXLOHltb1gCFY7xAyzd+D+NqAfFIMS4iGhh1YE0o2y MJLEztzBIfrJM59I55RwUXLFdGGBxRZtKW9/jUDbEgzv0UJC2ThKzcXsHsGNxVfbqXY3 NevuNascpxsPtqkrvEl77ams4n1s2Ovu5Fb1zfYxI91AhBY+Ods0RxD6gftza3Z4a2YP EDdNwTBGeUVLv+G8z4Slex9MC4fqTwC9xS4rPTds+ILPtpDyU3Q7gAb+hV9ynomGjzXK 3BRL+N/2wEhdG+ceqKt1QLto/EC+37VFKvjuj7dVhdNQ/wOlaYCI8XboVhhgMNbpRRrm GsEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=dTu509k+WyuuHjdAjC4RMs5eTyI1sjQuzduYPX/8YCg=; b=tqACdNR54W3BZWFznSOfm2B8BuHh4PyH8H2k53W0awYoOeI+veIuRTZ9L8Ts0SrV8x ZDOg1AlhJHY147pn4ZwpsR6elTLgo+x49wja8voVnVtYqAakd8pbIcHWCnqgaxcBGDIm Q97gEvj3CsuP7++GnBl36bHVFFrXaQoFePL5FwBNt417sIPYo8uqe614xo5iYkEe1xuL TcpydgvRdHuDxTtDmxXSdnieQaVxCo8JaHGF6JFlaAnNUYanuWIEdS4iNARUAyHofQtj Yq7P23yTeLlIX2i/i1ey4g7eoB2WnYEVTueIRK3DDcvntR5AEQyL+aFe0a++a/G4fSMn sZtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="t/gmqvF5"; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d12-v6si26597278plr.92.2018.10.31.16.54.23; Wed, 31 Oct 2018 16:54:38 -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=@kernel.org header.s=default header.b="t/gmqvF5"; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727537AbeKAIGG (ORCPT + 99 others); Thu, 1 Nov 2018 04:06:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:52768 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727312AbeKAIGE (ORCPT ); Thu, 1 Nov 2018 04:06:04 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 522742082E; Wed, 31 Oct 2018 23:05:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541027153; bh=obuc7086Q6zmysTpVaBFTWFjKHgh4FSzEoAaXfcYzyg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t/gmqvF5VlIqkwG+BdtahyYsQhqN3rI/DOgP0SYPHSltfeJUbpk+hGuESnRvFBtW2 9sdvpqMrA1tL7ChI309pFJfkupeJTZexdBTUeqWjocCFAwt8RpiZk/+y/0Jp2yMU36 mvhRO4nOvXnf4hYqP8vxaHdD1q8aN0jyuwX2yF9U= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Janosch Frank , Martin Schwidefsky , Sasha Levin Subject: [PATCH AUTOSEL 4.19 012/146] s390/sthyi: Fix machine name validity indication Date: Wed, 31 Oct 2018 19:03:27 -0400 Message-Id: <20181031230541.28822-12-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031230541.28822-1-sashal@kernel.org> References: <20181031230541.28822-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Janosch Frank [ Upstream commit b5130dc2224d1881f24224c0590c6d97f2168d6a ] When running as a level 3 guest with no host provided sthyi support sclp_ocf_cpc_name_copy() will only return zeroes. Zeroes are not a valid group name, so let's not indicate that the group name field is valid. Also the group name is not dependent on stsi, let's not return based on stsi before setting it. Fixes: 95ca2cb57985 ("KVM: s390: Add sthyi emulation") Signed-off-by: Janosch Frank Signed-off-by: Martin Schwidefsky Signed-off-by: Sasha Levin --- arch/s390/kernel/sthyi.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/s390/kernel/sthyi.c b/arch/s390/kernel/sthyi.c index 0859cde36f75..888cc2f166db 100644 --- a/arch/s390/kernel/sthyi.c +++ b/arch/s390/kernel/sthyi.c @@ -183,17 +183,19 @@ static void fill_hdr(struct sthyi_sctns *sctns) static void fill_stsi_mac(struct sthyi_sctns *sctns, struct sysinfo_1_1_1 *sysinfo) { + sclp_ocf_cpc_name_copy(sctns->mac.infmname); + if (*(u64 *)sctns->mac.infmname != 0) + sctns->mac.infmval1 |= MAC_NAME_VLD; + if (stsi(sysinfo, 1, 1, 1)) return; - sclp_ocf_cpc_name_copy(sctns->mac.infmname); - memcpy(sctns->mac.infmtype, sysinfo->type, sizeof(sctns->mac.infmtype)); memcpy(sctns->mac.infmmanu, sysinfo->manufacturer, sizeof(sctns->mac.infmmanu)); memcpy(sctns->mac.infmpman, sysinfo->plant, sizeof(sctns->mac.infmpman)); memcpy(sctns->mac.infmseq, sysinfo->sequence, sizeof(sctns->mac.infmseq)); - sctns->mac.infmval1 |= MAC_ID_VLD | MAC_NAME_VLD; + sctns->mac.infmval1 |= MAC_ID_VLD; } static void fill_stsi_par(struct sthyi_sctns *sctns, -- 2.17.1