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 0342CC6FD1D for ; Fri, 17 Mar 2023 19:03:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229842AbjCQTDW (ORCPT ); Fri, 17 Mar 2023 15:03:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229542AbjCQTDU (ORCPT ); Fri, 17 Mar 2023 15:03:20 -0400 Received: from out-38.mta1.migadu.com (out-38.mta1.migadu.com [IPv6:2001:41d0:203:375::26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 255CA18B1C for ; Fri, 17 Mar 2023 12:03:15 -0700 (PDT) Date: Fri, 17 Mar 2023 19:03:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1679079794; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iYk329oimIyoyr6HEV187xsnoHnlkvYP7PzGhsvf1kY=; b=IamHNS7lY2b4v2cJjnMLU6gVKcV4+KXtB2QUB1B/NaPr1+t7lL0TpNWq0Z6PtJsYs8B6wB gNvipNnhZRE0D0y6kPZeNRYo5JLekke+moYUvi8grah1eZ8afHws9XFZZTPQnhOwmvfR9+ 3uIf0KVdYb2Vb9QLZ/0Nuj0/+4nSXSQ= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Anish Moorthy Cc: seanjc@google.com, jthoughton@google.com, kvm@vger.kernel.org Subject: Re: [WIP Patch v2 12/14] KVM: arm64: Implement KVM_CAP_MEMORY_FAULT_NOWAIT Message-ID: References: <20230315021738.1151386-1-amoorthy@google.com> <20230315021738.1151386-13-amoorthy@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Fri, Mar 17, 2023 at 12:00:30PM -0700, Anish Moorthy wrote: > On Fri, Mar 17, 2023 at 11:27 AM Oliver Upton wrote: > > > > + pfn = __gfn_to_pfn_memslot( > > > + memslot, gfn, exit_on_memory_fault, false, NULL, > > > + write_fault, &writable, NULL); > > > > As stated before [*], this google3-esque style does not match the kernel style > > guide. You may want to check if your work machine is setting up a G3-specific > > editor configuration behind your back. > > > > [*] https://lore.kernel.org/kvm/Y+0QRsZ4yWyUdpnc@google.com/ > > If you're referring to the indentation, then that was definitely me. > I'll give the style guide another readthrough before I submit the next > version then, since checkpatch.pl doesn't seem to complain here. > > > > + if (exit_on_memory_fault && pfn == KVM_PFN_ERR_FAULT) { > > > > nit: I don't think the local is explicitly necessary. I still find this > > readable: > > The local was for keeping a consistent value between the two blocks of code here > > pfn = __gfn_to_pfn_memslot( > memslot, gfn, exit_on_memory_fault, false, NULL, > write_fault, &writable, NULL); > > if (exit_on_memory_fault && pfn == KVM_PFN_ERR_FAULT) { > // Set up vCPU exit and return 0 > } > > I wanted to avoid the possibility of causing an early > __gfn_to_pfn_memslot exit but then not populating the vCPU exit. Ignore me, I didn't see the other use of the local. -- Thanks, Oliver