From patchwork Fri Aug 18 12:07:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jose E. Marchesi" X-Patchwork-Id: 136014 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b82d:0:b0:3f2:4152:657d with SMTP id z13csp1350815vqi; Fri, 18 Aug 2023 05:08:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEwN3uDlLXU4y2G/phOoGmwGDeirFYczTotvgTqp7eoSsQFRgPv3nzn7ugpnoF9DTkBuvwt X-Received: by 2002:a05:6512:234c:b0:4fe:1f1c:184f with SMTP id p12-20020a056512234c00b004fe1f1c184fmr1917234lfu.44.1692360533154; Fri, 18 Aug 2023 05:08:53 -0700 (PDT) Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id e16-20020a50fb90000000b00525672a80dfsi1253100edq.571.2023.08.18.05.08.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Aug 2023 05:08:53 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="jK8hSL/z"; arc=fail (signature failed); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CCE263851ABE for ; Fri, 18 Aug 2023 12:08:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CCE263851ABE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1692360531; bh=CSEghCPE6asTPHFUKOfqy10xGvJJhQZ4eXq6TKAAVes=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=jK8hSL/zPss7vQZPB9/QQ6nW3foZN3tqUz5ao799fHXjjc2mvBesRJzjZGXBe/pJ/ thvZiuEucoFayP1wISqmv0ud6OkdYytOIbLg+0p4BADhPxzUy76Y4H06chRQsWK50f 6Pj+JVJOhqJu8E3oRfG+KwMHlhdmKdw8dyQoXQWk= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by sourceware.org (Postfix) with ESMTPS id 312653858401 for ; Fri, 18 Aug 2023 12:08:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 312653858401 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 37IAIkY7018754 for ; Fri, 18 Aug 2023 12:08:05 GMT Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3se2yfuj5t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 18 Aug 2023 12:08:05 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 37IAAgiG038861 for ; Fri, 18 Aug 2023 12:08:04 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2169.outbound.protection.outlook.com [104.47.58.169]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3sey7429kw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 18 Aug 2023 12:08:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y2ix+aJMlTX5UVsnm4AxDsIKo6H9DMkmhSeIKsZFOtQ2Esbkw4QOVjLrT0McNh1ekAYmUYIsFipVGcoa0lg0s9G8wwg57CqebB9oODeHEIXYbl9Vwe33Zlus9icRlORLuy8LWk5PEi6m6SAwl9YkGmjXEsLxgcMLfVDcb/4weD965K0pocHlXnB0FedDTR08YljXLA8P2/Ijducidw/mfmwG/INQd9e2VguFBBSAy0m8hfvzDvvM5D4zogEddczqOSs2C9NNRJuUNJsQ0wu06J/hU0AJV3pzEbNG14GLSshEC59PYQ6MeGJ4mJqo1ucn7WHxT25PqQ73xR5ZsBMERQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=CSEghCPE6asTPHFUKOfqy10xGvJJhQZ4eXq6TKAAVes=; b=GC4Ck7XWeJCCRxa//Sea0q+cGWBpBfyD7+W83ifmfzcyZzTohoLCW948e60CjFM+TFfcDZ70OMPqRop+c19r0jxEYgb1mldCtYyCO+uUrX8q8vxOCUlOJV3gAXQl35crarwJSiuG82nTiey3qAV9MqcnfUr0zkxNDDUydE65N5Tlyl0PBZK4mi8EB/nULD5KFZL3Wm7Y5fpeghoDsvulfxjglHOywXTcP1o1H6MWmxmCEtfMw63EteWIAfbyRyr7PqSRkMT3KSiTybh23Ce+RW58o4+H2+eRsq83SaM76Qk2Rs4GWosR60o4090FfpXEl90CJgnESI6UBIXh/GWqPQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none Received: from BYAPR10MB2888.namprd10.prod.outlook.com (2603:10b6:a03:88::32) by SJ2PR10MB7734.namprd10.prod.outlook.com (2603:10b6:a03:56f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20; Fri, 18 Aug 2023 12:08:02 +0000 Received: from BYAPR10MB2888.namprd10.prod.outlook.com ([fe80::7d31:72cf:ebed:894f]) by BYAPR10MB2888.namprd10.prod.outlook.com ([fe80::7d31:72cf:ebed:894f%5]) with mapi id 15.20.6678.029; Fri, 18 Aug 2023 12:08:02 +0000 To: gcc-patches@gcc.gnu.org Subject: [COMMITTED] bpf: bump maximum frame size limit to 32767 bytes Date: Fri, 18 Aug 2023 14:07:55 +0200 Message-Id: <20230818120755.28912-1-jose.marchesi@oracle.com> X-Mailer: git-send-email 2.30.2 X-ClientProxiedBy: LO4P265CA0127.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2c6::18) To BYAPR10MB2888.namprd10.prod.outlook.com (2603:10b6:a03:88::32) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR10MB2888:EE_|SJ2PR10MB7734:EE_ X-MS-Office365-Filtering-Correlation-Id: d0b11a7c-3f87-49ba-4bab-08db9fe3c524 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CzRzyog5x32lTB1aqO9sEvmYFsInkb3CGdKV4UkcTAlaYCP4VFqaWJENW/quAE5ENnU4FUfSU3z/G/0Fi9IeLRPFv3g119/VHW3VuY1QBe4B1J5+8eZeeepcPo3hP7NPb9nVSjI6C/fZ5CMsb5C8nrfbFkB5oZWyapgnoB2RZnDyj0fxPV/8pq/scDrCyRrwhDzt2NK2STTp2uZjv93inSf0fK3wTjerMGkQAIdqCvnHzRXrdwuGrhwhZbHX9mei448uz723kTcozUJsHykvwzpXu/LAODmRy2mvv1KsPB38475oubnFOpB5RSwXnZu02rwKlzp9R81Cm66Ciy0+i6uNQTv9AvCFeot96wIhnfmYqhGb9iQeydaBKiMPSBfbuWca5n7Jc2pRAeqttwfyjxl+nyupF3gJBHFiM2ay8RcJGVow2l+trl+53+4IOy3mWgudbd9Tctc+yV7w4hcV7/Bams0N8faEIsd0Hs9Z46QzJOxEcYss1JyBeN8apzD1+sg07YzjcNNYBS8Q9ito52s6QRSldaw36GXXseyHkFc= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR10MB2888.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(346002)(136003)(39860400002)(366004)(376002)(396003)(186009)(1800799009)(451199024)(6666004)(6486002)(6506007)(38100700002)(6512007)(86362001)(1076003)(26005)(83380400001)(36756003)(2616005)(2906002)(66946007)(66476007)(66556008)(316002)(6916009)(84970400001)(41300700001)(5660300002)(8676002)(8936002)(478600001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3hqCuwoqGIKsYf74jMqYspKpbDo6Ulgc+GtBEu/N18DlrYsLYKe/3soF2d3mo7NbwHqAWk6fWCUkyr+O8CIXlM3HnKJBcOTY/lztER0URq0jTfpiPdp/R/yofeNGhc/4ZKRusqH0Ox/SG36OH5FI8JdsJpgIObZgxIM8OqLuC03JUdChnYQKvr3JN+xFOG65SiL3Qopb8W+HhTSXu1UhH+9SEgZyzhqjrE3uJKPaarqkOkJEucfSbn8AZizuWzhvfGcXh3udpZrOwFzhi+pZLXGfbx8AzBtTCMqEHBQ0krttlF7Ug3g+Gcu1lc4uO+ztx0HYmnJY9cn8yT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ant-Network-Message-Id: d0b11a7c-3f87-49ba-4bab-08db9fe3c524 X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB2888.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2023 12:08:01.9358 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: aOVCCkie8J1CJb1uDtyYQ7AKcr6HZAsp09KqMMfPfF1gxoReHOnNYZxsEqasHuSYb1eGLHTB3O2SGtWyEGqYfDpCI+0oGU0UHHQyceNviyo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR10MB7734 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-08-18_14,2023-08-18_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 spamscore=0 bulkscore=0 mlxlogscore=999 adultscore=0 suspectscore=0 malwarescore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2308180111 X-Proofpoint-ORIG-GUID: tRHTAa0BXRGBVBipe5OxSGQ3F33cGr7A X-Proofpoint-GUID: tRHTAa0BXRGBVBipe5OxSGQ3F33cGr7A X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "Jose E. Marchesi via Gcc-patches" From: "Jose E. Marchesi" Reply-To: "Jose E. Marchesi" Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774568638493847214 X-GMAIL-MSGID: 1774568638493847214 This commit bumps the maximum stack frame size allowed for BPF functions to the maximum possible value. Tested in x86_64-linux-gnu host and target bpf-unknown-none. gcc/ChangeLog * config/bpf/bpf.opt (mframe-limit): Set default to 32767. gcc/testsuite/ChangeLog * gcc.target/bpf/frame-limit-1.c: New test. * gcc.target/bpf/frame-limit-2.c: Likewise. --- gcc/config/bpf/bpf.opt | 2 +- gcc/testsuite/gcc.target/bpf/frame-limit-1.c | 18 ++++++++++++++++++ gcc/testsuite/gcc.target/bpf/frame-limit-2.c | 16 ++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/bpf/frame-limit-1.c create mode 100644 gcc/testsuite/gcc.target/bpf/frame-limit-2.c diff --git a/gcc/config/bpf/bpf.opt b/gcc/config/bpf/bpf.opt index 8e240d397e4..efa0380ee3f 100644 --- a/gcc/config/bpf/bpf.opt +++ b/gcc/config/bpf/bpf.opt @@ -38,7 +38,7 @@ Target RejectNegative InverseMask(BIG_ENDIAN) Generate little-endian eBPF. mframe-limit= -Target Joined RejectNegative UInteger IntegerRange(0, 32767) Var(bpf_frame_limit) Init(512) +Target Joined RejectNegative UInteger IntegerRange(0, 32767) Var(bpf_frame_limit) Init(32767) Set a hard limit for the size of each stack frame, in bytes. mco-re diff --git a/gcc/testsuite/gcc.target/bpf/frame-limit-1.c b/gcc/testsuite/gcc.target/bpf/frame-limit-1.c new file mode 100644 index 00000000000..7843e04b5ce --- /dev/null +++ b/gcc/testsuite/gcc.target/bpf/frame-limit-1.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-O0" } */ + +/* The stack frame size is limited to 32767 bytes. */ + +int +foo () +{ + long data[4095]; + return 0; +} + +int +bar () +{ + long data[4096]; + return 0; +} /* { dg-error "stack limit" } */ diff --git a/gcc/testsuite/gcc.target/bpf/frame-limit-2.c b/gcc/testsuite/gcc.target/bpf/frame-limit-2.c new file mode 100644 index 00000000000..57f82e00567 --- /dev/null +++ b/gcc/testsuite/gcc.target/bpf/frame-limit-2.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-O0 -mframe-limit=256" } */ + +int +foo () +{ + long data[32]; + return 0; +} + +int +bar () +{ + long data[33]; + return 0; +} /* { dg-error "stack limit" } */