Received: by 10.223.185.116 with SMTP id b49csp3979150wrg; Tue, 13 Feb 2018 10:42:08 -0800 (PST) X-Google-Smtp-Source: AH8x226VzoeGresox1AADbEwwyzXmgQCex29rqTf6CDJu1pcohAKmLGlwKpPIUV/jxpLxgxMUCZg X-Received: by 2002:a17:902:8e83:: with SMTP id bg3-v6mr2012763plb.246.1518547327918; Tue, 13 Feb 2018 10:42:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518547327; cv=none; d=google.com; s=arc-20160816; b=dKz2O01iI3lY+igS0VcpzoaPyINo8deiySf/QFKtGxI4QLKaFaNitXcYOHtBIa74/z rHS5uR1SSabrznfknB5+hkeHFluEoHSPEU1KHyXiP7QPwiuE+bYSt1sSJ8k68VF0h7Fr 21fNxjkPvesG9ihQ85RlQ8Djg6WPkV7gMyBSZxzxWKbwqIB0ZnmkKzkj1DILyv0dv+lD rQuHvVRgwUeY3lzKliXbnma4lr5P1ObVYEhQ74UIPYbZcq69lrJ9r9LNBct7mFjrZJDT xJrVbapk7wHl8WhVRt2DZn+dI7UHCU2ksPqW6zkmvxrQW6pYOmltZN22takdGQbcdrza CXCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=M0GaeYLtkwx3p4cWB32GEFISlRY8I2zD8aytZJ9xNWM=; b=F0BNF/lr/2TL9TtHLZxOh6i43RK6Yay1gmw0cfg+WsvjmJMiIc0/nZj7X1DGyUuXi+ T1qFWUnKnkdGKNjr3yVVYQ8bLBoNn4aoCevPODnGgf4dvhOlVuU+q/c8uEUWIClZNs1O EACJVvJ+RYV7bFsLPXgGvE8Rxw9f0l7dqlkKDWVy9YGCceR2Q84CVk59ILScXNDruqhs aUt5siUZQL5MXMzLK5M8/4Axg7zH0OwcA3+m4UB0OoNSoToguRUrtW5d/4xM6x0ggaTc Mk26gOejWGMfLxkw3/2ovf4ClK1Rda9FZNBo2nJI6daF173fln1T09xJbnRkQpR9s4gN kDrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Nb/2E8kW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 y6si6818371pgc.112.2018.02.13.10.41.53; Tue, 13 Feb 2018 10:42:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=Nb/2E8kW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S965551AbeBMSkv (ORCPT + 99 others); Tue, 13 Feb 2018 13:40:51 -0500 Received: from mail-io0-f193.google.com ([209.85.223.193]:36349 "EHLO mail-io0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965530AbeBMSku (ORCPT ); Tue, 13 Feb 2018 13:40:50 -0500 Received: by mail-io0-f193.google.com with SMTP id t22so2413750iob.3 for ; Tue, 13 Feb 2018 10:40:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=M0GaeYLtkwx3p4cWB32GEFISlRY8I2zD8aytZJ9xNWM=; b=Nb/2E8kWEPWZIzdXW3v11bV4eG4YpsWjmFFOgyNfcbB+dAnkz+tt0oqfoIStSN4T6G H5RihrDabFjCz5mxRLaDIxk7hE7f7kWNsI+BPhQd4tZOtLACBCYUG0GH+eLd8CjO8k+c XcTMF/QUniJfvQKZQPXGQjnnLJ5V3Xc+E9vXU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=M0GaeYLtkwx3p4cWB32GEFISlRY8I2zD8aytZJ9xNWM=; b=Mg90w5BytIx2TaOfaNXmtlG+KQLfg12wKGBSnbcysLhoZogsTp3yntp1Xsy+YpRXEO DAuJk2xwljSR1ZgSSqE4s4wLQ+DGHVuRUn4FDU1DRdPTgnWsK2+jiP1SUK+HumcjeZaw mWIYJNRBEIk9BNPAksvbZ4bPHQAqydvJMqNlmed9qdz/HYEXMKs47wfLEm7Ts3+ZJW36 0gHUbMAUF60k39itN8qAFCV+kNvgGcG2kkzZES9XMP3vfGXSVnkmjwVJFn+uAGyZl6Nt nUw9R/zfmKiJtT3swWnuiL2YyX920T1vHdiAfFTlsHjc8wdbZ+ur6sSc3adcRYfC2hw/ 7TUw== X-Gm-Message-State: APf1xPCITUhhxUWExFCPelelzLwgiUpaxtsAkU8zGYdp1NZkJEPDW8pc xY9ODZVhbocL97fijW0dStPbkqJ45pxgVWtpyLRRCg== X-Received: by 10.107.25.195 with SMTP id 186mr2552331ioz.200.1518547249437; Tue, 13 Feb 2018 10:40:49 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.112.13 with HTTP; Tue, 13 Feb 2018 10:40:48 -0800 (PST) In-Reply-To: <20180213180707.einsznaoghtctkqn@gmail.com> References: <1516847386-5291-1-git-send-email-baijiaju1990@gmail.com> <20180213180707.einsznaoghtctkqn@gmail.com> From: Ard Biesheuvel Date: Tue, 13 Feb 2018 18:40:48 +0000 Message-ID: Subject: Re: [PATCH] x86: efi: Replace GFP_ATOMIC with GFP_KERNEL in efi_query_variable_store To: Ingo Molnar Cc: Jia-Ju Bai , Matt Fleming , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , "the arch/x86 maintainers" , linux-efi@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13 February 2018 at 18:07, Ingo Molnar wrote: > > * Jia-Ju Bai wrote: > >> The function kzalloc here is not called in atomic context. >> If nonblocking in efi_query_variable_store is true, >> namely it is in atomic context, efi_query_variable_store will return before >> this kzalloc is called. >> Thus GFP_ATOMIC is not necessary, and it can be replaced with GFP_KERNEL. >> >> This is found by a static analysis tool named DCNS written by myself. >> >> Signed-off-by: Jia-Ju Bai >> --- >> arch/x86/platform/efi/quirks.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/arch/x86/platform/efi/quirks.c b/arch/x86/platform/efi/quirks.c >> index 8a99a2e..b6dcb52 100644 >> --- a/arch/x86/platform/efi/quirks.c >> +++ b/arch/x86/platform/efi/quirks.c >> @@ -177,7 +177,7 @@ efi_status_t efi_query_variable_store(u32 attributes, unsigned long size, >> * that by attempting to use more space than is available. >> */ >> unsigned long dummy_size = remaining_size + 1024; >> - void *dummy = kzalloc(dummy_size, GFP_ATOMIC); >> + void *dummy = kzalloc(dummy_size, GFP_KERNEL); > > Looks good to me! > > Reviewed-by: Ingo Molnar > Queued in linux-efi/next Thanks all.