From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E3D0C388F9 for ; Wed, 11 Nov 2020 12:32:52 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 893DC20709 for ; Wed, 11 Nov 2020 12:32:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="oOO5sbNv"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="Ja7qkn/l" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 893DC20709 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ZxHToDWCThign46GBlfmsFEFgGhjEfNbXEFNuBcDXNM=; b=oOO5sbNvKrkllirgfoL3CwBwa wN3PFivh9JIpBSWzvwQ0iAYuyx55Uba/BfKQOFdKz/ZdBeyoBjPemIK2gs6RMnvCj2HJ1p/Xe0+AH j6bElCMU03/e0kUsw6SZQqOBPuhiY+nyRjVSWN+086FaPj04IIHRCN1HQg/UcB/Bs6GFAnYZBnLMQ SaI3ftXDC9FteUy9Vl71XUSVi9YQ3WXbYCJw1EOoCvGvFtbau5zpO+VmYrO4HwCrvsnQDELc4fC2h Gq5VAdaWTHkDuQ7DqbnsBcseN1c6Nx+jli9iZGtA8ylXG96FyAS4yLe5K2hnDLxhLx/1FalHiYk3B eeELDFbuQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcpIa-0007jS-ND; Wed, 11 Nov 2020 12:32:28 +0000 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcpIY-0007j2-CH for linux-arm-kernel@lists.infradead.org; Wed, 11 Nov 2020 12:32:27 +0000 Received: by mail-wm1-x341.google.com with SMTP id w24so2194825wmi.0 for ; Wed, 11 Nov 2020 04:32:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=XtEuYJqpVWdYVZAacuVpb6hyxFgTbQMkbAIhltpNKL8=; b=Ja7qkn/lq9oiqwC27+zkFQJeArO4GLvWWzlfFEwQ4TlruRJR5FzFVktlan4lAT8uhT GTABF5yUj9gP5jOMJ9b5esYLbeH5VjnSC//QJghLJYlz73VNRELC20/ketIza7Dr2R8U cCkGoBD7R6CNx1xup45TuhqV+reaJnR2Cd0zcdo6OcHKd6Sxt4z0Np1Bu6C2Z5LKmWKV 5UgF385H5RiSnyWytK9qT7kC4gPbObKUnFyLIn3MFhVEWNO4irXz27rtFMVJsspRyhBJ 1uT0ZDHMKlz9yGFhLJjHKc+kpshuA1VbkZOaClTXU0YlDhhMESkMLX080Wqtp0Qw9iIF DR3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=XtEuYJqpVWdYVZAacuVpb6hyxFgTbQMkbAIhltpNKL8=; b=rK4/UsXz79VZfdr7zOHE+W/E7dQOwX93xsNmQJO38Xquj4v7Bgvyy6RSSOh8SPdimn Q65/MX1GD/HmOGLqGMt4RkAFipnX0mKbucl0SHKuii74XaBzCZiyzZ0MN+3Vx+5/1NsH 2cXdPchGfNRv1NKZNhES7WtQPByd+6E/tw43AzwElMJ9G4Yt+8aFK4cDNzhV4lewwwEM NNMRheYdCY1PFn2IsQYCediOKg81Aa3vnk9nxBNVHM1wd2M1RWTHFDoHCvHGVkN/UBAa 5VOEuF3k+3d2dKv51RW0BqK9KeU+X20j/BdJkhyxLkhjgUz9uHp6PVQ9FF2YkSqQ2js0 9HhQ== X-Gm-Message-State: AOAM532qrNEgkYxO4iwqh84bssuDUm3U/5ynL7gj6M2T+pyJV0XMQFC0 h+1zBAwWGFq2O+N6xflqmEMspEhnj4HRGIg9 X-Google-Smtp-Source: ABdhPJyMdXM5aicXN5Ib33YGeRQlcphSIsMKmTWL4A6/3D5qrbO5zhbeG85AQYouCaWcr+Nk5zMANQ== X-Received: by 2002:a7b:c384:: with SMTP id s4mr3911891wmj.77.1605097945020; Wed, 11 Nov 2020 04:32:25 -0800 (PST) Received: from google.com ([2a01:4b00:8523:2d03:2595:ed05:1717:fe6e]) by smtp.gmail.com with ESMTPSA id q16sm2414688wrn.13.2020.11.11.04.32.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Nov 2020 04:32:23 -0800 (PST) Date: Wed, 11 Nov 2020 12:32:22 +0000 From: David Brazdil To: Marc Zyngier Subject: Re: [PATCH v1 06/24] kvm: arm64: Support per_cpu_ptr in nVHE hyp code Message-ID: <20201111123222.ooevu6nryu3ncphv@google.com> References: <20201109113233.9012-1-dbrazdil@google.com> <20201109113233.9012-7-dbrazdil@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201111_073226_484794_DA285F01 X-CRM114-Status: GOOD ( 14.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , kernel-team@android.com, Lorenzo Pieralisi , Andrew Walbran , Suzuki K Poulose , Catalin Marinas , Quentin Perret , linux-kernel@vger.kernel.org, James Morse , linux-arm-kernel@lists.infradead.org, Tejun Heo , Dennis Zhou , Christoph Lameter , Will Deacon , kvmarm@lists.cs.columbia.edu, Julien Thierry , Andrew Scull Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org > > + > > + cpu_base_array = kern_hyp_va(&kvm_arm_hyp_percpu_base[0]); > > There is no guarantee that this will not generate a PC relative > addressing, resulting in kern_hyp_va() being applied twice. > > Consider using hyp_symbol_addr() instead, which always does the right > by forcing a PC relative addressing and not subsequently mangling > the address. > > > + this_cpu_base = kern_hyp_va(cpu_base_array[cpu]); > > + return this_cpu_base - (unsigned long)&__per_cpu_start; > > And this is the opposite case: if the compiler generates an absolute > address, you're toast. Yes, this is just as unlikely, but hey... > Same remedy should apply. Good point, and I'll probably keep forgetting about this in the future. Now that all .hyp.text is only executed under hyp page tables, should we start thinking about fixing up the relocations? _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel