From nobody Mon Feb 9 17:35:49 2026 Received: from mail-wm1-f74.google.com (mail-wm1-f74.google.com [209.85.128.74]) (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 78A523382CB for ; Mon, 26 Jan 2026 10:44:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769424290; cv=none; b=rl6TBWZr9WdPZxkdkyDnXbDjKZefoen1Hk/wQiMSXLRkVmHMNrznK35gFlW0KasW9zX42xh2bcdFbInTxf6F/mkikOiT5DKsHiLhf1vkfSBZwHWJJtytywJDLBsxo+D8dCf/BJ0eleF9HPXwlhJV3Sg2czsha1fir/7JZs6690U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769424290; c=relaxed/simple; bh=oo4/5f4YHfSVUMNCfUHjyArRgPM9xVrZtPhrVV+hXu4=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=hvAnEmbwbLTtwEQZb5MqVQEnkXp0WijAeqyc1dGVKBIKpdkrQKI+ACg06qv5Vizuf1VAtO9Xvbhm3CrK9oky447eXpE4wwtYvVMWsm28qRHhs5SdM0ltglddS2rsDbsUpmctq0HCqbPPNssdlQ97KKjnH+3fuTeJOazLGruyE3o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--vdonnefort.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=cjtvoSJ/; arc=none smtp.client-ip=209.85.128.74 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=flex--vdonnefort.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="cjtvoSJ/" Received: by mail-wm1-f74.google.com with SMTP id 5b1f17b1804b1-47edc79ff28so27462545e9.2 for ; Mon, 26 Jan 2026 02:44:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1769424286; x=1770029086; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=JHa7j/CKtQd71sr9sGVN3KtiKJalnxGKPFOliEGiPCE=; b=cjtvoSJ/nFEwArZRawlnObOcK92nt7gfofnieIgV0/wAGwXTAeZXCy2JwBO+0IDYGO ag3vsaIiuE4Jt0QjDErbGdcOg9wJMHUnYnA5LM1MwUeN/l/F3M1OsNU8abaNBsUpwTrs 6iUFrLgHJ8QaxbNbiLXrDBb0EVbtvyK/+3q2ucpMLysYjF2ihFGzbPe8HX0n6+6ed5f0 DmwVgIoDDTb/iWmgXXcqIDLnQ2tvJPM7YZGVgag5mYex6yxKG0n/YoUwlB/BLDgen58o AfIuxA/mx38YKLD+X5Q5z75CiNKiCEMIjfGMxe5ZUhq4QSS8Q6pzBooiP0nhase1D6aD WXLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769424286; x=1770029086; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JHa7j/CKtQd71sr9sGVN3KtiKJalnxGKPFOliEGiPCE=; b=nk1GsNsl0CeYn8CEVT7DE5xGY4cfSn93Lvz+v9MhwmrqTuALon9iIB78Sf8YhZib+g TfmpFaRYMM/Kdh1cmNzHDrXwk5z9f7YGlhehfEhqKK73dRhLKBJrt2/MAi623qjM5TzT UBsFAJynf2IfRtOzSt0dFe6bz1VoPDEQOohY4UphKtsEVZ1/MhfzuJ+LFjbcyTj80O9a aX8P0+RTUQSigMa305PAREzTEhySSu1GtZRdk7lYIetg/leMd0vjunnOEOBjEQrumoh+ 36iORF3fvXyMKjzXNZVPyHorG7urQ6ZOFz0B4Ydn12WjpMLVPbmTYv9pGL8dmGe66EwM 9CPw== X-Forwarded-Encrypted: i=1; AJvYcCVcATqv3BugyEptzDhvkbXJy1CSM4PQ2pB+5y2Ea8sFlVtqBHyLMDPozt87tWpW7KMWw+pdrQy6flVIZmQ=@vger.kernel.org X-Gm-Message-State: AOJu0Ywy9/T/4SjJWl+mdlOCTKcyRDg/7XC9Y57BuGQ/qs2MvfirhbGW afwyypFjlFusw4PZXbuRvaOcqZe/45OrqwfDh0jedYxrWiIo1pPaPl7ufyl32kgiFJZzDjM+PZe 3Nt9bONRZsW705EbMr+L6hw== X-Received: from wmpx5.prod.google.com ([2002:a05:600c:1885:b0:480:4a03:7b7f]) (user=vdonnefort job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:8a1a:20b0:480:4a4f:c36f with SMTP id 5b1f17b1804b1-4805e6f7fddmr42640155e9.21.1769424286085; Mon, 26 Jan 2026 02:44:46 -0800 (PST) Date: Mon, 26 Jan 2026 10:44:11 +0000 In-Reply-To: <20260126104419.1649811-1-vdonnefort@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260126104419.1649811-1-vdonnefort@google.com> X-Mailer: git-send-email 2.52.0.457.g6b5491de43-goog Message-ID: <20260126104419.1649811-23-vdonnefort@google.com> Subject: [PATCH v10 22/30] KVM: arm64: Support unaligned fixmap in the pKVM hyp From: Vincent Donnefort To: rostedt@goodmis.org, mhiramat@kernel.org, mathieu.desnoyers@efficios.com, linux-trace-kernel@vger.kernel.org, maz@kernel.org, oliver.upton@linux.dev, joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com Cc: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, jstultz@google.com, qperret@google.com, will@kernel.org, aneesh.kumar@kernel.org, kernel-team@android.com, linux-kernel@vger.kernel.org, Vincent Donnefort Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Return the fixmap VA with the page offset, instead of the page base address. This allows to use hyp_fixmap_map() seamlessly regardless of the address alignment. While at it, do the same for hyp_fixblock_map(). Signed-off-by: Vincent Donnefort diff --git a/arch/arm64/kvm/hyp/nvhe/mm.c b/arch/arm64/kvm/hyp/nvhe/mm.c index ae8391baebc3..a6eafd72f87c 100644 --- a/arch/arm64/kvm/hyp/nvhe/mm.c +++ b/arch/arm64/kvm/hyp/nvhe/mm.c @@ -244,7 +244,7 @@ static void *fixmap_map_slot(struct hyp_fixmap_slot *sl= ot, phys_addr_t phys) =20 void *hyp_fixmap_map(phys_addr_t phys) { - return fixmap_map_slot(this_cpu_ptr(&fixmap_slots), phys); + return fixmap_map_slot(this_cpu_ptr(&fixmap_slots), phys) + offset_in_pag= e(phys); } =20 static void fixmap_clear_slot(struct hyp_fixmap_slot *slot) @@ -366,7 +366,7 @@ void *hyp_fixblock_map(phys_addr_t phys, size_t *size) #ifdef HAS_FIXBLOCK *size =3D PMD_SIZE; hyp_spin_lock(&hyp_fixblock_lock); - return fixmap_map_slot(&hyp_fixblock_slot, phys); + return fixmap_map_slot(&hyp_fixblock_slot, phys) + offset_in_page(phys); #else *size =3D PAGE_SIZE; return hyp_fixmap_map(phys); --=20 2.52.0.457.g6b5491de43-goog