From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7117E1946BB; Thu, 27 Jun 2024 13:56:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719496590; cv=none; b=NCs3eSpXCfgGvO6EtfIFOiN4tvnONS+MBP98I8CSBQFmsYQ85sUegQCVX0JmWQ66UmE8kLpEMqpn9DW4/Kzm/HD6pCNHNzGUypBBzSpXpwnWUR0kLeHRjfH0E6j+u0Zg3HWp21kmU6FVmtg3aRyMkbTBy6eyK+Oa119pgFU9zoI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719496590; c=relaxed/simple; bh=kYrvsf0uqKm88ZvZcePkZ49uLkndvFg7AwD2JBZhy68=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=hPw6ffowuRaqCu4BDXQ8k7jIVpr5rm4Zoa+VilzQhXqksvHX6Sjc8VutytmnqWZ5XR0+fcfri9iyY4XEmarrgaeIVtsCHOscUGZTlcZy4U5tEzOhkVpmcggLLmCeBEBrYbmd7KK5V2wEn5x1RxbshxJcm2VdcdsUcu3lF5BaOTI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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