Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp666481ybg; Tue, 28 Jul 2020 15:59:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYaI8s913MlQNY465tN6vSpsP12pcDJYXfIpIF6srHuDn3OJBsSNMoWP8oMPqvIlEEZh2y X-Received: by 2002:a17:906:26d6:: with SMTP id u22mr19784392ejc.271.1595977145207; Tue, 28 Jul 2020 15:59:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595977145; cv=none; d=google.com; s=arc-20160816; b=gZzNuDEwg9jtfoJu89jagCUPRYQ7i6JdW/sHrj/t9R+WtmX6h56nU5WeQK1/JjsplU QM91XCaipI59avY3LY33nbNFHknXneI5EN4zsOudvNmeZN2IP4aaFj1L/zwEnkGDlZip S+0bonYgUkeAfwVH+ttMj2TMfw2rLf6WWhQPrYAp2qclYKqeYjVvAllnXc/Fs3ThSMAJ EmdVIuRrZzx3HHaEmjtrDRukTQ2LDT2SDfhSxW1XxvMx++PC7qyNeKbLNn7GoJNvzhhC BkZPz4yxFXCeoXf5BIzJh9enjT3AoGsPmJZn+xvl6iOKWcpBSslz0+NpgbuI+GvIhW0M vJaQ== 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; bh=WjLPXpYPdYtXDDTE3El4LanUu/hXqncSApiFUMGDGnw=; b=YPLwcUTPniSxreLdDeXLdX2E5UaFw1A/bn6v8xIHVh//tKSpIqcDuwBPvTyiV/A7bu K6nr7S85Inl28YflnG/AtBYdRnylQF/Wdqn4ZLG16HXb24AWhH6XtZ4942VR9VazUZJZ WZ+fuKs+jYTMhFgIOkCM9MO44QxDU/h6l1Y6X4KT91Um7JOvRKU3eXNOA68amI3+4WiZ GgEPFy4YbLD/lTenYD2AEyUxjsT3df+OgJbRQZ1lvQ67TP9uq6oixGbdaiagadIIu+g3 kOk42yrdY+IRqypbSv9pgJwiPngJif4p5ws5pxbkOdxoxq3wZPeZepKorjjmJXv0HdXP Gd4g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f18si120236edw.95.2020.07.28.15.58.43; Tue, 28 Jul 2020 15:59:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730103AbgG1W5m (ORCPT + 99 others); Tue, 28 Jul 2020 18:57:42 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:45945 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729944AbgG1W5b (ORCPT ); Tue, 28 Jul 2020 18:57:31 -0400 Received: by mail-qk1-f195.google.com with SMTP id u64so20414227qka.12 for ; Tue, 28 Jul 2020 15:57:30 -0700 (PDT) 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=WjLPXpYPdYtXDDTE3El4LanUu/hXqncSApiFUMGDGnw=; b=HXzTvstUzRvwe0JH3sO2ZfoIBlIO6XzyGQwXjkgUwCvYtz4l5NGOVMzHKX//m5zh5c X0G5ThFgoanIxwAWEnt+k5e1HsjIOiEMSDp693JjIUliJn9JEdis4xYpIFd7aDkkGE9R 124qj2TNB/TWOQj33hh+fvdusga/iq3mWmVyoTwnQSYK5tog6nqfP/9gvVf/EdwJjj4u Fze19gJQjKbDXaTqPQY7VoaGakTqvwt1onUQJR9uHKaHkw5b1QM7sJXcrZYATSklG6xM cUVa70gdq8wibQioV/e4zjwYbZ6mLwJz5JXElHZenfyg/86t77sM7i0g8WjsJqBx+aON NSUA== X-Gm-Message-State: AOAM530cVlUzcq/chi4F3XNh75MZQBsxU2DSpR0s9E/JAZDHASxsQD+J bUVn5ERXYSIP3nLrTaAbMM8= X-Received: by 2002:ae9:ef01:: with SMTP id d1mr29281552qkg.64.1595977050013; Tue, 28 Jul 2020 15:57:30 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id o187sm88118qkd.112.2020.07.28.15.57.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jul 2020 15:57:29 -0700 (PDT) From: Arvind Sankar To: Kees Cook , x86@kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH v3 08/21] x86/kaslr: Drop redundant variable in __process_mem_region Date: Tue, 28 Jul 2020 18:57:09 -0400 Message-Id: <20200728225722.67457-9-nivedita@alum.mit.edu> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200727230801.3468620-1-nivedita@alum.mit.edu> References: <20200727230801.3468620-1-nivedita@alum.mit.edu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org region.size can be trimmed to store the portion of the region before the overlap, instead of a separate mem_vector variable. Signed-off-by: Arvind Sankar --- arch/x86/boot/compressed/kaslr.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c index e978c3508814..8cc47faea56d 100644 --- a/arch/x86/boot/compressed/kaslr.c +++ b/arch/x86/boot/compressed/kaslr.c @@ -664,11 +664,8 @@ static void __process_mem_region(struct mem_vector *entry, /* Store beginning of region if holds at least image_size. */ if (overlap.start >= region.start + image_size) { - struct mem_vector beginning; - - beginning.start = region.start; - beginning.size = overlap.start - region.start; - process_gb_huge_pages(&beginning, image_size); + region.size = overlap.start - region.start; + process_gb_huge_pages(®ion, image_size); } /* Return if overlap extends to or past end of region. */ -- 2.26.2