From patchwork Tue Apr 26 10:40:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 66686 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp1542379qge; Tue, 26 Apr 2016 04:08:41 -0700 (PDT) X-Received: by 10.140.238.76 with SMTP id j73mr1587425qhc.24.1461668921063; Tue, 26 Apr 2016 04:08:41 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id r64si13179405qki.177.2016.04.26.04.08.41 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 26 Apr 2016 04:08:41 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:37484 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1av0rA-0001iq-KH for patch@linaro.org; Tue, 26 Apr 2016 07:08:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53735) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1av0Qe-0006l4-Gy for qemu-devel@nongnu.org; Tue, 26 Apr 2016 06:41:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1av0Qc-0006BJ-Ho for qemu-devel@nongnu.org; Tue, 26 Apr 2016 06:41:16 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:8672) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1av0Qb-0006AS-VN; Tue, 26 Apr 2016 06:41:14 -0400 Received: from 172.24.1.136 (EHLO szxeml434-hub.china.huawei.com) ([172.24.1.136]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id CAP01978; Tue, 26 Apr 2016 18:40:54 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml434-hub.china.huawei.com (10.82.67.225) with Microsoft SMTP Server id 14.3.235.1; Tue, 26 Apr 2016 18:40:42 +0800 From: Shannon Zhao To: , Date: Tue, 26 Apr 2016 18:40:27 +0800 Message-ID: <1461667229-9216-4-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1461667229-9216-1-git-send-email-zhaoshenglong@huawei.com> References: <1461667229-9216-1-git-send-email-zhaoshenglong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.16.142] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090202.571F45B7.0063, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 39040758b7f8f5a60056e30d9a3fce2d X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 119.145.14.66 Subject: [Qemu-devel] [PATCH v8 3/5] ACPI: Fix the definition of proximity in AcpiSratMemoryAffinity X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: drjones@redhat.com, "Michael S. Tsirkin" , david.daney@cavium.com, peter.huangpeng@huawei.com, qemu-devel@nongnu.org, shannon.zhao@linaro.org, Igor Mammedov Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Shannon Zhao ACPI spec says that Proximity Domain is an "Integer that represents the proximity domain to which the processor belongs". So define it as a uint32_t. Cc: Michael S. Tsirkin Cc: Igor Mammedov Signed-off-by: Shannon Zhao Reviewed-by: Andrew Jones --- hw/i386/acpi-build.c | 3 +-- include/hw/acpi/acpi-defs.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) -- 2.0.4 diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 9ae4c0d..3c031aa 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -2440,8 +2440,7 @@ acpi_build_srat_memory(AcpiSratMemoryAffinity *numamem, uint64_t base, { numamem->type = ACPI_SRAT_MEMORY; numamem->length = sizeof(*numamem); - memset(numamem->proximity, 0, 4); - numamem->proximity[0] = node; + numamem->proximity = cpu_to_le32(node); numamem->flags = cpu_to_le32(flags); numamem->base_addr = cpu_to_le64(base); numamem->range_length = cpu_to_le64(len); diff --git a/include/hw/acpi/acpi-defs.h b/include/hw/acpi/acpi-defs.h index bcf5c3f..850a962 100644 --- a/include/hw/acpi/acpi-defs.h +++ b/include/hw/acpi/acpi-defs.h @@ -475,7 +475,7 @@ typedef struct AcpiSratProcessorAffinity AcpiSratProcessorAffinity; struct AcpiSratMemoryAffinity { ACPI_SUB_HEADER_DEF - uint8_t proximity[4]; + uint32_t proximity; uint16_t reserved1; uint64_t base_addr; uint64_t range_length;