From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 911D9740035 for ; Tue, 30 Jan 2024 19:29:39 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=/TY1fgXSL/8KN2CfEIAzlrvifRpRR84E7ABnKk80mmI=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1706642978; v=1; b=pERZNSP8LwEdIiEfTezhpl/rqSaRjJq8wP19Hbe7mUfkl+8eO+BjN4cAD7jIL1MUCKnG/6qu ewWO6L0OSbx14dRg/py+HDYO1RsQh5JPAiWoq7RpMNyN/sAwNw/3yyeD0QkAD8yilAsI0lcVoGJ e+5VZu2tiDs5dvODX2ToTTgI= X-Received: by 127.0.0.2 with SMTP id NMU2YY7687511xevreXT57rS; Tue, 30 Jan 2024 11:29:38 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web10.5670.1706642977627707269 for ; Tue, 30 Jan 2024 11:29:37 -0800 X-Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-572-LE7aDCg0PyOzwJgWOfSExA-1; Tue, 30 Jan 2024 14:29:30 -0500 X-MC-Unique: LE7aDCg0PyOzwJgWOfSExA-1 X-Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9F2CA8F5DA2; Tue, 30 Jan 2024 19:29:29 +0000 (UTC) X-Received: from [10.39.192.28] (unknown [10.39.192.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 11DAA2166B31; Tue, 30 Jan 2024 19:29:27 +0000 (UTC) Message-ID: Date: Tue, 30 Jan 2024 20:29:27 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH v3 3/4] UefiCpuPkg/MtrrLib.h: use cache type #defines from ArchitecturalMsr.h To: devel@edk2.groups.io, kraxel@redhat.com Cc: Michael Roth , Oliver Steffen , Jiewen Yao , Tom Lendacky , Min Xu , Ard Biesheuvel , Erdem Aktas , Rahul Kumar , Ray Ni References: <20240130130441.772484-1-kraxel@redhat.com> <20240130130441.772484-4-kraxel@redhat.com> From: "Laszlo Ersek" In-Reply-To: <20240130130441.772484-4-kraxel@redhat.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,lersek@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: MHjpfcsg9e0tHJoa1Ffmf2l4x7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=pERZNSP8; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io CC'ing Ray and Rahul On 1/30/24 14:04, Gerd Hoffmann wrote: > Signed-off-by: Gerd Hoffmann > --- > UefiCpuPkg/Include/Library/MtrrLib.h | 26 ++++++++++++++------------ > 1 file changed, 14 insertions(+), 12 deletions(-) >=20 > diff --git a/UefiCpuPkg/Include/Library/MtrrLib.h b/UefiCpuPkg/Include/Li= brary/MtrrLib.h > index 86cc1aab3b8e..9d715d50dfb0 100644 > --- a/UefiCpuPkg/Include/Library/MtrrLib.h > +++ b/UefiCpuPkg/Include/Library/MtrrLib.h > @@ -9,6 +9,8 @@ > #ifndef _MTRR_LIB_H_ > #define _MTRR_LIB_H_ > =20 > +#include > + > // > // According to IA32 SDM, MTRRs number and MSR offset are always consist= ent > // for IA32 processor family > @@ -82,20 +84,20 @@ typedef struct _MTRR_SETTINGS_ { > // Memory cache types > // > typedef enum { > - CacheUncacheable =3D 0, > - CacheWriteCombining =3D 1, > - CacheWriteThrough =3D 4, > - CacheWriteProtected =3D 5, > - CacheWriteBack =3D 6, > - CacheInvalid =3D 7 > + CacheUncacheable =3D MSR_IA32_MTRR_CACHE_UNCACHEABLE, > + CacheWriteCombining =3D MSR_IA32_MTRR_CACHE_WRITE_COMBINING, > + CacheWriteThrough =3D MSR_IA32_MTRR_CACHE_WRITE_THROUGH, > + CacheWriteProtected =3D MSR_IA32_MTRR_CACHE_WRITE_PROTECTED, > + CacheWriteBack =3D MSR_IA32_MTRR_CACHE_WRITE_BACK, > + CacheInvalid =3D MSR_IA32_MTRR_CACHE_INVALID_TYPE, > } MTRR_MEMORY_CACHE_TYPE; > =20 > -#define MTRR_CACHE_UNCACHEABLE 0 > -#define MTRR_CACHE_WRITE_COMBINING 1 > -#define MTRR_CACHE_WRITE_THROUGH 4 > -#define MTRR_CACHE_WRITE_PROTECTED 5 > -#define MTRR_CACHE_WRITE_BACK 6 > -#define MTRR_CACHE_INVALID_TYPE 7 > +#define MTRR_CACHE_UNCACHEABLE MSR_IA32_MTRR_CACHE_UNCACHEABLE > +#define MTRR_CACHE_WRITE_COMBINING MSR_IA32_MTRR_CACHE_WRITE_COMBINING > +#define MTRR_CACHE_WRITE_THROUGH MSR_IA32_MTRR_CACHE_WRITE_THROUGH > +#define MTRR_CACHE_WRITE_PROTECTED MSR_IA32_MTRR_CACHE_WRITE_PROTECTED > +#define MTRR_CACHE_WRITE_BACK MSR_IA32_MTRR_CACHE_WRITE_BACK > +#define MTRR_CACHE_INVALID_TYPE MSR_IA32_MTRR_CACHE_INVALID_TYPE > =20 > typedef struct { > UINT64 BaseAddress; -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#114824): https://edk2.groups.io/g/devel/message/114824 Mute This Topic: https://groups.io/mt/104052592/7686176 Mute #defines:https://edk2.groups.io/g/devel/mutehashtag/defines Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/19134562= 12/xyzzy [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-