From patchwork Sat Jun 22 08:51:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 167478 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp1734095ilk; Sat, 22 Jun 2019 01:51:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqy4qDyiUKz2lwefC5idMSZfgzJ0ujOXtoOyggbXxZMBWa4IVF0ZHV6dm0MeVZ3Z9D0PO/f0 X-Received: by 2002:a17:90a:ba94:: with SMTP id t20mr11962275pjr.8.1561193478735; Sat, 22 Jun 2019 01:51:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561193478; cv=none; d=google.com; s=arc-20160816; b=QiFvprn+gTYUOQRYvAAFn1rJgQLXPCODa+C+E8+QkjVdEtr3T7clmsQRgBqnx4TW1C xe/VRM0vvy8aINinM5iTpM6Z5HLRWv6dWVrdlGAbwvFXkbjp97aMnlYQ0vEtoGhOzMiX 6+Fmx0cWo8uBVLqBZZwMRzwP788NSeOrhbkixb5xltu21XAfQakP+hBt26uJFRXWO9NR fUE5YUQXdb2/SR/SFkbmEvKYfn2YQt11sINmWQKEspYIHOHQVzE30UAc7jO9TfjAg3m6 gx7iswdMn5dbm+8/rFnp19CU2CjbZOzqWeEpaVJC99NP5K0aLNIqgDF0iDdZfMVd/mxv VPnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OT8SPNHWk4z4I8Pp+icjCJXudD3ZuOCKF+jmfrUNbnE=; b=LHwuY154qHFFCGuss/JwQiNYL7SiTdXhjMBzJrQKAPS4LlaE27xNMAujLxTjpAFMOW T0/zw9ByVOvysM2BVUNeE7knfoMQMXpEBvQIMZBLWgvP0+Ht+/MJ3MBcG3WSL/Sb0zFx dx90R3onCTivc0bDRDFO5D7xX+AUweYdvuM5TOClUQIb3OSy8+72VyEGFX3ePYOiewEp DwifTYotXROWOff+n8Hb6kDn3LoqD8OdUfg/EzCPctMArPAGQayM5NGiv1W2n2TZOeAQ E3pZcy8Sjl5fejySuOxa7ZMbRCjDdfEWwcEvJ1jBNDrXdLtXKR/9qBn0Hhf2Y1dlWMCG EBCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XDAd1wO7; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5si4917528pfd.273.2019.06.22.01.51.18; Sat, 22 Jun 2019 01:51:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XDAd1wO7; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726308AbfFVIvR (ORCPT + 3 others); Sat, 22 Jun 2019 04:51:17 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:43000 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726397AbfFVIvQ (ORCPT ); Sat, 22 Jun 2019 04:51:16 -0400 Received: by mail-wr1-f67.google.com with SMTP id x17so8710018wrl.9 for ; Sat, 22 Jun 2019 01:51:15 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=OT8SPNHWk4z4I8Pp+icjCJXudD3ZuOCKF+jmfrUNbnE=; b=XDAd1wO7ZXP/gkz9tP6VaxixOwMxJNdn94LT+0YFDWEbbHwXz3J0qni/pdrkNShwW+ iX6TbIyyRSWGcNxHBi7Rf30Oi2htKV3CxWTHG72+lG2m+eYRMeqoOF3yWEetK3cRtcH/ JILOcF6hfHOM0geAh1PJ7P1jeMzDra6B9baC6Wn3+5/YQ77gSqHUr4+vXObVUxZUyt6t SzwC0XKnD5ycOhRK1hduOSRi/XLrQ8QQBgFiF19fp4ANigZM3AkbsCsgdGdgtIARiL8x k3ANoZz06BRD3MCxcjYdLQNoLmcwGFx8k23M/J+lCMqCN/+F0K8+1gGkz8PCFLa3va0K Mz8g== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=OT8SPNHWk4z4I8Pp+icjCJXudD3ZuOCKF+jmfrUNbnE=; b=WBZ5sSGihI/HH+Cwj3axIXxzuv36WvbF8FQoirkn6Ku9onZuaWODTImGdC/UyxGPLC RukI3sW5OnBMEUcZEuVtn0fljgWYd+ftkmL9ltHQ6RvapdgKgmkgdrc31+pfRambZzNM cD2PBH6uW98iIkKtkq6szkyMZoN3tzqtIOVbMI/daQWslZNVAFJqz9yvJke/R7pqqFrF g54TQ5PWUXe+Pg+mAQAzxYEbvknd5IMPgcBTfn3CH0MlBu02wF1c96EasOdu7+ftWIDn jPQv2+1tTg2omvlufG9zsszdkyB+83L39JO15xgQe5rLznH12dikPw9+tAoBGsA3RYE8 qd+A== X-Gm-Message-State: APjAAAUYcU2p9bwevsqBRB9kxyqaVBWUcdm6M/k0can7EHgOrLDCCsej tE6RVVZvnVUkI9/P2Xf0IbLgtxaeu2Md5t0z X-Received: by 2002:adf:f3cc:: with SMTP id g12mr95195242wrp.149.1561193474094; Sat, 22 Jun 2019 01:51:14 -0700 (PDT) Received: from sudo.home ([2a01:cb1d:112:6f00:4bd:3f91:4ef8:ae7e]) by smtp.gmail.com with ESMTPSA id v15sm4863589wrt.25.2019.06.22.01.51.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 22 Jun 2019 01:51:13 -0700 (PDT) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, Ingo Molnar , Thomas Gleixner Cc: Ard Biesheuvel , linux-kernel@vger.kernel.org, Hans de Goede , Jonathan Richardson , Luo XinanX , "Prakhya, Sai Praneeth" , Qian Cai , Tian Baofeng Subject: [PATCH 2/4] efi/bgrt: Drop BGRT status field reserved bits check Date: Sat, 22 Jun 2019 10:51:04 +0200 Message-Id: <20190622085106.24859-3-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190622085106.24859-1-ard.biesheuvel@linaro.org> References: <20190622085106.24859-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org From: Hans de Goede Starting with ACPI 6.2 bits 1 and 2 of the BGRT status field are no longer reserved. These bits are now used to indicate if the image needs to be rotated before being displayed. The first device using these bits has now shown up (the GPD MicroPC) and the reserved bits check causes us to reject the valid BGRT table on this device. Rather then changing the reserved bits check, allowing only the 2 new bits, instead just completely remove it so that we do not end up with a similar problem when more bits are added in the future. Signed-off-by: Hans de Goede Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/efi-bgrt.c | 5 ----- 1 file changed, 5 deletions(-) -- 2.20.1 diff --git a/drivers/firmware/efi/efi-bgrt.c b/drivers/firmware/efi/efi-bgrt.c index a2384184a7de..b07c17643210 100644 --- a/drivers/firmware/efi/efi-bgrt.c +++ b/drivers/firmware/efi/efi-bgrt.c @@ -47,11 +47,6 @@ void __init efi_bgrt_init(struct acpi_table_header *table) bgrt->version); goto out; } - if (bgrt->status & 0xfe) { - pr_notice("Ignoring BGRT: reserved status bits are non-zero %u\n", - bgrt->status); - goto out; - } if (bgrt->image_type != 0) { pr_notice("Ignoring BGRT: invalid image type %u (expected 0)\n", bgrt->image_type); From patchwork Sat Jun 22 08:51:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 167479 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp1734113ilk; Sat, 22 Jun 2019 01:51:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqwc/KYtFK3BTUdV9FLq7Pu7cRXIOwRQ53hj7KtVaEI23SHujhPMioJo+nDS7Ztchzg/LIC1 X-Received: by 2002:a17:902:124:: with SMTP id 33mr76442107plb.145.1561193479937; Sat, 22 Jun 2019 01:51:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561193479; cv=none; d=google.com; s=arc-20160816; b=BhNfFf561NkL8AOb2JRbJnEkHzTO1qbKG8/XPNOvra/AlTihlZjYqvHZWEeuth1YxB 1GAWZ19172o7r9gY2LftvoZnSMaCFgT11rB20dqSCKmkZ4Wx3XHWAUuvvkLLUtZ36J2q WCUozHAyR/XPnQ3DP+qhagT/OgYyNJLZiZRezgixSrWtRU512vvTLux2o0NOqbEySgFW ogyUdJ5U3mra5E1iEChRbruxN/MKcIZCka38d2GBzIGYOFCZjJB/TAgvYuU6nMSYgr6D B2kmPYUbSQ5RBl571351WhDrR3dPWhHwq7tNFlmRyLP+Rwbr4QN64pQlP0poSESRMIve +Y+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=u9crTsB/UrpUqqHUWXJKG+JkHwY6C6DtrEmHZcdZhy8=; b=za3YzdwPkU12qm3krWpLYTM7pLtCMAXGrowQO91W4+btDQDwrSfkVOyQIEsFMbDypm zJG1d/+V8401mkS2ug9B/4HHfi7ysgDA5h8cIcDKBqSxyL6fWEzjuNbmhgeMmcMxsw2M Ken4TFzlolp0en6UAzmxZp4OJaVyk9sfWRdgGv4kDe9lwTnfBZoe2tEclyIzPb5U5MUR oUEqcWLB1kk7xxk1faU8JdKYjAGKtePAmTP/96PN45KI6VhmnSF715MqjZHLanMbycqZ 3zO14VZbfOvjRs3ChDmKlSeUtD75aASopRZmLzXHuAxKQ2UnfDS4ZxmgM/UHqTZ/r42l 4CAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Aw5AY8Lx; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5si4917528pfd.273.2019.06.22.01.51.19; Sat, 22 Jun 2019 01:51:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Aw5AY8Lx; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726424AbfFVIvS (ORCPT + 3 others); Sat, 22 Jun 2019 04:51:18 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:40443 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726417AbfFVIvR (ORCPT ); Sat, 22 Jun 2019 04:51:17 -0400 Received: by mail-wr1-f65.google.com with SMTP id p11so8718057wre.7 for ; Sat, 22 Jun 2019 01:51:16 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=u9crTsB/UrpUqqHUWXJKG+JkHwY6C6DtrEmHZcdZhy8=; b=Aw5AY8LxmwqzQm5h+un10GlowGYa2zi9DKB9ANx/rA9mkgDgc08z6KR4kCiOEtTISn M65JF8S/jPwJY8MDUGqlujppgDB46RZlKKvQEUxw4lXogAnaup8P13uMbys8QN8cIpUD bFR/ggkFZZWluEem+8XG1X5wamCkMtO5mnzi6pgorB3QSjrGQ6hmhU5BWrtCU1phnJk/ p+ZFw5RFgn8yjr9YLuptDXmZzT+N7rDcnG0wuDwq+TOq7dXZ8hEXvEr6xVExV9lbTqll VAQdhSWWRA0h3ZVVVpNMzMTEc/MPGkiUHl3xYLkFoY9sSSE+ZVHHXCFHoUS2IMNG1hc/ pKyw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=u9crTsB/UrpUqqHUWXJKG+JkHwY6C6DtrEmHZcdZhy8=; b=Z70M1ix5sfv87kht44LwGexDWL19WYyH9D9pyaCLb/Mt9XkTMrXE8AdAwW8DwNJH7A 1c01oKw5DKF4ZxJlLK3+J64oJ7L6D9J2ryBzG814L5F84PDuqCbMnGRh1Q0QIEbiHEBM MhAvSkk4kDifcGSq0JgvN8RiLJjTUKVJy90IwUti+d3fyMrA6P2WMpALsVmLr3uN0Q// ubyYgf0XQgDUSgafjpqNWAYeULFcFbdvfgJ6oLhxGa6Dx/8v3h19oT2BAutRwCGoWGKE uz/eA2vRCMizl8vNtIEnWNyoEDvrgZHzysUBira5j2W4hneiLJAc9NZyCucskS6FiGLD GydA== X-Gm-Message-State: APjAAAVmlTpyzin9dVCgM13nyYLUqsGiCUfXLw8PTlyqwIGCq4sHckGj VQmg3sgLHbsCAMFigMrOqLN5w/sFGBuwXf2H X-Received: by 2002:adf:c506:: with SMTP id q6mr85043928wrf.219.1561193475344; Sat, 22 Jun 2019 01:51:15 -0700 (PDT) Received: from sudo.home ([2a01:cb1d:112:6f00:4bd:3f91:4ef8:ae7e]) by smtp.gmail.com with ESMTPSA id v15sm4863589wrt.25.2019.06.22.01.51.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 22 Jun 2019 01:51:14 -0700 (PDT) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, Ingo Molnar , Thomas Gleixner Cc: Ard Biesheuvel , linux-kernel@vger.kernel.org, Hans de Goede , Jonathan Richardson , Luo XinanX , "Prakhya, Sai Praneeth" , Qian Cai , Tian Baofeng Subject: [PATCH 3/4] x86/efi: fix a -Wtype-limits compilation warning Date: Sat, 22 Jun 2019 10:51:05 +0200 Message-Id: <20190622085106.24859-4-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190622085106.24859-1-ard.biesheuvel@linaro.org> References: <20190622085106.24859-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org From: Qian Cai Compiling a kernel with W=1 generates this warning, arch/x86/platform/efi/quirks.c:731:16: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits] Fixes: 3425d934fc03 ("efi/x86: Handle page faults occurring while running ...") Signed-off-by: Qian Cai Acked-by: "Prakhya, Sai Praneeth" Signed-off-by: Ard Biesheuvel --- arch/x86/platform/efi/quirks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.1 diff --git a/arch/x86/platform/efi/quirks.c b/arch/x86/platform/efi/quirks.c index 632b83885867..3b9fd679cea9 100644 --- a/arch/x86/platform/efi/quirks.c +++ b/arch/x86/platform/efi/quirks.c @@ -728,7 +728,7 @@ void efi_recover_from_page_fault(unsigned long phys_addr) * Address range 0x0000 - 0x0fff is always mapped in the efi_pgd, so * page faulting on these addresses isn't expected. */ - if (phys_addr >= 0x0000 && phys_addr <= 0x0fff) + if (phys_addr <= 0x0fff) return; /*