Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2968117rdb; Mon, 4 Dec 2023 12:32:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IG4+EQuvWUOhlQaJt+NUuW8iBBTszLDhZgtFi1iMTOsp52E/K53nDlr+3ufxcdfu/bJOMqz X-Received: by 2002:a17:90a:bd81:b0:286:6cc1:865e with SMTP id z1-20020a17090abd8100b002866cc1865emr121135pjr.67.1701721969515; Mon, 04 Dec 2023 12:32:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701721969; cv=none; d=google.com; s=arc-20160816; b=gFBd5Hno5jlth0yAOfE1AKhcUTLQ8SdGp30HRr4SqdeMIeRbaIiTfU+NGgCySrz1MJ k7oiIgXZXEFk+1dXmC0vzBUV0wF90dhHJG48ZQzPAHJ7J/rxxkmK8PtcbQwssLP+YEMX 7W5z7obNrdj0t88iAJRIAWexQD8RnVCp/IX1eFzFmGD4z/9QSWtDI9sMNdBhAYjR2zoN 6zQcEEHJqBoaD2X4UAchroVFQ/Ns/vpq4u7AFRgOrmHPhMmZEwzHJgcZ6LZ4K51dPYDr 8hm1p+3cA3f8A0nIfKyM8DcON28O1p9Dhj9pHSP1Fge/2hmV6ZKSVt2IF34por0E228q V1yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=KU+uMIFFgAmEpiU6c77Vf2nx1gSzq3cfvabr3WepOyQ=; fh=/ZxUwnH8ZJMyqLR2EUU4R1GFwxWL6wP/uvat8KJzPm8=; b=C6tJIX/ppAhXUSlHD8qoyESx4QxHpMIk9Fx8wZuidIJGFhlWuJYmTengaavyh2FvP6 4kQUBEmt2qbo/eL+/7QtOR9v+NYo/2Holv5ga5TEZaCvfSzYwaYIstuS6YbR6C0idYGv KJZzmzZtAIYdhAWovrMC18Z4Rs2YxANX97rd5OYI2C4LDM6BFaElulJLAOvEKlZVQ/UU GxpDmrwR9a/7EO2YEn4wX3H4AUHqpOb7l2lPV9BlZS92I+e6TWkCIjeO9HvNuVf3MhhM pBtiggttS4JiBBFDDvkoaGkqCG1dnCqm4OQUYcpd18kpVCFAXHIR66r8TDMZD9RSRWG7 0NIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=eQaI5NeG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id m24-20020a17090ab79800b002791035445esi8105857pjr.76.2023.12.04.12.32.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 12:32:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=eQaI5NeG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id D20068057420; Mon, 4 Dec 2023 12:32:46 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233868AbjLDUcb (ORCPT + 99 others); Mon, 4 Dec 2023 15:32:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229741AbjLDUca (ORCPT ); Mon, 4 Dec 2023 15:32:30 -0500 Received: from mail-vk1-xa31.google.com (mail-vk1-xa31.google.com [IPv6:2607:f8b0:4864:20::a31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9441D7 for ; Mon, 4 Dec 2023 12:32:36 -0800 (PST) Received: by mail-vk1-xa31.google.com with SMTP id 71dfb90a1353d-4b2da1fa27aso467833e0c.3 for ; Mon, 04 Dec 2023 12:32:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701721956; x=1702326756; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=KU+uMIFFgAmEpiU6c77Vf2nx1gSzq3cfvabr3WepOyQ=; b=eQaI5NeGZTQTJXLS5boGt4fSswWK83Eb+P3m09f+FOoDqL5/SN0WMiXqjUNO+VQZXb BNaw2CcpLnS+iFEk76N4imZas7r3Zq5Eg/wQWio2O33tmwxAVZjOuQeHPD3IhWBC3P3D KmjrJuAN0SIQglRn7hJateXyeRcYYaJfGzf2SPcYTX4KJY3mb4C3g+eb43d+R9V98FJz 8W/xlWlypIjYC9cHsA2pr38tHirwxtqza3ClemCmiX0VeoLJbEyvTqQQRm1WqSUjELgM gZegaSAbleUNWyEGgXl5wZf5lpvGRidwLRdlvBOemb7ypRGN3AbaieUN79SwZbWGE+4r DOUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701721956; x=1702326756; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KU+uMIFFgAmEpiU6c77Vf2nx1gSzq3cfvabr3WepOyQ=; b=SA5nSa9YcCR9HxfHS97V0KkNf++Bo6pE7wXfZW49+I8Qm+RjW6WascZiWIuFITGQFB DwtCmOdq6U3ieuJ6FDI4c0Rz8CwvY4E4BEAOzlqcTwvK8sqbn1fQsGWJ7rgD6HIWpRNU h0Bes4xMdP1Dzzlnh0hqfky3p4OscpATIbSUQ+w8ZrcOhu5P8o+xcdL75BhvocDkFip5 Qo8ccOx9Y5zox7wumtpGV8fM0D3CiyKJnq5WgRQin6ltxHXaEV8NNoUn5UfRYarUEbyc RZ2yQJecqlHHaav5bG/OuiNqQQwUWslzH/dkjWyIPovacVTmNHu6gk97TWwL0Z+rM2Y3 DMsg== X-Gm-Message-State: AOJu0YxftERazhsqHc3trYU27RrnvDL74fubNfZfbJKGgi28aV48GnpX sIjkaVrhbL8rTYCwIcmzYws/Rj32YaxaGcjkn/s= X-Received: by 2002:a1f:c502:0:b0:4b2:87d3:4936 with SMTP id v2-20020a1fc502000000b004b287d34936mr3023418vkf.6.1701721955821; Mon, 04 Dec 2023 12:32:35 -0800 (PST) MIME-Version: 1.0 References: <20231127-module_linking_freeing-v4-0-a2ca1d7027d0@rivosinc.com> <20231127-module_linking_freeing-v4-2-a2ca1d7027d0@rivosinc.com> In-Reply-To: <20231127-module_linking_freeing-v4-2-a2ca1d7027d0@rivosinc.com> From: "Lad, Prabhakar" Date: Mon, 4 Dec 2023 20:32:10 +0000 Message-ID: Subject: Re: [PATCH v4 2/2] riscv: Correct type casting in module loading To: Charlie Jenkins Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Ron Economos , Samuel Holland , Andreas Schwab , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 04 Dec 2023 12:32:47 -0800 (PST) On Mon, Nov 27, 2023 at 10:08=E2=80=AFPM Charlie Jenkins wrote: > > Use __le16 with le16_to_cpu. > > Fixes: 8fd6c5142395 ("riscv: Add remaining module relocations") > Signed-off-by: Charlie Jenkins > Reviewed-by: Samuel Holland > Tested-by: Samuel Holland > --- > arch/riscv/kernel/module.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > Tested-by: Lad Prabhakar #On RZ/Five SMARC EVK Cheers, Prabhakar > diff --git a/arch/riscv/kernel/module.c b/arch/riscv/kernel/module.c > index 53593fe58cd8..aac019ed63b1 100644 > --- a/arch/riscv/kernel/module.c > +++ b/arch/riscv/kernel/module.c > @@ -55,7 +55,7 @@ static bool riscv_insn_valid_32bit_offset(ptrdiff_t val= ) > > static int riscv_insn_rmw(void *location, u32 keep, u32 set) > { > - u16 *parcel =3D location; > + __le16 *parcel =3D location; > u32 insn =3D (u32)le16_to_cpu(parcel[0]) | (u32)le16_to_cpu(parce= l[1]) << 16; > > insn &=3D keep; > @@ -68,7 +68,7 @@ static int riscv_insn_rmw(void *location, u32 keep, u32= set) > > static int riscv_insn_rvc_rmw(void *location, u16 keep, u16 set) > { > - u16 *parcel =3D location; > + __le16 *parcel =3D location; > u16 insn =3D le16_to_cpu(*parcel); > > insn &=3D keep; > > -- > 2.42.0 > > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv