Received: by 2002:ab2:715a:0:b0:1fd:c064:50c with SMTP id l26csp5452lqm; Mon, 10 Jun 2024 10:50:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVjzMImnR5HPZgcYbdF96mytMdDsnERIHtFgQSMAeSr69UtSlMEC5D6WoZ5XCq0/AUoJDeGHYhUZ7wxhrjJVtAzrZuJ2wQG+ELUWqkekQ== X-Google-Smtp-Source: AGHT+IEbhmtxE1E/Tv2q0QFpwZUgMV1xT9fcEo7p/WF29OFeXAW8ZF6QOKmZEZ+4Ekma7EpOV8UT X-Received: by 2002:a05:622a:10c:b0:441:1536:2faf with SMTP id d75a77b69052e-44115363070mr23514051cf.19.1718041820091; Mon, 10 Jun 2024 10:50:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718041820; cv=pass; d=google.com; s=arc-20160816; b=ZAZd6EsZRO21+y2ngVi0HI9rZ5zQTtYiZQbJmFkfCn5I1/uq8ZGD7za12GgobE3zpV KoE5yArWMHnlRlIcqrA/tty8mCVOy4q4gAtslEjUN107ol5OA55fGsg1SRGjRiFSnd+9 +KBWh4afzM8mBP7GyNk+eQtysNP1LJTW0fm0GthDthiZ66LhrILfmORD8SpAmcjpcsJ9 EWwh8jG+XorRQC+FKhdrg2JA6p2W9dl/ukkSeV7s8Di9zfj1tc6jV2LIf0j+nHs0/1RE wFga0RSVciZjsIC1i+tDzoY+MN5EzgawoSrMXZWDHGRaAnlUuQvJ80s5SUBN/oBpthEz d7dA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=F1J9jhOymnes2R/K+DHh4R+xubzk6v82vjHWHmvwY+w=; fh=pKn/293/ZKXIMcQJl9ZzFjLMVevdBzTVVGTle239r1w=; b=XOGuuiN4e10F2wXCfkh9J8wf5Zm3Qoa15hSHExywpJtsOVsQoqh77iXEx+xjnLbN75 t9RUjEG/X7RUs87WlMY5PH5qdnwqhRKAVJpUL4SztmZ+ZXA+8/oS9svlVPzVeniI7EAQ 4+g0voj18vqZbet4lNP+Nxx7+ia1Q18LeOCSq8Vh5cVWQWfBJw862mZ1RI81anf2Ot6O cqoFzj/IIliLMeS4dRZkBz97qJoi6t8Ru99bLuJQcC6E4i4uJ7ZNnN8qvLhw8pJp9+qI WUY/O1gHKbU5sg1/oU892tONC6BwwjlF/Q85IjyR42c9a328yuFuQd+rIOgiAQgo7YF8 KADg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-208675-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208675-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-44038a6d692si112108101cf.150.2024.06.10.10.50.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 10:50:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208675-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-208675-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208675-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C9BA31C22059 for ; Mon, 10 Jun 2024 17:50:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6BA1614A4FC; Mon, 10 Jun 2024 17:50:05 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D8AC4147C86; Mon, 10 Jun 2024 17:50:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718041804; cv=none; b=jxmx+MQ/PYTk0t+/qrNKFXNXFk3VvrSOKnGpF95SqNS+wPdp0Jpr63DgXVjZfmzZCl4JA2Y17u1jZ4XJYSSMlsaqu//6/4b6pg1to8DkravVm+kM2godVHu/5FicK4biSKkvteTyI+uA7AFHf0yfnOxn9xNwkKz/Bv2vSKBUAPs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718041804; c=relaxed/simple; bh=WoVq+0Vo2WUlILwBRL9qEzQohV9M9XZ8hqHTaINtZgs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uMTVtOK6ybkYTccQ8dG5kWS+DWMSVlj9bzoxiXS55HvpnQKSvVClmnNScrayVcLlwE11ilaQzE14gHO0HRaiy7PQp0IykjoQJteU8rB3hm0MJDbjEEFubrMgr1DM03k8ehpVzlKb5m2MMgzQfO8s+tvYNfdnRFwcqet9FmRgvcQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5FA17C4AF1A; Mon, 10 Jun 2024 17:50:01 +0000 (UTC) Date: Mon, 10 Jun 2024 18:49:59 +0100 From: Catalin Marinas To: Steven Price 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 Subject: Re: [PATCH v3 06/14] arm64: Override set_fixmap_io Message-ID: References: <20240605093006.145492-1-steven.price@arm.com> <20240605093006.145492-7-steven.price@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240605093006.145492-7-steven.price@arm.com> 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? -- Catalin