xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/vhpet: Fix type size in timer_int_route_valid
@ 2020-07-28  8:33 Eslam Elnikety
  2020-07-28  8:58 ` Roger Pau Monné
  2020-07-28  9:26 ` Andrew Cooper
  0 siblings, 2 replies; 12+ messages in thread
From: Eslam Elnikety @ 2020-07-28  8:33 UTC (permalink / raw)
  To: xen-devel
  Cc: Wei Liu, Andrew Cooper, Eslam Elnikety, Paul Durrant,
	Jan Beulich, Roger Pau Monné

The macro timer_int_route_cap evalutes to a 64 bit value. Extend the
size of left side of timer_int_route_valid to match.

This bug was discovered and resolved using Coverity Static Analysis
Security Testing (SAST) by Synopsys, Inc.

Signed-off-by: Eslam Elnikety <elnikety@amazon.com>
---
 xen/arch/x86/hvm/hpet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/hpet.c b/xen/arch/x86/hvm/hpet.c
index ca94e8b453..9afe6e6760 100644
--- a/xen/arch/x86/hvm/hpet.c
+++ b/xen/arch/x86/hvm/hpet.c
@@ -66,7 +66,7 @@
     MASK_EXTR(timer_config(h, n), HPET_TN_INT_ROUTE_CAP)
 
 #define timer_int_route_valid(h, n) \
-    ((1u << timer_int_route(h, n)) & timer_int_route_cap(h, n))
+    ((1ULL << timer_int_route(h, n)) & timer_int_route_cap(h, n))
 
 static inline uint64_t hpet_read_maincounter(HPETState *h, uint64_t guest_time)
 {
-- 
2.16.6



^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-07-31 12:39 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-28  8:33 [PATCH] x86/vhpet: Fix type size in timer_int_route_valid Eslam Elnikety
2020-07-28  8:58 ` Roger Pau Monné
2020-07-28  9:14   ` Eslam Elnikety
2020-07-28  9:26 ` Andrew Cooper
2020-07-28 11:09   ` Eslam Elnikety
2020-07-28 13:46     ` Andrew Cooper
2020-07-28 13:55       ` Eslam Elnikety
2020-07-28 17:51   ` Jan Beulich
2020-07-31  8:38     ` Eslam Elnikety
2020-07-31  9:53       ` Jan Beulich
2020-07-31 12:35         ` Julien Grall
2020-07-31 12:38           ` Jan Beulich

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).