From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.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 465F11FCFFB for ; Wed, 8 Jan 2025 14:41:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736347297; cv=none; b=qDJfhSxzOm5BanFmKBWq2PR4O3VzJm02aYzpfH4qgjqh2e5zttf/mu0vydQA/t5JaRHv7DYazI2a6EasyRwSzZtOce8pZ+9zfufgAak3Q1OUyfAMnAhELArugVa/2+wsKEnlnPeFH8sTZHkSW5Ka1mPwjFd5YazF10hk8Vwm1AM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736347297; c=relaxed/simple; bh=2ZQNK22CDDsOnlzthXlIGxkPF9H21YpseKace6terSU=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=EYwdpLPkAuCxRqSNyLp0qgulLALXYAnnj6KyR3mtQh7hy9Pkv9S32vFeDBmAU6rU/R95OqpcYDDNZIw+kscfaBz/WSAAsA+wjklDnBtTvKLc9lwgeNrDRt+ryftcB8brmvc53dvJn2Pqh1qud3wszEKFPQG/V3p8G1sAA8X21ug= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=i9wYwswt; arc=none smtp.client-ip=209.85.216.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--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="i9wYwswt" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-2ee6dccd3c9so24256671a91.3 for ; Wed, 08 Jan 2025 06:41:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1736347295; x=1736952095; 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=SQLM+LoHGnaCGsXSe5lLcsoCAmL6bhSjsazuawUJ1sE=; b=i9wYwswtd6OloC86TSYJhyFLyc6m6uw/nqR4RQJvNBDBHfAncVY9GupSw6RzGbFAso IC+c0nBSxMm65FHAeGMmtIyzUNM4/3YJ3vO3ZE622DMu9bn3J5vW9kFq4hTJkcL3lTzR 8nBLPjBtJjxAwk3Xv2e7tlDNujkfsd2ACdVTr7nFqB92zO5eOhgHY64dDid29pXXiHEy lZxTw3CpqU7MQ36DGHPg+0V2m0VyztX727r7scQyYlT7uUZeOzAaWRYhCppEK3nY3Kwu tMVGf0PMF+DbnCxbN5biMU/s+4wQx/JfMeySxd373jMAg4w85BGEhJwJRZ2eA2gpHMJd M4+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736347295; x=1736952095; 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=SQLM+LoHGnaCGsXSe5lLcsoCAmL6bhSjsazuawUJ1sE=; b=oUk5nghbzhSkfB887KSrYrnoK3T+QbQz73xyyqYEoW2oRmy14EDgZovir4STYin9MO tbuu9nJCcARotFVkJJ332gIZzqeW403LJ8CwUTujNDIfGxDb8QjRNYFikADrpil8LkMq qzKHtH7sTVw+SJVfgCml4SJgnncThcVtJpfKcgykgPWohrTgFGtZM6Uh6AfAXiGNZOOa TqG5xLiz70du4J5BhZbyMmote8TC0JkNse5AappiQWUHwTOmAJiag39cw4tZXoEDkOhP Qh3puNDT8CCm59xFsLRLPBYqiPkVF6IVgVXvk+ikBM4aPtCd9SeF9E543TT8ARfO6f0G I3Gw== X-Gm-Message-State: AOJu0YxGieQLIbS+oOGZXvbLVySgDB4XOkrDH8+W4jGWUlPIo0QEvBfZ gKAA4dk3Co0PMRUDLEUV1qm5UJoosjYVbf6Vvp9K5o6Od0ObZignAiqVeKgbm7U80bao9WVNixp HEg== X-Google-Smtp-Source: AGHT+IGmkPaMq6fyPiGwNEznCVmXKv73lSbOSvpsyNn1ze2H+LKp+qpzjKZzXeZPKeZkIqzTmMcSaKGlbq8= X-Received: from pfbbt23.prod.google.com ([2002:a05:6a00:4397:b0:727:3c81:f42a]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:3e01:b0:725:e37d:cd35 with SMTP id d2e1a72fcca58-72d21ff4af7mr4989790b3a.18.1736347295712; Wed, 08 Jan 2025 06:41:35 -0800 (PST) Date: Wed, 8 Jan 2025 06:41:34 -0800 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250101064928.389504-1-pbonzini@redhat.com> Message-ID: Subject: Re: [PATCH] KVM: allow NULL writable argument to __kvm_faultin_pfn From: Sean Christopherson To: Paolo Bonzini Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Christian Zigotzky , linuxppc-dev@lists.ozlabs.org, regressions@lists.linux.dev Content-Type: text/plain; charset="us-ascii" On Mon, Jan 06, 2025, Sean Christopherson wrote: > On Wed, Jan 01, 2025, Paolo Bonzini wrote: > > kvm_follow_pfn() is able to work with NULL in the .map_writable field > > of the homonymous struct. But __kvm_faultin_pfn() rejects the combo > > despite KVM for e500 trying to use it. Indeed .map_writable is not > > particularly useful if the flags include FOLL_WRITE and readonly > > guest memory is not supported, so add support to __kvm_faultin_pfn() > > for this case. > > I would prefer to keep the sanity check to minimize the risk of a page fault > handler not supporting opportunistic write mappings. e500 is definitely the > odd one out here. Per a quick chat at PUCK, Paolo is going to try and fix the e500 code to actually use the @writable param as it's intended.