From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A18F81F5842 for ; Fri, 12 Jun 2026 08:44:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781253854; cv=none; b=QLIUCo+uJsBxIM8nbeZFfwU7+UDTiMBtBcKUw6oeD/uOBhCNtrvJU7q4vBZBvl3d5v2TknGNXywa1ZIMtcB4XJa0nT8E9hg2aTn+Jn3/2cEbmce0VlxC6V99JSsFRYqqVNy/vZcGuP5iMOyel9R3GvLtJasS4LkKyhY+7s/lyhk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781253854; c=relaxed/simple; bh=vbzdlqcqkv8gJp+dU6Lg52X3WUk9zCOBbjGtGgVH72E=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FCTOolZY6MYqq/Tf42KG6CqQd2Fcwdo1/P+urvtV/FVt3//kJsyQb3YtfmNa22gzk9Jfm++NqSzPpASmQvDj4xNlB++JpFtaexIq/lU5Ft9ttdX4QAowGaPR+SFDvEEUVjT6vXKdJDKBHTy7CVlSk6UfTEXtRtGqe93e3/YGxZw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=qmq9K45W; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="qmq9K45W" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-4891b4934ffso54875e9.0 for ; Fri, 12 Jun 2026 01:44:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1781253851; x=1781858651; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Yy+2xQMR5McOLxiiEQRjJGzs375KERWHEJ+Tzp4rPHk=; b=qmq9K45WX1JsnVvsHGqQ3mIqsjBXlSTtI35qgBOHOV6Lupy+PZi07bfAkd/SXWO5m9 A5/inbLTuKKIs7cDE3PTALI2Hv+3DllZ/lTWdAyNWVaS69wVQxgjItuMasb+62EorwHn U8GNb1j8KnY5kgNiwt8fKXFQl/OCrP9/f0XoA5l1wanJpmBjxDU3Og7JQHp5tRl+gTHV enh3J+xuH61tUp8kZorEPbWJsAzCyCCs9ZFm2SIE1lk9FYrF4L/QEEO3gaBMMhmSL9kR A1UEwsI+6v1yqyOdLijrzKoNE2CYfXPstBzPdd7HXhLEES9TDiz03o4+hyJC3NvW2YH6 Nk/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781253851; x=1781858651; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Yy+2xQMR5McOLxiiEQRjJGzs375KERWHEJ+Tzp4rPHk=; b=iqg6Gezlt4EDQsqVKa8uirrch7bxEIADWuzsYWpVNN9CWvZ00OD+FdRaeL8iS4qGuq lmgfguBrMaurIGPsAQkd3ScF7/sybsotFrIYuj3CPgq3Wy0BL+8zcrOf3X5WhEJ4g63o gd4EyHgKuBW3IHrHMOPEBdNHiOg0MmBvWBAHMYsi84ZOo2lMvZzxddfxCVYRsRseEXBS ubW6mnBfniSKZeh3ImpTNVhA3oLZoikc5bHZXXSI9wOvQOBtFsMnmQf9zcY+hTWppYmR WzUEj4zu+sSzfMXs8ZHVLCaZvWNU6bNTNYPTsS6bwrLyc5t60KHKCHmNsM42PLhWFI3s P15g== X-Forwarded-Encrypted: i=1; AFNElJ8Wwj63Opjf6+iBkTG7Njz3KLPKZkG84n8aq3zyRUUjM43zOgqeF49BzVdD1gSBfFHti3u/uDl5aZT0efE=@vger.kernel.org X-Gm-Message-State: AOJu0Ywo8t4N5PH/Jr8UqKvXbWmZDMjSZLSQHDVBUw66Ho67iCpAeODC L2q4VYS+i3IQ77BADcESNL9WzN9IeMCSFr74b6ptXAnv7iMpDKayZtB1UEAIgTWWlQ== X-Gm-Gg: Acq92OH5gvv6+4lSLL6YcMtULWV4G6cmnEppVmqdkYStaFrjDbIDATiErNIMvaxtzf3 ZpNp/O7HRDvzebidJfCnELwXPqPQJbksKTIiwDXaBW7BkNU3Dt9L84w5UsObaL471LovGPBN8RT KHgZJNe9SqjK9XCl7R/BFgBWs2IZaKR5yf8kd2M2DPRoqGNmrLximz93vW9FxbH3FBHHYBN4Mpa 87+uwEdOMj5Z5zeeOiU2DYPESJcccra/35/hQgz5lsCKYrMzaQToS8lqwm/4v0z82GMcpzHdGMU 3tTnrk+Er8bZ+wHZ++YXm8Kx+fAVXijUruqmn+ad2nyb1k3o1vHQeyGIRO1z169Xu9nkZiUpO1W y31sb2nhA1PPAGBW2jjpIovUnu8tKlQmtvXT5qDlGfU+Nuj/qqKGTX3xPibaLZRO1D0lr25xm3g UA8ngTCmMFPiUkgP89m+r8FlNas0G8stBD1SpLmE8iVvbvteZH7+BZ8S6WZNMsEA== X-Received: by 2002:a05:600c:2297:b0:48a:5618:b4d4 with SMTP id 5b1f17b1804b1-490eabcf574mr489365e9.1.1781253850528; Fri, 12 Jun 2026 01:44:10 -0700 (PDT) Received: from google.com (140.240.76.34.bc.googleusercontent.com. [34.76.240.140]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490e2d09a85sm126214275e9.14.2026.06.12.01.44.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jun 2026 01:44:09 -0700 (PDT) Date: Fri, 12 Jun 2026 08:44:06 +0000 From: Mostafa Saleh To: "Aneesh Kumar K.V" Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, catalin.marinas@arm.com, will@kernel.org, rppt@kernel.org, maz@kernel.org Subject: Re: [PATCH 3/3] arm64/coco: Add pKVM as a CC platform Message-ID: References: <20260603110522.3331819-1-smostafa@google.com> <20260603110522.3331819-4-smostafa@google.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: On Thu, Jun 04, 2026 at 02:29:00PM +0530, Aneesh Kumar K.V wrote: > Mostafa Saleh writes: > > > pKVM does support memory encryption, expose that to the rest of > > the kernel through cc_platform_has() > > > > At the moment, all devices inside the guest are emulated which > > requires its memory to be shared back to the host (decrypted), so > > set force_dma_unencrypted() to always return true. > > > > Although, typically pKVM guests rely on restricted-dma-pools to > > bounce traffic, with this change, it is possible to solely rely on > > the default SWIOTLB for that (assuming the appropriate size is set > > from the command line) > > > > Signed-off-by: Mostafa Saleh > > --- > > This change is critical for the ongoing refactoring of the DMA-API[1] > > that will break protected guests under pKVM with this patch. That is > > due to this rework will make the state of the SWIOTLB and restricted > > dma pools depends on the value returned by cc_platform_has() > > > > [1] https://lore.kernel.org/all/20260522042815.370873-1-aneesh.kumar@kernel.org/ > > --- > > arch/arm64/include/asm/hypervisor.h | 13 +++++++++++++ > > arch/arm64/include/asm/mem_encrypt.h | 3 ++- > > arch/arm64/kernel/rsi.c | 12 ------------ > > arch/arm64/mm/init.c | 15 ++++++++++++++- > > drivers/virt/coco/pkvm-guest/arm-pkvm-guest.c | 3 +++ > > 5 files changed, 32 insertions(+), 14 deletions(-) > > > > index d66291def0f4..26fe9c3f22e3 100644 [...] > > --- a/drivers/virt/coco/pkvm-guest/arm-pkvm-guest.c > > +++ b/drivers/virt/coco/pkvm-guest/arm-pkvm-guest.c > > @@ -17,6 +17,7 @@ > > #include > > > > static size_t pkvm_granule; > > +DEFINE_STATIC_KEY_FALSE_RO(pkvm_guest); > > > > Do we need EXPORT_SYMBOL on this? I was not sure about that, all users of this are in tree, I saw RME code have the EXPORT but did not know why? Thanks, Mostafa > > > -aneesh