From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52EC7C4338F for ; Mon, 2 Aug 2021 02:51:04 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B8AEE61057 for ; Mon, 2 Aug 2021 02:51:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B8AEE61057 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id ABC5083352; Mon, 2 Aug 2021 04:50:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="cBJ2SWFx"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DE1828336B; Mon, 2 Aug 2021 04:50:48 +0200 (CEST) Received: from mail-yb1-xb2b.google.com (mail-yb1-xb2b.google.com [IPv6:2607:f8b0:4864:20::b2b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BC2B883350 for ; Mon, 2 Aug 2021 04:50:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-yb1-xb2b.google.com with SMTP id w17so26223946ybl.11 for ; Sun, 01 Aug 2021 19:50:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Lyq69SQSis3Gyit9i5IkEV9bC127AjO2abHMlt31PBo=; b=cBJ2SWFx2jMpx6PM30VeszK1kvf4udbF4LfROpeqY1tDGbKe2noeS702GrkAstf63j WP40HQnQjFMJHJ0/GUrDHNjknvtOhO+aa2xe16uU0PGfhbdMrkvRyOvhCFXYdZDLIPH9 geZoDTa1HJPxk7yhflIefAArfi50lqOywiTGy4LBryk1g2JEAzssy1dAF9KB6KUHjnBZ MClYo+nxLgA8bJbsX0V6O04z4viTEkIlG3znY0MXXDvvJtmP5/vRoVcQy/UUPJwgvs0W UFDOp8RfqqSefv4rXVoYaiGK25FJOpy9aB0Rfm29Ud4etRb4ZEq1OxzyyXQ+O+7GkDDX gIeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Lyq69SQSis3Gyit9i5IkEV9bC127AjO2abHMlt31PBo=; b=ioVwSsPE0YdVVVIghuBAUQyD+M/OWGgJBib2G0mA9x2h7Wksqd199Evt3rjJSZ6rvd 3rpan8zZ6xLhhRZWbfJFD7zCtXc/jYIyBnRQF+WjQiuxcuAwJ3SzZ8l8XY8XyoZvcQV3 3swKgCBlR4qbEbE/H6b1IjKcGLwSQXKuvjLtsnogwYi/w6KtSqi1L7cf7tySQSD5SFLd bjrbD3xPzWJ8vy1t0rYNFSRXaZkJFEmEnGq118qnuvH1zD1fiLtjhaj9qy/zSmVQmiUU o3myAfGFSPllhHQI/proYyWVCd5UfoYmX3cQw/swmq1yBfItoKNQsAurBWGGBzCPN201 k9mA== X-Gm-Message-State: AOAM532WRd1TVVZ+CVNeIQo0LjUHi6Wd3da0kY4iHjE0qlOWSg3OWAO1 I82NmlosMRoB8zbFJjckLEVjz8jyr34atXwhDsg= X-Google-Smtp-Source: ABdhPJxsUJC96gzpI1Zu4lZPowiiJlZMHbt3TygjSiUrjS9xPx6CBkp/ITam0Ri/+G5+PHFDJnL/XfnawYPl63Y4GEo= X-Received: by 2002:a25:bb08:: with SMTP id z8mr19330168ybg.306.1627872644533; Sun, 01 Aug 2021 19:50:44 -0700 (PDT) MIME-Version: 1.0 References: <20210731084529.7524-1-bmeng.cn@gmail.com> <20210731084529.7524-5-bmeng.cn@gmail.com> In-Reply-To: From: Bin Meng Date: Mon, 2 Aug 2021 10:50:33 +0800 Message-ID: Subject: Re: [PATCH 4/7] x86: mtrr: Abort if requested size is not power of 2 To: Simon Glass Cc: U-Boot Mailing List Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On Mon, Aug 2, 2021 at 3:19 AM Simon Glass wrote: > > On Sat, 31 Jul 2021 at 02:45, Bin Meng wrote: > > > > The size parameter of mtrr_add_request() and mtrr_set_next_var() > > shall be power of 2, otherwise the logic creates a mask that does > > not meet the requirement of IA32_MTRR_PHYSMASK register. > > > > Programming such a mask value to IA32_MTRR_PHYSMASK generates #GP. > > > > Signed-off-by: Bin Meng > > --- > > > > arch/x86/cpu/mtrr.c | 7 +++++++ > > arch/x86/include/asm/mtrr.h | 7 ++++--- > > 2 files changed, 11 insertions(+), 3 deletions(-) > > Reviewed-by: Simon Glass > Tested on chromebook_coral, chromebook_samus, chromebook_link, minnowmax > Tested-by: Simon Glass applied to u-boot-x86, thanks!