From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D2D65C3064D for ; Thu, 27 Jun 2024 13:57:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=BXRVarc7eQ7G0iz1dcreYR9izYXY/zZ2IkvbR8M9q5E=; b=HoXVZptBvyuhDivqyFCEK3f5tk AjGZCx+pGcOAE3I2aZbnZU2afufDDjM3GpF7QE7nYkzUA2kPn4yUPZ1n+UdJsrilyjs3UyLENkrcW 2Bk2+oTDXYVtqiJGps+FM67ZZdg8YDM7PCIyWCfGLRewzNuaLus+mLY7Ex1pfaAe8VvpgThFGBtiB CnAKpoDnNg3bqMzMpAuUuG4jzb2HBZn4l52blfY5R1DzECuGpSt/f0tnbY/sXH40XqSg0xujOxfj5 nc7qxEVhPJas1pxXQGoa03oFaaT4RmfYXmMr48mtjct9MW25TnF+3BkXu1j8t5w7qgv8Z6ndDtqr6 7sXZ7X0A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMpcC-0000000AXlk-0Pq0; Thu, 27 Jun 2024 13:56:44 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMpc1-0000000AXii-1K18 for linux-arm-kernel@lists.infradead.org; Thu, 27 Jun 2024 13:56:36 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id ABD27367; Thu, 27 Jun 2024 06:56:52 -0700 (PDT) Received: from [10.1.30.72] (e122027.cambridge.arm.com [10.1.30.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8FB513F73B; Thu, 27 Jun 2024 06:56:23 -0700 (PDT) Message-ID: Date: Thu, 27 Jun 2024 14:56:21 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 06/14] arm64: Override set_fixmap_io To: Catalin Marinas Cc: kvm@vger.kernel.org, kvmarm@lists.linux.dev, Suzuki K Poulose , Marc Zyngier , Will Deacon , James Morse , Oliver Upton , Zenghui Yu , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Joey Gouly , Alexandru Elisei , Christoffer Dall , Fuad Tabba , linux-coco@lists.linux.dev, Ganapatrao Kulkarni References: <20240605093006.145492-1-steven.price@arm.com> <20240605093006.145492-7-steven.price@arm.com> From: Steven Price Content-Language: en-GB In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240627_065633_915221_6D45B712 X-CRM114-Status: GOOD ( 15.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 10/06/2024 18:49, Catalin Marinas wrote: > On Wed, Jun 05, 2024 at 10:29:58AM +0100, Steven Price wrote: >> +void set_fixmap_io(enum fixed_addresses idx, phys_addr_t phys) >> +{ >> + pgprot_t prot = FIXMAP_PAGE_IO; >> + >> + /* >> + * For now we consider all I/O as non-secure. For future >> + * filter the I/O base for setting appropriate permissions. >> + */ >> + prot = __pgprot(pgprot_val(prot) | PROT_NS_SHARED); >> + >> + return __set_fixmap(idx, phys, prot); >> +} > > In v2, Suzuki said that we want to keep this as a function rather than > just adding PROT_NS_SHARED to FIXMAP_PAGE_IO in case we want to change > this function in the future to allow protected MMIO. > > https://lore.kernel.org/linux-arm-kernel/6ba1fd72-3bad-44ca-810d-572b70050772@arm.com/ > > What I don't understand is that all the other MMIO cases just statically > assume unprotected/shard MMIO. Should we drop this patch here as well, > adjust FIXMAP_PAGE_IO and think about protected MMIO later when we > actually have to do device assignment? I agree, there's not much point in this patch as it stands. I'll drop it (and the previous one) for the next version of the series. We can add it back if needed when protected MMIO is a thing. Thanks, Steve