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,URIBL_BLOCKED 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 A08F0C2B9F4 for ; Mon, 28 Jun 2021 17:07:08 +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 516976121E for ; Mon, 28 Jun 2021 17:07:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 516976121E 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]:47160 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lxuix-0004L9-8Q for qemu-devel@archiver.kernel.org; Mon, 28 Jun 2021 13:07:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33070) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxufY-0002g7-Nz; Mon, 28 Jun 2021 13:03:36 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:55185) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxufW-00032I-VR; Mon, 28 Jun 2021 13:03:36 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id A9E3F5C0046; Mon, 28 Jun 2021 13:03:33 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 28 Jun 2021 13:03:33 -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=yJTtWdXK5g0aGrjaM8cxqSWRVj6 n6zkQkHyAl4VuTUg=; b=GkEslt//fxztdnwsKgMd5wVbxmZxNUyHYIfnH/Z537i s7T3eFqDBWC9aeKlNfX7dJSMtz5Ms4/sWht7zQdSqKo/DWZBXqyXfb2Y6s5lE25X XDvL1L0tfubKxeo6r/16sLEnPWq28wUpZOfaw4pVwhzGmVX6DxlwpcY0vdsYYw/B rOmN6VULo41Cb8HV776Ps9DpE2onJ42b+eNTyuUn7zWObZh9mF4nNwzKulYHfnpC 2do44CyjceFH2gx6H3kOlJqo3IdTZ9AYPP6mmmBFeNhI0rPcF8wYAvTuypiB3hEE lc7hxS2fnMSk3QW5jmU4Dg+3GN34AvbYkUVbvNjmDFA== 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=yJTtWd XK5g0aGrjaM8cxqSWRVj6n6zkQkHyAl4VuTUg=; b=p60fgMBeMgk7YPpORFItPK NjdBnTWnwDiJP3VTWEhrGh7AXMHQ2SVE6C8YWJwIzBkJ3Igu0Ri43OsWdLhDkO1K VIHuz257kR52XWMlh8Cs+lydyiECzIv3zRSeAB4hes/B8XWv31uBxyPB3qxLA6Pu TY+10MBFlz9AjhVypBBxCMJnyScPUJWEh0XdHoZbsP5hpklSdzYeShD4GtnmulLr uQZm8V5Rn67cwfuodefEWjh/N/d/eM+cMr5OeJA6ejBg78O2jDO+Kj5wEzB6nySx bty2l7Cb90X4npYVkBbYGFghAklP+FY+1mZSnwe8zA6jWPY/dkUQK1gSfTBW/5mA == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfeehgedguddtjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkfhggtggujgesghdtreertddtjeenucfhrhhomhepmfhlrghu shculfgvnhhsvghnuceoihhtshesihhrrhgvlhgvvhgrnhhtrdgukheqnecuggftrfgrth htvghrnhepteduheeffefhgfeifeehgfetffffgeetveffgeduteetuedvjeevteeljefg fedunecuffhomhgrihhnpehgihhtlhgrsgdrtghomhenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehithhssehirhhrvghlvghvrghnthdrughk X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 28 Jun 2021 13:03:31 -0400 (EDT) Date: Mon, 28 Jun 2021 19:03:29 +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="ZbSwbYTnt1ApPFNW" Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=66.111.4.29; envelope-from=its@irrelevant.dk; helo=out5-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_H4=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" --ZbSwbYTnt1ApPFNW Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Jun 17 21:17, Klaus Jensen wrote: >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 off= set, 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 >> > >Bump :) Bump^2 :) --ZbSwbYTnt1ApPFNW Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEUigzqnXi3OaiR2bATeGvMW1PDekFAmDaAOAACgkQTeGvMW1P Deni7gf/bmO4ieC0rTGRogl2EMi3uoLHgDs+GSYeTB46J4pPdLe+vnfV/vsTeuSC 10lkkAnOCFeIb8HbX3szoL5MIMDtNTE5kz2B8EaGRsBDHOou9KqU4YikjomL3BaJ uZdUb4b4emYhURAf4OlNBds2kTQDWN4q+QuZyJX4EkUjhbN0N5i8Nyw/kKuZVyn4 JFHu81FsKVncWsWYCY8nvK2uez/sNfe2WzrDdCVHACi+Z+2RIKEGOrhik2PqE8dL w5g9WMQP6I37r/DVrwXCZZPtqd3M5g3oDTI6NmzyQSY0IyZNtjGfV4e9rwEFn614 bTC/N1c71XGEEqBefql2mzQnEyz1QA== =WHSx -----END PGP SIGNATURE----- --ZbSwbYTnt1ApPFNW--