From nobody Mon Feb 9 08:28:46 2026 Received: from mail-wm1-f73.google.com (mail-wm1-f73.google.com [209.85.128.73]) (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 44D9F35503C for ; Sat, 31 Jan 2026 13:29:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769866186; cv=none; b=EBaltXahtd1pEX0jEXuF4kVplmVHV2GqIz5PuRe/VPMPSjzSDX+jlfHDcLSPMJopyRsO2IrS6xUHocyUtavHq8EJG6+qrscLA9nkX2tMQbfewYrWNctwpQvHFfx+TztESHbImIMR1OA14Rq5Uzb2ACGDgA2u40PVklGtJwjZLck= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769866186; c=relaxed/simple; bh=akk2UdENQbgS4aNRHidtxoT1q7g4hUSbv0c7DfQudsk=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=N/Bq5D9TTN7bKXJabgjp0j6q1n4cbuutqwEa+wh+YQLlg4xHA/kDX5d4i3+1Nj0vgyE2RNSrWljLwrwFwkU1xUQaakPwJWh/vTaglx1reHCWZ5N4c5WFCnO3XhlxgSOJHs152IiUhfdblhZ8bSrwduDR4TQuCqVfIfnAtlGJSvk= 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=t/pNujnO; arc=none smtp.client-ip=209.85.128.73 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="t/pNujnO" Received: by mail-wm1-f73.google.com with SMTP id 5b1f17b1804b1-482d8e6e13aso15113385e9.3 for ; Sat, 31 Jan 2026 05:29:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1769866182; x=1770470982; 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=l1Vepb6gWbmfw10H3EWIgkkfZunr0icHCkKhsRxDAh8=; b=t/pNujnOwB85L2YeTRb9dJriij34mynEj5+sU3zaNqDyqewNrkT+6n8/7QqKIQDxx0 UafwOZslGpmcg3+SkV8McU7PPHylq8mzwqAThEnRKe6JpXZoPQ1rTvOFnrNOmo/h7Dll f9GPFXAK8oe+QeAycwdx0DGi0S98W33luaxCfT62Jh9FTTB4hyKuLmUUhZIZz22c1dX5 I3b5HxmJFui5PBxWw5cYLMkq2rC0381VwsIiFZ0wVxcaaBsquXWjKjLkjfWgN6CW9vvy IjMs/FYTUI3nI5qvuBhjs+cmADXlaM3pYlSYpdhva3BU7yamqAHAB7R8qOZyhcS5rUM7 WeIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769866182; x=1770470982; 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=l1Vepb6gWbmfw10H3EWIgkkfZunr0icHCkKhsRxDAh8=; b=WnD8Qt9S7WBKqc4lGmcYmXRKxhBn7SckV5CXED4df+XU8aINaL1q1+nTeB8Yc8sNSE j11MDpvxJUlLSS9HlVJxE6vgnhGsLVqVbhtTXtMRAllWZV3h8fED/4Dj6a5bLbQ06K5+ cbu0B8zymB9jRGl56xaAw5G+H9bh3502f/E/dkOppuV4z0qZXLYifKVnYGkh3KP39YY7 +jYn+cH2ZG7wzFUHkhXP7KmiW0lQ5DWsVRGsv6Z1rzdTBzvI4UzW1Ouo3HJw6dqZaODQ +Hl/XpZ+V/k+I4UFILC026MQ50w/wO2GfdgN1l5+nhga9N8Se659SUQPdl43650DZ0LX H+DQ== X-Forwarded-Encrypted: i=1; AJvYcCUtAeBw0srXiQl1eyw9tfJuVLcqQtTcu/dlQa7oK8b9gdWyjmI9YUPkbFIut2j+PPa86APupomqRV7g2X8=@vger.kernel.org X-Gm-Message-State: AOJu0Yy/Z6TYt2kCkEfAWlvpZWO1sDl9a6a8IT8gl85Y9fniUHFJYzee zvYorJpdyDq35h+fksoCfLMuWGF8hxrnj5Elic9o6f1IwyYx7db2wdi5xPxbG3gkn/nHD5mV0as Y2q9PHFD1ZnbVnqXvP7/5Rg== X-Received: from wmcn4.prod.google.com ([2002:a05:600c:c0c4:b0:480:6afd:1fd0]) (user=vdonnefort job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:1d03:b0:477:7f4a:44b4 with SMTP id 5b1f17b1804b1-482db4567d6mr85643685e9.1.1769866182054; Sat, 31 Jan 2026 05:29:42 -0800 (PST) Date: Sat, 31 Jan 2026 13:28:40 +0000 In-Reply-To: <20260131132848.254084-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: <20260131132848.254084-1-vdonnefort@google.com> X-Mailer: git-send-email 2.53.0.rc1.225.gd81095ad13-goog Message-ID: <20260131132848.254084-23-vdonnefort@google.com> Subject: [PATCH v11 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.53.0.rc1.225.gd81095ad13-goog