From patchwork Mon Jun 10 06:06:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 166283 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp633943ilk; Sun, 9 Jun 2019 23:06:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqxGlYtZnEw5dkV8s4uRMxL3OBt1BSuNDlljXoc09IHn1di88usJnX4topzzBRrwKHK+KrjA X-Received: by 2002:a17:902:8d95:: with SMTP id v21mr47948274plo.225.1560146802390; Sun, 09 Jun 2019 23:06:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560146802; cv=none; d=google.com; s=arc-20160816; b=mXTaJ5GKPgVBetP4AYiedpcC2Lxp9ELmAHON41gQqvn2tHlApdOK9R627cTkeJH1ln LqoLmjPz3HlSdbz3dWV890g7r+jc3/CLrgcyBoU5ta3m+29Y79Lsm2IZstLC3F0Cj9SQ P2Cp9ZQlJM+YY6zrTQ99UkDsJ/tOgceH1MpjFViCGX9svOF9z4BhQEooVkJVjFPoiG99 LLSlniRFBiuvudOyqOp3q8/HAuNYUVk3LtZJO7ax1LBBQvpmj8uLyr4v3TfkUcBPYKU/ ivPBTMJIPvwcy6lAGIiVluQ6yWgcRmsVwlSjGvIAmatYXz0ThiJM6hkxerLdOhm3Md1W Lh0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=/Dkvj991Uhw/1cfRgxPNcyrHB69xx77ySHEyTXjhqvA=; b=Dds/5B7qAUhLbg+RoL4LPCvinWfJ45JyLf6ddIGMAms1FIbpJudqvQTlP59FSvJXkH jaE5kwIFBwRtzz2LYtJSpcVB+MtpHamRSAA44VnHv4J5IbIISlSjUSD5iykCXaNVuxDc YjlIvI3goqZKl3caWExHYuY1w64ajQTbE11QDY25bK6R1R6d76q/dNkBtg3kEnJ3GN7l oSX6pKOGGTO8G2q9ANaXgBRLnj6nZf7OGf4OnBjFErzbKIGZXiys+1/pVrrsq5OQ7Hkc 1OGOKsWmhw3fNMtl5IumrtZu5rCKfF6qwwC7xP+c/wApPvZpyPj+tDe7QZM9Bloctnzr freg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JivEgBVu; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d26si8552912pgl.542.2019.06.09.23.06.42; Sun, 09 Jun 2019 23:06:42 -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; dkim=pass header.i=@linaro.org header.s=google header.b=JivEgBVu; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387796AbfFJGGl (ORCPT + 30 others); Mon, 10 Jun 2019 02:06:41 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:43594 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387718AbfFJGGk (ORCPT ); Mon, 10 Jun 2019 02:06:40 -0400 Received: by mail-pf1-f196.google.com with SMTP id i189so4622549pfg.10 for ; Sun, 09 Jun 2019 23:06:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/Dkvj991Uhw/1cfRgxPNcyrHB69xx77ySHEyTXjhqvA=; b=JivEgBVuc6FZ4RjN29MeUE/bi4q5QoB1acpQCvG8UpXZhGQxck6vFiqw3+HjTh4Z5W 2K4vQW/5irgR3BnFrr6hbyNMNs+TGlC5gFHh39gF46VAA6T3UWprM0IpMfaexBbj7klS C0Urd0dp0FU36novirPjriUnM1bK4c4qYvHL5ciE28lX6N/I6tkzuWewsiYx41IgwElK 8EN8i0ved+yvkXSHOyHWnRxljY31ztw1L4wSWA9XJg4P1lxb+WrzDxCzsVGJ9b6EpCpr lNF96CTDQxEDstXRPOrYiz/mixGYEg9zIzZHwEFO467O4vSldUCZJuNfgCWnHkneFL4s oaew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/Dkvj991Uhw/1cfRgxPNcyrHB69xx77ySHEyTXjhqvA=; b=Mi93uUw/OmIYWiAEKXjjUy3kKCYX4Vr+UHFv1o4putZWSHZ2ds+hiXUOeOXOw/spgN kPcsRV3pptkY0u9dQPrSzf5bwrbxzaQSB2MCKSTmT8U0Hbf1kZ2IMNU9sC4x1YZ608h0 J++wC+2YEle5oVTeFsoJplV/UWApcWO8amY0znXMWbrKpg5USmdxVc6m7lj8M3k4ZYaB kzpyaovgG56WSg6seHjZwvZrJis+N9rMhZ8aXO2xNNOArzuX3lTfdYeczf17Ot3Drnbk 9Hqi0Dq22G6FCwVvRG4kybKdytlQhyCTr2FpXQPG/JQP2ZNWLIIXdG/GkLGaW2mls7OM g54w== X-Gm-Message-State: APjAAAVGkRJJSbdBlPDg9UCebFFs83DjDeMeFwRXd/jDJ2aqzkQy7rpj PU42YoYhJ8u3+Kk1fNueW6rOrw== X-Received: by 2002:a62:2643:: with SMTP id m64mr70607053pfm.46.1560146800022; Sun, 09 Jun 2019 23:06:40 -0700 (PDT) Received: from localhost ([122.172.66.84]) by smtp.gmail.com with ESMTPSA id 26sm9290214pfi.147.2019.06.09.23.06.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Jun 2019 23:06:38 -0700 (PDT) From: Viresh Kumar To: Dave Martin , Marc Zyngier , James Morse , Julien Thierry , Suzuki K Pouloze , Catalin Marinas , Will Deacon Cc: Viresh Kumar , Vincent Guittot , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org Subject: [PATCH V2] KVM: arm64: Implement vq_present() as a macro Date: Mon, 10 Jun 2019 11:36:33 +0530 Message-Id: <7c2590c4d8cc95cd40bbb05c0d0c5e2b0735a16b.1560145715.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.21.0.rc0.269.g1a574e7a288b MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This routine is a one-liner and doesn't really need to be function and should be rather implemented as a macro. Suggested-by: Dave Martin Signed-off-by: Viresh Kumar --- V1->V2: - The previous implementation was fixing a compilation error that occurred only with old compilers (from 2015) due to a bug in the compiler itself. - Dave suggested to rather implement this as a macro which made more sense. arch/arm64/kvm/guest.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) -- 2.21.0.rc0.269.g1a574e7a288b Signed-off-by: Viresh Kumar Reviewed-by: Dave Martin diff --git a/arch/arm64/kvm/guest.c b/arch/arm64/kvm/guest.c index 3ae2f82fca46..a429ed36a6a0 100644 --- a/arch/arm64/kvm/guest.c +++ b/arch/arm64/kvm/guest.c @@ -207,13 +207,7 @@ static int set_core_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg) #define vq_word(vq) (((vq) - SVE_VQ_MIN) / 64) #define vq_mask(vq) ((u64)1 << ((vq) - SVE_VQ_MIN) % 64) - -static bool vq_present( - const u64 (*const vqs)[KVM_ARM64_SVE_VLS_WORDS], - unsigned int vq) -{ - return (*vqs)[vq_word(vq)] & vq_mask(vq); -} +#define vq_present(vqs, vq) ((*(vqs))[vq_word(vq)] & vq_mask(vq)) static int get_sve_vls(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg) {