From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-io1-f50.google.com (mail-io1-f50.google.com [209.85.166.50]) by mx.groups.io with SMTP id smtpd.web09.36188.1612796237565848843 for ; Mon, 08 Feb 2021 06:57:17 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=YcuYiv/k; spf=pass (domain: nuviainc.com, ip: 209.85.166.50, mailfrom: rebecca@nuviainc.com) Received: by mail-io1-f50.google.com with SMTP id f67so13452661ioa.1 for ; Mon, 08 Feb 2021 06:57:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=nolICJZZKdEHp+4hJWT97be1c7+KIFx0jyLNdWZvP0g=; b=YcuYiv/kx3xcHq3X2LJsC/A9GNgxaXIpwc806vqgFDYKdaLgnORprAR0wHgcbfmEnM 8GNvfSH2XQnxM0cu/znK2WPfHnKSLYs2DSmJUXRpt7NVqEzzWVhkv+WBKPx8rtWQqMOs BwmlzGPjBcesId+aOZRlInSipju8pAcW5XH2Lr/v6WWctc7iZAzc7XAoEz55NK4JoIBT Z2ZoY410tbg1rtfsXfG0dc35BRBuwujD6mlUcs0+wU/mZAcyuPmZs7TVg4kFHQgIl2L1 REqqi55MA1RxNte76U/Jqj58MMDxfxIeZSDZA/by5cIhT/Me5ov1zqXLe45WNvgXow6x lKIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=nolICJZZKdEHp+4hJWT97be1c7+KIFx0jyLNdWZvP0g=; b=YbFMgLcMFhYbRW0cjR9dPRw3TZXiPIs85ecG5NilrqMT70Za64fcRMmrr/EhFbO8o6 I7gDOQRmPgiLvvdPzTZQQ7nXZRYnde0Pcp0xnajeA7QFL2ZrgxxJlvx/59qUrK51qKXL jkjI89k/f1kTsSE8/pWxn6UXSoYKa8d9LEnRjgEJcTEUgUE7IsdWXLeNv6exDcYBd9BC fa88nYU2QfBmYA7iqPQ1mQdAzKuzggfpqB3ljMO7f2hMB9JUd5VCz4MH/clVrnxFWj5c Bi4yQEgKuSX8ovWIPYoMSSZr4W5X2aUr69EGyNLgZuXnZpLJea+ejV6G+PNwTCVGGzoL 8TWg== X-Gm-Message-State: AOAM5313sfqauBQNuwIiSL7A9bFYE3Qq9FDyJ1s60fBNWK/11oQgwdAj 5CFCskw86BCKvygnugXI2ySYAg== X-Google-Smtp-Source: ABdhPJzkylgXkcm4KNO25fqnoz4gqwpaNKXRAXS5ZHz+sqT0AVoloppbwr4IrXHCyIikTPxGRbvt9w== X-Received: by 2002:a6b:5002:: with SMTP id e2mr7082580iob.152.1612796237021; Mon, 08 Feb 2021 06:57:17 -0800 (PST) Return-Path: Received: from [10.0.10.142] (c-174-52-16-57.hsd1.ut.comcast.net. [174.52.16.57]) by smtp.gmail.com with ESMTPSA id x19sm3304520ioh.32.2021.02.08.06.57.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 Feb 2021 06:57:16 -0800 (PST) Subject: Re: [PATCH v7 13/21] ArmPkg: Add Universal/Smbios/ProcessorSubClassDxe To: Leif Lindholm Cc: devel@edk2.groups.io, Ard Biesheuvel , nd@arm.com, Sami Mujawar , Liming Gao , Michael D Kinney , Zhiguang Liu , Samer El-Haj-Mahmoud , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= References: <20210131232511.18340-1-rebecca@nuviainc.com> <20210131232511.18340-14-rebecca@nuviainc.com> <20210203151844.GX1664@vanye> From: "Rebecca Cran" Message-ID: Date: Mon, 8 Feb 2021 07:57:14 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <20210203151844.GX1664@vanye> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 2/3/21 8:18 AM, Leif Lindholm wrote: > On Sun, Jan 31, 2021 at 16:25:03 -0700, Rebecca Cran wrote: >> + // At each level of cache, we can have a single type (unified, instruction or data), >> + // or two types - separate data and instruction caches. If we have separate >> + // instruction and data caches, then on the first iteration (CacheSubLevel = 0) >> + // process the instruction cache. >> + for (DataCacheType = 0; DataCacheType <= 1; DataCacheType++) { >> + // If there's no separate data/instruction cache, skip the second iteration >> + if (DataCacheType > 0 && !SeparateCaches) { >> + continue; >> + } >> + >> + Type7Record = AllocateAndInitCacheInformation (CacheLevel, >> + DataCacheType == 0 && SeparateCaches, >> + DataCacheType == 1, >> + DataCacheType == 0 && !SeparateCaches >> + ); > > This is a bit too clever for my poor brain. > Could we pass DataCacheType and SeparateCaches and do the logic > conversion in the function? I hope you don't mind, but I kept the DataCache and UnifiedCache parameters in the v8 version and just passed !SeparateCaches instead, which I think is neater. > It feels like this is still somewhat encoding ARM architectural > behaviour in the API? SMBIOS defines > typedef enum { > CacheTypeOther = 0x01, > CacheTypeUnknown = 0x02, > CacheTypeInstruction = 0x03, > CacheTypeData = 0x04, > CacheTypeUnified = 0x05 > } CACHE_TYPE_DATA; > > OK, let's worry about that aspect later, but please, move the logic > into the functions. I don't think there should be any left, now: just a generic assumption about caches either being split I/D or unified. -- Rebecca Cran