Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4112964ybb; Tue, 7 Apr 2020 00:39:15 -0700 (PDT) X-Google-Smtp-Source: APiQypJclqj4GokMPgvEaCFj2WJXCFCo7Bwd8eTj+KL6MuxPvFwdef8mB8M1n0E0esCPreM/FH3D X-Received: by 2002:a05:6830:148d:: with SMTP id s13mr507146otq.342.1586245155016; Tue, 07 Apr 2020 00:39:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586245155; cv=none; d=google.com; s=arc-20160816; b=KQd4S0D/TgRRHJw2oUgBe0HjnNqQEpxT8w/ROT5OKbvLYMBiHZdBN1SnL/s/MTbhCY O1t1ErK5HBTCEeRVt0f6fnYD8zLZNTg+SwwySedCUt6MP64fOjbbKejTVd6KNHO5TX1A BHPKm290QaaiPoHvHmc82B1AAK0ESJnJJ82ixVdrxg3VLYdaaRzQsS/JU0nX55tOIjV7 2LZzJOXKgeGD+v0ENHuSVT+JXw1F1k3UyCXiYGtSdA7NjWB/AeL7WCTxlR0vfoPB//y0 spXDlbL85SAQZ5hwSJ8qN7u2UnCAjGhGzk8jm7BaCXUUju0GIc0/U2ti5mXyJCKTwnIQ LHLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=oSYoVDudRdLgHWwrYFrTmcqEEMjRlE9rRTJ7pxD9lbA=; b=c4iFVgWs28c2zw/eDmfV38hKB54r7wrpNNyXApEjaznb+8ojjHvtlylMgTVubctW2E f5I/M9N0Ug5JoFEEluaZbuqvJVr8XAY8jFAYlQQ3i3KeKNXzD4c8npbVM56dNZpTvQHN 00UV105KoKxxA5glRN484L2qIRHjmaYUoRbqguGftWXRykwyt44UeH8d6QPOlMxNJSBA M/xwembgEQZCqWdoh9D0uFGc00dpMnVUNcr21WmaegYP9Xcn75YVoetzSfWzXZ5mH5NA nCbrjRa7DiMl+8MRwCcPkrWzp2233EZLkyFRHdb4BXJjKEOWIGyRo6Wrn3T++WZs63fG 6XYw== 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 a18si988545otq.286.2020.04.07.00.39.02; Tue, 07 Apr 2020 00:39:15 -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 S1726889AbgDGHif (ORCPT + 99 others); Tue, 7 Apr 2020 03:38:35 -0400 Received: from verein.lst.de ([213.95.11.211]:36825 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726393AbgDGHie (ORCPT ); Tue, 7 Apr 2020 03:38:34 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id D459E68BEB; Tue, 7 Apr 2020 09:38:30 +0200 (CEST) Date: Tue, 7 Apr 2020 09:38:30 +0200 From: Christoph Hellwig To: Vitaly Kuznetsov Cc: Christoph Hellwig , x86@kernel.org, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, "K. Y. Srinivasan" , Stephen Hemminger , Andy Lutomirski , Peter Zijlstra Subject: Re: hv_hypercall_pg page permissios Message-ID: <20200407073830.GA29279@lst.de> References: <20200407065500.GA28490@lst.de> <87v9mblpq6.fsf@vitty.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87v9mblpq6.fsf@vitty.brq.redhat.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 07, 2020 at 09:28:01AM +0200, Vitaly Kuznetsov wrote: > Christoph Hellwig writes: > > > Hi all, > > > > The x86 Hyper-V hypercall page (hv_hypercall_pg) is the only allocation > > in the kernel using __vmalloc with exectutable persmissions, and the > > only user of PAGE_KERNEL_RX. Is there any good reason it needs to > > be readable? Otherwise we could use vmalloc_exec and kill off > > PAGE_KERNEL_RX. Note that before 372b1e91343e6 ("drivers: hv: Turn off > > write permission on the hypercall page") it was even mapped writable.. > > [There is nothing secret in the hypercall page, by reading it you can > figure out if you're running on Intel or AMD (VMCALL/VMMCALL) but it's > likely not the only possible way :-)] > > I see no reason for hv_hypercall_pg to remain readable. I just > smoke-tested Thanks, I have the same in my WIP tree, but just wanted to confirm this makes sense.