Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2295637imm; Mon, 16 Jul 2018 05:47:49 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc+XPQ1URegrRcxE76op0jGG79PeXAT0mVZbGfm3V7/GB3xGGKQ5q3C7nJnanRz18CB0OE5 X-Received: by 2002:a17:902:262:: with SMTP id 89-v6mr3771367plc.221.1531745269425; Mon, 16 Jul 2018 05:47:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531745269; cv=none; d=google.com; s=arc-20160816; b=DHap//dihSTI6O5eXeCqOv9p96e8LmJlcCWoY8ty+ljkUd5NWODj4VGc7rd/uXK4Dy OhkbV/UtnAkwtxlzTybvGuaCzmA6rvB+f0gt6EVHPHZ4ByBqUwH3T1pM09vIw6KBeOE6 27CSCnYgWSbYTSZ0WZpdSbz33caCsz93OWAtvs+kDWVwvyr2W/IAXrQTuY+hq7Z/5vU5 mG7BWs/3ctUBMrbYTIQAa7zdScpvnru3kP9Q3Ob8Q/BkWdht4mThU9Hg9HxpaVPOQFVq FWAG7OyFrzm4puYD9yVw1rkAqRNVeBdMCcwiTzPIznky+c5T0zaNYW8g5ryNr6P9leH0 zc7g== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=tf3bHYxAKIN0KcK3EFPi+sYRUq1B+ftssVvjzePa/uo=; b=lzqAH5u3ADbrBb0sl67eEie3kTUgnRMRcNRu3zy4y9RE/6J5CX12lQ8z2cevdnli6V +Asxb47s0TngZp/mEIXfe1C4Im5KqinW9cdO4xlRTsYsSrPwAkxjD5lDWM+Y/7+DI4Q8 gIGTvY9JTjMs38gz5uMZBFATQ7sfMlZNJ37tDNvBlqYw33Iqo2MlgxTEl9GKq0cYO3jh S5DUo2Rz2Yr8HgzxA6Vy5D2TAXeLszzxvN6I/+tGzaI9oFsn2nWVw3HETLSraj1Vjzb1 dD24n7BeGrJlW9fTB/SrS23YmODkn/PZ5s1On4gF/NYl+TVGgMMwxQMuW+k3SF2440oe TabQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g17-v6si29621895plo.355.2018.07.16.05.47.34; Mon, 16 Jul 2018 05:47:49 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729934AbeGPNOE (ORCPT + 99 others); Mon, 16 Jul 2018 09:14:04 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:59030 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728719AbeGPNOE (ORCPT ); Mon, 16 Jul 2018 09:14:04 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1CF7518A; Mon, 16 Jul 2018 05:46:47 -0700 (PDT) Received: from [10.1.206.73] (en101.cambridge.arm.com [10.1.206.73]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BDDA43F5B1; Mon, 16 Jul 2018 05:46:45 -0700 (PDT) Subject: Re: [PATCH v6 2/8] KVM: arm/arm64: Re-factor setting the Stage 2 entry to exec on fault To: Punit Agrawal , kvmarm@lists.cs.columbia.edu Cc: linux-arm-kernel@lists.infradead.org, marc.zyngier@arm.com, christoffer.dall@arm.com, linux-kernel@vger.kernel.org, will.deacon@arm.com References: <20180716110857.19310-1-punit.agrawal@arm.com> <20180716110857.19310-3-punit.agrawal@arm.com> From: Suzuki K Poulose Message-ID: Date: Mon, 16 Jul 2018 13:46:43 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180716110857.19310-3-punit.agrawal@arm.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16/07/18 12:08, Punit Agrawal wrote: > Stage 2 fault handler marks a page as executable if it is handling an > execution fault or if it was a permission fault in which case the > executable bit needs to be preserved. > > The logic to decide if the page should be marked executable is > duplicated for PMD and PTE entries. To avoid creating another copy > when support for PUD hugepages is introduced refactor the code to > share the checks needed to mark a page table entry as executable. > > Signed-off-by: Punit Agrawal > Cc: Christoffer Dall > Cc: Marc Zyngier Reviewed-by: Suzuki K Poulose