From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (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 6FE0722DF80 for ; Thu, 16 Jan 2025 14:50:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737039010; cv=none; b=TjxP0b9dasNLn0Y6Kx9mK5AmKe583YMDPkWiiB8rcuXaPn4c1QFat3rgY/fRitzd1Qv8Afs0H5/e9dLHFpOWGWu857tkq6oKBpnQNMmszTgYJxcdLDt/y3gsXpAUxTQgjJLr0iTDETKHB5ocCSQ8+Sl8FYdWcQMSlIljpctSX5o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737039010; c=relaxed/simple; bh=4hbCTX37OlL7FWZdGlRYXpiEDdg5Z2+huHxFb8o3nLc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ee9X81AhFw58GUhAPqkloSaUcPsC82HkgnL5F2Iq6bV+N4LxWLFSPskKJ4smDIIhtEGbglw3kcq9Qvf4544ShqDavaNAJiE9UR4QgMb/XabnTWgNsbJyfIFgklZKApeok78x7EVUC4vwaWl/AZGDf47nAmJ21j9uYGjz9DYnN/8= 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=CC8sxV0h; arc=none smtp.client-ip=209.85.128.54 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="CC8sxV0h" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-43621d2dd4cso57455e9.0 for ; Thu, 16 Jan 2025 06:50:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1737039007; x=1737643807; 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=th+KCDURk+54uiOu7vrQtTKV4wr7vJCxQzUoT2E5qpU=; b=CC8sxV0hWIIi50SGwEHBpgYc6/kS1LhSBrIGiwD/+2stjhL/WWjZ715i9cmX+JKRJr EwMYzjUqkreLKGiSfx98x64jtQAMeI4He6zBvtvTM2qUeUJw/fi4Kh0W05Ibn0TU3PN+ Vr+YPK5IbPoN1h2Kkkl7VAAvwkaHOpm/WR7DrmQQSv7/qX4StJU0tUYNWdXbBfUhjiGO iEbN6g8S1HFuwV8j8n+E8Z2YF7ulVBu0QfnRChu9HgVn2JmxQVxBY5QseVGpNnarR4R2 njbJ1y+W/fsLdBrl+u9rhK8J+tro3fC/IcHXqRRqGkI82qZf3qPl3JVe3uTeR9+cKoAK m5tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737039007; x=1737643807; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=th+KCDURk+54uiOu7vrQtTKV4wr7vJCxQzUoT2E5qpU=; b=SiUvN+HABgRZU0KwualaAqz9VIT2/tf5t5sNdvmC/HXpwMijV0pA+JlhdDxL/jWUD6 GjjWoYl8DjjyWQAdRGoSpEf9BHGf4c4hhEPTQpQpJEaAVVIlEtbufgLAvSuyE3AQqrBT ptVNllkBv2njJrbssmx6O8muIrs8WpeQDSHC3PmHRAHkQrAk6HfakXqV7V1uz3vqx0Fj qFJTqcybISIdDI6KBv97kFX1w7vb2U9bB6R818D6I8uPuA+mz3tgHaDGgS+vXHZVRv0l 20DXYMMlrMxLyL2rGQMQiorKmGrHkagru27LhV97mntEc+aauCX75LIbnund4s0fkyla MySQ== X-Forwarded-Encrypted: i=1; AJvYcCXFiXnDiiI6c6Qm3ExSCa++5/1t4mkohssE0Rzt/aehV63CNLF3iAJ3qzi+t9fV52mYt7EzcsFxtTqTvgk=@vger.kernel.org X-Gm-Message-State: AOJu0YwBHQYap24uFFtitCcFUtelt2LGzCsFnHc2CcYXsFSh9M2uJox9 HPeYpePsdSVCBcLMgCBF6CPjpFN+QaVCYvzkvORtyedIeDX9FvHy+Qka/4iRDQ== X-Gm-Gg: ASbGncsIlamZfmmixRI+vfz9YVbUt/uctAYsJZ5/5SmkFZD5sqsnbxQp7+CYfWLjtI+ jBNaeOQQvMqDlJcebP7MoUF3F6JxcOApm9OdkEOBM+faoFtBssZPOWavnl1AFM1T7ycM6cUEoMq 9bDdoN/fV4cl/qZUr1EQAJ6uvYQEOKhhoj8bxpm5mPCa6OxWFycTdwo2nlYMaKtcbnBI8SaSv2q 9bGPMs/uq5s6B+ZEIx73A8sHNHdtrKytLWOMdlwEct5E/25TQkU9xxdPxntnxvCqAcq+vj0MXbP 7s9tPGI9iy4HUuXB2JfL8FoM X-Google-Smtp-Source: AGHT+IHbW5e6FcdINOIJSuAL5IxGPUZUYCUoVAOoYMejLluSZuDbScxH72g/lWhucPA8oug2f237Bw== X-Received: by 2002:a05:600c:693:b0:436:1811:a79c with SMTP id 5b1f17b1804b1-4388b98b77amr1013155e9.5.1737039006638; Thu, 16 Jan 2025 06:50:06 -0800 (PST) Received: from google.com (47.246.140.34.bc.googleusercontent.com. [34.140.246.47]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438904625e5sm1453475e9.32.2025.01.16.06.50.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jan 2025 06:50:05 -0800 (PST) Date: Thu, 16 Jan 2025 14:50:03 +0000 From: Sebastian Ene To: Suzuki K Poulose Cc: Marc Zyngier , Mark Brown , catalin.marinas@arm.com, joey.gouly@arm.com, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, oliver.upton@linux.dev, will@kernel.org, Aishwarya.TCV@arm.com Subject: Re: [PATCH] KVM: arm64: Fix the upper limit of the walker range Message-ID: References: <20250114145050.563658-2-sebastianene@google.com> <14cce00c-29bd-4feb-b7d0-7aae6e948d1e@sirena.org.uk> <8634hjvxi2.wl-maz@kernel.org> 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, Jan 16, 2025 at 01:49:54PM +0000, Suzuki K Poulose wrote: Hi, > On 16/01/2025 10:55, Marc Zyngier wrote: > > On Thu, 16 Jan 2025 01:16:40 +0000, > > Mark Brown wrote: > > > > > > On Tue, Jan 14, 2025 at 02:50:51PM +0000, Sebastian Ene wrote: > > > > > > > Prevent the walker from running into weeds when walking an > > > > entire address range. > > > > > > The KVM page_fault_test selftest started failing in next-20250115 on > > > at least n1sdp and TX2 in VHE mode and a bisect seems to point to this > > > change. The bisect only just finished, I've done no further > > > investigation. > > > > > > When the test fails it generates backtraces like that below: > > > > [...] > > > > Thanks for the heads up. > > > > Given how close we are to the merge window opening, I've dropped this > > patch from -next. > > > > Seb: it looks this breaks a bunch of existing assumptions. Let's > > revisit this before -rc1, if possible. > In kvm_pgtable_walk() we set the walk_data.end to PAGE_ALIGNED(start + > size), where size is BIT(ia_size) and start = 0, for > kvm_pgtable_stage2_destroy(). > > And subtracting the limit in _kvm_pgtable_walk makes things go bad, > returning -ERANGE. > Given the kvm_pgtable_walk() passes the "end" as the top address (not > including it), and is always PAGE_ALIGNED, we should probably leave things > as it is in the code. > Thanks for looking into this. I have a fix but it is too much of a surgery so we decided not to send it and instead go with the removal of my change. > > Cheers > Suzuki > > > > > > Thanks, > > > > M. > > > Thanks, Sebastian