From patchwork Thu Mar 29 08:19:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gary guo X-Patchwork-Id: 132559 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp1447076ljb; Thu, 29 Mar 2018 01:20:26 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/9uDcEKEOtO/gp4khc6JTqUippW2q6P4kjb1V4KM73Pq18L9GMbFEL7rHZzp+EC1DKokRJ X-Received: by 10.99.65.6 with SMTP id o6mr4802049pga.57.1522311626314; Thu, 29 Mar 2018 01:20:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522311626; cv=none; d=google.com; s=arc-20160816; b=GrsL3Ttfo+6FFr6g0kugJkanoMk5BLyExNFrKxAPbkBT5ZYcdgYwnibWFXZvo6i98u 7JVsLvWUP8JJbjKn4KaKknusAzHhgwCMvsZFFDFR+ObRFhA0u2uHy7OZsjjuYyOwsnf3 dsg1ClQN0oG2J6fObU7HwbdrsEXfzMwmK0LrtcGVN1/pqYPmrtfj3hCjvFfjRrHsZjz5 tXmjMsVnL5NVmgwz7kmJ3XCc1rZGmd84q0E31cXQHfFq2lqznHpXfDAO5Lh5MNR6UV0p Okq7BvaCN6xm1CTTnkERa3iAkyIiQAH/iVx0Zu4sRVC3x0XtmtOrvLzvudAmS1/OzioF VzLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=BFIsZEO4iuDthM6YqiJDSwWZ7PBTtRQki18VRXbGIMw=; b=WsN6i35sLA1lSAJJqgV2TE5DEzX0vDeWrYFxOv4gHQ5GrEkBqsz7MeXfuoEn51+Kf2 YIiyQ/Sdt40p/pAdQbsjbBHKnAccu0o7SbfaCgo/4ft1osAspSJPLZI1edue9LbzoGFp GsSdX8hK1hQGeEKxosWCkD5ia1zM2xQNfDy00N0mmo+r7mEdWCE1vWwTMPGoytIXADBl j0tyntIceAk2lmRcEeXNmsHBcns30leC7QgSoKcgyuOwLuXXM5sHmHW+nZCEzNZf7rHR Xcwp5rTK/KJmCN9hnt/ECpc4YQEsZAQIYEUR2/w2Qi6NoVprhC5uZ0EYO3PbmABCfSbh I6LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=DBJYjnfp; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id w64si3705918pgd.176.2018.03.29.01.20.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Mar 2018 01:20:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=DBJYjnfp; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id B2CCC21F0DB21; Thu, 29 Mar 2018 01:13:45 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:400e:c05::244; helo=mail-pg0-x244.google.com; envelope-from=heyi.guo@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pg0-x244.google.com (mail-pg0-x244.google.com [IPv6:2607:f8b0:400e:c05::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7BEDE21F0DB18 for ; Thu, 29 Mar 2018 01:13:43 -0700 (PDT) Received: by mail-pg0-x244.google.com with SMTP id y63so2590848pgy.12 for ; Thu, 29 Mar 2018 01:20:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=AsA7a75/5ef5tHRQn6rBxMA0KnJquNy8MlqmPXgC21Y=; b=DBJYjnfp11WRSEdkD+sgghiDlC+2g77WqaHJgESYSbxzVVZUewAs0SZsHFiV+2+6Yu sA8PHUdJSl7L8PZmImusqtnPKRTwXxNAjWRNZzhROs0hTefJqjA80P5IR6YSqpuLdNEl 2iHxPEoXPInaDXfCsR8mggvPQ9B+tEpsClr/s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=AsA7a75/5ef5tHRQn6rBxMA0KnJquNy8MlqmPXgC21Y=; b=akTtNEWvPTYDxYfc6YjvH9rDFsSAtuHpSkXkAL8SzBP5MqTcctr+vE3nqLidecl0RI I17HFICoOXM0zITOEDuT/9dZcq/wMQjzzwf6UvS+XTEz+3LlQ26dRwq30GdqlX/vbSU2 EzUD0OdFzWu8dohNalbhtq8EG1gb/kfUNAbXg0CiaMRszDWD2tCRcLV4JO4WmkYGcIlk 69Wo/oWzPPilpkucV9ftRIrvnxRu4W+38WopINYBrFAOnwzXJOstk4lGjZG2968sRFfX 06C/CS2Gmlwpt450nLyeW4MAT1Wjw/aFbnj8nsPWOlLLSdtWsGTw25X2b0nKTn6F7+na 0GeQ== X-Gm-Message-State: AElRT7GAZpA8Sm4gRSEzNkjQLf7XDCPGB3ig7Hr7qUiCezWko77e+yrT dapDzNE7IRfgOJR3O/AGtyvNxbwZQ7k= X-Received: by 2002:a17:902:8609:: with SMTP id f9-v6mr2454606plo.8.1522311622376; Thu, 29 Mar 2018 01:20:22 -0700 (PDT) Received: from localhost.localdomain ([104.237.91.79]) by smtp.gmail.com with ESMTPSA id s7sm10235471pgq.48.2018.03.29.01.20.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Mar 2018 01:20:21 -0700 (PDT) From: Heyi Guo To: edk2-devel@lists.01.org Date: Thu, 29 Mar 2018 16:19:50 +0800 Message-Id: <1522311590-104218-1-git-send-email-heyi.guo@linaro.org> X-Mailer: git-send-email 2.7.4 Subject: [edk2] [PATCH 1/1] MdeModulePkg/Gcd: Fix bug of attribute conversion X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ruiyu Ni , Yi Li , Eric Dong , Renhao Liang , Liming Gao , Heyi Guo , Michael D Kinney , Star Zeng MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" For gDS->SetMemorySpaceAttributes(), when user passes a combined memory attribute including CPU arch attribute and other attributes, like EFI_MEMORY_RUNTIME, ConverToCpuArchAttributes() will return INVALID_CPU_ARCH_ATTRIBUTES and skip setting page/cache attribute for the specified memory space. We don't see any reason to forbid combining CPU arch attributes and non-CPU-arch attributes when calling gDS->SetMemorySpaceAttributes(), so we remove the check code in ConverToCpuArchAttributes(); the remaining code is enough to grab the interested bits for Cpu->SetMemoryAttributes(). Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Heyi Guo Signed-off-by: Yi Li Signed-off-by: Renhao Liang Cc: Star Zeng Cc: Eric Dong Cc: Michael D Kinney Cc: Liming Gao Cc: Jian J Wang Cc: Ruiyu Ni --- MdeModulePkg/Core/Dxe/Gcd/Gcd.c | 5 ----- 1 file changed, 5 deletions(-) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Star Zeng Signed-off-by: Heyi Guo Signed-off-by: Yi Li Signed-off-by: Renhao Liang Signed-off-by: Heyi Guo Signed-off-by: Yi Li Signed-off-by: Renhao Liang diff --git a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c index 77f4adb4bc01..907245a3f512 100644 --- a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c +++ b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c @@ -673,11 +673,6 @@ ConverToCpuArchAttributes ( { UINT64 CpuArchAttributes; - if ((Attributes & ~(EXCLUSIVE_MEMORY_ATTRIBUTES | - NONEXCLUSIVE_MEMORY_ATTRIBUTES)) != 0) { - return INVALID_CPU_ARCH_ATTRIBUTES; - } - CpuArchAttributes = Attributes & NONEXCLUSIVE_MEMORY_ATTRIBUTES; if ( (Attributes & EFI_MEMORY_UC) == EFI_MEMORY_UC) {