Граф коммитов

20 Коммитов

Автор SHA1 Сообщение Дата
Dave Thaler b7f82b66c5
Remove cmake build (#2764)
Other projects can now consume ebpf-for-windows in binary form,
using either nuget or MSI install.  We no longer need to build
ebpf-for-windows both ways, so removing the cmake build to free
up build resources and reduce the development cost of maintaining
both msbuild and cmake builds.

Fixes #2743

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
2023-08-18 00:48:10 +00:00
Dave Thaler 8fecc2e376
Make bpf2c maps parser match verifier's maps parser (#2543)
* Add map_in_map_legacy.c

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Make bpf2c maps parser match verifier's maps parser

The verifier will parse "maps/*" sections, and is able to deal with
maps sections with various record sizes.  This PR updates bpf2c to
use the same algorithm.  In the future it would be good to refactor
the verifier so the same code can be used.

Fixes #900

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Make tests pass

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* PR feedback

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Rename map_in_map_* samples

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix BTF ID resolution

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* PR feedback

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Cleanup

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Bug fixes

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Add doc fix

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Update verifier

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Updates for libbtf

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Use libbtf

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix sanitize build by using updated libbtf

Temporarily point to fork until https://github.com/vbpf/ebpf-verifier/pull/515
is merged, so we can verify the fix in CI/CD.

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Update ebpf-verifier

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* PR feedback

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

---------

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
2023-06-28 18:32:13 +00:00
Alan Jowett 5bd706092b
Add option to generate .spd files for sample driven PGO (#1931)
* Add option to generate .spd files for sample driven PGO

Signed-off-by: Alan Jowett <alanjo@microsoft.com>

* Fix test failure

Signed-off-by: Alan Jowett <alanjo@microsoft.com>

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2023-01-20 23:10:24 +00:00
Gianni Trevisiol 99b7ece81f
Visual Studio 2022 porting (#1521)
* Draft

* wip - full build

* wip

* Docs & scripts update

* revert test

* Updates to overall GettingStarted.md guide.

* Updated CI/CD scripts

* Update ebpf-verifier cache key

* Fix #1513. Next action forwarded to #1563.

* Bump up epbfverifier to 05bca47

* Fix CRT path.

* Disable sanitizing

* fix cmake build

* Removed unsupported x86 and ARM configurations.

* Test address sanitizer off

* wip -full build w/asan

* asan enabled on ci/cd

* update wdk version to 22621

* wip - full build

* add mock asan

* Update CL param

* wip - proj sync

* wip - ltcg

* wip - driver settings

* wip-build props

* wip - asan opts

* wip-plat asan

* wip-asan

* wip

* wip

* wip-debug

* Branch resync

* Mitigate compiler OOM.

* remove asan mock

* doc update

* doc update

* Removed commented code.

* Added comments for pragma-s
2022-12-08 20:06:57 -07:00
Dave Thaler ee166b5717
Increase instruction count limit (#1152)
* Increase bound on instruction count

And align more with other platforms

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix compiler error

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
2022-05-31 16:02:05 -07:00
Dave Thaler 9995c09621
Remove unused code (#1148)
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
2022-05-25 14:26:04 -07:00
Shankar Seal 6b98a8d384
cmakefile (#1075) 2022-05-13 18:23:18 -06:00
Alessandro Gario 6a54714ec2
cmake: Add base targets (#882)
Signed-off-by: Alessandro Gario <alessandro.gario@gmail.com>
2022-04-26 05:39:37 -07:00
Alan Jowett 1989d26873
Remove ebpf_verify_program API (#997)
* Remove ebpf_verify_program API

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

* Remove old test

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

* Cleanup runners

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

* PR feedback

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

* Cleanup old artifacts

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
2022-04-25 10:46:22 -06:00
Alan Jowett fd94c807a5
Centralize compiler options (#823)
* Centralize all compiler options

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2022-03-29 10:41:09 -06:00
Dave Thaler 20d7a6565e
Add more libbpf APIs needed by bpftool (#576)
* Add more libbpf APIs needed by bpftool

* Add missing export for existing bpf_map__name API
* Add bpf_object__load
* Add bpf_object__load_xattr
* Add bpf_object__open_file
* Add bpf_object__unload() API
* Add bpf_program__get_type
* Add bpf_program__set_type
* Add bpf_program__unload() API
* Add libbpf_get_error
* Add libbpf_num_possible_cpus
* Rename BPF_MAP_TYPE_UNSPECIFIED to BPF_MAP_TYPE_UNSPEC for libbpf
  compat
* Rename BPF_PROG_TYPE_UNKNOWN to BPF_PROG_TYPE_UNSPEC for libbpf compat
* Add attach_type to bpf_link_info
* Add map_flags to bpf_map_info (but currently always 0)

Fixes #575

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
2021-09-23 19:32:09 -07:00
Alan Jowett 967990f700
Disable /ZI and incremental linking (#546)
* Disable /ZI and incremental linking

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2021-09-16 16:49:02 -06:00
Dave Thaler 0a1555956e
Add map-in-map type checking (#451)
* Add map-in-map type checking

This PR enforces that all inner maps must be of the same type
as the inner map template used for verification.  Other fields
might need to match too, and if so those will be updated in
a subsequent PR once it is confirmed which fields must match.

A few pieces of this PR related to map_id are prerequisites
for issue #396 which will add IDs for programs, maps, and links.

Finally, there are multiple definitions of bpf_map, since the
version used to write eBPF programs is different from what is
stored in memory (which uses map IDs) so to avoid confusion in
code and allow the compiler to do type checking to catch some
bugs, this splits ebpf_map_definition_t into two, one for
in_memory and one for in_file (meaning in an eBPF program).
This will also allow the future PR for issue 396 to be more
understandable, but also aids clarity in some parts of this PR.

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
2021-08-30 19:14:08 -07:00
Alan Jowett 4be43a7ea1
Include required Clang version (#431)
* Update Getting Started to recommend current release version of Clang/LLVM

Clang-format behaves differently depending on the version of Clang installed.
Update getting started guide to recommend Clang / LLVM 10.0.0.
Update the development guide to indicate that Clang 10 or higher is required for consistent formatting.
Reformat all code using Clang 10.0.0

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2021-08-25 09:01:16 -06:00
Dave Thaler 4d0ac1bd4d
Replace "information" with "info" for consistency (#331)
Previously some places had "info" and some had "information".
Both appear in dictionaries, so guidance to avoid abbreviations does not apply.

Fixes #314

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
2021-07-07 11:16:35 -07:00
Dave Thaler 6ad00a1449
Annotate IDL GUID so clang-format will not interfere (#280)
Without the annotation, clang-format would convert
`uuid(6bef171d-7205-4b63-a1e5-d00f01e6a0c1)`
to
`uuid(6bef171d - 7205 - 4b63 - a1e5 - d00f01e6a0c1)`
which would be invalid.

Fixes #269

Signed-off-by: Dave Thaler <dthaler@ntdev.microsoft.com>
2021-06-15 11:24:58 -07:00
Alan Jowett 9e8b88a41a
Switch to approved license header format (#268)
* Switch to approved license header format

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2021-06-10 12:02:00 -07:00
saxena-anurag cf2ef87325
Move program load to ebpfsvc (#245)
* remove duplicate windows_helpers.cpp, refactor

* remove commented code

* move program load to service

* cleanup commented code

* remove commented code

* cr comments

* make device handle init optional

* cr comments

* change return type of some functions

* fix

* cr comments

* cr comments, cover more error conditions in windows_error_to_ebpf_result

* cr comments

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
Co-authored-by: Alan Jowett <alanjo@microsoft.com>
2021-06-07 15:22:04 -06:00
Dave Thaler faebbdd32a
Clean up compiler warnings (#225)
The IDL was generating MIDL2279 because it used const on an [out] param,
which is warned against since RPC marshaling copies the result into new
memory.  See https://marc.info/?l=ms-dcom&m=103440617317922 for some
discussion.

Other changes should hopefully be obvious.

Signed-off-by: Dave Thaler <dthaler@ntdev.microsoft.com>
2021-05-25 15:36:19 -07:00
saxena-anurag 4b2384479d
refactor api.lib to api.lib, common.lib, service.lib (#219)
* refactor api.lib to api.lib, common.lib, service.lib

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2021-05-25 14:11:13 -07:00