From: Jonathan Cameron via <qemu-devel@nongnu.org>
To: <linuxarm@huawei.com>, <qemu-devel@nongnu.org>,
"Michael S . Tsirkin" <mst@redhat.com>,
Igor Mammedov <imammedo@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>
Cc: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>,
"Ben Widawsky" <bwidawsk@kernel.org>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: [PATCH 3/3] hw/cxl: Fix size of constant in interleave granularity function.
Date: Fri, 1 Jul 2022 14:23:00 +0100 [thread overview]
Message-ID: <20220701132300.2264-4-Jonathan.Cameron@huawei.com> (raw)
In-Reply-To: <20220701132300.2264-1-Jonathan.Cameron@huawei.com>
Whilst the interleave granularity is always small enough that this isn't
a real problem (much less than 4GiB) let's change the constant
to ULL to fix the coverity warning.
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Fixes: 829de299d1 ("hw/cxl/component: Add utils for interleave parameter encoding/decoding")
Fixes: Coverity CID 1488868
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
include/hw/cxl/cxl_component.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/hw/cxl/cxl_component.h b/include/hw/cxl/cxl_component.h
index 70b5018156..94ec2f07d7 100644
--- a/include/hw/cxl/cxl_component.h
+++ b/include/hw/cxl/cxl_component.h
@@ -215,7 +215,7 @@ uint8_t cxl_interleave_granularity_enc(uint64_t gran, Error **errp);
static inline hwaddr cxl_decode_ig(int ig)
{
- return 1 << (ig + 8);
+ return 1ULL << (ig + 8);
}
CXLComponentState *cxl_get_hb_cstate(PCIHostState *hb);
--
2.32.0
next prev parent reply other threads:[~2022-07-01 13:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-01 13:22 [PATCH 0/3] hw/cxl, hw/machine, hw/i386: Misc minor fixes / cleanup Jonathan Cameron via
2022-07-01 13:22 ` [PATCH 1/3] hw/machine: Clear out left over CXL related pointer from move of state handling to machines Jonathan Cameron via
2022-07-01 13:22 ` [PATCH 2/3] hw/i386/pc: Always place CXL Memory Regions after device_memory Jonathan Cameron via
2022-07-01 13:23 ` Jonathan Cameron via [this message]
2022-07-11 12:42 ` [PATCH 0/3] hw/cxl, hw/machine, hw/i386: Misc minor fixes / cleanup Igor Mammedov
2022-07-19 14:09 ` Peter Maydell
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=20220701132300.2264-4-Jonathan.Cameron@huawei.com \
--to=qemu-devel@nongnu.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=bwidawsk@kernel.org \
--cc=imammedo@redhat.com \
--cc=linuxarm@huawei.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=shameerali.kolothum.thodi@huawei.com \
/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;
as well as URLs for NNTP newsgroup(s).