From: Davidlohr Bueso <dave@stgolabs.net>
To: Jonathan.Cameron@huawei.com
Cc: fan.ni@samsung.com, dan.j.williams@intel.com,
alison.schofield@intel.com, ayush.m55@samsung.com,
a.manzanares@samsung.com, dave@stgolabs.net,
linux-cxl@vger.kernel.org
Subject: [PATCH 1/4] cxl/type3: Fix crash in set_cacheline()
Date: Fri, 8 Sep 2023 00:31:49 -0700 [thread overview]
Message-ID: <20230908073152.4386-2-dave@stgolabs.net> (raw)
In-Reply-To: <20230908073152.4386-1-dave@stgolabs.net>
Use the correct vmr_size, otherwise a clear poison operation, for
example, can crash the emulator.
Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
---
hw/mem/cxl_type3.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/mem/cxl_type3.c b/hw/mem/cxl_type3.c
index fd9d134d468f..b90a7397d62f 100644
--- a/hw/mem/cxl_type3.c
+++ b/hw/mem/cxl_type3.c
@@ -1417,7 +1417,7 @@ static bool set_cacheline(CXLType3Dev *ct3d, uint64_t dpa_offset, uint8_t *data)
as = &ct3d->hostvmem_as;
} else if (dpa_offset < vmr_size + pmr_size) {
as = &ct3d->hostpmem_as;
- dpa_offset -= vmr->size;
+ dpa_offset -= vmr_size;
} else {
as = &ct3d->dc.host_dc_as;
dpa_offset -= (vmr_size + pmr_size);
--
2.42.0
next prev parent reply other threads:[~2023-09-08 7:32 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-08 7:31 [PATCH -qemu 0/4] hw/cxl: Support for scan media Davidlohr Bueso
2023-09-08 7:31 ` Davidlohr Bueso [this message]
2023-09-08 18:37 ` [PATCH 1/4] cxl/type3: Fix crash in set_cacheline() Fan Ni
2023-09-12 10:59 ` Jonathan Cameron
2023-09-08 7:31 ` [PATCH 2/4] hw/cxl: Add get scan media capabilities cmd support Davidlohr Bueso
2023-09-08 18:47 ` Fan Ni
2023-09-08 19:44 ` Davidlohr Bueso
2023-09-12 11:20 ` Jonathan Cameron
2023-09-12 11:25 ` Jonathan Cameron
2023-09-08 7:31 ` [PATCH 3/4] hw/cxl: Add scan media " Davidlohr Bueso
2023-09-12 11:57 ` Jonathan Cameron
2023-09-13 3:47 ` Davidlohr Bueso
2023-09-08 7:31 ` [PATCH 4/4] hw/cxl: Add get scan media results " Davidlohr Bueso
2023-09-12 12:04 ` Jonathan Cameron
2023-09-13 3:33 ` Davidlohr Bueso
2023-09-13 13:30 ` Jonathan Cameron
2023-09-16 0:11 ` Davidlohr Bueso
2023-09-18 11:11 ` Jonathan Cameron
2023-09-18 16:58 ` Gregory Price
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230908073152.4386-2-dave@stgolabs.net \
--to=dave@stgolabs.net \
--cc=Jonathan.Cameron@huawei.com \
--cc=a.manzanares@samsung.com \
--cc=alison.schofield@intel.com \
--cc=ayush.m55@samsung.com \
--cc=dan.j.williams@intel.com \
--cc=fan.ni@samsung.com \
--cc=linux-cxl@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox