Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2136269imm; Wed, 16 May 2018 08:24:27 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqJYhEFZI6X3nQGs3CaVdqj6s7/0UrbXNRROuF/aJV8u1MpHagoqoDlFsPjbDBzLGSdh/Uz X-Received: by 2002:a62:190f:: with SMTP id 15-v6mr1419987pfz.42.1526484267923; Wed, 16 May 2018 08:24:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526484267; cv=none; d=google.com; s=arc-20160816; b=oi2zeqS519+S8QORCfChUQHxLOxTSOzdJrl3IeHsIODtQ/Cg7ATcqUKVijfOwSBxSk bUXeMtHvn/6sbMMmSoKKMj7Gz2DUM+vhEJ2uWCBeDt+FgEY+Dhp4Y09UkwHo0mo7bokF X/BXvcWyaW7yrFr2DDkHMAkvgnHAgVi57y21aDm2pMdAY8psZVvBcOET8UzTUheroiQh OusHquvVxm1V1rUKnbrGweJLHjH9U6Fv4foAvyfo7g2JGe8EIhaOom8x871wnE0qCkhv 91UaAHNHlE/gN9wrdhBQDY6bzkSurLXSl2zq7xVX0yBxeh87vYhQ91h7LnKpLXQ/Qvhz 4g1Q== 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=LbFqyRHW3d5gWF8qSphYQ7vFUNBjyETGFMssO3EtPnI=; b=GBrgdp2Az/kZc5TCafuZFbIX3xrs0bbFlOJqiqJq5l+5xQzxLwXR68UlW1EbLSCn2f 0uJikGabRorxynAFQL1qahSFs6hEAle8oPJm3sWpc5EPOyvSFwY/lWVWIhS5pvec91Jl ELEdRiLOhpEpSTzA6iwIYe6K/f4YijlNDvj4fUiwMIEvdqI+dC+feKS5vwX2/RkeiTFY HoYQi7kncaDmKu9isX82fKPjkrE4dv6XZdQJOoIXJRzP38tbFthBcuYsF49e/6GZ96DW NkYjCY3n3ERgiguP38WpdBU+uCYhlNQRo1zK+Yq0qEaqyLqv1ojPOQNT9aS4s/vNJcNO ak9g== 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 n125-v6si2982151pfn.352.2018.05.16.08.24.13; Wed, 16 May 2018 08:24:27 -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 S1752119AbeEPPVr (ORCPT + 99 others); Wed, 16 May 2018 11:21:47 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:58198 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751830AbeEPPVl (ORCPT ); Wed, 16 May 2018 11:21:41 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A58F840214E2; Wed, 16 May 2018 15:21:40 +0000 (UTC) Received: from vitty.brq.redhat.com (unknown [10.43.2.155]) by smtp.corp.redhat.com (Postfix) with ESMTP id CCF6D215CDAC; Wed, 16 May 2018 15:21:38 +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 v4 3/8] KVM: x86: hyperv: use defines when parsing hypercall parameters Date: Wed, 16 May 2018 17:21:26 +0200 Message-Id: <20180516152131.30689-4-vkuznets@redhat.com> In-Reply-To: <20180516152131.30689-1-vkuznets@redhat.com> References: <20180516152131.30689-1-vkuznets@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 16 May 2018 15:21:40 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 16 May 2018 15:21:40 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.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 5708e951a5c6..dcfeae2deafa 100644 --- a/arch/x86/kvm/hyperv.c +++ b/arch/x86/kvm/hyperv.c @@ -1341,9 +1341,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