From owner-svn-src-projects@freebsd.org Thu Oct 11 20:08:12 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 576A710C6125 for ; Thu, 11 Oct 2018 20:08:12 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D53367FF31; Thu, 11 Oct 2018 20:08:11 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-io1-xd30.google.com with SMTP id w16-v6so7582989iom.7; Thu, 11 Oct 2018 13:08:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hC+903HkF3Q5KuKedtt4lKlmkM8eqzbZG3JXkI+62S8=; b=AGITpnZT4NZLHQNHpwBC/YHVueKUKM2pq/R+9WGZKx8cuNOdGLx834zNzf1xCi4D+d N7gPFuXbboNM+L3zCdGU5zOQRgP4fxYyNYADJ6Rrd6AgnNGAZtlzn5XkGk4Ze3kMI3+j 600OxjSyVOMqRVFyTdXzsyhRfeLyDr+gwvKhcQlS1WwgKvG0iFQxq9sBaEvF/vHeFiUm gvwVMZ4Oj7GI7hhvIVz9rtuTLkhmFB4wEmIplOR2nY4LHK22ZcsOzm5S/76op6C3Momv Nxg8nG5m5zpfWrJZY29kAUKBl9V7ST7cV0Wt/MHJQv0EbyCZeBsbwZ4Lqgrmocm3SjYa spPg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=hC+903HkF3Q5KuKedtt4lKlmkM8eqzbZG3JXkI+62S8=; b=NIYnjqaBJNOMAFVP5zhPEaRculpEy0117nqP/gsnK6cgZtqVulAXtGxFGeth5Tpz6A zR9zXxr0iVXYCoJxQDYik3NTQOmbKk+aDzQRYh+O32Z1XVYwyTtAtfir0EV/qW/ur5RD rOZIjGF20Vf4A6PFMkeYTTAzmy1fe9UdzGC9qhS0cT4jo4p+iC6ckVQxBE9/vevuvZ5M jZBTwClDlnBfFSSwizRyfouvP6u5HlDSvtqkgwE4q8NL6UOXWWyiKcalzBsfrxhggvpm EgYHPc+37y6MDw9ezF2Bq3wbMXiA9vfE8qHJjArim73L49ohCzETQ1a63xTAFJcsdkKp NZ9A== X-Gm-Message-State: ABuFfogOFSIIOeTSDMoTOqQv5hAX9md9QUT192FhZRhcvFokH0f70vQI M2qBkHDDDW2rc0r0hYxWe/LIGVc0 X-Google-Smtp-Source: ACcGV632gz7G+c/Lyvpg+754isKGdNlSKspa9xYwVhWwAZzce28l+ZKCum84YvJuf+GHTKJMPfepow== X-Received: by 2002:a6b:b409:: with SMTP id d9-v6mr2220475iof.227.1539288490717; Thu, 11 Oct 2018 13:08:10 -0700 (PDT) Received: from ralga.knownspace (173-25-245-129.client.mchsi.com. [173.25.245.129]) by smtp.gmail.com with ESMTPSA id b66-v6sm6211521itd.35.2018.10.11.13.08.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Oct 2018 13:08:10 -0700 (PDT) Date: Thu, 11 Oct 2018 15:08:05 -0500 From: Justin Hibbits To: Leandro Lupori Cc: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: Re: svn commit: r339316 - projects/power8_bringup_hacks/sys/powerpc/powerpc Message-ID: <20181011150805.7234d85c@ralga.knownspace> In-Reply-To: <201810111918.w9BJI6Ak067450@repo.freebsd.org> References: <201810111918.w9BJI6Ak067450@repo.freebsd.org> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; powerpc64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Oct 2018 20:08:12 -0000 On Thu, 11 Oct 2018 19:18:06 +0000 (UTC) Leandro Lupori wrote: > Author: luporl > Date: Thu Oct 11 19:18:06 2018 > New Revision: 339316 > URL: https://svnweb.freebsd.org/changeset/base/339316 > > Log: > Initialize SPRG0 before its first possible use. > > Modified: > projects/power8_bringup_hacks/sys/powerpc/powerpc/machdep.c > > Modified: projects/power8_bringup_hacks/sys/powerpc/powerpc/machdep.c > ============================================================================== > --- > projects/power8_bringup_hacks/sys/powerpc/powerpc/machdep.c > Thu Oct 11 19:06:54 2018 (r339315) +++ > projects/power8_bringup_hacks/sys/powerpc/powerpc/machdep.c > Thu Oct 11 19:18:06 2018 (r339316) @@ -383,12 +383,12 @@ > powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offs if > (platform_smp_get_bsp(&bsp) != 0) bsp.cr_cpuid = 0; pc = > &__pcpu[bsp.cr_cpuid]; > + __asm __volatile("mtsprg 0, %0" :: "r"(pc)); > pcpu_init(pc, bsp.cr_cpuid, sizeof(struct pcpu)); > pc->pc_curthread = &thread0; > thread0.td_oncpu = bsp.cr_cpuid; > pc->pc_cpuid = bsp.cr_cpuid; > pc->pc_hwref = bsp.cr_hwref; > - __asm __volatile("mtsprg 0, %0" :: "r"(pc)); > > /* > * Init KDB > Wow, that's quite some sleuthing! Consider this approved by me, and email re@ to get it into head. Then hop on IRC and give me the play-by-play on how you figured it out. I'm really curious! At first I thought it was a fairly innocuous change, because "nothing" could be doing a PCPU_GET() for pcpu[0], right? Then I saw AIM's cpu_pcpu_init() doing a memcpy() from PCPU_GET(aim.slb). So, with this change you're making a memcpy() overwrite itself (which, I hope, is a real nop in code?). - Justin