Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2596345lqo; Tue, 14 May 2024 03:49:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV7N0oX0MsFMurTR9bgbNco3drAP4yeujo8jzXYTNFREYTYwDQdinS+izeLS5PLU5RwYwIYEQbfIBYmmJbGviXg+SgDLEvTEFn3sjw01A== X-Google-Smtp-Source: AGHT+IE9L01sIBkumjjZzF0YkPaoqoK9oIv2j+Z5cRwky3FjrtIHDTQEZmK7/WpM6PYRP0rQpiIz X-Received: by 2002:a17:90a:d685:b0:2ae:814f:43fa with SMTP id 98e67ed59e1d1-2b6ccd8fc69mr10552605a91.46.1715683768697; Tue, 14 May 2024 03:49:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715683768; cv=pass; d=google.com; s=arc-20160816; b=JdyR8uw/gTHz5OsgP6rOg6TtXn94ugglsxgsLBgRzAeunP1xhcdaEArI2JmJZLdDC2 iBaUtWXaAmX/sAmRQbre90KI4food5rQ9dE+K3h3XPMAPLtpfIvkqA+/y1SdLAXcmBPi izGu/z5iO5O9vN3sBQUCCJ+kbVMTxihdKybTraR9y1X5wj7IPo58clDrHKdI7ekTwjmx qIq2E7YV2FDCFyNtj2Dxmm9uTHYkS2YZMaxbeMI+0hKQHPwqkDSteD0FfLjY43lwvzet ENHqymvUB6XL/yf0IWFPUWBtWLhJeF/y78QVrP9pJyhhpcqUs1c4aXZ++NYleh/Mwlco g3IQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=ouwDXxFDWrYAuXzauf2zAl+gtUacTTJipAeeC/hvs6E=; fh=0XAGB15uw/ad0w0rXWRmuDKjWgzEQ95h+7C2O4TyTQo=; b=ro08QuQ4GYRZDNCPo0tj3nViGx8cK1CBqB1BblQS0JOnB+U88TJNQDzzqEq5i1UOUT SFLlbW4owdg6wSKaIoqBySA+ta0z8+WKV3kweIFazxWi8TQi008WbK9jsTz3GWDcLgtB xrHAauLoZF1pAlsDqOCS+Yo0bF6tPMOU9aBBy5Jj/OmQ1zctFBnbMbYCQBX0EVt2lcaz XGrdp0KypyqYYmRYT0RlAmlSrBhECG0oiKr3kVmQWM+kgSUuei//tMPIghwPtsNhAJ5y voFwLICGZyA3xpSh6RSFQck7L69pRP+hjMuD7CLsRqiVCIgNv6GYoTmB79zwSbZnckOW tRNA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-178554-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178554-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2b6290d04acsi13311676a91.162.2024.05.14.03.49.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 03:49:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178554-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-178554-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178554-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 51197280DFC for ; Tue, 14 May 2024 10:49:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D565112A154; Tue, 14 May 2024 10:21:46 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E26D74F88C; Tue, 14 May 2024 10:21:44 +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=1715682106; cv=none; b=pvPCHRDaGxDtOMvTdz/1Lq3hMNGMpPFvtEUMJmyGvFWdsSOfXHPDKJtdxyRdDZhDZJ2oQ6Y7lgHY0N/R2GHmxzYp2NNwk8ajb8h2RGP61hzO7Ab7uSQbR1p89duVJ6NnnbnIsd6+tBHDtmaCFIaXsgRUCe2yu6aoQzF4gvO78Ss= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715682106; c=relaxed/simple; bh=cfXngHl7xisjDpCrf/BadTTuQnGlonr0VClHLZYx6B4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=NqakqzEnBSeq0zXOpD5o6de6/46Vvol1/HmI24v74wBXDc3QgDDdpth+hAa0Ybw9DUULgLbijJkAKV01ryp/8sIYt3QCcuY9Mcy44cU7VpIPfrd/9B9PrI/F+J0TxK7NCIxDnyAHf43vxWwGpPtnE2Pjpt+2BJtXBwVWSQnOjf4= 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 4D3BD1007; Tue, 14 May 2024 03:22:09 -0700 (PDT) Received: from [10.57.81.220] (unknown [10.57.81.220]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1EA773F762; Tue, 14 May 2024 03:21:42 -0700 (PDT) Message-ID: <6ba1fd72-3bad-44ca-810d-572b70050772@arm.com> Date: Tue, 14 May 2024 11:21:40 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 06/14] arm64: Override set_fixmap_io Content-Language: en-GB To: Catalin Marinas , Steven Price Cc: kvm@vger.kernel.org, kvmarm@lists.linux.dev, 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: <20240412084213.1733764-1-steven.price@arm.com> <20240412084213.1733764-7-steven.price@arm.com> From: Suzuki K Poulose In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 13/05/2024 17:14, Catalin Marinas wrote: > On Fri, Apr 12, 2024 at 09:42:05AM +0100, Steven Price wrote: >> Override the set_fixmap_io to set shared permission for the host >> in case of a CC guest. For now we mark it shared unconditionally. >> Future changes could filter the physical address and make the >> decision accordingly. > [...] >> +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); >> +} > > I looked through the patches and could not find any place where this > function does anything different as per the commit log suggestion. Can > we just update FIXMAP_PAGE_IO for now until you have a clear use-case? > This gets used by the earlycon mapping. The commit description could be made clear. We may have to revisit this code to optionally apply the PROT_NS_SHARED attribute, depending on whether this is a "protected MMIO" or not. Suzuki