Received: by 10.213.65.68 with SMTP id h4csp956746imn; Sun, 18 Mar 2018 08:44:04 -0700 (PDT) X-Google-Smtp-Source: AG47ELuySumIDN9ifzpMRAup5PX+K1UsZW/QjzyngKuFXxIDZ81XqBwQ85BwAV47MLnTEtOLGYul X-Received: by 2002:a17:902:2cc1:: with SMTP id n59-v6mr421365plb.198.1521387843981; Sun, 18 Mar 2018 08:44:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521387843; cv=none; d=google.com; s=arc-20160816; b=t/4SredjH8YfYME6foqWOtcJPYavXw76s6/0k/J0irwf9rS6yEJw7pGkN39SiG4GGh bvl/sAeq+q9VccRh1Kfg1WtCi1WyhW7aiheDIvg3DBZK09Rxl3DLGDlfT+YPKYhvJjUx uT1AOOp1AdGTcrAwSoZcY4JhCd6Ov4E3LYXkLo1g6jAzvv4yo2uMFO/jH/xszFwUj9jU hLQ6g8XEmfenIwmpYx37SX1oAMhqcaeZd3vx8mZLd3oBCkGs3dCHbD8Y0k6L5P4ZAdeU d4otoPLERHZr/bPTQdM0SKqLRO0Mz+DrGAGZxD2+U9hgb03WJDgXeOoLPhcaGG/qLwv4 MD5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=uhwPNiefZIGo3fiZ+Un4p/zkCswidUoDjjID2LR6Drc=; b=X8f8ETPSM8puqKhqW9jsiagY/Pkxy4df7b1daIN7HyEGfDOLurApCJDJyLEaog4HLX ysy+kvMxSKnuuLx9aKe9RK66YTxEKA9UO5n23JvHtAXcDh/WxkNMu40pSqNptYTgb2iX 9Jy27aAMPObXKJlUsklxVGBPodVaRMQpFNm/bPYC+Qcwq/BaQRYWZEs96F5uL0KR/rE4 eWmVwpjB9aRRT5ZXWtngFdUVNfqv0kP1UQnL6PwioEUPK68mbVABayOzTustsLm+r5ZZ QjkiEXpsBjeyWMjUSH5nrD4A1fwrijhMom03t1nuayQAbc6VWEKOPc1lkj+iznRhtGgT 6n/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 70-v6si10472703ple.639.2018.03.18.08.43.47; Sun, 18 Mar 2018 08:44:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754037AbeCRPmq (ORCPT + 99 others); Sun, 18 Mar 2018 11:42:46 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:58567 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751061AbeCRPmn (ORCPT ); Sun, 18 Mar 2018 11:42:43 -0400 Received: from p4fea5f09.dip0.t-ipconnect.de ([79.234.95.9] helo=nanos.glx-home) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1exaSA-0004Bm-Sy; Sun, 18 Mar 2018 16:42:35 +0100 Date: Sun, 18 Mar 2018 16:42:34 +0100 (CET) From: Thomas Gleixner To: Vitaly Kuznetsov cc: kvm@vger.kernel.org, x86@kernel.org, Paolo Bonzini , =?ISO-8859-2?Q?Radim_Kr=E8m=E1=F8?= , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , "Michael Kelley (EOSG)" , Mohammed Gamal , Cathy Avery , Bandan Das , Christoph Hellwig , linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 4/7] x86/hyper-v: allocate and use Virtual Processor Assist Pages In-Reply-To: <20180316142220.32506-5-vkuznets@redhat.com> Message-ID: References: <20180316142220.32506-1-vkuznets@redhat.com> <20180316142220.32506-5-vkuznets@redhat.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 16 Mar 2018, Vitaly Kuznetsov wrote: > static int hv_cpu_init(unsigned int cpu) > @@ -101,6 +104,23 @@ static int hv_cpu_init(unsigned int cpu) > if (msr_vp_index > hv_max_vp_index) > hv_max_vp_index = msr_vp_index; > > + if (!hv_vp_assist_page) > + return 0; > + > + if (!hv_vp_assist_page[smp_processor_id()]) > + hv_vp_assist_page[smp_processor_id()] = > + __vmalloc(PAGE_SIZE, GFP_KERNEL, PAGE_KERNEL); Please avoid the ugly line break which makes the statement appear as multiline - which would require curly braces for readability - and simply have a local variable struct hv_vp_assist_page **hvp = hv_vp_assist_page[smp_processor_id()]; and use that throughout the function. > + if (hv_vp_assist_page[smp_processor_id()]) { > + u64 val; > + > + val = vmalloc_to_pfn(hv_vp_assist_page[smp_processor_id()]); > + val = (val << HV_X64_MSR_VP_ASSIST_PAGE_ADDRESS_SHIFT) | > + HV_X64_MSR_VP_ASSIST_PAGE_ENABLE; > + > + wrmsrl(HV_X64_MSR_VP_ASSIST_PAGE, val); > + } > + > return 0; Other than that: Reviewed-by: Thomas Gleixner