From nobody Tue Dec 16 07:11:27 2025 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 4882F13A879 for ; Tue, 14 Jan 2025 14:51:07 +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=1736866268; cv=none; b=Gt9/hq02rCBw3fBwbBUPREm0tLuVVr9PXUjeOd9iDZzam3KysnITqhfDBERkV52sazENv4JJYbEu1zSujLmi01TAUWcNeRtLEBg8Taeq0fdfebzE5jrrYBx3BXig/EkI8LCOQU0RTidbkY3e3O/1UrsJXqhHZ4hek7NDk9nysj0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736866268; c=relaxed/simple; bh=FncsAYkcJF/nMHqGnW/3nMpMk2ByWsCClyouYgkRPcM=; h=Date:Mime-Version:Message-ID:Subject:From:To:Content-Type; b=hqk+/uPsD1kzc2C1D12qfLPeFMPillUsJZIr+09X1CP7axOIWfmDGqhz5ir8hKWKKOBeolpPbS6sWjsnsHhwVNPXt2ZYHlKRjtciGCD4AL3mcd0ZAeF6tNkhXJglY2NlrJvbnZELz5jLJOOGy30llWrZKn8Fm0X3Etq2rlclxtA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--sebastianene.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=GlQ0pUGI; 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--sebastianene.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="GlQ0pUGI" Received: by mail-wm1-f73.google.com with SMTP id 5b1f17b1804b1-436723bf7ffso19216665e9.3 for ; Tue, 14 Jan 2025 06:51:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1736866265; x=1737471065; darn=vger.kernel.org; h=to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=0eTIIfStQ+7VgOiC8tdc+ucwS1WrBZu33tceKYHTFlo=; b=GlQ0pUGIcNNn51m+83D0zPpz+ov46ytdYyasWJY6g79GpHMeUcj0gPDrrqUD5vnTEC hqDPIXty3HfF9kJ/QI2iTc8hlm6lmaEUik3+flhUApR4oJrFlcTeqsuQTby057uX5240 RB49uTN3w6RFUr8SfwFsc6WwZNwjGSMw9kxn223bFkcLr9ZOZgfsBMKdtNgapPgu+SB4 xi/TVHLtAWBF9Fur9wjXB51LG+r4W/mvh+FjcZTzcs6dCmhhipzGYS/F41X+A7zieunX kr5zF0N3/pniHJYorTudGgbKs2s7t35LdNpjMBufwhDJSI/QTLHSrAfmVuYzeU5Ro2aZ JZDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736866265; x=1737471065; h=to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=0eTIIfStQ+7VgOiC8tdc+ucwS1WrBZu33tceKYHTFlo=; b=BqHC02f4hK4F4DWFLSXDUJ1nsZz3FGoi4P6IgTy4vsap+Z2QJSip/+/sSw2dKaRZoz ZYVVMVaiNISUZvvj95FG1ZQ+0ee1sHAStyTFi3PKj+G1Gek6jZP7SfkqMehDOSaqFPUa F/f46++xuAOcdeP18uGq/ju3ODmA8b6QYgKI/UP2Oz+ng+SyG32GjnVX8VABG/3q3j+a lyPaNr29XR78xtTfHkq0J8LI+/6kkr2/tDwhdUcpmlVsQSIBpKhoORM7uLJaHy+j5iQx wgcuYDFiUXhJgCDb6b6Rg5fwZtJavt8Bf2O+2r9xo31J1mPfRucVg0Ob8Bx+EXid+fYp Tbvg== X-Forwarded-Encrypted: i=1; AJvYcCXn4jYr3JuY0LWAFaPejjkOp2edObAMMi9zioQ/Q0C9fXjbO/m3nDnRVaM7Mv5WNNPgricZd96k6/mcJ80=@vger.kernel.org X-Gm-Message-State: AOJu0YyffyiR+amY+v99jTnwOp3CEPAqjO0rGd6ShPzYSuQRJK5d7SIs WHblJpONdNclg5pzkrMCc9ccVNjAgDxOdqUJvxRZFtdFY6utL7ipt7izLQcjF8n/GY7TezSKL1k suq5Id/3CurRqO+DJp3hMY4HCUg== X-Google-Smtp-Source: AGHT+IHHxF6PgjGCqVXzpxA4AjixYi8BbG8haFoZBwrYz/9M9zFcbsfYBWQrtZ6low6sVY/sgvFdwRItNXxCPl5Z6Pk= X-Received: from wmbfp16.prod.google.com ([2002:a05:600c:6990:b0:434:fc6f:e8c3]) (user=sebastianene job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:4f4e:b0:436:1ac2:1acf with SMTP id 5b1f17b1804b1-436e26e28cemr219984475e9.20.1736866265825; Tue, 14 Jan 2025 06:51:05 -0800 (PST) Date: Tue, 14 Jan 2025 14:50:51 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.47.1.688.g23fc6f90ad-goog Message-ID: <20250114145050.563658-2-sebastianene@google.com> Subject: [PATCH] KVM: arm64: Fix the upper limit of the walker range From: Sebastian Ene To: catalin.marinas@arm.com, joey.gouly@arm.com, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, maz@kernel.org, oliver.upton@linux.dev, sebastianene@google.com, suzuki.poulose@arm.com, will@kernel.org, yuzenghui@huawei.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Prevent the walker from running into weeds when walking an entire address range. Signed-off-by: Sebastian Ene --- arch/arm64/kvm/hyp/pgtable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c index 40bd55966..2ffb5571e 100644 --- a/arch/arm64/kvm/hyp/pgtable.c +++ b/arch/arm64/kvm/hyp/pgtable.c @@ -260,7 +260,7 @@ static int _kvm_pgtable_walk(struct kvm_pgtable *pgt, s= truct kvm_pgtable_walk_da { u32 idx; int ret =3D 0; - u64 limit =3D BIT(pgt->ia_bits); + u64 limit =3D BIT(pgt->ia_bits) - 1; =20 if (data->addr > limit || data->end > limit) return -ERANGE; --=20 2.47.1.688.g23fc6f90ad-goog