From nobody Thu Apr 25 20:17:14 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1593515147; cv=none; d=zohomail.com; s=zohoarc; b=Af0JVsqL+a88v8InAvjBVsK3A0bTua8xKG9gK9ujy8NPFprX+4oEcZDUuzWyMtPpLPH6JqfgrsO6OTrs1OIp/zrW/EpjKXyC2vBPGehBP6hUswBD+JT0upKjLyE3JyOMSBrFrhlx5wVjFIbzlzFXyUJT5E7/LkRaLppXFqkgrE4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593515147; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=c2SOqjYn/sQWeHMGBwgSo4MEkKWnWmTRHpTDF+JXJD8=; b=KE/o89uAepMBlz2NjosL4rMZVqVQyfYAXs7ATgUfTVKkbO/0nr+9tW/h3Xa/rtW1hOpSBKsBWJSAg7o7xJS0w3QBGvM8o+oxYyKfrqyPW7zwO3Fj3vVftxNR9VW3IUVm0Ky8TkfsRawj6u9/k9/nTUQGeYEXNCD0Edvogg2XLXw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 159351514777975.92001488250276; Tue, 30 Jun 2020 04:05:47 -0700 (PDT) Received: from localhost ([::1]:57266 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jqE5C-0000Fs-IL for importer@patchew.org; Tue, 30 Jun 2020 07:05:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46778) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jqE49-00078j-Ua for qemu-devel@nongnu.org; Tue, 30 Jun 2020 07:04:41 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:48359 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jqE48-0006Pg-Bc for qemu-devel@nongnu.org; Tue, 30 Jun 2020 07:04:41 -0400 Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-511-EWoOWi4PP8GoHGch5v9Vag-1; Tue, 30 Jun 2020 07:04:37 -0400 Received: by mail-ej1-f69.google.com with SMTP id cf15so12788600ejb.6 for ; Tue, 30 Jun 2020 04:04:37 -0700 (PDT) Received: from x1w.redhat.com (1.red-83-51-162.dynamicip.rima-tde.net. [83.51.162.1]) by smtp.gmail.com with ESMTPSA id ce19sm1729984ejb.24.2020.06.30.04.04.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2020 04:04:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593515079; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=c2SOqjYn/sQWeHMGBwgSo4MEkKWnWmTRHpTDF+JXJD8=; b=O4OlVJTYkYqOlUuxchOjf+wo5PAmattOYkDAxLotkRBaPIzGQlHdvtHrL5cQZblDpkwi4f 5/tvVAUnzovXrO8xcGy9+MWT3rfuQT778/Xyrh2Xc3h5Z0gZ9YccYXoh/gh1FAeeo7TpeH bqETeM2v30K/zKFPdRUy8enHuiuWA3k= X-MC-Unique: EWoOWi4PP8GoHGch5v9Vag-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=c2SOqjYn/sQWeHMGBwgSo4MEkKWnWmTRHpTDF+JXJD8=; b=qj8U20Y33Sq2drkmJeTaGIP56vk2Jqwp7n9+Iqi5gpdHCh4oVNNmX5iOI1asP+3Taf /CLF/BxgNlWO1fFHJVviPuEItWSmqeTjbOyMURCGnuv3tqpt5Bql9+Fg0Ko6wDFrGFFI jtJNk7LMqnT1tmBQH4/jrBfd47XvlseJFoktuYiIj1SQtEZvT3bX3Wmhh8YmHAB1BhY8 qrUuPk4/n/iQhh3uCtU0Tm5B8JPBDxXuwk0KWaJaaublLgCtATIYzhthajp9kOYIxjkV jbLeS+DQB/n7EIWyXZJrLbYrPHDuvfNyssQP7t48uambYCQQoJAelTY335rsiE9O67j4 Iufw== X-Gm-Message-State: AOAM531pFi7baKPczkhaXfHYuhg5Kn/lLP8Y7rcbavRCTlRvzRX9Tqaa XP4jff6UJ+ICADSgrJh6Z20FaS9qSD3kuvHCf1GxcbylPfgkC1ESayu8yaiBcBCzil23kQUetqq crlMJgeNUVyjn1y8= X-Received: by 2002:a17:906:6a4f:: with SMTP id n15mr17416382ejs.378.1593515076501; Tue, 30 Jun 2020 04:04:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOPV0HJIU201xbqXAcgAe4vdWSqAobzYIFIB5IUFt/NfIyy1z6RrvCESxlUbTtrEyzSY1OCA== X-Received: by 2002:a17:906:6a4f:: with SMTP id n15mr17416372ejs.378.1593515076349; Tue, 30 Jun 2020 04:04:36 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v3 1/4] hw/block/nvme: Update specification URL Date: Tue, 30 Jun 2020 13:04:26 +0200 Message-Id: <20200630110429.19972-2-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200630110429.19972-1-philmd@redhat.com> References: <20200630110429.19972-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.120; envelope-from=philmd@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/30 00:34:33 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu-block@nongnu.org, Klaus Jensen , Maxim Levitsky , Keith Busch , Max Reitz , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) At some point the URL changed, update it to avoid other developers to search for it. Reviewed-by: Klaus Jensen Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Dmitry Fomichev --- hw/block/nvme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 1aee042d4c..6628d0a4ba 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -11,7 +11,7 @@ /** * Reference Specs: http://www.nvmexpress.org, 1.2, 1.1, 1.0e * - * http://www.nvmexpress.org/resources/ + * https://nvmexpress.org/developers/nvme-specification/ */ =20 /** --=20 2.21.3 From nobody Thu Apr 25 20:17:14 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1593515245; cv=none; d=zohomail.com; s=zohoarc; b=iUX67vuCP9dSRSoQHhsstpsJ8guP6lZ3L8OrMI67BpZHU1R28LSE2692AxzYsDpl3fmVky45RdQbqQBu8bgcp7YIXDxjmZBnC+mER0qs42mfzUPeD1Q17YQIg0hj6tAb7Yb5k26g9bVYe88/kS4NwodJUVlldfUc7offGP3S7f4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593515245; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+Jh5kF+rFa72J9zwOvi/ro9LrJgq9M690I3MFYHPbQo=; b=QT51omGQgZuxRoNqzPvLGeXCB6qvDkNmNCbw8msHpb5sMIPe/zKdR+PYng0CP+X/cfTda6CEL/yxpC9vZsBHglC+kPdckcfUSh0OgCGxS+N37tsr4y80n+4eUPZbLxbIi/e3tlXiUXnViQrmbiPm+C3n8yx+35ITCJNgePn/GVU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 159351524550972.76706857914678; Tue, 30 Jun 2020 04:07:25 -0700 (PDT) Received: from localhost ([::1]:35248 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jqE6m-0002pY-9t for importer@patchew.org; Tue, 30 Jun 2020 07:07:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46830) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jqE4F-0007Iz-Ne for qemu-devel@nongnu.org; Tue, 30 Jun 2020 07:04:47 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:43137 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jqE4D-0006QQ-V0 for qemu-devel@nongnu.org; Tue, 30 Jun 2020 07:04:47 -0400 Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-26-rggSiahgNA26h0Q7u5ZYyQ-1; Tue, 30 Jun 2020 07:04:43 -0400 Received: by mail-ed1-f71.google.com with SMTP id 64so16502312edf.2 for ; Tue, 30 Jun 2020 04:04:42 -0700 (PDT) Received: from x1w.redhat.com (1.red-83-51-162.dynamicip.rima-tde.net. [83.51.162.1]) by smtp.gmail.com with ESMTPSA id u60sm2513139edc.59.2020.06.30.04.04.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2020 04:04:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593515084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+Jh5kF+rFa72J9zwOvi/ro9LrJgq9M690I3MFYHPbQo=; b=Utcgm1fcz7t0tX/h0MQTHyFGab4qfu6JTsC7bhGg5jDzHe3Nvg40lnryWlLR2saS8ptFOX NsPksz0/18hgAN0XkKbPTvyyLaahKQ0+xcEKbERwoE6UmD3uOwd6sh0jBEaWip8rqAPS7T WHOYK49qDa4excO6R5GIxxDwv4lEniI= X-MC-Unique: rggSiahgNA26h0Q7u5ZYyQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+Jh5kF+rFa72J9zwOvi/ro9LrJgq9M690I3MFYHPbQo=; b=glhECIyLvpOAFCYUMRo9YBnF8LUKDLRHbwRT8VP1HTgvnZU/ZyZoPhVm0ra1UnNIcA Nw6GXWlItNnMkWLSQZHueZ8scm4on/M2neBWWizLTQqGdpZT4GDzyT83vUUqBx9mv/XF 0ZgsPGg05iG1mD/AcmWuoxzPFDnKGWkk6Ff4QF5RhECVbxH23hBorJZNRnixDo1bBhtf Q0mqRRKnSXvx0ONYU/9NLJax34MVoiMRkAy9zaV7vDAMsBXobZFvYnX/WrbmkJKDhwnI MIS+QJAVGOLNom/SCpBs3d/0GWrWGHSWUPUvwm7xiOH2P3Rw+sraMudzCeMlRGb6/J6o Lufg== X-Gm-Message-State: AOAM5334jlJcKOMc+EebId2C/Bo1v+Gs3uCSl3N72oBOnl1lzV2ohIuE lswPo7IKSkG5oVJ05SlRyRLYDj4N+228/Rp7bO9sp4mnCfQ4914HMavLAj3gCcH93rEBmZiF52t P3qaHseRAGz0wXbM= X-Received: by 2002:a17:906:26c3:: with SMTP id u3mr17170847ejc.483.1593515081538; Tue, 30 Jun 2020 04:04:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytU3NflAmYOTzg1nG1o/PFFk6FTq86Q5w0prTdzWWJIHjOihbdpI4OCsTZnNvDz+gbXNKsjw== X-Received: by 2002:a17:906:26c3:: with SMTP id u3mr17170836ejc.483.1593515081363; Tue, 30 Jun 2020 04:04:41 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v3 2/4] hw/block/nvme: Use QEMU_PACKED on hardware/packet structures Date: Tue, 30 Jun 2020 13:04:27 +0200 Message-Id: <20200630110429.19972-3-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200630110429.19972-1-philmd@redhat.com> References: <20200630110429.19972-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.120; envelope-from=philmd@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/30 03:55:26 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu-block@nongnu.org, Klaus Jensen , Maxim Levitsky , Keith Busch , Max Reitz , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) These structures either describe hardware registers, or commands ('packets') to send to the hardware. To forbid the compiler to optimize and change fields alignment, mark the structures as packed. Reviewed-by: Klaus Jensen Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Dmitry Fomichev --- include/block/nvme.h | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/include/block/nvme.h b/include/block/nvme.h index 1720ee1d51..71c5681912 100644 --- a/include/block/nvme.h +++ b/include/block/nvme.h @@ -1,7 +1,7 @@ #ifndef BLOCK_NVME_H #define BLOCK_NVME_H =20 -typedef struct NvmeBar { +typedef struct QEMU_PACKED NvmeBar { uint64_t cap; uint32_t vs; uint32_t intms; @@ -377,7 +377,7 @@ enum NvmePmrmscMask { #define NVME_PMRMSC_SET_CBA(pmrmsc, val) \ (pmrmsc |=3D (uint64_t)(val & PMRMSC_CBA_MASK) << PMRMSC_CBA_SHIFT) =20 -typedef struct NvmeCmd { +typedef struct QEMU_PACKED NvmeCmd { uint8_t opcode; uint8_t fuse; uint16_t cid; @@ -422,7 +422,7 @@ enum NvmeIoCommands { NVME_CMD_DSM =3D 0x09, }; =20 -typedef struct NvmeDeleteQ { +typedef struct QEMU_PACKED NvmeDeleteQ { uint8_t opcode; uint8_t flags; uint16_t cid; @@ -432,7 +432,7 @@ typedef struct NvmeDeleteQ { uint32_t rsvd11[5]; } NvmeDeleteQ; =20 -typedef struct NvmeCreateCq { +typedef struct QEMU_PACKED NvmeCreateCq { uint8_t opcode; uint8_t flags; uint16_t cid; @@ -449,7 +449,7 @@ typedef struct NvmeCreateCq { #define NVME_CQ_FLAGS_PC(cq_flags) (cq_flags & 0x1) #define NVME_CQ_FLAGS_IEN(cq_flags) ((cq_flags >> 1) & 0x1) =20 -typedef struct NvmeCreateSq { +typedef struct QEMU_PACKED NvmeCreateSq { uint8_t opcode; uint8_t flags; uint16_t cid; @@ -474,7 +474,7 @@ enum NvmeQueueFlags { NVME_Q_PRIO_LOW =3D 3, }; =20 -typedef struct NvmeIdentify { +typedef struct QEMU_PACKED NvmeIdentify { uint8_t opcode; uint8_t flags; uint16_t cid; @@ -486,7 +486,7 @@ typedef struct NvmeIdentify { uint32_t rsvd11[5]; } NvmeIdentify; =20 -typedef struct NvmeRwCmd { +typedef struct QEMU_PACKED NvmeRwCmd { uint8_t opcode; uint8_t flags; uint16_t cid; @@ -528,7 +528,7 @@ enum { NVME_RW_PRINFO_PRCHK_REF =3D 1 << 10, }; =20 -typedef struct NvmeDsmCmd { +typedef struct QEMU_PACKED NvmeDsmCmd { uint8_t opcode; uint8_t flags; uint16_t cid; @@ -547,7 +547,7 @@ enum { NVME_DSMGMT_AD =3D 1 << 2, }; =20 -typedef struct NvmeDsmRange { +typedef struct QEMU_PACKED NvmeDsmRange { uint32_t cattr; uint32_t nlb; uint64_t slba; @@ -569,14 +569,14 @@ enum NvmeAsyncEventRequest { NVME_AER_INFO_SMART_SPARE_THRESH =3D 2, }; =20 -typedef struct NvmeAerResult { +typedef struct QEMU_PACKED NvmeAerResult { uint8_t event_type; uint8_t event_info; uint8_t log_page; uint8_t resv; } NvmeAerResult; =20 -typedef struct NvmeCqe { +typedef struct QEMU_PACKED NvmeCqe { uint32_t result; uint32_t rsvd; uint16_t sq_head; @@ -634,7 +634,7 @@ enum NvmeStatusCodes { NVME_NO_COMPLETE =3D 0xffff, }; =20 -typedef struct NvmeFwSlotInfoLog { +typedef struct QEMU_PACKED NvmeFwSlotInfoLog { uint8_t afi; uint8_t reserved1[7]; uint8_t frs1[8]; @@ -647,7 +647,7 @@ typedef struct NvmeFwSlotInfoLog { uint8_t reserved2[448]; } NvmeFwSlotInfoLog; =20 -typedef struct NvmeErrorLog { +typedef struct QEMU_PACKED NvmeErrorLog { uint64_t error_count; uint16_t sqid; uint16_t cid; @@ -659,7 +659,7 @@ typedef struct NvmeErrorLog { uint8_t resv[35]; } NvmeErrorLog; =20 -typedef struct NvmeSmartLog { +typedef struct QEMU_PACKED NvmeSmartLog { uint8_t critical_warning; uint8_t temperature[2]; uint8_t available_spare; @@ -693,7 +693,7 @@ enum LogIdentifier { NVME_LOG_FW_SLOT_INFO =3D 0x03, }; =20 -typedef struct NvmePSD { +typedef struct QEMU_PACKED NvmePSD { uint16_t mp; uint16_t reserved; uint32_t enlat; @@ -713,7 +713,7 @@ enum { NVME_ID_CNS_NS_ACTIVE_LIST =3D 0x2, }; =20 -typedef struct NvmeIdCtrl { +typedef struct QEMU_PACKED NvmeIdCtrl { uint16_t vid; uint16_t ssvid; uint8_t sn[20]; @@ -807,7 +807,7 @@ enum NvmeFeatureIds { NVME_SOFTWARE_PROGRESS_MARKER =3D 0x80 }; =20 -typedef struct NvmeRangeType { +typedef struct QEMU_PACKED NvmeRangeType { uint8_t type; uint8_t attributes; uint8_t rsvd2[14]; @@ -817,13 +817,13 @@ typedef struct NvmeRangeType { uint8_t rsvd48[16]; } NvmeRangeType; =20 -typedef struct NvmeLBAF { +typedef struct QEMU_PACKED NvmeLBAF { uint16_t ms; uint8_t ds; uint8_t rp; } NvmeLBAF; =20 -typedef struct NvmeIdNs { +typedef struct QEMU_PACKED NvmeIdNs { uint64_t nsze; uint64_t ncap; uint64_t nuse; --=20 2.21.3 From nobody Thu Apr 25 20:17:14 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1593515233; cv=none; d=zohomail.com; s=zohoarc; b=WAjQl9m6hyy3CYJke8OOlKIQ7YGx4m+cqsV9AYXVwHoV/BZP2rNUkExsit4C0RQ5X3mDaWyiOOdLGt8VEFHMLzn0jcD6xBBB+gZ32ROeWy5D6752YE8L+KxXjdjDqRohrzq4pU6TF4AVvXBToPj2d3lLNsbsvNhyLC/bdK+6wZw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593515233; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YZCe5OgsdLzHyTw8HV351yv3jE/x9fSK5ohsnhOc0Kk=; b=Af4K/CqKZZGhojNw/YbiRa4oCuD02yuHrzsCA5+34gNCKspmppAE1EwJRgPtv7Vv+7DPl+QhFr90GrLNf18G6e+CJH23uD5/bgK0oGJIcjH673EK/zAj3wJvinGtBN8atcbDNHuIVEXV1bTbH0Mx0xRdfqYu4vNzksbiYrqJMho= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1593515233082803.7621278030887; Tue, 30 Jun 2020 04:07:13 -0700 (PDT) Received: from localhost ([::1]:34484 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jqE6Z-0002V4-UF for importer@patchew.org; Tue, 30 Jun 2020 07:07:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46854) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jqE4M-0007Uh-2H for qemu-devel@nongnu.org; Tue, 30 Jun 2020 07:04:54 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:57202 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jqE4K-0006R0-H3 for qemu-devel@nongnu.org; Tue, 30 Jun 2020 07:04:53 -0400 Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-189-40z8NBxTN1ybQt7q1hqBdg-1; Tue, 30 Jun 2020 07:04:47 -0400 Received: by mail-ed1-f71.google.com with SMTP id 92so16630270edl.8 for ; Tue, 30 Jun 2020 04:04:47 -0700 (PDT) Received: from x1w.redhat.com (1.red-83-51-162.dynamicip.rima-tde.net. [83.51.162.1]) by smtp.gmail.com with ESMTPSA id sa10sm1756669ejb.79.2020.06.30.04.04.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2020 04:04:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593515091; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YZCe5OgsdLzHyTw8HV351yv3jE/x9fSK5ohsnhOc0Kk=; b=YoREJ7czVVrCBVPZvQbL02ZSdIv36qOH3/h9CwxjzWtje/GmAu+uuhVwClt6DCzljbGS9X MjUKfMAP0aBdy/ypN+h8i7F0mb7yTpBOlHw1vtx/zqPyLy1h4AnTqaHp8gJtlvqJdC/4bk Yub96knXQHBSmHHzsnLVWo1JHYRhFVM= X-MC-Unique: 40z8NBxTN1ybQt7q1hqBdg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YZCe5OgsdLzHyTw8HV351yv3jE/x9fSK5ohsnhOc0Kk=; b=a6kzgnNl/Tecl6WmW2zZpPdxNo18ktB6nOwWM8z4e8LWQ4mPOQoLCQQ+EEENFguJiD 8wp7UcHa/Cgfh//d43bCf42idn/GLI4oldu726XzEeLOpj/YPeEP4mESd594QmFw55v2 0/hkekkv/04vzA4pgzXuYsFj0Fx6u+tL+PB5HZ39LmhF8nMj5U13DTTd8X6xBwpf+J+L Hic8Cl/+osP534ks72VjslUIOF37iVabLOUQjT717q8pbpxVRrf+t5eUYfuspzyVrauc h0tbjtsBNcW7GaRMB8sTNi/5983e9+ZV5EnqVWj0pyELpkKdC/vm4otnhG+utqNuw0Qp pkIA== X-Gm-Message-State: AOAM5317AamaFCH6LaSqMemj5+dNPYW3NbqE47zsGVvjA9eyq7DIxkz5 kaJ1Y0QvpU2KODzDfJMFj9+b5qvlxKGe/gSeB0Zuwv+N8avs8PAx2ZM4QVfmSd7cejmJpQkX/FG /pBMCc8t6wrehxJw= X-Received: by 2002:a17:906:2851:: with SMTP id s17mr18057134ejc.347.1593515086525; Tue, 30 Jun 2020 04:04:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxquEY1ayhYdraosdZZbxagGQCURPcP1PP5/ZbIJQXa3Ch69ikv0ig+if7CiLz0O1U9PJeqpQ== X-Received: by 2002:a17:906:2851:: with SMTP id s17mr18057121ejc.347.1593515086374; Tue, 30 Jun 2020 04:04:46 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v3 3/4] hw/block/nvme: Fix pmrmsc register size Date: Tue, 30 Jun 2020 13:04:28 +0200 Message-Id: <20200630110429.19972-4-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200630110429.19972-1-philmd@redhat.com> References: <20200630110429.19972-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.81; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/30 02:00:02 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu-block@nongnu.org, Klaus Jensen , Maxim Levitsky , Andrzej Jakowski , Keith Busch , Max Reitz , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The Persistent Memory Region Controller Memory Space Control register is 64-bit wide. See 'Figure 68: Register Definition' of the 'NVM Express Base Specification Revision 1.4'. Fixes: 6cf9413229 ("introduce PMR support from NVMe 1.4 spec") Reported-by: Klaus Jensen Reviewed-by: Klaus Jensen Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by Andrzej Jakowski Reviewed-by: Dmitry Fomichev --- Cc: Andrzej Jakowski --- include/block/nvme.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/block/nvme.h b/include/block/nvme.h index 71c5681912..82c384614a 100644 --- a/include/block/nvme.h +++ b/include/block/nvme.h @@ -21,7 +21,7 @@ typedef struct QEMU_PACKED NvmeBar { uint32_t pmrsts; uint32_t pmrebs; uint32_t pmrswtp; - uint32_t pmrmsc; + uint64_t pmrmsc; } NvmeBar; =20 enum NvmeCapShift { --=20 2.21.3 From nobody Thu Apr 25 20:17:14 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1593515314; cv=none; d=zohomail.com; s=zohoarc; b=MQpdg6JijcOdM+fm3qDzMyTecb+wYs7O7DhJT3E/D1j10tE4YvDnb6Jb0Oucz79KE8Y/nV0bKlg7TEnExjmwlc0AKiAR+ndUZP3/Y5oxnkbraEt/qBKybrVRl6NxmGrFOLBTNO4+f3YIBCun/RLDCMdtYHfiInL2QAqM+DuxPXI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593515314; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=6hZuFq5xzvZS6bLKa5uoWehD4BHAaugQmIpv0406m0o=; b=ZEbNph9y3M9EBEtQcp7PEbFeroj6DqhOUJTmrdetc4k1G7DL4s4BOwG+HOIQ4E/s4KPpz31eKTfdS3tqLNu7kNpjygSAWG47JIdpwoLnMJNg6hKs5QjAJK4SM+Nt6Nh+Uj+tMcjCOgCe/7tLj1M5dRW0PEXSg01LhulDEzS+By0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1593515314645164.09921491988985; Tue, 30 Jun 2020 04:08:34 -0700 (PDT) Received: from localhost ([::1]:38746 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jqE7t-0004Mo-FE for importer@patchew.org; Tue, 30 Jun 2020 07:08:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jqE4O-0007as-Sy for qemu-devel@nongnu.org; Tue, 30 Jun 2020 07:04:56 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:26230 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jqE4N-0006RI-BH for qemu-devel@nongnu.org; Tue, 30 Jun 2020 07:04:56 -0400 Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-61-bK6T768AMYqFJWpmg8q0UQ-1; Tue, 30 Jun 2020 07:04:53 -0400 Received: by mail-ej1-f70.google.com with SMTP id q9so2350523ejr.21 for ; Tue, 30 Jun 2020 04:04:52 -0700 (PDT) Received: from x1w.redhat.com (1.red-83-51-162.dynamicip.rima-tde.net. [83.51.162.1]) by smtp.gmail.com with ESMTPSA id d12sm2472028edx.80.2020.06.30.04.04.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2020 04:04:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593515094; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6hZuFq5xzvZS6bLKa5uoWehD4BHAaugQmIpv0406m0o=; b=fBOd9b32PtI5b4NCQmApcQx+uSUx8XJfGu0DiLpJwXTL63yrGaG8Qkvq71/odCoUxQuX/f HFV8zLl2UIZbHL2IcHuVnfqdCfzjkZH3xh7ZH8wLfoHMOF+bmRL/Yp03JipRH7kIiT3fKM qzJVo51yukYILT1TX5yv3bw17lyxK1c= X-MC-Unique: bK6T768AMYqFJWpmg8q0UQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6hZuFq5xzvZS6bLKa5uoWehD4BHAaugQmIpv0406m0o=; b=YqSfNI5N9hIfBAkqMBeSXq6SKWdfoTrxcPDzU72BXQUHWE4wZBsNJmX3FbrFx7mmWW vSFvMfJl6XagFENCB5hc9AtbBqOppgchM+OMb2vmWEJUBI+iZMmjzDPp8A7VSRU3x5xg mfOFyvcFq56Qc+/CTSsGVIZzdYyslaCgK1xS3T/TpNyzcXvcF3eRLw4rEYe0M1JeAJ+Z TapZTkEwDsf6fyP8a4voddrEBV7C7lN2Bs40gbWxJ1L4T7BJcaU74azHzGkrPS6VmTLE OsNEJD5lfUZ6Fn2qlOjPA8ujDi/RBbg+M1rnjQpgT+eD+/Te8kzYj7SaJFmHUNe7dfCM YeZw== X-Gm-Message-State: AOAM5335TWY9wRdoBHtnFcKhvOxqtiFXZBFoyq2F50znJOvhkOMU6Fxa 0ryx3EAttRri9PwuG3gRwlZ9wJgVEHdYzzePtENm9TeFNejNSmtJQd93MV3slIGcIcmZeYLuyZ0 e0I6Tb2fO6xZEhYI= X-Received: by 2002:a05:6402:30b2:: with SMTP id df18mr22502385edb.229.1593515091613; Tue, 30 Jun 2020 04:04:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZUkApC1FjmmylYyn2z2GZ6iWGdUJiEoqr44T2hS6r3AcnMdadaqiLSoi1HMBQkHtJGZQ9mQ== X-Received: by 2002:a05:6402:30b2:: with SMTP id df18mr22502365edb.229.1593515091375; Tue, 30 Jun 2020 04:04:51 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v3 4/4] hw/block/nvme: Align I/O BAR to 4 KiB Date: Tue, 30 Jun 2020 13:04:29 +0200 Message-Id: <20200630110429.19972-5-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200630110429.19972-1-philmd@redhat.com> References: <20200630110429.19972-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.120; envelope-from=philmd@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/30 00:34:33 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu-block@nongnu.org, Klaus Jensen , Maxim Levitsky , Keith Busch , Max Reitz , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Simplify the NVMe emulated device by aligning the I/O BAR to 4 KiB. Reviewed-by: Klaus Jensen Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Dmitry Fomichev --- include/block/nvme.h | 2 ++ hw/block/nvme.c | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/block/nvme.h b/include/block/nvme.h index 82c384614a..4e1cea576a 100644 --- a/include/block/nvme.h +++ b/include/block/nvme.h @@ -22,6 +22,7 @@ typedef struct QEMU_PACKED NvmeBar { uint32_t pmrebs; uint32_t pmrswtp; uint64_t pmrmsc; + uint8_t reserved[484]; } NvmeBar; =20 enum NvmeCapShift { @@ -879,6 +880,7 @@ enum NvmeIdNsDps { =20 static inline void _nvme_check_size(void) { + QEMU_BUILD_BUG_ON(sizeof(NvmeBar) !=3D 4096); QEMU_BUILD_BUG_ON(sizeof(NvmeAerResult) !=3D 4); QEMU_BUILD_BUG_ON(sizeof(NvmeCqe) !=3D 16); QEMU_BUILD_BUG_ON(sizeof(NvmeDsmRange) !=3D 16); diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 6628d0a4ba..2aa54bc20e 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -55,7 +55,6 @@ #include "nvme.h" =20 #define NVME_MAX_IOQPAIRS 0xffff -#define NVME_REG_SIZE 0x1000 #define NVME_DB_SIZE 4 #define NVME_CMB_BIR 2 #define NVME_PMR_BIR 2 @@ -1322,7 +1321,7 @@ static void nvme_mmio_write(void *opaque, hwaddr addr= , uint64_t data, NvmeCtrl *n =3D (NvmeCtrl *)opaque; if (addr < sizeof(n->bar)) { nvme_write_bar(n, addr, data, size); - } else if (addr >=3D 0x1000) { + } else { nvme_process_db(n, addr, data); } } @@ -1416,7 +1415,7 @@ static void nvme_init_state(NvmeCtrl *n) { n->num_namespaces =3D 1; /* add one to max_ioqpairs to account for the admin queue pair */ - n->reg_size =3D pow2ceil(NVME_REG_SIZE + + n->reg_size =3D pow2ceil(sizeof(NvmeBar) + 2 * (n->params.max_ioqpairs + 1) * NVME_DB_SIZE= ); n->namespaces =3D g_new0(NvmeNamespace, n->num_namespaces); n->sq =3D g_new0(NvmeSQueue *, n->params.max_ioqpairs + 1); --=20 2.21.3