From patchwork Mon Nov 11 10:19:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 3166951 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 072E09F3AE for ; Mon, 11 Nov 2013 10:21:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 60EA92034B for ; Mon, 11 Nov 2013 10:20:56 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 19DCF20240 for ; Mon, 11 Nov 2013 10:20:55 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vfobc-0002s9-GI; Mon, 11 Nov 2013 10:20:28 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VfobV-0002ri-1N; Mon, 11 Nov 2013 10:20:21 +0000 Received: from mail-we0-f180.google.com ([74.125.82.180]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VfobI-0002oM-SO for linux-arm-kernel@lists.infradead.org; Mon, 11 Nov 2013 10:20:09 +0000 Received: by mail-we0-f180.google.com with SMTP id q59so4314449wes.39 for ; Mon, 11 Nov 2013 02:19:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=sFosebwLUZk3ryEtxv6USI3HyCelG0DJWRYKCMi+Ef0=; b=iRLNlpDt8NLr/yeELBl/TniXQvHR4EL2xqk7aQgXqYfHlspAs0hHX11aBRLWeH0UU7 9j6SsSLVEPpnXeHvvoKrFD/eaK6Ypwo7J2SeMK6aRU0QEo7lk2sZUfm/EhrMdcDfB4sv JOKzKttwUWrGsDSjBGuZ3OLBIUBfYj4uiTxLwTpo4Ej/leBBPJh0gSE6qs4OlfJMkrC1 pTXWVsydB9Cf/hjoHHrkmljvUG4J5a/tExysdmajB56aoUhC3+H5t9awHbTZ4jvGdxQG mXfzgvLX6+7PaFJ4jDu0Shhnq32B3xc6Ys6rs0MV8557uesNEdYjo1mDFSznCLpWHqv9 vQvw== X-Gm-Message-State: ALoCoQl8gmzwtQLjgGF29n4VC+DFNLW/1Sb90xhrwr+NRKPwo9XFYr3tR5TRcc+vYi8Js3DWI+iq X-Received: by 10.180.94.38 with SMTP id cz6mr11700704wib.27.1384165187286; Mon, 11 Nov 2013 02:19:47 -0800 (PST) Received: from localhost.localdomain (cag06-7-83-153-85-71.fbx.proxad.net. [83.153.85.71]) by mx.google.com with ESMTPSA id gg20sm33709571wic.1.2013.11.11.02.19.45 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 11 Nov 2013 02:19:46 -0800 (PST) From: Ard Biesheuvel To: x86@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/4] x86: align with generic cpu modalias Date: Mon, 11 Nov 2013 11:19:34 +0100 Message-Id: <1384165175-16134-4-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1384165175-16134-1-git-send-email-ard.biesheuvel@linaro.org> References: <1384165175-16134-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131111_052009_060034_83499684 X-CRM114-Status: GOOD ( 10.40 ) X-Spam-Score: -2.6 (--) Cc: ak@linux.intel.com, steve.capper@linaro.org, Ard Biesheuvel , gregkh@linuxfoundation.org, hpa@zytor.com, catalin.marinas@arm.com, dave.martin@arm.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Align with the new generic 'cpu:type:...:features:...' modalias by moving the 'x86' prefix and the vendor/family/model IDs into the 'type' field. Signed-off-by: Ard Biesheuvel --- arch/x86/kernel/cpu/match.c | 3 +-- scripts/mod/file2alias.c | 10 +++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/arch/x86/kernel/cpu/match.c b/arch/x86/kernel/cpu/match.c index ab6082a..82e92b2 100644 --- a/arch/x86/kernel/cpu/match.c +++ b/arch/x86/kernel/cpu/match.c @@ -56,8 +56,7 @@ ssize_t arch_print_cpu_modalias(struct device *dev, int i, n; char *buf = bufptr; - n = snprintf(buf, size, "x86cpu:vendor:%04X:family:%04X:" - "model:%04X:feature:", + n = snprintf(buf, size, "cpu:type:x86,ven%04Xfam%04Xmod%04X:feature:", boot_cpu_data.x86_vendor, boot_cpu_data.x86, boot_cpu_data.x86_model); diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index efc7abe..856c343 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c @@ -1110,7 +1110,7 @@ static int do_amba_entry(const char *filename, } ADD_TO_DEVTABLE("amba", amba_id, do_amba_entry); -/* LOOKS like x86cpu:vendor:VVVV:family:FFFF:model:MMMM:feature:*,FEAT,* +/* LOOKS like cpu:type:x86,venVVVVfamFFFFmodMMMM:feature:*,FEAT,* * All fields are numbers. It would be nicer to use strings for vendor * and feature, but getting those out of the build system here is too * complicated. @@ -1124,10 +1124,10 @@ static int do_x86cpu_entry(const char *filename, void *symval, DEF_FIELD(symval, x86_cpu_id, model); DEF_FIELD(symval, x86_cpu_id, vendor); - strcpy(alias, "x86cpu:"); - ADD(alias, "vendor:", vendor != X86_VENDOR_ANY, vendor); - ADD(alias, ":family:", family != X86_FAMILY_ANY, family); - ADD(alias, ":model:", model != X86_MODEL_ANY, model); + strcpy(alias, "cpu:type:x86,"); + ADD(alias, "ven", vendor != X86_VENDOR_ANY, vendor); + ADD(alias, "fam", family != X86_FAMILY_ANY, family); + ADD(alias, "mod", model != X86_MODEL_ANY, model); strcat(alias, ":feature:*"); if (feature != X86_FEATURE_ANY) sprintf(alias + strlen(alias), "%04X*", feature);