Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp3601515ybd; Tue, 25 Jun 2019 05:33:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqwi1gZ7Rp9f2x/AhcGRavqTD1ZWibtIFrQ/bcP3RPuOtN3L5JGYq3mOB/Izsz6SMfG5LUQf X-Received: by 2002:a63:81c2:: with SMTP id t185mr14012478pgd.448.1561466007259; Tue, 25 Jun 2019 05:33:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561466007; cv=none; d=google.com; s=arc-20160816; b=LmVvzPCJuAOtfhVTZh0X7CZZPs/Q8Ld6vm3dXMHlGDCioWHaAZEWCuWKHZhU46fo32 uuwYK7Z+NLm9oyAt9uB6JCr0RB4A+qafE38S3ezKROrDOiKu2Oc804SDSybA7MNcotHi w9Go+pp6dn+sYoWb1q4j+lDJX0C5dyb0DkuzqOvwrAXHZy1g230/03pw+aWeSWVfkRvt QrK6c4kB+uwjNWD53NlixK4Yq9xgBxCcGpIJdOY4VCMcJPDAl+XYW3K2uncRsWAS3j2r 90oD/XRGfki6bqsHEj5H0U+bIX/3HkNxFKgvIf0gXeQlCrHQD6AnTSrlchhtXjwqQdiH X7Tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to:date :references:subject:cc:to:from; bh=ze8Z9S8fEYMCJqdDP0704cl9K4gYI/YoSP0Mf5YeDa0=; b=Irv+bhTKToz67UB5Tyt3z19b0apJ+wmEoKReM8L3hUZXc0lfzidNxgRtB4nhk2tvm9 kxeF4O/M+MkAa+aHaWDrSpErmnyXYXYjtnjwpvCtTJPD2rVzQpLzkqRizMPHDw1+jgGy K4JySae76fmqjXXbYYfHtyj/VECyBgh5D1DUXV3eKgaRNvVEtDy82DDkXJYhP7cnVF0r SFa+B77stBpwSIeBdIui+ibSfzK6/Za7v6wxVVsl/6PolWIt4kfE2GeyKb4dBKOi1LAI o0p4pVq3/IOyfIfQm9OD7SIkkTjVwvfiGqSasWJodgQoFLJMaR6IxdbuPMRLoUecp8kU mKkA== 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 h4si12390603pgp.123.2019.06.25.05.33.11; Tue, 25 Jun 2019 05:33: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 S1732013AbfFYKlg (ORCPT + 99 others); Tue, 25 Jun 2019 06:41:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40774 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726756AbfFYKlg (ORCPT ); Tue, 25 Jun 2019 06:41:36 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 32D393D953; Tue, 25 Jun 2019 10:41:36 +0000 (UTC) Received: from astarta.redhat.com (ovpn-116-223.ams2.redhat.com [10.36.116.223]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0492F600CD; Tue, 25 Jun 2019 10:41:34 +0000 (UTC) From: Yauheni Kaliuta To: Jiong Wang Cc: linux-kernel@vger.kernel.org, Jiri Olsa , Jiri Benc , bpf@vger.kernel.org Subject: Re: ebpf: BPF_ALU32 | BPF_ARSH on BE arches References: <87ef3i9dbc.fsf@netronome.com> Date: Tue, 25 Jun 2019 13:41:34 +0300 In-Reply-To: <87ef3i9dbc.fsf@netronome.com> (Jiong Wang's message of "Tue, 25 Jun 2019 11:20:07 +0100") Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 25 Jun 2019 10:41:36 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Jiong! >>>>> On Tue, 25 Jun 2019 11:20:07 +0100, Jiong Wang wrote: > Yauheni Kaliuta writes: >> Hi! >> >> Looks like the code: >> >> ALU_ARSH_X: >> DST = (u64) (u32) ((*(s32 *) &DST) >> SRC); >> CONT; >> ALU_ARSH_K: >> DST = (u64) (u32) ((*(s32 *) &DST) >> IMM); >> CONT; >> >> works incorrectly on BE arches since it must operate on lower >> parts of 64bit registers. >> >> See failure of test_verifier test 'arsh32 on imm 2' (#23 on >> 5.2-rc6). > Ah, thanks for reporting this. > Should not taken the address directly, does the following fix resolved the > failure? > ALU_ARSH_X: > DST = (u64) (u32) ((s32) DST) >> SRC); > CONT; > ALU_ARSH_K: > DST = (u64) (u32) ((s32) DST) >> IMM); > CONT; Yes, thanks (just add the missing braces). -- WBR, Yauheni Kaliuta