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

29 Коммитов

Автор SHA1 Сообщение Дата
Anurag Saxena f6a478842a
Remove store km lib and code (#3109)
* remove store km lib and code

* fix

* more cleanup

* Apply suggestions from code review

Co-authored-by: Dave Thaler <dthaler1968@gmail.com>

---------

Co-authored-by: Dave Thaler <dthaler1968@gmail.com>
2023-12-12 13:53:04 +00:00
Dave Thaler c947ca63b9
Make runtime binaries not depend on usersim (#2783)
* build ebpfcore under usersim

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

* Work around analysis warnings

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

* Fix installer project

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

* Temporarily use ubpf branch with memory fix

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

* WIP

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

* WIP

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

* Create project for files shared between ebpfapi and the ebpf runtime

Move existing files from libs/platform either to:
* libs/shared, if meant to be common between user-mode and ebpf runtime
* libs/runtime, if meant to be used by the ebpf runtime only (whether in
  user or kernel mode)

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

* Move ebpf_tracelog.c to shared

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

* Create shared_user and shared_kernel projects

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

* WIP

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

* WIP

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

* Remove usersim from ebpfsvc

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

* Update to cxplat branch of usersim

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

* Use cxplat_utf8_string

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

* Cleanup

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

* Fix build errors

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

* Fix ebpf_allocate_with_tag

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

* Fixes

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

* Bug fixes

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

* Fix use of ebpf_reallocate to not pass a null pointer

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

* Fix printf tests

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

* Fix memory leaks

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

* Temporary change to help debug double-free in test

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

* Update to latest usersim

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

* Fix analysis warnings

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

* Update to latest usersim

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

* Update usersim to latest

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

* Change native module to use latest usersim

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

* Update nuget package

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

* Only call cxplat_cleanup if cxplat_initialize succeeds

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

* Revert setup_build.vcxproj change

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

* Update usersim to latest

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

---------

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
2023-09-05 17:57:21 +00:00
Gianni Trevisiol 4cb79e547d
Isolate eBPF store APIs into atomic km & um libraries. (#2690)
* draft

* wip

* wip

* wip

* wip

* wip - km & um compile

* fix

* fix include order

* wip

* wip

* wip

* wip - api_common

* wip - updated projects

* wip

* wip

* fix merge issues

* wip

* fix C28196/C6387

* wip

* wip

* fix SAL

* cleanup

* fix SAL bugs

* wip - cmake

* add cmake files

* wip

* wip

* update msi artifacts

* wip

* cleanup

* collapse null-checks

* clean-up headers

* refactor return types to ebpf_result_t

* replace ebpf_registry_result_t with ebpf_result_t

* update header

* remove cpp wrapper, misc cleanup.

* rename um/km registry helpers

* cleanup

* cleanup

* update

* nit

* fix

* Added KERNEL_MODE var, so to default to USER_MODE.

* fix cmake

* align result var names with ebpf_result_t

* pr feedback

* add project refs

* Add NativeOnly* cfgs to ebpf_store_helper_km

* Update docs, API reordering in source.

* pr feedback

* Rename types to abstract use of registry

* Normalize all registry API names.

* rename

* merge sln

* fix var typo

* refactor store root keys

* feedback

* doc/comments

* remove KERNEL_MODE

* Force ignore format on all preprocessor code paths.
2023-08-07 19:53:24 +00:00
Dave Thaler ec27659adf
Move usersim code into a separate repo (#2596)
* Use usersim repo

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

* Remove DISPATCH test code from _preprocess_load_native_module

Per Anurag: the code was added earlier to execute the 2 paths in
native module, and it is not needed anmore IIRC, as the "DISPATCH"
code has been removed now from the native module

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

* Bug fixes

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

* Unify some APIs

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

* Fix warnings and clean up code

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

* updated

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

---------

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
2023-06-27 15:26:46 +00:00
Dave Thaler 87b6520c34
Remove JIT and interpreter code from NativeOnly builds (#2475)
* Remove JIT and interpreter code from NativeOnly builds

Fixes #2030
Fixes #2488

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

* Try conditional project references

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

* Various test fixes

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

* Native-only fixes to deploy-ebpf.ps1

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

* Native-only support for setup-ebpf.ps1

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

* Native-only support for api_test.exe

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

* Add connect_redirect_tests to deploy-ebpf.ps1

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

* PR feedback from Anurag

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

---------

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
2023-06-07 15:49:03 +00:00
Alan Jowett f084c9d4c3
Remove unneeded nuget package (#2507)
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2023-05-24 14:38:32 +00:00
Alan Jowett 8b1a8e4e0f
Update NuGet packages (#2386)
Co-authored-by: Alan-Jowett <Alan-Jowett@users.noreply.github.com>
2023-04-28 15:57:08 +00:00
Dave Thaler 93b7634d23
Fix sanitizer build of fuzzer (#2201)
* Fix sanitizer build of fuzzer

Fixes #1817

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

* Fixes

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

* More fixes

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

* Disable some build steps for FuzzerDebug

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

* Update github workflows

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

* Update verifier to latest

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

* Fix execution_context_fuzzer build

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

* Fix bpf2c and samples

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

* Fix samples compilation

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

* Fix custom program type sample

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

---------

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
2023-04-13 15:00:49 +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
github-actions[bot] 0dff94f740
Update NuGet packages (#1768)
Co-authored-by: Alan-Jowett <Alan-Jowett@users.noreply.github.com>
Co-authored-by: Alan Jowett <alanjo@microsoft.com>
2022-12-19 21:02:25 +00:00
github-actions[bot] d28c045228
Update NuGet packages (#1747)
Co-authored-by: Alan-Jowett <Alan-Jowett@users.noreply.github.com>
Co-authored-by: Alan Jowett <alanjo@microsoft.com>
2022-12-13 19:36:39 -07: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
saxena-anurag 1160f7914e
Registry changes for program and section data. (#1192)
* fix

* backup

* fix backup

* msbuild compiling

* fix release build

* fixes

* cmake build fix

* fix cmake build

* fix analyse build

* fix

Signed-off-by: Anurag Saxena <43585259+saxena-anurag@users.noreply.github.com>

* fix expected output

* add pre step for tests

* add pre step for tests

* add -s option, revert this later

* Revert "add -s option, revert this later"

This reverts commit 1f42d100e4.

* code cleanup

Signed-off-by: Anurag Saxena <anusa@microsoft.com>

* rename driver_registry_helper.h

* delete bpf_structs.h

* fix

* hardcode HKLM

* code cleanup

* fix

* backup

* fix backup

* msbuild compiling

* fix release build

* fixes

* cmake build fix

* fix cmake build

* fix analyse build

* fix

Signed-off-by: Anurag Saxena <43585259+saxena-anurag@users.noreply.github.com>

* add pre step for tests

* add pre step for tests

* add -s option, revert this later

* Revert "add -s option, revert this later"

This reverts commit 1f42d100e4.

* code cleanup

Signed-off-by: Anurag Saxena <anusa@microsoft.com>

* rename driver_registry_helper.h

* delete bpf_structs.h

* fix

* hardcode HKLM

* code cleanup

* fix build break

* fix build break, enable warning

* fix bad merge

* cleanup

* fix

* fix tests

* add tests, make ebpf_store_helper platform agnostic

* fixes, cleanup, common code for store APIs

* fix cmake build, driver tests

* cleanup

* code cleanup

* cr comments

* code cleanup

* cleanup

* bugfix

* Apply suggestions from code review

Co-authored-by: Dave Thaler <dthaler@microsoft.com>

* cr comments

* fix build break

* move UM read store APIs to a different file

* cr comments

* cr comments

* cr comments

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2022-06-30 16:53:03 -07:00
saxena-anurag 96226a7db9
Change default program type to EBPF_PROGRAM_TYPE_UNSPECIFIED (#1173)
* fixes

* update cmakelists

* fix bpf2c tests

* fix cilium tests

* add tests

* update bpf2c issue number

* Apply suggestions from code review

Co-authored-by: Dave Thaler <dthaler@microsoft.com>

* fix

* fix

* fix

* cr comments

* fix build break

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
Co-authored-by: Alan Jowett <alanjo@microsoft.com>
2022-06-15 09:59:39 -06:00
Alan Jowett 17379737cf
Add all program types to get_program_type_info in offline mode (#972)
* Encode all program info types

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

* Expand hard coded program types and helper functions

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

* Fix tail_call_map verification failure

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

* Fix tail_call_map verification failure

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2022-04-18 17:41:01 -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
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
Alan Jowett f5ba5c5d7c
Use CRT library to map handles to fds (#513)
* Use CRT library to map handles to fds

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2021-09-14 09:25:56 -06:00
Alan Jowett e553150b1b
Switch from MultiThreadedDebug to MultiThreadedDebugDll (#528)
* Switch from MultiThreadedDebug to MultiThreadedDebugDll
* Pull in latest ebpf-verifier

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2021-09-14 08:46:01 -06:00
Dave Thaler c99a43e5e9
Revert "Remove dead code (#381)" (#401)
This reverts commit 7d779cf117.
2021-08-20 12:07:57 -07:00
Shankar Seal 7d779cf117
Remove dead code (#381)
* Remove dead code

* Address PR feedback

Co-authored-by: Alan Jowett <alanjo@microsoft.com>
2021-08-13 14:56:36 -06:00
Shankar Seal be67121fda
Test Extension Part 2 (#361)
* Test Extension Part 2

* rename test extension to sample extension and update Getting-started doc.

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2021-08-07 14:19:00 -07:00
Shankar Seal 266578ee63
test extension - Part 1 (#336)
* test extension
2021-07-14 14:40:34 -07: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 a46b00c2e3
Add VM setup scripts and docs (#281)
* Create an install script rather than having to manually do lots
  of steps
* Make Debug build use vcruntime as static libs to avoid adding
  another prerequisite on a machine before installing eBPF.  This
  isn't required for Release builds as vcruntime release DLLs
  are part of Windows, unlike vcruntime debug DLLs

Fixes #248

Signed-off-by: Dave Thaler <dthaler@ntdev.microsoft.com>
2021-06-15 08:44:43 -07:00
Shankar Seal 27f8d49888
API to create map and enumerate all pinned maps. (#246)
* API to create map and enumerate all pinned maps.

* Apply suggestions from code review

Co-authored-by: Dave Thaler <dthaler@microsoft.com>

* Address code review comments

* Address code review comments #2

* Address code review comments #3

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
Co-authored-by: Alan Jowett <alanjo@microsoft.com>
2021-06-09 09:44:24 -06: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
saxena-anurag 3a8e5dd7cd
remove duplicate windows_helpers.cpp, refactor (#236)
* remove duplicate windows_helpers.cpp, refactor

* remove commented code

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2021-05-28 15:29:41 -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