Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp1934445ybb; Fri, 29 Mar 2019 14:33:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqz88JbkRz/4dniAKx64SJfIR5WE6lC8bU047/jH7thdscwH+T+cS89aajTTp0rdDOR+5l9a X-Received: by 2002:a63:da4e:: with SMTP id l14mr7730968pgj.96.1553895185227; Fri, 29 Mar 2019 14:33:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553895185; cv=none; d=google.com; s=arc-20160816; b=PrBtf7Too/EE3SY5Jt+Rfd8NSV7n9+YUwtF6m3e9OxlOE9r8m35pczeduKaJ2kGCV5 qGJO1f0t5to7P5XQLseCcf7YPbJDy3VWBtDgDEYtJagM5iXoQiZnPyZUPEPoV4d+CFY5 D8P6nNKd6Ifm6e96Rir5gwYtizVjIaNDBmW8jORVx9OYOo6f/nZnDA12MujMwa5kMGpX XTOlecHsTK7sm4lKKQu3K9VQKqfYtbtzkKkXd13ZpoyDYUMI9zIFAg/4VjZhb7puNc3W ldqMBBPHI0Pj/Hlo4ZZJ3aAIST6gA36hBUe0p40LFrJICefD3+srcIhgsXDkF/iqsyWV jKiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to; bh=NuCQ1VcMOl7Eb68NcwzdBMrBIUQDE6IeqSa8BJiK9DY=; b=j9dEPgbwQgHSvIJVQcBeJ+lypVvocza20PILDsH0bf1PiNCo09tYZo0yOsbnJJDSNV rAmLdS8qUS+9n9ifw67khRWwmLWMLhaXXALmBjNX2YYdsCyAYzHVUxkZ1qTRTO0LDphj vNbLw0CaGXdURm6EwhDnEpZ6+jdChOVkhMlWrlAkkFdZ8Lv/hYZX12wPon9aUWgHamWB ZYsICsadUtntE2kwiJCCFhZ+XpIpJ2+yOa6Wm0Qa7vi43QyjIsdbXxizG4g1VZ4VxTN5 niiXgOGMxnhQXLI4WW48SNQ1UhKfxn3eSTF2CynLeCOwwyLJXuQOtvDDB3EGiuVPnyhz d5cg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gn18si2767091plb.185.2019.03.29.14.32.49; Fri, 29 Mar 2019 14:33:05 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730241AbfC2VcM (ORCPT + 99 others); Fri, 29 Mar 2019 17:32:12 -0400 Received: from ale.deltatee.com ([207.54.116.67]:51454 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730051AbfC2VcL (ORCPT ); Fri, 29 Mar 2019 17:32:11 -0400 Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtp (Exim 4.89) (envelope-from ) id 1h9z6g-0003yf-4p; Fri, 29 Mar 2019 15:32:10 -0600 To: Jann Horn , Mukesh Ojha , =?UTF-8?Q?Horia_Geant=c4=83?= Cc: Muli Ben-Yehuda , Jon Mason , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , the arch/x86 maintainers , iommu@lists.linux-foundation.org, kernel list References: <20190328225925.241998-1-jannh@google.com> <530a0823-5dcd-9006-2057-ae5b9da2389a@codeaurora.org> From: Logan Gunthorpe Message-ID: <3275e86a-5b12-29ff-9b1f-d8eba099ae98@deltatee.com> Date: Fri, 29 Mar 2019 15:32:07 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-CA Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.1.162 X-SA-Exim-Rcpt-To: linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, x86@kernel.org, hpa@zytor.com, bp@alien8.de, mingo@redhat.com, tglx@linutronix.de, jdmason@kudzu.us, mulix@mulix.org, horia.geanta@nxp.com, mojha@codeaurora.org, jannh@google.com X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-8.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE autolearn=ham autolearn_force=no version=3.4.2 Subject: Re: [PATCH] x86/calgary: fix bitcast type warnings X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-03-29 3:19 p.m., Jann Horn wrote: >>> Can the existing api's not be used here like iowrite64be/ioread64be/ or >>> similar variant in "include/asm-generic/io.h" >> >> Oooh! I didn't realize that those exist. I'll change that and send a v2. Yes, they are very new! It took me a while to get those patches in as it is a bit more complicated than it seems. > Actually, that doesn't work at the moment on x86-64: > > include/asm-generic/io.h only defines these things if > CONFIG_GENERIC_IOMAP isn't defined; and X86 unconditionally defines > it. With CONFIG_GENERIC_IOMAP set, these functions are provided by > include/asm-generic/iomap.h. For CONFIG_GENERIC_IOMAP, lib/iomap.c provides _lo_hi and _hi_lo implementations seeing the pio regions must be emulated with 32bit operations and we have to define the order. > The definitions for these are in lib/iomap.c, except that there are no > definitions for ioread64be() and iowrite64be(); if you try to use > them, you get linker errors. Some platforms implement these but most do not. If I recall correctly only powerpc does. If you want to use 64 bit operations in a portable fashion, you should include "linux/io-64-nonatomic-hi-lo.h" or "linux/io-64-nonatomic-lo-hi.h", depending on weather you want the lower bits or the higher bits to be written or read first in cases where an atomic operation is not available. Logan