From patchwork Thu Jan 21 06:57:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 12034925 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F106C433E0 for ; Thu, 21 Jan 2021 07:04:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F037423877 for ; Thu, 21 Jan 2021 07:04:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727096AbhAUHEB (ORCPT ); Thu, 21 Jan 2021 02:04:01 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:31731 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726477AbhAUHDj (ORCPT ); Thu, 21 Jan 2021 02:03:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611212533; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=k4womrgZC1t12zXUnXkUHJc1RDUUJ4HKh78lY5FVqYE=; b=gSKJYHqJm5MtrdesLSRQzmKhLJUFvxFn0xCAbUsIigGnb/zQMhblIusNgy6mtA1RZ+uK0j SeZZcIyelv7al3efygr8cl6IuhsJPM80XJ4QzNNsZfbwQcuRzVsDzrocSBaHrNE1nTG6u3 CNTf8kgVFmoZHXHdOsUIveIOjsHtZSU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-261-q6Gp6TnFMlOIFURspEDrQQ-1; Thu, 21 Jan 2021 01:57:11 -0500 X-MC-Unique: q6Gp6TnFMlOIFURspEDrQQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1ACA9107ACE3; Thu, 21 Jan 2021 06:57:10 +0000 (UTC) Received: from thuth.com (ovpn-112-82.ams2.redhat.com [10.36.112.82]) by smtp.corp.redhat.com (Postfix) with ESMTP id A9A9F9CA0; Thu, 21 Jan 2021 06:57:05 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Janosch Frank Cc: David Hildenbrand , cohuck@redhat.com Subject: [kvm-unit-tests PATCH] lib/s390x/sclp: Clarify that the CPUEntry array could be at a different spot Date: Thu, 21 Jan 2021 07:57:03 +0100 Message-Id: <20210121065703.561444-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org The "struct CPUEntry entries[0]" in the ReadInfo structure is misleading since the entries could be add a completely different spot. Replace it by a proper comment instead. Signed-off-by: Thomas Huth Reviewed-by: Cornelia Huck Reviewed-by: David Hildenbrand --- lib/s390x/sclp.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/s390x/sclp.h b/lib/s390x/sclp.h index 9f81c0f..8523133 100644 --- a/lib/s390x/sclp.h +++ b/lib/s390x/sclp.h @@ -131,10 +131,15 @@ typedef struct ReadInfo { uint16_t highest_cpu; uint8_t _reserved5[124 - 122]; /* 122-123 */ uint32_t hmfai; - uint8_t reserved7[134 - 128]; + uint8_t reserved7[134 - 128]; /* 128-133 */ uint8_t byte_134_diag318 : 1; uint8_t : 7; - struct CPUEntry entries[0]; + /* + * At the end of the ReadInfo, there are also the CPU entries (see + * struct CPUEntry). When the Extended-Length SCCB (ELS) feature is + * enabled, the start of the CPU entries array begins at an offset + * denoted by the offset_cpu field, otherwise it's at offset 128. + */ } __attribute__((packed)) ReadInfo; typedef struct ReadCpuInfo {