From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04AE2C636CC for ; Wed, 15 Feb 2023 23:38:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229614AbjBOXiI (ORCPT ); Wed, 15 Feb 2023 18:38:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229485AbjBOXiG (ORCPT ); Wed, 15 Feb 2023 18:38:06 -0500 Received: from out-120.mta1.migadu.com (out-120.mta1.migadu.com [IPv6:2001:41d0:203:375::78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE45F2E80D for ; Wed, 15 Feb 2023 15:38:05 -0800 (PST) Date: Wed, 15 Feb 2023 23:37:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1676504283; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vwVLRoeRqgxnx8cuSjz2tafLXCrYIoaiIXqNZRNOEVY=; b=UqJns25zBmIfCzRBDy3EJC6wKpNhvLPIMpm4BLNQUI9CorkowdQc77jxWNBeTOn/Bo2uy2 U7Z9nbX3r0r3u+6Hjsvp28pvzfTsCoJtyaYYUXWZ2obPZEaAf1aGGdRmajF5Wkf/HJId03 545GJ28C+Ep4iI7ikBuQ5bCxppsl4Zk= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Anish Moorthy Cc: Paolo Bonzini , Marc Zyngier , Sean Christopherson , James Houghton , Ben Gardon , David Matlack , Ricardo Koller , Chao Peng , Axel Rasmussen , kvm@vger.kernel.org, kvmarm@lists.linux.dev Subject: Re: [PATCH 7/8] kvm/arm64: Implement KVM_CAP_MEM_FAULT_NOWAIT for arm64 Message-ID: References: <20230215011614.725983-1-amoorthy@google.com> <20230215011614.725983-8-amoorthy@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Wed, Feb 15, 2023 at 03:28:31PM -0800, Anish Moorthy wrote: > On Wed, Feb 15, 2023 at 10:24 AM Oliver Upton wrote: > > > > All of Sean's suggestions about writing a change description apply here > > too. > > Ack > > > > + if (mem_fault_nowait && pfn == KVM_PFN_ERR_FAULT) { > > > + vcpu->run->exit_reason = KVM_EXIT_MEMORY_FAULT; > > > + vcpu->run->memory_fault.gpa = gfn << PAGE_SHIFT; > > > + vcpu->run->memory_fault.size = vma_pagesize; > > > + return -EFAULT; > > > > We really don't want to get out to userspace with EFAULT. Instead, we > > should get out to userspace with 0 as the return code to indicate a > > 'normal' / expected exit. > > > > That will require a bit of redefinition on user_mem_abort()'s return > > values: > > > > - < 0, return to userspace with an error > > - 0, return to userspace for a 'normal' exit > > - 1, resume the guest > > Ok, easy enough: do you want that patch sent separately or as part > of the next version of this series? Roll it into the next spin of the series. Splitting off patches (as asked in patch 1) is only useful if there's a bugfix or some other reason for inclusion ahead of the entire series. -- Thanks, Oliver