Received: by 10.192.165.156 with SMTP id m28csp709690imm; Mon, 16 Apr 2018 07:30:51 -0700 (PDT) X-Google-Smtp-Source: AIpwx48rNys5Lg59sdsZ0kx4HnsKL7yy2SC8GiP6NGtyPNat1k8YPg4rbVS/X9Jw4huo2QFezH5J X-Received: by 10.101.101.132 with SMTP id u4mr13340344pgv.260.1523889051274; Mon, 16 Apr 2018 07:30:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523889051; cv=none; d=google.com; s=arc-20160816; b=SOmTNAjLa63IVI5Specjq9sG06gwKrAaIzzHw9q/xvwjhljzAB5MxRk/V0bssIqCi8 7n+bh6n6C8IkNr34WKuIvnjsvqbsJ74gZMt7iA5jeopvrhW0r3y7Z6ec5YvSLDb/VGm5 d7/X5+dJMO5eg/fQRTI7KSuuuBOLIzJ89D9Gk8fPnN/VE/OTf5/IH3P57rfWmfwlx5zZ d9O3S8MaAi3s73aGsz1JDbEGNceKCw8B7DDm1ey3hfLc+f7b6thWI0YK0WsmSN4fNIFa GoVrDYVLsTTtTunBM1RWW2PfeVjV/y7+/Xw/AGvgK7+1OcGmheaWZu7prmVEy3u/MMQ7 L45w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=Gbc0fzjMHs5CSRjO2HR+uiQjOvAXCoNXFIkPhBsq+WY=; b=UfNNWnA/rdIr06egAKm24+t8KAPrb0LTNA4qW3EYhFcuSo+xu7IqHtm0o/bllzmatA 79wrpWTgauJV018JOsM0p53BvOrKwXHLOPCx8pDgp+dlj9cuOH+1/yXQ3gzntsZc+/fp frMyc81k4kp4ZfbBH3XYDXviOmxuZoeCigchr0AirE41KExrA6ZY7OLpVVdm767kRZ3Y NWAPx948DsMzmpWr9mefxSCGBZoUBzhVgErPYopRILGaGtx5sc0watMm+tSwXE/YjKay 0uCbtSasHVIOOAEP7jqPRsjSZZQWtbpmMAdyw5sddv/5DstUL5UphtIypz2Jtg5Lcbwy DmOA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z188si10827879pfz.336.2018.04.16.07.30.37; Mon, 16 Apr 2018 07:30:51 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754931AbeDPLKB (ORCPT + 99 others); Mon, 16 Apr 2018 07:10:01 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:54002 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754290AbeDPLIO (ORCPT ); Mon, 16 Apr 2018 07:08:14 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 823F440676C0; Mon, 16 Apr 2018 11:08:13 +0000 (UTC) Received: from vitty.brq.redhat.com (unknown [10.43.2.155]) by smtp.corp.redhat.com (Postfix) with ESMTP id A4077111DCF1; Mon, 16 Apr 2018 11:08:11 +0000 (UTC) From: Vitaly Kuznetsov To: kvm@vger.kernel.org Cc: x86@kernel.org, Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Roman Kagan , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , "Michael Kelley (EOSG)" , Mohammed Gamal , Cathy Avery , linux-kernel@vger.kernel.org Subject: [PATCH v3 2/6] KVM: x86: hyperv: use defines when parsing hypercall parameters Date: Mon, 16 Apr 2018 13:08:02 +0200 Message-Id: <20180416110806.4896-3-vkuznets@redhat.com> In-Reply-To: <20180416110806.4896-1-vkuznets@redhat.com> References: <20180416110806.4896-1-vkuznets@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Mon, 16 Apr 2018 11:08:13 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Mon, 16 Apr 2018 11:08:13 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'vkuznets@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Avoid open-coding offsets for hypercall input parameters, we already have defines for them. Signed-off-by: Vitaly Kuznetsov --- arch/x86/kvm/hyperv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c index 98618e397342..3cb3bb68db7e 100644 --- a/arch/x86/kvm/hyperv.c +++ b/arch/x86/kvm/hyperv.c @@ -1339,9 +1339,9 @@ int kvm_hv_hypercall(struct kvm_vcpu *vcpu) #endif code = param & 0xffff; - fast = (param >> 16) & 0x1; - rep_cnt = (param >> 32) & 0xfff; - rep_idx = (param >> 48) & 0xfff; + fast = !!(param & HV_HYPERCALL_FAST_BIT); + rep_cnt = (param >> HV_HYPERCALL_REP_COMP_OFFSET) & 0xfff; + rep_idx = (param >> HV_HYPERCALL_REP_START_OFFSET) & 0xfff; trace_kvm_hv_hypercall(code, fast, rep_cnt, rep_idx, ingpa, outgpa); -- 2.14.3