Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2110846rwl; Thu, 13 Apr 2023 01:36:58 -0700 (PDT) X-Google-Smtp-Source: AKy350Z069R9EKcN94S/l3v/tu57ukKscyE1MruhoDa8SB+VhuO6ly3U94QEGV52CQhjE1YQUn4o X-Received: by 2002:a17:906:7e45:b0:94e:bc04:1e19 with SMTP id z5-20020a1709067e4500b0094ebc041e19mr59080ejr.71.1681375018296; Thu, 13 Apr 2023 01:36:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681375018; cv=none; d=google.com; s=arc-20160816; b=PSGAMZvpXbgiUovvIMd8iYopd5IKGoQLKyMNbk34UYAwJb6qkmSNRcagXZu0vHqN1f JV9XNvZdcpnG5yYEa3vGYE33BvnOk+iIzfP/7Lo1TXffRJfmksnoysT/JLmMu6tJf0yO KHa6NXbmJJ+wBfQrISplQvpKcCpV75vxPf5AFcZRbeNM0a4HsbAzduiLi2ghUNt5c3xM MQrykEHYOCo3Nuyhh5CpzuexJS5FcPuBBcRnWUw0YbGt4spwbICzyOpIo9/B53zsKllK e+mUFWla/bz0YqB24zuvf0rM10jiIcIDypgJTtLTK9ER+vtJGkeUaJqlUJe+JVMGRcji HyGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=EXAHzem28v7RZNUJ5za9I/EOAYp3OPUChc4dJaQip9k=; b=ENokarBDmoyYnLPcdG0bBrhfdFJDqPD/oknhRUl+qs8eoqgfTFEmR1r9ddvJ++Oc6N DJHGxJP/TpLyZRrQ/nWxsZHtybopAka3pgmqTDE4qTdNPn4KZn4W7NjO/SNMtP9SYUyt R9wH/t1q1gxwElb1B+3LnZIDnAT/xQMiyfUX2dfJu1r5WshyJzdS8I3WDMIwZRMBG/up jMDWq+aeZAfPjsxg0ZJsJkp5i7b86xUv2HjmpxGyhkeTWxSS8sKqHWydOzzczBVdplyM sk+V3//p0UWFsSoZZSiXfRQp1s9mJamO471NFPoymEqBIJlY3ptk44crm2a1gur4ycyN yOZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xry111.site header.s=default header.b=mMPkg7kd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=xry111.site Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gc13-20020a1709072b0d00b0094e4b064151si1222556ejc.980.2023.04.13.01.36.33; Thu, 13 Apr 2023 01:36:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@xry111.site header.s=default header.b=mMPkg7kd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=xry111.site Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229637AbjDMId1 (ORCPT + 99 others); Thu, 13 Apr 2023 04:33:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229546AbjDMId0 (ORCPT ); Thu, 13 Apr 2023 04:33:26 -0400 Received: from xry111.site (xry111.site [IPv6:2001:470:683e::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3F3810E5; Thu, 13 Apr 2023 01:33:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1681374801; bh=SD8a8KFvnCSwbVV6zTztQabyB1P9t20ITTiwlQmT/kI=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=mMPkg7kd9d75I9RqubzvixZuTjV6gCBc24cVfdissGsaD546SzMl6lHKKk97MVXY5 arvvJFZE2+2piTELSwG6ZBV1DkuEVUCc2DKc0j+J9gj7LBWUK6Z8sGFRvYUzstmWX3 d+Vs220AH4XoU20omhJFRsciXnyPUKhuCS76xOX0= Received: from [192.168.124.11] (unknown [113.140.11.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id 772AE65C44; Thu, 13 Apr 2023 04:33:18 -0400 (EDT) Message-ID: Subject: Re: [PATCH v6 29/30] LoongArch: KVM: Enable kvm config and add the makefile From: Xi Ruoyao To: kernel test robot , Tianrui Zhao , Paolo Bonzini Cc: oe-kbuild-all@lists.linux.dev, Huacai Chen , WANG Xuerui , Greg Kroah-Hartman , loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Jens Axboe , Mark Brown , Alex Deucher , Oliver Upton , maobibo@loongson.cn Date: Thu, 13 Apr 2023 16:33:10 +0800 In-Reply-To: <202304131526.iXfLaVZc-lkp@intel.com> References: <20230412083023.1693910-30-zhaotianrui@loongson.cn> <202304131526.iXfLaVZc-lkp@intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.0 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2023-04-13 at 15:32 +0800, kernel test robot wrote: > vim +/asm +244 arch/loongarch/include/asm/loongarch.h >=20 > f2ac457a61389b Huacai Chen=C2=A0 2022-05-31=C2=A0 238=C2=A0=20 > 2c87b678639d25 Tianrui Zhao 2023-04-12=C2=A0 239=C2=A0 /* GCSR */ > 2c87b678639d25 Tianrui Zhao 2023-04-12=C2=A0 240=C2=A0 static inline u64 = gcsr_read(u32 reg) Try __always_inline instead of inline because this "function" will definitely break up if it's not inlined. And I guess we should have something like: extern u64 __compiletime_error("gcsr_read parameter is not a constant")=20 __gcsr_read_non_const(void); static __always_inline u64 gcsr_read(u32 reg) { u64 val =3D 0; if (!__builtin_constant_p(reg)) return __gcsr_read_non_const(); asm volatile ( ... ... Or perhaps we should just rewrite gcsr_read to a macro. > 2c87b678639d25 Tianrui Zhao 2023-04-12=C2=A0 241=C2=A0 { > 2c87b678639d25 Tianrui Zhao 2023-04-12=C2=A0 242=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0u64 val =3D 0; > 2c87b678639d25 Tianrui Zhao 2023-04-12=C2=A0 243=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0/* Instructions will be available in binutils later */ > 2c87b678639d25 Tianrui Zhao 2023-04-12 @244=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= asm volatile ( > 2c87b678639d25 Tianrui Zhao 2023-04-12=C2=A0 245=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0"parse_r __reg, %[val= ]\n\t" > 2c87b678639d25 Tianrui Zhao 2023-04-12=C2=A0 246=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* > 2c87b678639d25 Tianrui Zhao 2023-04-12=C2=A0 247=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * read val from gues= t csr register %[reg] > 2c87b678639d25 Tianrui Zhao 2023-04-12=C2=A0 248=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * gcsrrd %[val], %[r= eg] > 2c87b678639d25 Tianrui Zhao 2023-04-12=C2=A0 249=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 */ > 2c87b678639d25 Tianrui Zhao 2023-04-12=C2=A0 250=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0".word 0x5 << 24 | %[= reg] << 10 | 0 << 5 | __reg\n\t" > 2c87b678639d25 Tianrui Zhao 2023-04-12=C2=A0 251=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0: [val] "+r" (val) > 2c87b678639d25 Tianrui Zhao 2023-04-12=C2=A0 252=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0: [reg] "i" (reg) > 2c87b678639d25 Tianrui Zhao 2023-04-12=C2=A0 253=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0: "memory"); > 2c87b678639d25 Tianrui Zhao 2023-04-12=C2=A0 254=C2=A0=20 > 2c87b678639d25 Tianrui Zhao 2023-04-12=C2=A0 255=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0return val; > 2c87b678639d25 Tianrui Zhao 2023-04-12=C2=A0 256=C2=A0 } > 2c87b678639d25 Tianrui Zhao 2023-04-12=C2=A0 257=C2=A0=20 >=20 --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University