From: jsg Date: Wed, 9 Aug 2023 02:59:41 +0000 (+0000) Subject: correct platform id mask, it is 3 bits 52:50 X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=f0857601a59e4c7604d6d8ec48c20536def019c2;p=openbsd correct platform id mask, it is 3 bits 52:50 --- diff --git a/sys/arch/amd64/amd64/ucode.c b/sys/arch/amd64/amd64/ucode.c index 1cb21e9c8c9..c2badbcfd9c 100644 --- a/sys/arch/amd64/amd64/ucode.c +++ b/sys/arch/amd64/amd64/ucode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ucode.c,v 1.6 2023/07/23 01:46:37 jsg Exp $ */ +/* $OpenBSD: ucode.c,v 1.7 2023/08/09 02:59:41 jsg Exp $ */ /* * Copyright (c) 2018 Stefan Fritsch * Copyright (c) 2018 Patrick Wildt @@ -261,7 +261,7 @@ out: struct intel_ucode_header * cpu_ucode_intel_find(char *data, size_t left, uint32_t current) { - uint64_t platform_id = (rdmsr(MSR_PLATFORM_ID) >> 50) & 0xff; + uint64_t platform_id = (rdmsr(MSR_PLATFORM_ID) >> 50) & 7; uint32_t sig, dummy1, dummy2, dummy3; uint32_t mask = 1UL << platform_id; struct intel_ucode_header *hdr; diff --git a/sys/arch/i386/i386/ucode.c b/sys/arch/i386/i386/ucode.c index 53f76211efc..ec73218f11a 100644 --- a/sys/arch/i386/i386/ucode.c +++ b/sys/arch/i386/i386/ucode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ucode.c,v 1.4 2023/07/23 02:59:53 jsg Exp $ */ +/* $OpenBSD: ucode.c,v 1.5 2023/08/09 02:59:41 jsg Exp $ */ /* * Copyright (c) 2018 Stefan Fritsch * Copyright (c) 2018 Patrick Wildt @@ -284,7 +284,7 @@ out: struct intel_ucode_header * cpu_ucode_intel_find(char *data, size_t left, uint32_t current) { - uint64_t platform_id = (rdmsr(MSR_PLATFORM_ID) >> 50) & 0xff; + uint64_t platform_id = (rdmsr(MSR_PLATFORM_ID) >> 50) & 7; uint32_t sig, dummy1, dummy2, dummy3; uint32_t mask = 1UL << platform_id; struct intel_ucode_header *hdr;