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 203E0C388F9 for ; Wed, 11 Nov 2020 13:04:55 +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 95EE02074B for ; Wed, 11 Nov 2020 13:04:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="XU3BSyFP"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="Sd1vuoKU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 95EE02074B 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=kw1nLuDyJyyX6UMO3J1lLZgVaKTWZ1CPabT0t1VP72Y=; b=XU3BSyFPuhaTQredxMrU7uFmF IMeihuxe1P5UmEm7NX/lPbfRrvqHpo/aeU4BrR9kixP36ti424qxfnNe2lldPTrwR8+ozKQpJ3lvy WRu0nNr2lVIz63LfqCBS6V147ra3GF8ex+Zl4M5mBnuk8nrh2hU1LlONxS27MDYX/M2Qnm6H03B9W 6iAW+RR13sB/2t3QsctsDxy+aEA86s70bEkaV6TCzhp8E2KNMVsncriYDBXiNbrhpFrb3rTXU5x1O sLNlxI/3nW172/pfyaIMuqz8PFEey0HmMK6XyVc93tROeYU3CXQTphIaUgNUqrZZmakBriiluXtYz vrHwqkavw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcpmg-0000er-QQ; Wed, 11 Nov 2020 13:03:35 +0000 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcpme-0000dj-2r for linux-arm-kernel@lists.infradead.org; Wed, 11 Nov 2020 13:03:32 +0000 Received: by mail-wm1-x32a.google.com with SMTP id c16so2263474wmd.2 for ; Wed, 11 Nov 2020 05:03: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=XdgP6+ZmS9XKah/BF5cKI8FqYLe6KBfyjX/IEuvicQk=; b=Sd1vuoKU1AAoYkRoYQHxPEIrxpuhnPYf6Jliv3HEtBhI373IsM55sSjF/1PlobkLkW SxhGOo+oyAGlcN0kEMK14apG+X1On5FFrOy26nZhrqCtJNnnHhs+zNwpB1QjAr9fxQ60 ulwdOIk3Cg6pW/Z5fHxdnoAEddVYu7JHHMCEAoqBTZugKX/R+QpchiECxxBoGjH1oyCX BD50o7vNtJFgFReaBuCHNnGAbz8EXlNJ5P6fFLhjeJFRPJlGMjBO7eI8UcPbUj45Nt51 s3yJhAm0LM8vaTZmzbaz654XgbC7HJOzzwOJQbnR/Pr73PQiiqVUjmE2rEppd6OAtCOc GVug== 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=XdgP6+ZmS9XKah/BF5cKI8FqYLe6KBfyjX/IEuvicQk=; b=PaKtyycx1hls/Xx+9LkCT+U9JZ+Yf73GqnvE6smyfizG8qlM5gMLczpMmAEXZz3v3K cYYIhvTH2fVmwRGDH3qNzT7PzyeILhcPU5seo1s+WFXdi47fIsdtmb+P8R1gwK2wMVsR LYeWYVzHTq9f/Nx1Hd2vXup+ss670ojioedX0Iku8FIewu2uREvUY7crAwAmBqFT20D/ LAmo38vWFd+6R9NLyHIcXvnvFQc9suJUyC4wE6XFzhaPNCT2lPJcS9L1ObM20dD8Oioq WBwU2w2yky4AxmbBfc614i/2AT7RwIFzG54p7wAtFlbmJUpmm+TRhUx4bJyXBWsgSWS2 TPPw== X-Gm-Message-State: AOAM531isGsw6U2mv8yMRTL1Ttw/U4rPfpA0QXumE6iGXAQ15o+joJAH igclcSha6mMC0esZ3dvETZT7haFqf3f8F3kb X-Google-Smtp-Source: ABdhPJzCms/R+/q5OstGcy7wJvxHU5hys4N0pivVj2UMObHaYOBFmyNaXLuMbMjj6xXFcRuzEIMErw== X-Received: by 2002:a1c:bd08:: with SMTP id n8mr4008787wmf.136.1605099804930; Wed, 11 Nov 2020 05:03:24 -0800 (PST) Received: from google.com ([2a01:4b00:8523:2d03:2595:ed05:1717:fe6e]) by smtp.gmail.com with ESMTPSA id g138sm2508752wme.39.2020.11.11.05.03.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Nov 2020 05:03:23 -0800 (PST) Date: Wed, 11 Nov 2020 13:03:21 +0000 From: David Brazdil To: Marc Zyngier Subject: Re: [PATCH v1 07/24] kvm: arm64: Create nVHE copy of cpu_logical_map Message-ID: <20201111130321.qalrzfabdonrwvsz@google.com> References: <20201109113233.9012-1-dbrazdil@google.com> <20201109113233.9012-8-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_080332_153436_3C95F675 X-CRM114-Status: GOOD ( 23.02 ) 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 > > +/* > > + * nVHE copy of data structures tracking available CPU cores. > > + * Only entries for CPUs that were online at KVM init are populated. > > + * Other CPUs should not be allowed to boot because their features were > > + * not checked against the finalized system capabilities. > > + */ > > +u64 __ro_after_init __cpu_logical_map[NR_CPUS] = { [0 ... NR_CPUS-1] > > = INVALID_HWID }; > > I'm not sure what __ro_after_init means once we get S2 isolation. It is stretching the definition of 'init' a bit, I know, but I don't see what your worry is about S2? The intention is to mark this read-only for .hyp.text at runtime. With S2, the host won't be able to write to it after KVM init. Obviously that's currently not the case. One thing we might change in the future is marking it RW for some initial setup in a HVC handler, then marking it RO for the rest of uptime. > > > + > > +u64 cpu_logical_map(int cpu) > > nit: is there any reason why "cpu" cannot be unsigned? The thought > of a negative CPU number makes me shiver... Same here. That's how it's defined in kernel proper, so I went with that. > > > +{ > > + if (cpu < 0 || cpu >= ARRAY_SIZE(__cpu_logical_map)) > > + hyp_panic(); > > + > > + return __cpu_logical_map[cpu]; > > +} > > + > > unsigned long __hyp_per_cpu_offset(unsigned int cpu) > > { > > unsigned long *cpu_base_array; > > Overall, this patch would make more sense closer it its use case > (in patch 19). I also don't understand why this lives in percpu.c... I didn't think it called for adding another C file for this. How about we rename this file to smp.c? Would that make sense for both? _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel