From mboxrd@z Thu Jan 1 00:00:00 1970 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=-18.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,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 2A8F0C11F66 for ; Tue, 29 Jun 2021 05:23:34 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CBAC761DC5 for ; Tue, 29 Jun 2021 05:23:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CBAC761DC5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=irrelevant.dk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:60800 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ly6Dc-0002hS-Pv for qemu-devel@archiver.kernel.org; Tue, 29 Jun 2021 01:23:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51102) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ly69o-0000uu-VJ; Tue, 29 Jun 2021 01:19:37 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:58277) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ly69m-0005TG-Lh; Tue, 29 Jun 2021 01:19:36 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 701AD5C02E4; Tue, 29 Jun 2021 01:19:32 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 29 Jun 2021 01:19:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irrelevant.dk; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=G1I2gCyW1TZau40qSU8r7bokyB0 Gl8AHG6GtZBJx2Hk=; b=YARqudrI4rPeaNqb4Q7toc1vHXBIDXxQC+FVC+61c0b fWdb+pF2QMhPV7pCtmy9MovXKZjjqIlHZsrB6TvUSH7JmUAmE7nb9nMpXljgWuBR vr9LYIBZ8Jh7sHxHzrxtxzZHM+TKIj6XE2/Uuwh1J05hcmpukrjm+FfoK0ysDH10 o8I7Sd4622cwghVfCcsTMSYqzu/skR9iFpZTLHbKnG/n2a/QwbrphA8cxcdTSGVT Fo6kMl2cuW3WvGxKcZuLk8/EIhU7aSSA0G40qCbL1Lin3Pr2WYUvpFLWBAbAtsX8 djGQVhmltZRytyV4bLIQttiSen8UVOSo8qhn2r9+0uw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=G1I2gC yW1TZau40qSU8r7bokyB0Gl8AHG6GtZBJx2Hk=; b=qmKrm4ad7l0SF3sqBsZx69 sIby5B70Z3Yt9P8y1CI1rBWPbr4kJuaoxag1b7ycRTB6TaYJlfWEDr/6vshIDxUv h6JmklbN2veMW/1ItOFACcrjjO6hlHthfR4wApNhc3AaQYFm8AvatBCA9Jyonvio 6usWnQkeHCXCGa/wuMiFAMO5PEWnsZEgndr3A9dwG9q1H+/7vuTl+ehmpyAvn6mT raIAcbZJzmKVMTRCavZ/xs4PIHuMG2dr4TnzAUmndwb6nw4xH/xn72VBqe6NDyrg WFrUp7C1caJ3eoRX2kmqDTsZYnyfgPDSQemy73fQ+N9QmPV43O14/1ViveqttBhA == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfeehhedgkeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttdejnecuhfhrohhmpefmlhgruhhs ucflvghnshgvnhcuoehithhssehirhhrvghlvghvrghnthdrughkqeenucggtffrrghtth gvrhhnpeetudehfeefhffgieefhefgteffffegteevffegudetteeuvdejveetleejgfef udenucffohhmrghinhepghhithhlrggsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepihhtshesihhrrhgvlhgvvhgrnhhtrdgukh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 29 Jun 2021 01:19:30 -0400 (EDT) Date: Tue, 29 Jun 2021 07:19:28 +0200 From: Klaus Jensen To: qemu-devel@nongnu.org Subject: Re: [PATCH] hw/nvme: fix missing check for PMR capability Message-ID: References: <20210607094757.29661-1-its@irrelevant.dk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="4LWarcxG3tbXVfuc" Content-Disposition: inline In-Reply-To: <20210607094757.29661-1-its@irrelevant.dk> Received-SPF: pass client-ip=66.111.4.26; envelope-from=its@irrelevant.dk; helo=out2-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no 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: Keith Busch , Klaus Jensen , qemu-stable@nongnu.org, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --4LWarcxG3tbXVfuc Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Jun 7 11:47, Klaus Jensen wrote: >From: Klaus Jensen > >Qiang Liu reported that an access on an unknown address is triggered in >memory_region_set_enabled because a check on CAP.PMRS is missing for the >PMRCTL register write when no PMR is configured. > >Cc: qemu-stable@nongnu.org >Fixes: 75c3c9de961d ("hw/block/nvme: disable PMR at boot up") >Resolves: https://gitlab.com/qemu-project/qemu/-/issues/362 >Signed-off-by: Klaus Jensen >--- > hw/nvme/ctrl.c | 4 ++++ > 1 file changed, 4 insertions(+) > >diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c >index 0bcaf7192f99..463772602c4e 100644 >--- a/hw/nvme/ctrl.c >+++ b/hw/nvme/ctrl.c >@@ -5583,6 +5583,10 @@ static void nvme_write_bar(NvmeCtrl *n, hwaddr offs= et, uint64_t data, > "invalid write to PMRCAP register, ignored"); > return; > case 0xe04: /* PMRCTL */ >+ if (!NVME_CAP_PMRS(n->bar.cap)) { >+ return; >+ } >+ > n->bar.pmrctl =3D data; > if (NVME_PMRCTL_EN(data)) { > memory_region_set_enabled(&n->pmr.dev->mr, true); >--=20 >2.31.1 > Applied to nvme-next! --4LWarcxG3tbXVfuc Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEUigzqnXi3OaiR2bATeGvMW1PDekFAmDarVsACgkQTeGvMW1P DelMHAf+NbtV4VpVNdordPcMlYmx68vwmpE1K1UtwAQ9covOFn/XKwZ+ZhkTij9x pY0IjhLXbGel1Y9jwQ/+8kItuVXojPcg+nlIqdfg9j79aOG/lVwUhedB/RAj5EB6 SoAcQ3E3cegrsjydDnP6AuOcVDBqRaVm0HfsDvDHem/v5AKZ0dYSbYB9kl0F4ydE wfhCA03s5pxj90krYESDHEpf4TVcgDQ5e8+Y2eN7ggjrDd3O1ReEbW62hHBk/CQn ATnMxYMz5mCepkez/pDhejcDaL3hwBNoKLRrniNuGEgPpcu1Qo1xMUfGaLDJSWvL 1WVtQ/JgY5LDuN4L0TsLklrOdNmOjg== =ZSnj -----END PGP SIGNATURE----- --4LWarcxG3tbXVfuc--